mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-01 18:00:26 +00:00
Update dependencies and fix introduced errors
This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
import { FC, useContext } from 'react';
|
||||
import { useContext } from 'react';
|
||||
import { ThemeContext } from '../../styles/theme';
|
||||
import { Props } from './types';
|
||||
import { Btn } from './styles';
|
||||
import Link from 'next/link';
|
||||
|
||||
const MDXButton: FC<Props & { className?: string }> = ({
|
||||
const MDXButton = ({
|
||||
variant = 'text',
|
||||
type = 'button',
|
||||
link,
|
||||
@@ -12,25 +11,23 @@ const MDXButton: FC<Props & { className?: string }> = ({
|
||||
children,
|
||||
disabled,
|
||||
className
|
||||
}) => {
|
||||
}: Props) => {
|
||||
const { mode } = useContext(ThemeContext);
|
||||
|
||||
return link ? (
|
||||
<Link href={link} passHref>
|
||||
<Btn
|
||||
as='a'
|
||||
target={target}
|
||||
variant={variant}
|
||||
type={type}
|
||||
mode={mode}
|
||||
disabled={disabled}
|
||||
className={className}
|
||||
>
|
||||
{children}
|
||||
</Btn>
|
||||
</Link>
|
||||
<Btn
|
||||
href={link}
|
||||
target={target}
|
||||
variant={variant}
|
||||
type={type}
|
||||
mode={mode}
|
||||
disabled={disabled}
|
||||
className={className}
|
||||
>
|
||||
{children}
|
||||
</Btn>
|
||||
) : (
|
||||
<Btn variant={variant} type={type} mode={mode} disabled={disabled} className={className}>
|
||||
<Btn href="#" variant={variant} type={type} mode={mode} disabled={disabled} className={className}>
|
||||
{children}
|
||||
</Btn>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user