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,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -3,4 +3,6 @@ export type Props = {
|
||||
href: string;
|
||||
target?: HTMLAnchorElement['target'];
|
||||
onClick?: () => void;
|
||||
children: React.ReactNode;
|
||||
className?: string;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user