mirror of
https://github.com/hazemKrimi/personal-website.git
synced 2026-05-02 02:10:27 +00:00
Add prettier configuration
This commit is contained in:
@@ -3,22 +3,28 @@ import { Props } from './types';
|
||||
import { StyledButton, StyledLink } from './styles';
|
||||
|
||||
const IconButton = ({
|
||||
alt,
|
||||
icon,
|
||||
href,
|
||||
target,
|
||||
onClick,
|
||||
className,
|
||||
width = 24,
|
||||
height = 24
|
||||
}: Props) => href ? (
|
||||
<StyledLink href={href} target={target} onClick={onClick} className={className}>
|
||||
<Image alt={alt} src={icon} width={width} height={height} />
|
||||
</StyledLink>
|
||||
) : (
|
||||
<StyledButton onClick={onClick} className={className}>
|
||||
<Image alt={alt} src={icon} width={width} height={height} />
|
||||
</StyledButton>
|
||||
);
|
||||
alt,
|
||||
icon,
|
||||
href,
|
||||
target,
|
||||
onClick,
|
||||
className,
|
||||
width = 24,
|
||||
height = 24,
|
||||
}: Props) =>
|
||||
href ? (
|
||||
<StyledLink
|
||||
href={href}
|
||||
target={target}
|
||||
onClick={onClick}
|
||||
className={className}
|
||||
>
|
||||
<Image alt={alt} src={icon} width={width} height={height} />
|
||||
</StyledLink>
|
||||
) : (
|
||||
<StyledButton onClick={onClick} className={className}>
|
||||
<Image alt={alt} src={icon} width={width} height={height} />
|
||||
</StyledButton>
|
||||
);
|
||||
|
||||
export default IconButton;
|
||||
|
||||
@@ -2,17 +2,17 @@ import styled, { css } from 'styled-components';
|
||||
import Link from 'next/link';
|
||||
|
||||
const sharedStyles = css`
|
||||
cursor: pointer;
|
||||
background: none;
|
||||
border: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
cursor: pointer;
|
||||
background: none;
|
||||
border: none;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
`;
|
||||
|
||||
export const StyledLink = styled(Link)`
|
||||
${sharedStyles}
|
||||
${sharedStyles}
|
||||
`;
|
||||
|
||||
export const StyledButton = styled.button`
|
||||
${sharedStyles}
|
||||
`;
|
||||
${sharedStyles}
|
||||
`;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
export interface Props {
|
||||
alt: string;
|
||||
icon: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
href?: string;
|
||||
target?: HTMLAnchorElement['target'];
|
||||
onClick?: () => void;
|
||||
className?: string;
|
||||
}
|
||||
alt: string;
|
||||
icon: string;
|
||||
width?: number;
|
||||
height?: number;
|
||||
href?: string;
|
||||
target?: HTMLAnchorElement['target'];
|
||||
onClick?: () => void;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user