/
dedaMazai
/
reactGoodPattern
Обзор
Документация
Войти
/
dedaMazai
/
reactGoodPattern
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
moduleFederation/container/src/shared/ui/AppLink/AppLink.tsx
33 строки
783 B
Andrey Chipizubov
add microFronts
25 май 2023, 01:05
25 май 2023, 01:05
ec973d2
Код
Авторство
О чём код?
import { memo, ReactNode } from "react"; import { Link, LinkProps } from "react-router-dom"; import { classNames } from "@/shared/lib/classNames/classNames"; import cls from "./AppLink.module.scss"; interface AppLinkProps extends LinkProps { className?: string; theme?: "primary" | "secondary"; children?: ReactNode; hovered?: boolean; } export const AppLink = memo((props: AppLinkProps) => { const { to, className, children, hovered, theme = "primary", ...otherProps } = props; return ( <Link to={to} className={classNames(cls.AppLink, { [cls.hovered]: hovered }, [className, cls[theme]])} {...otherProps} > {children} </Link> ); });