mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 20:01:59 +00:00
Fix bug and optimzed code
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import styled, { css } from 'styled-components';
|
||||
|
||||
type TButtonStyle = 'primary' | 'secondary';
|
||||
|
||||
interface IButtonStyle {
|
||||
styled?: 'primary' | 'secondary';
|
||||
styled?: TButtonStyle;
|
||||
}
|
||||
|
||||
const Button = styled.button<IButtonStyle>`
|
||||
@@ -11,7 +13,7 @@ const Button = styled.button<IButtonStyle>`
|
||||
font-weight: 600;
|
||||
|
||||
cursor: pointer;
|
||||
|
||||
|
||||
border-radius: var(--radius-md);
|
||||
|
||||
${(props) =>
|
||||
|
||||
@@ -5,7 +5,7 @@ const ButtonIcon = styled.button`
|
||||
|
||||
padding: 8px;
|
||||
transition: all 0.2s;
|
||||
|
||||
|
||||
border: none;
|
||||
border-radius: var(--radius-md);
|
||||
|
||||
|
||||
@@ -5,9 +5,9 @@ const CommonInput = css`
|
||||
border-radius: var(--radius-sm);
|
||||
|
||||
padding: 10px 20px;
|
||||
|
||||
|
||||
font-size: var(--fs-sm-x);
|
||||
|
||||
|
||||
width: 200px;
|
||||
`;
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import styled, { css } from 'styled-components';
|
||||
|
||||
type TDirection = 'vertical' | 'horizontal';
|
||||
|
||||
interface IDirection {
|
||||
type?: 'vertical' | 'horizontal';
|
||||
type?: TDirection;
|
||||
}
|
||||
|
||||
const Direction = styled.div<IDirection>`
|
||||
|
||||
@@ -3,8 +3,10 @@ import styled, { css } from 'styled-components';
|
||||
// Styled
|
||||
import CommonInput from './CommonInput';
|
||||
|
||||
type TInput = 'text' | 'checkbox' | 'hidden';
|
||||
|
||||
interface IInputTyped {
|
||||
type?: 'text' | 'checkbox' | 'hidden';
|
||||
type?: TInput;
|
||||
}
|
||||
|
||||
const Input = styled.input<IInputTyped>`
|
||||
|
||||
Reference in New Issue
Block a user