1
1
'use client' ;
2
2
3
- import { ReactNode } from "react" ;
3
+ import { ReactNode , CSSProperties } from "react" ;
4
4
5
5
export const EarthScene : React . FC < {
6
6
toolbar ?: ReactNode ;
7
7
topSection ?: ReactNode ;
8
8
middleSection ?: ReactNode ;
9
9
bottomSection ?: ReactNode ;
10
- } > = ( { toolbar, topSection, middleSection, bottomSection } ) => {
10
+ middleSectionTwo ?: ReactNode ;
11
+ } > = ( { toolbar, topSection, middleSection, bottomSection, middleSectionTwo } ) => {
12
+ // Collect all sections to determine height distribution
13
+ const sections = [ topSection , middleSection , middleSectionTwo , bottomSection ] . filter ( Boolean ) ;
14
+ const totalSections = sections . length ;
15
+
16
+ // Define the flex properties for each section
17
+ const sectionStyles : CSSProperties [ ] = sections . map ( ( _ , index ) => {
18
+ // Distribute height for each section
19
+ let flexValue = 0 ;
20
+
21
+ if ( index === 0 ) {
22
+ flexValue = 22.5 ; // Top section
23
+ } else if ( index === 1 || index === 2 ) {
24
+ flexValue = 15 ; // Middle sections, reduced height
25
+ } else if ( index === 3 ) {
26
+ flexValue = 22.5 ; // Bottom section
27
+ }
28
+
29
+ return {
30
+ flex : flexValue ,
31
+ } ;
32
+ } ) ;
33
+
11
34
return (
12
- < div className = "relative min-h-screen w-full flex flex-col justify-start" >
13
- < img
14
- className = "absolute inset-0 w-full h-full object-cover"
15
- src = "/assets/Backdrops/Earth.png"
16
- alt = "Earth Background"
17
- />
18
-
19
- < div className = "relative flex flex-col h-full" >
20
- { topSection && < div className = "w-full h-[22.5vh]" > { topSection } </ div > }
21
-
22
- < div className = "flex w-full h-[55vh] relative" >
23
- < div className = "w-2/3 h-full mx-auto p-4 overflow-hidden" >
24
- { middleSection }
25
- </ div >
26
-
27
- { toolbar && (
28
- < div className = "absolute top-0 right-0 h-full flex flex-col justify-center p-7" >
29
- { toolbar }
30
- </ div >
31
- ) }
32
- </ div >
33
-
34
- { bottomSection && (
35
- < div className = "flex w-full h-[22.5vh]" >
36
- < div className = "w-2/3 h-full mx-auto p-4 overflow-hidden" >
37
- { bottomSection }
38
- </ div >
35
+ < div className = "relative min-h-screen w-full flex flex-col" >
36
+ < img
37
+ className = "absolute inset-0 w-full h-full object-cover"
38
+ src = "/assets/Backdrops/Earth.png"
39
+ alt = "Earth Background"
40
+ />
41
+
42
+ < div className = "relative flex flex-col h-full z-10" >
43
+ { topSection && (
44
+ < div className = "relative flex" style = { sectionStyles [ 0 ] } >
45
+ { topSection }
46
+ </ div >
47
+ ) }
48
+
49
+ { middleSection && (
50
+ < div className = "mt-4 relative flex" style = { sectionStyles [ 1 ] } >
51
+ < div className = "w-2/3 h-full mx-auto p-4 overflow-hidden" >
52
+ { middleSection }
53
+ </ div >
54
+
55
+ { toolbar && (
56
+ < div className = "absolute top-0 right-0 h-full flex flex-col justify-center p-7" >
57
+ { toolbar }
58
+ </ div >
59
+ ) }
60
+ </ div >
61
+ ) }
62
+
63
+ { middleSectionTwo && (
64
+ < div className = "mt-4 relative flex" style = { sectionStyles [ 2 ] } >
65
+ < div className = "w-2/3 h-full mx-auto p-4 overflow-hidden" >
66
+ { middleSectionTwo }
67
+ </ div >
68
+ </ div >
69
+ ) }
70
+
71
+ { bottomSection && (
72
+ < div className = "relative flex" style = { sectionStyles [ 3 ] } >
73
+ < div className = "w-2/3 h-full mx-auto p-4 overflow-hidden" >
74
+ { bottomSection }
75
+ </ div >
76
+ </ div >
77
+ ) }
39
78
</ div >
40
- ) }
41
79
</ div >
42
- </ div >
43
80
) ;
44
- } ;
81
+ } ;
0 commit comments