feat: add start section
This commit is contained in:
@@ -1 +0,0 @@
|
||||
reusable components
|
||||
46
src/shared/ui/button/button.module.scss
Normal file
46
src/shared/ui/button/button.module.scss
Normal file
@@ -0,0 +1,46 @@
|
||||
.Button {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 13px 33px;
|
||||
border-radius: 28px;
|
||||
|
||||
font-family: $font-open-sans;
|
||||
font-weight: $font-regular;
|
||||
font-size: 24px;
|
||||
line-height: 1;
|
||||
|
||||
transition: all 0.15s linear;
|
||||
white-space: nowrap;
|
||||
|
||||
|
||||
svg {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
//fill: var(--text-primary);
|
||||
|
||||
margin-right: 18px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&:hover svg {
|
||||
fill: var(--white);
|
||||
}
|
||||
|
||||
&_default {
|
||||
background: $color-lightgray;
|
||||
color: $color-text;
|
||||
}
|
||||
|
||||
&_orange {
|
||||
background: $color-orange;
|
||||
color: $color-white;
|
||||
}
|
||||
|
||||
&_disabled {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
39
src/shared/ui/button/button.tsx
Normal file
39
src/shared/ui/button/button.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import s from './button.module.scss';
|
||||
import { FunctionComponent, HTMLAttributes, ReactNode, SVGProps } from 'react';
|
||||
import { clsx } from 'clsx';
|
||||
|
||||
type ButtonProps = {
|
||||
className?: string;
|
||||
children?: ReactNode;
|
||||
disabled?: boolean;
|
||||
Icon?: FunctionComponent<SVGProps<SVGSVGElement>>;
|
||||
onClick?: () => void;
|
||||
variant?: 'default' | 'orange' | 'ghost';
|
||||
} & HTMLAttributes<HTMLButtonElement>;
|
||||
|
||||
export default function Button({
|
||||
className,
|
||||
children,
|
||||
onClick,
|
||||
Icon,
|
||||
disabled,
|
||||
variant = 'default',
|
||||
...props
|
||||
}: ButtonProps) {
|
||||
return (
|
||||
<button
|
||||
className={clsx(
|
||||
s.Button,
|
||||
disabled && s.Button_disabled,
|
||||
s['Button_' + variant],
|
||||
className,
|
||||
)}
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
{...props}
|
||||
>
|
||||
{Icon && <Icon />}
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
1
src/shared/ui/button/index.ts
Normal file
1
src/shared/ui/button/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default as Button } from './button';
|
||||
1
src/shared/ui/index.ts
Normal file
1
src/shared/ui/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { Button } from './button';
|
||||
Reference in New Issue
Block a user