Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GOVUKAPP-986: Topics title scrolling #141

Merged
merged 3 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
package uk.govuk.app.design.ui.component

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.defaultMinSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -37,7 +35,7 @@ fun TabHeader(
Title2BoldLabel(
text = text,
textAlign = TextAlign.Center,
modifier = modifier.weight(1f)
modifier = Modifier.weight(1f)
)
}
}
Expand All @@ -55,9 +53,7 @@ fun ChildPageHeader(
Row(
modifier = Modifier
.height(64.dp)
.fillMaxWidth()
.padding(GovUkTheme.spacing.small),
horizontalArrangement = Arrangement.SpaceBetween,
.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically,
) {
if (onBack != null) {
Expand All @@ -69,12 +65,11 @@ fun ChildPageHeader(
contentDescription = stringResource(R.string.content_desc_back),
tint = GovUkTheme.colourScheme.textAndIcons.link
)
Spacer(Modifier)
}
}

if (onAction != null && actionText != null) {
Spacer(Modifier)
Spacer(Modifier.weight(1f))

TextButton(
onClick = onAction
Expand All @@ -90,20 +85,12 @@ fun ChildPageHeader(
}

if (text != null) {
Row(
modifier = modifier
.defaultMinSize(64.dp)
LargeTitleBoldLabel(
text = text,
modifier = Modifier
.fillMaxWidth()
.padding(GovUkTheme.spacing.small),
verticalAlignment = Alignment.CenterVertically,
) {
LargeTitleBoldLabel(
text = text,
modifier = modifier
.fillMaxWidth()
.padding(horizontal = GovUkTheme.spacing.medium)
)
}
.padding(horizontal = GovUkTheme.spacing.medium)
)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import uk.govuk.app.design.ui.component.BodyRegularLabel
import uk.govuk.app.design.ui.component.ChildPageHeader
import uk.govuk.app.design.ui.component.ExternalLinkListItem
import uk.govuk.app.design.ui.component.InternalLinkListItem
import uk.govuk.app.design.ui.component.LargeTitleBoldLabel
import uk.govuk.app.design.ui.component.LargeVerticalSpacer
import uk.govuk.app.design.ui.component.ListHeader
import uk.govuk.app.design.ui.component.MediumVerticalSpacer
Expand Down Expand Up @@ -110,7 +111,6 @@ private fun TopicScreen(
}

ChildPageHeader(
text = topic.title,
onBack = onBack
)

Expand All @@ -130,6 +130,7 @@ private fun TopicScreen(
LazyColumn(Modifier.padding(horizontal = GovUkTheme.spacing.medium)) {
item {
Column {
LargeTitleBoldLabel(topic.title)
MediumVerticalSpacer()
topic.description?.let { description ->
BodyRegularLabel(description)
Expand Down
Loading