@@ -20,115 +20,128 @@ export function Footer(props: {
20
20
const { context, customization } = props ;
21
21
22
22
return (
23
- < footer className = "border-t border-tint-subtle scroll-nojump" >
24
- < div
25
- className = { tcls (
26
- CONTAINER_STYLE ,
27
- 'py-8' ,
28
- 'gap-12' ,
29
- 'flex' ,
30
- 'flex-wrap' ,
31
- 'items-start' ,
32
- ) }
33
- >
34
- { /* Footer Logo */ }
35
- < div className = "shrink sm:basis-72 page-no-toc:lg:basis-56 mr-auto order-1 empty:hidden empty:lg:block page-no-toc:empty:lg:hidden page-no-toc:empty:xl:block" >
36
- { customization . footer . logo ? (
37
- < Image
38
- alt = "Logo"
39
- sources = { {
40
- light : {
41
- src : customization . footer . logo . light ,
42
- } ,
43
- dark : customization . footer . logo . dark
44
- ? {
45
- src : customization . footer . logo . dark ,
46
- }
47
- : null ,
48
- } }
49
- priority = "lazy"
50
- style = { [
51
- 'w-auto' ,
52
- 'max-w-40' ,
53
- 'lg:max-w-64' ,
54
- 'max-h-12' ,
55
- 'object-contain' ,
56
- 'object-left' ,
57
- 'rounded' ,
58
- 'straight-corners:rounded-sm' ,
59
- ] }
60
- sizes = { [
61
- {
62
- width : 320 ,
63
- } ,
64
- ] }
65
- />
66
- ) : null }
67
- </ div >
68
-
69
- { /* Mode Switcher */ }
70
- < div
23
+ < >
24
+ < hr className = "border-t border-tint-subtle" />
25
+ < div className = "scroll-nojump" >
26
+ < footer
71
27
className = { tcls (
72
- 'ml-auto' ,
73
- 'order-2 lg:order-4' ,
74
- customization . footer . groups ?. length < 3 &&
75
- customization . footer . logo == undefined &&
76
- 'sm:order-4' ,
77
- 'xl:basis-56' ,
28
+ CONTAINER_STYLE ,
29
+ 'px-4' ,
30
+ 'mx-auto' ,
31
+ 'flex' ,
32
+ 'gap-12' ,
33
+ // If the footer only contains a mode toggle, we only show it on smaller screens
34
+ customization . themes . toggeable &&
35
+ ! customization . footer . copyright &&
36
+ ! customization . footer . logo &&
37
+ customization . footer . groups ?. length == 0
38
+ ? 'xl:hidden'
39
+ : null ,
78
40
) }
79
41
>
80
- { customization . themes . toggeable ? (
81
- < div className = "flex items-center justify-end" >
82
- < React . Suspense fallback = { null } >
83
- < ThemeToggler />
84
- </ React . Suspense >
85
- </ div >
86
- ) : null }
87
- </ div >
88
-
89
- { /* Navigation Groups (split into equal columns) */ }
90
- { customization . footer . groups ?. length > 0 ? (
42
+ < div className = "hidden lg:block basis-72 page-no-toc:hidden" />
91
43
< div
92
44
className = { tcls (
93
- 'flex flex-col sm:flex-row mx-auto grow lg:max-w-3xl gap-10 sm:gap-6 order-3' ,
94
- 'w-full lg:w-auto' ,
95
- customization . footer . groups ?. length < 3 &&
96
- customization . footer . logo == undefined &&
97
- 'sm:w-auto' ,
45
+ 'py-8' ,
46
+ 'gap-12' ,
47
+ 'flex' ,
48
+ 'flex-wrap' ,
49
+ 'items-start' ,
50
+ 'w-full' ,
51
+ 'flex-1' ,
52
+ 'max-w-3xl' ,
53
+ 'page-full-width:max-w-none' ,
54
+ 'mx-auto' ,
98
55
) }
99
56
>
100
- { partition ( customization . footer . groups , FOOTER_COLUMNS ) . map (
101
- ( column , columnIndex ) => (
102
- < div key = { columnIndex } className = "flex w-full flex-col gap-10" >
103
- { column . map ( ( group , groupIndex ) => (
104
- < FooterLinksGroup
105
- key = { groupIndex }
106
- group = { group }
107
- context = { context }
108
- />
109
- ) ) }
110
- </ div >
111
- ) ,
112
- ) }
113
- </ div >
114
- ) : null }
57
+ { /* Footer Logo */ }
58
+ { customization . footer . logo ? (
59
+ < Image
60
+ alt = "Logo"
61
+ sources = { {
62
+ light : {
63
+ src : customization . footer . logo . light ,
64
+ } ,
65
+ dark : customization . footer . logo . dark
66
+ ? {
67
+ src : customization . footer . logo . dark ,
68
+ }
69
+ : null ,
70
+ } }
71
+ priority = "lazy"
72
+ style = { [
73
+ 'w-auto' ,
74
+ 'max-w-40' ,
75
+ 'lg:max-w-64' ,
76
+ 'max-h-12' ,
77
+ 'object-contain' ,
78
+ 'object-left' ,
79
+ 'rounded' ,
80
+ 'straight-corners:rounded-sm' ,
81
+ 'order-1' ,
82
+ ] }
83
+ sizes = { [
84
+ {
85
+ width : 320 ,
86
+ } ,
87
+ ] }
88
+ />
89
+ ) : null }
115
90
116
- { /* Legal */ }
117
- < div
118
- className = { tcls (
119
- 'mx-auto w-full grow text-xs text-tint items-center text-center order-4 flex flex-col gap-2 empty:hidden' ,
120
- customization . footer . groups . length == 0 &&
121
- 'order-2 lg:flex-1 lg:w-auto lg:items-start lg:max-w-3xl self-center lg:text-start' ,
122
- customization . footer . groups . length == 0 &&
123
- customization . footer . logo == undefined &&
124
- 'sm:w-auto sm:flex-1 sm:items-start sm:max-w-3xl sm:text-start' ,
125
- ) }
126
- >
127
- { customization . footer . copyright ? (
128
- < p > { customization . footer . copyright } </ p >
129
- ) : null }
130
- </ div >
91
+ { /* Mode Switcher */ }
92
+ { customization . themes . toggeable ? (
93
+ < div className = "flex items-center justify-end ml-auto order-2 xl:hidden" >
94
+ < React . Suspense fallback = { null } >
95
+ < ThemeToggler />
96
+ </ React . Suspense >
97
+ </ div >
98
+ ) : null }
99
+
100
+ { /* Navigation Groups (split into equal columns) */ }
101
+ { customization . footer . groups ?. length > 0 ? (
102
+ < div
103
+ className = { tcls (
104
+ 'flex flex-col sm:flex-row mx-auto grow gap-10 sm:gap-6 order-3 w-full' ,
105
+ ! customization . footer . logo &&
106
+ customization . footer . groups . length < 2 &&
107
+ 'sm:order-1 sm:flex-1 sm:w-auto sm:items-start sm:max-w-3xl self-center sm:text-start' ,
108
+ ) }
109
+ >
110
+ { partition ( customization . footer . groups , FOOTER_COLUMNS ) . map (
111
+ ( column , columnIndex ) => (
112
+ < div
113
+ key = { columnIndex }
114
+ className = "flex w-full flex-col gap-10"
115
+ >
116
+ { column . map ( ( group , groupIndex ) => (
117
+ < FooterLinksGroup
118
+ key = { groupIndex }
119
+ group = { group }
120
+ context = { context }
121
+ />
122
+ ) ) }
123
+ </ div >
124
+ ) ,
125
+ ) }
126
+ </ div >
127
+ ) : null }
128
+
129
+ { /* Legal */ }
130
+ < div
131
+ className = { tcls (
132
+ 'mx-auto w-full grow text-xs text-tint items-center text-center order-4 flex flex-col gap-2 empty:hidden' ,
133
+ customization . footer . groups . length == 0 &&
134
+ 'sm:order-1 sm:flex-1 sm:w-auto sm:items-start sm:max-w-3xl self-center sm:text-start' ,
135
+ ) }
136
+ >
137
+ { customization . footer . copyright ? (
138
+ < p > { customization . footer . copyright } </ p >
139
+ ) : null }
140
+ </ div >
141
+ </ div >
142
+ < div className = "hidden lg:block xl:basis-56 page-no-toc:hidden" />
143
+ </ footer >
131
144
</ div >
132
- </ footer >
145
+ </ >
133
146
) ;
134
147
}
0 commit comments