Skip to content

Commit

Permalink
refactor(member): improved Linker Component UI (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
gwansikk committed Mar 30, 2024
1 parent 53528e5 commit 4b7b744
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions apps/member/src/components/common/Linker/Linker.tsx
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
import classNames from 'classnames';
import { PropsWithChildren } from 'react';
import { Link } from 'react-router-dom';

import { useNavigate } from 'react-router-dom';

interface LinkerProps {
interface LinkerProps extends PropsWithChildren {
to: string | Partial<Location>;
onClick?: () => void;
className?: string;
children: React.ReactNode;
}

const Linker = ({ to, className, children }: LinkerProps) => {
const navigate = useNavigate();

return (
<a
onClick={() => navigate(to)}
<Link
to={to}
className={classNames(
"text-bold cursor-pointer underline after:content-['_↗']",
"font-semibold hover:underline underline-offset-2 text-black/50 hover:text-black after:content-['_↗']",
className,
)}
>
{children}
</a>
</Link>
);
};

Expand Down

0 comments on commit 4b7b744

Please sign in to comment.