Update dependencies and fix introduced errors

This commit is contained in:
Hazem Krimi
2023-03-19 00:17:48 +01:00
parent fad540e17b
commit c97cb80ce8
19 changed files with 1316 additions and 1311 deletions
+7 -14
View File
@@ -1,24 +1,17 @@
import { FC, useContext } from 'react';
import { ThemeContext } from '../../styles/theme';
import { Props } from './types';
import { Btn } from './styles';
import Link from 'next/link';
import { StyledButton } from './styles';
const Button: FC<Props & { className?: string }> = ({
const Button = ({
variant = 'text',
href,
target,
onClick,
children,
className
}) => {
return (
<Link href={href} passHref>
<Btn as='a' target={target} variant={variant} onClick={onClick} className={className}>
{children}
</Btn>
</Link>
);
};
}: Props) => (
<StyledButton href={href} target={target} className={className} onClick={onClick} variant={variant}>
{children}
</StyledButton>
);
export default Button;
+2 -1
View File
@@ -1,7 +1,8 @@
import styled from 'styled-components';
import Link from 'next/link';
import { Props } from './types';
export const Btn = styled.button<Omit<Props, 'href'>>`
export const StyledButton = styled(Link)<Props>`
position: relative;
display: inline;
cursor: pointer;
+2
View File
@@ -3,4 +3,6 @@ export type Props = {
href: string;
target?: HTMLAnchorElement['target'];
onClick?: () => void;
children: React.ReactNode;
className?: string;
};