Skip to content

Make goal copy in ticker configurable #2065

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

Merged
merged 4 commits into from
Apr 29, 2025
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
5 changes: 5 additions & 0 deletions .changeset/fast-wombats-post.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@guardian/source-development-kitchen': minor
---

Make the goalCopy in tickerCopy configurable
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ const Template: StoryFn<typeof Ticker> = (args: TickerSettings) => (
export const HalfwayContributed: StoryFn<typeof Ticker> = Template.bind({});
HalfwayContributed.args = {
currencySymbol: '£',
copy: {},
copy: {
goalCopy: 'goal',
},
tickerData: {
total: 50000,
goal: 100000,
Expand All @@ -38,6 +40,7 @@ SmallDonationsSoFar.args = {
currencySymbol: '£',
copy: {
headline: 'Help us reach our end-of-year goal',
goalCopy: 'goal',
},
tickerData: {
total: 99,
Expand All @@ -52,6 +55,7 @@ ContributionGoalMet.args = {
currencySymbol: '£',
copy: {
headline: 'Help us reach our end-of-year goal',
goalCopy: 'goal',
},
tickerData: {
total: 10000000,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { useTicker } from './useTicker';

interface TickerCopy {
headline?: string;
goalCopy?: string;
}

export interface TickerData {
Expand Down Expand Up @@ -186,7 +187,7 @@ export const Ticker = ({
{runningTotal.toLocaleString()}
</span>{' '}
of {currencySymbol}
{tickerData.goal.toLocaleString()} goal
{tickerData.goal.toLocaleString()} {copy.goalCopy ?? 'goal'}
</div>
</div>
</div>
Expand Down
Loading