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

Decouple Source dev kitchen components from ArticleFormat #12493

Closed
jamesmockett opened this issue Oct 3, 2024 · 1 comment
Closed

Decouple Source dev kitchen components from ArticleFormat #12493

jamesmockett opened this issue Oct 3, 2024 · 1 comment
Assignees
Milestone

Comments

@jamesmockett
Copy link
Contributor

jamesmockett commented Oct 3, 2024

The following Source Development Kitchen components include a format prop that relies on the ArticleFormat type from @guardian/libs:

QuoteIcon
ToggleSwitch
EditorialButton

Source components should not be dependent on ArticleFormat as this ties them to DCR whereas they should be reusable anywhere. Additionally, we want to relocate the ArticleFormat types from @guardian/libs to DCR, but this can't be done whilst there are components that rely on them.

format is used by all of these components to apply an appropriate colour scheme based on the selected Pillar. They should be refactored so that a colour scheme or theme can be applied in a more generic way that doesn't rely upon ArticleFormat.

QuoteIcon

Doesn't appear to be used anywhere. DCR has it's own local copy so we can probably safely remove the format prop entirely.

ToggleSwitch

Used by DCR, manage-frontend and support-frontend, but none of these appear to use format. ArticleFormat isn't used in any meaningful way—the presence of format simply toggles between two alternate colour schemes.

EditorialButton

Used by DCR in single place. format is used to theme the button using the selected Pillar.

@jamesmockett jamesmockett added this to the Health milestone Oct 3, 2024
@SiAdcock SiAdcock self-assigned this Oct 9, 2024
@SiAdcock SiAdcock added the Epic label Oct 9, 2024
@SiAdcock
Copy link
Contributor

SiAdcock commented Oct 9, 2024

@JamieB-gu JamieB-gu removed the Epic label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

3 participants