Skip to content

Commit 2c191bb

Browse files
committed
Move version history to bottom of Parrot page with navigation button
- Add 'View Version History' button below latest release - Move version history section to bottom of page - Button uses anchor link to scroll to version history section - Improves page flow and keeps focus on latest release
1 parent a4b6220 commit 2c191bb

1 file changed

Lines changed: 37 additions & 18 deletions

File tree

  • site/src/jsMain/kotlin/io/github/retar/portfolio/pages

site/src/jsMain/kotlin/io/github/retar/portfolio/pages/Parrot.kt

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package io.github.retar.portfolio.pages
22

33
import androidx.compose.runtime.Composable
4+
import com.varabyte.kobweb.compose.dom.ref
45
import com.varabyte.kobweb.compose.foundation.layout.Box
56
import com.varabyte.kobweb.compose.foundation.layout.Column
67
import com.varabyte.kobweb.compose.foundation.layout.Row
@@ -21,6 +22,7 @@ import com.varabyte.kobweb.silk.components.graphics.Image
2122
import com.varabyte.kobweb.silk.components.text.SpanText
2223
import com.varabyte.kobweb.silk.style.toModifier
2324
import io.github.retar.portfolio.components.widgets.DownloadButton
25+
import io.github.retar.portfolio.components.widgets.OutlineButton
2426
import io.github.retar.portfolio.resources.ImageRes
2527
import io.github.retar.portfolio.resources.ParrotRelease
2628
import io.github.retar.portfolio.resources.ParrotRes
@@ -79,7 +81,7 @@ fun ParrotPage() {
7981
}
8082

8183
// Download Section
82-
ReleasesSection()
84+
LatestReleaseSection()
8385

8486
// Features Section
8587
Column(
@@ -108,12 +110,17 @@ fun ParrotPage() {
108110
description = "Life is busy, and Parrot understands that. Your reading position is saved automatically, so you can seamlessly switch between your phone, tablet, and desktop without losing your place. Tap a notification and jump straight back into your book — no searching, no scrolling, just reading."
109111
)
110112
}
113+
114+
// Version History Section (at the bottom)
115+
if (ParrotRes.releases.size > 1) {
116+
VersionHistorySection()
117+
}
111118
}
112119
}
113120
}
114121

115122
@Composable
116-
private fun ReleasesSection() {
123+
private fun LatestReleaseSection() {
117124
val latestRelease = ParrotRes.latestRelease
118125

119126
Column(
@@ -135,24 +142,36 @@ private fun ReleasesSection() {
135142
// Latest Release Changelog
136143
ReleaseChangelog(latestRelease)
137144

138-
// Version History
145+
// Version History Button
139146
if (ParrotRes.releases.size > 1) {
140-
Column(
141-
modifier = Modifier
142-
.fillMaxWidth()
143-
.gap(24.px)
144-
.alignItems(AlignItems.FlexStart)
145-
.margin(top = 48.px),
146-
) {
147-
SpanText(
148-
text = "Version History",
149-
modifier = HeadingMStyle.toModifier(),
150-
)
147+
OutlineButton(
148+
url = "#version-history",
149+
label = "View Version History",
150+
modifier = Modifier.margin(top = 16.px)
151+
)
152+
}
153+
}
154+
}
151155

152-
ParrotRes.releases.drop(1).forEach { release ->
153-
ReleaseHistoryItem(release)
154-
}
155-
}
156+
@Composable
157+
private fun VersionHistorySection() {
158+
Column(
159+
modifier = Modifier
160+
.fillMaxWidth()
161+
.gap(24.px)
162+
.alignItems(AlignItems.FlexStart)
163+
.margin(top = 48.px),
164+
ref = ref { element ->
165+
element.id = "version-history"
166+
}
167+
) {
168+
SpanText(
169+
text = "Version History",
170+
modifier = HeadingMStyle.toModifier(),
171+
)
172+
173+
ParrotRes.releases.drop(1).forEach { release ->
174+
ReleaseHistoryItem(release)
156175
}
157176
}
158177
}

0 commit comments

Comments
 (0)