+10








b7892b10ef
Co-authored-by: Nitesh Singh <nitesh.singh@gitstart.dev> Co-authored-by: Matheus Benini Ferreira <88898100+MatheusBeniniF@users.noreply.github.com> Co-authored-by: gitstart <gitstart@users.noreply.github.com> Co-authored-by: gitstart <gitstart@gitstart.com> Co-authored-by: Rafael Toledo <87545086+Toledodev@users.noreply.github.com> Co-authored-by: Matheus Benini <matheus_benini@hotmail.com> Co-authored-by: Murilo Amaral <87545137+MuriloAmarals@users.noreply.github.com> Co-authored-by: Rubens Rafael <70234898+RubensRafael@users.noreply.github.com> Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com> Co-authored-by: Rafael <rafael.toledo@engenharia.ufjf.br> Co-authored-by: Grace Nshokano <grace.devolop@gmail.com> Co-authored-by: MuriloAmarals <muralha2000@gmail.com> Co-authored-by: Matheus Muniz <matheusmuniz100@hotmail.com> Co-authored-by: Júlio Piubello da Silva Cabral <julio.piubello@gitstart.dev> Co-authored-by: Matheus Muniz <87545749+matheusmuniz03@users.noreply.github.com> Co-authored-by: C000Ldude <coolmagnas@gmail.com> Co-authored-by: Klinger Matheus <50892465+KlingerMatheus@users.noreply.github.com> Co-authored-by: Eman <emmanuelgatwech@gmail.com>
23 lines
619 B
TypeScript
23 lines
619 B
TypeScript
import Link from "next/link";
|
|
|
|
interface ILinkTextProps {
|
|
href: string;
|
|
children: React.ReactNode;
|
|
classNameChildren?: string;
|
|
target?: string;
|
|
}
|
|
/**
|
|
* This component had to be made in order to make i18n work with next/link
|
|
* @see https://github.com/i18next/react-i18next/issues/1090#issuecomment-615426145
|
|
**/
|
|
export const LinkText = (props: ILinkTextProps) => {
|
|
const { target, href, children, classNameChildren, ...moreProps } = props;
|
|
return (
|
|
<Link href={href || ""} {...moreProps}>
|
|
<a target={target || ""} className={classNameChildren}>
|
|
{children}
|
|
</a>
|
|
</Link>
|
|
);
|
|
};
|