File tree Expand file tree Collapse file tree 3 files changed +12
-37
lines changed
Expand file tree Collapse file tree 3 files changed +12
-37
lines changed Original file line number Diff line number Diff line change 1- import * as React from "react" ;
2-
31import Landscape from "./Timeline/Landscape" ;
42import Portrait from "./Timeline/Portrait" ;
53
64const Timeline = ( ) => {
7- const [ { height, width } , setSizes ] = React . useState < {
8- width : number ;
9- height : number ;
10- } > ( {
11- width : 0 ,
12- height : 0 ,
13- } ) ;
14-
15- React . useEffect ( ( ) => {
16- const handleResize = ( ) => {
17- const width = window . innerWidth - 32 ;
18- const height = ( width * 695 ) / 732 ;
19- setSizes ( { width, height } ) ;
20- } ;
21-
22- if ( typeof window !== "undefined" ) {
23- handleResize ( ) ;
24- window . addEventListener ( "resize" , handleResize ) ;
25- }
26-
27- return ( ) => {
28- window . removeEventListener ( "resize" , handleResize ) ;
29- } ;
30- } , [ ] ) ;
31-
325 return (
336 < div className = "flex w-full items-center justify-center" >
34- < div className = "hidden sm:block" >
7+ < div className = "relative hidden px-[16px] sm:block" >
358 < Landscape />
369 </ div >
37- < div className = "block w-full px-[16px] sm:hidden" >
38- < Portrait width = { width } height = { height } />
10+ < div className = "relative block w-full px-[16px] sm:hidden" >
11+ < Portrait />
3912 </ div >
4013 </ div >
4114 ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ const Landscape = () => (
55 viewBox = "0 0 1220 412"
66 fill = "none"
77 xmlns = "http://www.w3.org/2000/svg"
8+ className = "w-full"
89 >
910 < circle cx = "7" cy = "17" r = "7" fill = "white" />
1011 < path
Original file line number Diff line number Diff line change 1- interface Props {
2- height : number ;
3- width : number ;
4- }
1+ // interface Props {
2+ // height: number;
3+ // width: number;
4+ // }
55
6- const Portrait = ( { height , width } : Props ) => (
6+ const Portrait = ( ) => (
77 < svg
8- width = { height }
9- height = { width }
8+ width = "732"
9+ height = "835"
1010 viewBox = "0 0 732 835"
1111 fill = "none"
1212 xmlns = "http://www.w3.org/2000/svg"
13+ className = "w-full"
1314 >
1415 < path
1516 d = "M354 15.3333C352.527 15.3333 351.333 16.5272 351.333 18C351.333 19.4728 352.527 20.6667 354 20.6667C355.473 20.6667 356.667 19.4728 356.667 18C356.667 16.5272 355.473 15.3333 354 15.3333ZM353.5 741C353.5 741.276 353.724 741.5 354 741.5C354.276 741.5 354.5 741.276 354.5 741L353.5 741ZM354 18L353.5 18L353.5 741L354 741L354.5 741L354.5 18L354 18Z"
You can’t perform that action at this time.
0 commit comments