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

Replace Bagdes by Tags in Card props #164

Closed
pprev94 opened this issue Aug 9, 2023 · 4 comments
Closed

Replace Bagdes by Tags in Card props #164

pprev94 opened this issue Aug 9, 2023 · 4 comments

Comments

@pprev94
Copy link
Contributor

pprev94 commented Aug 9, 2023

In the documentation of dsfr (https://www.systeme-de-design.gouv.fr/elements-d-interface/composants/carte) it's already tags instead of badges.
So we should apply changes to Card component

I can work on a PR

@ocruze
Copy link
Contributor

ocruze commented Aug 9, 2023

Sorry we read a little too fast. So it seems that both tags and badges are possible but not at the same time. We would like to have the possibility to choose from tags or badges.

We thought of something like this: changing the following prop badges: BadgeProps[] | TagProps[]
Maybe reuse the <Badge /> and <Tag /> components?

sbourdon13 pushed a commit to sbourdon13/react-dsfr that referenced this issue Aug 11, 2023
@enguerranws
Copy link
Collaborator

enguerranws commented Sep 18, 2023

We thought of something like this: changing the following prop badges: BadgeProps[] | TagProps[]
Maybe reuse the and components?

@ocruze Seems fine to me. Do you plan to work on this?

@slafayIGN
Copy link
Contributor

slafayIGN commented Sep 21, 2023

I got some new elements from DSFR UX/UI.
There are actually several issues with the way the react-dsfr Card component deal with badges and tags:

  • There should be only one badge element in the media area : one single badge or one single tag (after trials, a tag is not possible here)
  • There should be a tags group xor a badges group in the content (.fr-card__start) area
  • No mixing of tags and badges is permitted in the content area
  • If there is a badge in the media area, only a tags group is permitted in the content. And if there is a tag in the media area, the element in the content has to be a badges group. (no tags in both places or badges in both places)

@garronej
Copy link
Collaborator

Hi @slafayIGN, thank you for bringing those rules to my attention.

If I understand correctly, you're saying that the current Card component allows usages that don't adhere to the official DSFR guidelines. Is that correct?
Are you suggesting that we should strengthen the Props type definition so that TypeScript will throw an error if all the rules aren't followed?

Should the component be completely overhauled?
Would anyone be willing to take this on? It seems straightforward, as there's no logic involved.

garronej added a commit that referenced this issue Sep 29, 2023
feat(Card)!: update component to match dsfr guidelines (refs #164)
@pprev94 pprev94 closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants