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(slash): add Link Component #598

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

feat(slash): add Link Component #598

wants to merge 1 commit into from

Conversation

pplancq
Copy link
Contributor

@pplancq pplancq commented Nov 18, 2024

Description

Implémentation du composant Link pour slash, pour ce composant j'ai fait le choix de suffixer la class css par af-slash car af-link sembler déjà exister (bien que le composant non) et je ne voulais pas occasionner de break ou parasiter les autres class css.

Le composant implémente le style décrit ici https://zeroheight.com/4b1e27a45/v/latest/p/657e74-link/b/7443f5

  • Pour les icones le composant fonctionne avec les glyphicon mais aussi les svg.

  • Le composant Link permet de surcharger automatiquement l'attribut rel de la balise a par noopener noreferrer si la target vaut _blank

  • Le composant Link est interopérable facilement avec des lib de routage tel que react-router-dom

import { Link as RouterLink } from "react-router-dom";

export const LinkExample = () => (
  <Link component={RouterLink} to="/contact">
    Go to Contact Page
  </Link>
);

@pplancq pplancq added agent-slash Component for the agent theme component component needs to be worked on labels Nov 18, 2024
@pplancq pplancq self-assigned this Nov 18, 2024
slash/css/src/Link/Link.scss Outdated Show resolved Hide resolved
slash/css/src/slash.scss Outdated Show resolved Hide resolved
a-pourrier
a-pourrier previously approved these changes Nov 19, 2024
a-pourrier
a-pourrier previously approved these changes Nov 25, 2024
slash/react/src/Link/Link.tsx Outdated Show resolved Hide resolved
slash/css/src/Link/Link.scss Show resolved Hide resolved
@johnmeunier
Copy link
Contributor

Hum j'y pense, Link c'est déjà un composant react-router, ca va poser problème et des gymnastiques pour rien ?

@johnmeunier johnmeunier reopened this Dec 16, 2024
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
66.1% Coverage on New Code (required ≥ 80%)
8.2% Duplication on New Code (required ≤ 3%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@pplancq
Copy link
Contributor Author

pplancq commented Dec 16, 2024

Hum j'y pense, Link c'est déjà un composant react-router, ca va poser problème et des gymnastiques pour rien ?

Alors oui je suis d'accord mais le zeroheight nomme un lien Link
Après j'ai toujours eu cette habitude car avec le lib material le composant de lien s'appel Link aussi

import { Link as RouterLink } from "react-router-dom";

export const LinkExample = () => (
  <Link component={RouterLink} to="/contact">
    Go to Contact Page
  </Link>
);

@pplancq pplancq requested a review from johnmeunier December 16, 2024 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-slash Component for the agent theme component component needs to be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants