Skip to content

Commit

Permalink
review: pass token directly to ShowcaseTokenCode
Browse files Browse the repository at this point in the history
  • Loading branch information
Tayebsed93 committed Nov 25, 2024
1 parent b048d5d commit a317daa
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 16 deletions.
3 changes: 1 addition & 2 deletions Showcase/Showcase/Pages/Tokens/Border/BorderTokenPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ struct BorderTokenPage: View {
VStack(alignment: .leading, spacing: activeTheme.spaceFixedMedium) {
Section {
VStack(alignment: .leading, spacing: activeTheme.spaceFixedNone) {
let tokenCode = "theme.borderWidthDefault"
ShowcaseTokenCode(code: tokenCode)
ShowcaseTokenCode(code: "theme.borderWidthDefault")
}
}
Section {
Expand Down
3 changes: 1 addition & 2 deletions Showcase/Showcase/Pages/Tokens/Color/ColorTokenPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ struct ColorTokenPage: View {
var body: some View {
Group {
Section {
let tokenCode = "theme.colorBgPrimary.color(for: colorScheme)"
ShowcaseTokenCode(code: tokenCode)
ShowcaseTokenCode(code: "theme.colorBgPrimary.color(for: colorScheme)")
}
Section { illustrationForBackground() } header: { header("Background") }
Section { illustrationForAction() } header: { header("Action") }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ struct SizeTokenPage: View {
var body: some View {
Group {
Section {
let tokenCode = "theme.sizeIconWithHeadingXLargeShort.dimension(for: horizontalSizeClass ?? .regular)"
ShowcaseTokenCode(code: tokenCode)
ShowcaseTokenCode(code: "theme.sizeIconWithHeadingXLargeShort.dimension(for: horizontalSizeClass ?? .regular)")
}
Section { illustrationForIconDecorative() } header: {
header("app_tokens_dimension_size_iconDecorative_label")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,7 @@ struct SpaceTokenPage: View {
var body: some View {
Group {
Section {
let tokenCode = "theme.spaceScaledMedium.dimension(for: horizontalSizeClass ?? .regular)"
ShowcaseTokenCode(code: tokenCode)
ShowcaseTokenCode(code: "theme.spaceScaledMedium.dimension(for: horizontalSizeClass ?? .regular)")
}
// Basic Space Tokens
Section { illustrationForScaledSpaces() } header: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ struct ElevationTokenPage: View {
var body: some View {
VStack(alignment: .leading, spacing: activeTheme.spaceFixedNone) {
Section {
let tokenCode = "theme.elevationNone.elevation(for: colorScheme)"
ShowcaseTokenCode(code: tokenCode)
ShowcaseTokenCode(code: "theme.elevationNone.elevation(for: colorScheme)")
}
Spacer()
.frame(height: activeTheme.spaceFixedMedium)
Expand Down
3 changes: 1 addition & 2 deletions Showcase/Showcase/Pages/Tokens/Grid/GrisTokenPage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ struct GridTokenPage: View {
}

Section {
let tokenCode = "theme.gridColumnCount(for: horizontalSizeClass)"
ShowcaseTokenCode(code: tokenCode)
ShowcaseTokenCode(code: "theme.gridColumnCount(for: horizontalSizeClass)")
}

Section { illustrationForGridTokens() } header: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ struct OpacityTokenPage: View {
var body: some View {
VStack(alignment: .leading, spacing: activeTheme.spaceFixedNone) {
Section {
let tokenCode = "theme.opacityTransparent"
ShowcaseTokenCode(code: tokenCode)
ShowcaseTokenCode(code: "theme.opacityTransparent")
}
Spacer()
.frame(height: activeTheme.spaceFixedMedium)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ struct TypographyTokenPage: View {
var body: some View {
VStack(alignment: .leading, spacing: activeTheme.spaceFixedNone) {
Section {
let tokenCode = "theme.typeBodyStrongLarge(theme)"
ShowcaseTokenCode(code: tokenCode)
ShowcaseTokenCode(code: "theme.typeBodyStrongLarge(theme)")
}
Spacer()
ForEach(NamedTypography.allCases, id: \.rawValue) { typographyName in
Expand Down

0 comments on commit a317daa

Please sign in to comment.