Skip to content

Commit cf63de1

Browse files
committed
Fix footer mobile view
1 parent a6b7361 commit cf63de1

File tree

2 files changed

+47
-35
lines changed

2 files changed

+47
-35
lines changed

komm-website/src/jsMain/kotlin/com/ucasoft/komm/website/App.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,11 +274,13 @@ private val Root = FC {
274274
Box {
275275
sx {
276276
flexGrow = number(1.0)
277-
paddingBottom = appTheme.spacing(if (isMobile) 35 else 21)
277+
paddingBottom = appTheme.spacing(if (isMobile) 13 else 21)
278278
}
279279
Outlet {}
280280
}
281-
Footer {}
281+
Footer {
282+
this.isMobile = isMobile
283+
}
282284
}
283285
}
284286
}

komm-website/src/jsMain/kotlin/com/ucasoft/komm/website/Footer.kt

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
package com.ucasoft.komm.website
22

3+
import com.ucasoft.komm.website.data.PathItem
34
import mui.material.*
45
import mui.material.styles.TypographyVariant
56
import mui.system.responsive
67
import mui.system.sx
78
import react.FC
9+
import react.Props
810
import react.create
911
import react.dom.html.ReactHTML.a
1012
import web.cssom.*
@@ -23,7 +25,11 @@ val footerLinks = mapOf(
2325
)
2426
)
2527

26-
val Footer = FC {
28+
external interface FooterProps : Props {
29+
var isMobile: Boolean
30+
}
31+
32+
val Footer = FC<FooterProps> {
2733
Box {
2834
sx {
2935
backgroundColor = Color("text.primary")
@@ -52,44 +58,48 @@ val Footer = FC {
5258
}
5359
Logo {}
5460
}
55-
Typography {
56-
variant = TypographyVariant.body2
57-
sx {
58-
color = rgb(255, 255, 255, 0.7)
59-
}
60-
+"KOMM is a powerful Kotlin Symbol Processing (KSP) based library for mapping between object models in Kotlin Multiplatform projects."
61-
}
62-
}
63-
footerLinks.map {
64-
Grid {
65-
item = true
66-
asDynamic().xs = responsive(12)
67-
asDynamic().sm = responsive(6)
68-
asDynamic().md = responsive(4)
61+
if(!it.isMobile) {
6962
Typography {
70-
variant = TypographyVariant.h6
63+
variant = TypographyVariant.body2
7164
sx {
72-
marginBottom = 3.px
65+
color = rgb(255, 255, 255, 0.7)
7366
}
74-
+it.key
67+
+"KOMM is a powerful Kotlin Symbol Processing (KSP) based library for mapping between object models in Kotlin Multiplatform projects."
7568
}
76-
List {
77-
disablePadding = true
78-
it.value.map {
79-
ListItem {
80-
disableGutters = true
81-
disablePadding = true
82-
ListItemText {
83-
primary = Typography.create {
84-
variant = TypographyVariant.body2
85-
component = a
86-
asDynamic().href = it.key
87-
asDynamic().target = "_blank"
88-
sx {
89-
color = rgb(255, 255, 255, 0.7)
69+
}
70+
}
71+
if (!it.isMobile) {
72+
footerLinks.map {
73+
Grid {
74+
item = true
75+
asDynamic().xs = responsive(12)
76+
asDynamic().sm = responsive(6)
77+
asDynamic().md = responsive(4)
78+
Typography {
79+
variant = TypographyVariant.h6
80+
sx {
81+
marginBottom = 3.px
82+
}
83+
+it.key
84+
}
85+
List {
86+
disablePadding = true
87+
it.value.map {
88+
ListItem {
89+
disableGutters = true
90+
disablePadding = true
91+
ListItemText {
92+
primary = Typography.create {
93+
variant = TypographyVariant.body2
94+
component = a
95+
asDynamic().href = it.key
96+
asDynamic().target = "_blank"
97+
sx {
98+
color = rgb(255, 255, 255, 0.7)
9099

100+
}
101+
+it.value
91102
}
92-
+it.value
93103
}
94104
}
95105
}

0 commit comments

Comments
 (0)