Skip to content

Commit

Permalink
fix: align code title with text size change
Browse files Browse the repository at this point in the history
  • Loading branch information
Tayebsed93 committed Nov 25, 2024
1 parent c3cfaa0 commit b048d5d
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions Showcase/Showcase/Pages/Utils/ShowcaseTokenCode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,13 @@ struct ShowcaseTokenCode: View {
// MARK: Private helpers

private func toggleButtonSection() -> some View {
HStack {
Button(action: {
isCodeVisible.toggle()
}, label: {
VStack(alignment: .leading, spacing: theme.spaceFixedNone) {
Button(action: toggle) {
HStack {
Text("app_tokens_code_title_label")
.typeBodyStrongLarge(theme)
.foregroundStyle(theme.colorContentDefault.color(for: colorScheme))
.padding(.vertical, theme.spacePaddingInlineShort)
Image(isCodeVisible ? "ic_chevron-up" : "ic_chevron-down")
.resizable()
.renderingMode(.template)
Expand All @@ -53,10 +52,11 @@ struct ShowcaseTokenCode: View {
.padding(.trailing, theme.spacePaddingInlineMedium)
.accessibilityLabel("app_tokens_code_visibility_button_a11y")
}
})
}
.buttonStyle(PlainButtonStyle())
}
.frame(maxWidth: .infinity, alignment: .leading)
.padding(.bottom, theme.spacePaddingBlockMedium)
.padding(.bottom, theme.spacePaddingBlockShort)
}

private func codeTokenDisplayCodeSection() -> some View {
Expand Down Expand Up @@ -100,4 +100,8 @@ struct ShowcaseTokenCode: View {
color: theme.colorBorderDefault)
)
}

private func toggle() {
isCodeVisible.toggle()
}
}

0 comments on commit b048d5d

Please sign in to comment.