+
Mot de passe oublié ?
-);
+)
Inverted.args = {
inverted: true,
-};
+}
diff --git a/packages/react/components/link/Link.tsx b/packages/react/components/link/Link.tsx
index 8b647bba..8ab6d6d9 100644
--- a/packages/react/components/link/Link.tsx
+++ b/packages/react/components/link/Link.tsx
@@ -1,8 +1,7 @@
import * as React from 'react'
import clsx from 'clsx'
import { LinkProps } from './LinkProps'
-import { has, is } from '@/services/classify'
-import { Icon, IconSize } from '@/components/icon'
+import { is } from '@/services/classify'
import { hashClass } from '@/helpers'
import { useTrilogyContext } from '@/context'
@@ -15,7 +14,6 @@ import { useTrilogyContext } from '@/context'
* @param title {string} Title attribute
* @param onClick {Function} onClick Event
* @param accessibilityLabel {string} Accessibility label
- * @param iconName {IconName} Adding Icon Link
* @param inverted {boolean} Inverted link
* @param others
* - -------------------------- WEB PROPERTIES -------------------------------
@@ -27,75 +25,30 @@ import { useTrilogyContext } from '@/context'
*/
const Link = ({
- children,
- className,
- id,
- to,
- href,
- onClick,
- accessibilityLabel,
- routerLink,
- iconName,
- inverted,
- blank,
- title,
- ...others
- }: LinkProps): JSX.Element => {
+ children,
+ className,
+ accessibilityLabel,
+ markup: LinkComponent = 'a',
+ inverted,
+ blank,
+ ...others
+}: LinkProps): JSX.Element => {
const { styled } = useTrilogyContext()
- const classes = hashClass(styled, clsx('link', iconName && has('icon'), inverted && is('inverted'), className))
-
- if (routerLink && to) {
- const RouterLink = (routerLink ? routerLink : 'a') as React.ElementType
-
- const RouterLinkTrilogy = (): JSX.Element => {
- return (
-
- {children}
-
- )
- }
-
- return
- }
-
- const LinkTrilogy = (): JSX.Element => {
- return (
-
- {iconName ? (
- <>
- {children}
-
- >
- ) : (
- children
- )}
-
- )
- }
-
- return
+ const classes = hashClass(styled, clsx('link', inverted && is('inverted'), className))
+
+ return (
+
+ {children}
+
+ )
}
export default Link
diff --git a/packages/react/components/link/LinkProps.ts b/packages/react/components/link/LinkProps.ts
index 5ed65846..29cadd63 100644
--- a/packages/react/components/link/LinkProps.ts
+++ b/packages/react/components/link/LinkProps.ts
@@ -1,4 +1,3 @@
-import { IconName, IconNameValues } from '../../components/icon'
import { Accessibility, Clickable, Dev } from '../../objects/facets'
import { CommonProps } from '../../objects/facets/CommonProps'
@@ -9,9 +8,7 @@ export interface LinkProps extends Accessibility, Clickable, Dev, CommonProps {
children?: React.ReactNode
to?: string
href?: string
- routerLink?: React.ElementType
- iconName?: IconName | IconNameValues
- inline?: boolean
+ markup?: React.ElementType
inverted?: boolean
blank?: boolean
title?: string
diff --git a/packages/react/components/link/test/link.test.tsx b/packages/react/components/link/test/link.test.tsx
index 6405feac..f84934a7 100644
--- a/packages/react/components/link/test/link.test.tsx
+++ b/packages/react/components/link/test/link.test.tsx
@@ -26,21 +26,10 @@ describe('Link component', () => {
expect(handleClick).toHaveBeenCalled()
})
- test('displays an icon when iconName is passed', async () => {
- const { findByTestId } = render(
-
- Example
- ,
- )
- const icon = await findByTestId('test-icon')
- expect(icon).toHaveClass('link has-icon')
- expect(icon).toBeInTheDocument()
- })
-
test('should have link with routerlink', () => {
const fn = jest.fn()
const { getByTestId } = render(
-
+
example
,
)