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

feat: update Tile component #150 #277

Merged
merged 5 commits into from
Jul 15, 2024
Merged

feat: update Tile component #150 #277

merged 5 commits into from
Jul 15, 2024

Conversation

ocruze
Copy link
Contributor

@ocruze ocruze commented Jul 15, 2024

❗BREAKING

#150

  • Attempt to update the Tile react component according to the changes in base DSFR Tile component.
  • Also added a mechanism to handle svg correctly (to be able to change colour according to the current theme)
  • Updated all storybook examples

@garronej
Copy link
Collaborator

Merci beaucoup!
@ddecrulle tu peut me dire ce que tu en pense?
Es-ce qu'on fait une major?

src/Tile.tsx Outdated Show resolved Hide resolved
src/Tile.tsx Outdated
@@ -63,15 +113,29 @@ export const Tile = memo(
"explicitlyProvidedId": id_props
});

if (!!disabled && linkProps !== undefined) {
linkProps.href = undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Plutôt que de muter le linkProps, je pense que c'est plus claire de faire L151 :

<Link
    {...linkProps} 
    href={disabled ? undefined : linkProps.href}
    className={cx(classes.link, linkProps.className)}
    aria-disabled={disabled}
>
    {title}
</Link>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fait. J'avais pas pensé à cette façon, mais je suis d'accord ça fait plus propre

src/Tile.tsx Outdated Show resolved Hide resolved
src/Tile.tsx Outdated Show resolved Hide resolved
@ddecrulle
Copy link
Collaborator

ddecrulle commented Jul 15, 2024

Je ne suis pas favorable à une version majeure étant donné que le DSFR n’a pas fait de mise à jour majeure. Cependant, cela reste un changement important (breaking change). Le DSFR a gardé l’ancienne version en mode déprécié, ce qui est plus difficile pour nous, mais cela peut être une option : conserver l’ancienne version en la renommant. Cela reste un changement important, mais les utilisateurs de l’ancienne version de Tile n’auraient pas grand-chose à modifier en mettant à jour leur version s’ils souhaitent conserver leurs Tiles.

@ocruze ocruze requested a review from ddecrulle July 15, 2024 12:31
@ddecrulle ddecrulle merged commit cab3f34 into codegouvfr:main Jul 15, 2024
6 checks passed
@ddecrulle
Copy link
Collaborator

@garronej Je te laisse bump la version 😎

@ocruze
Copy link
Contributor Author

ocruze commented Jul 15, 2024

Oups, j'avais laissé un nom de variable temporaire, du coup j'ai recréé une PR #278

garronej added a commit that referenced this pull request Jul 15, 2024
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

Successfully merging this pull request may close these issues.

3 participants