File tree Expand file tree Collapse file tree 3 files changed +47
-4
lines changed Expand file tree Collapse file tree 3 files changed +47
-4
lines changed Original file line number Diff line number Diff line change 1+ .fullscreen-horizontal {
2+ writing-mode : sideways-rl;
3+ text-orientation : mixed;
4+ word-wrap : break-word;
5+ }
6+ .fullscreen {
7+ display : flex;
8+ justify-content : center;
9+ align-items : center;
10+ height : 100vh ;
11+ width : 100vw ;
12+ margin : 0 ;
13+ position : fixed;
14+ }
15+ .hidden {
16+ display : none;
17+ opacity : 0 ;
18+ }
19+
Original file line number Diff line number Diff line change 1+ import React from "react" ;
2+ import styles from "./FullscreenModalComponent.module.css" ;
3+ type Props = {
4+ orientation ?: "vertical" | "horizontal" ,
5+ isFullscreenValue : boolean ,
6+ }
7+ export const FullscreenModalComponent : React . FC < React . PropsWithChildren < Props > > = ( {
8+ orientation = "vertical" ,
9+ isFullscreenValue = false ,
10+ children
11+ } ) => {
12+ return (
13+ < div
14+ className = {
15+ [
16+ orientation == "horizontal" && styles [ "fullscreen-horizontal" ] ,
17+ ! isFullscreenValue && styles . hidden ,
18+ styles . fullscreen
19+ ] . join ( " " )
20+ }
21+ >
22+ { isFullscreenValue && children }
23+ </ div >
24+ ) ;
25+ } ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { LargeTextInputComponent } from "./LargeTextInputComponent";
55import { LargeButtonComponent } from "./LargeButtonComponent" ;
66import { LargeTextDisplayComponent } from "@/components/shared/LargeTextDisplayComponent" ;
77import { QrComponent } from "./QrComponent" ;
8- import { FullscreenComponent } from "./FullscreenComponent " ;
8+ import { FullscreenModalComponent } from "./FullscreenModalComponent " ;
99import styles from "./page.module.css" ;
1010export default function Page ( ) {
1111 const [ text , setText ] = useState ( "" ) ;
@@ -56,9 +56,8 @@ export default function Page() {
5656 </ div >
5757 </ div >
5858 </ div >
59- < FullscreenComponent
59+ < FullscreenModalComponent
6060 isFullscreenValue = { isFullscreen }
61- updateFullscreenState = { setFullscreen }
6261 orientation = { orientation }
6362 >
6463 { fullscreenContent === "text" ?
@@ -86,6 +85,6 @@ export default function Page() {
8685 < Image src = "/cross.svg" alt = "close" width = { 100 } height = { 100 } />
8786 </ LargeButtonComponent >
8887 </ div >
89- </ FullscreenComponent >
88+ </ FullscreenModalComponent >
9089 </ div > ) ;
9190} ;
You can’t perform that action at this time.
0 commit comments