Add common component and helpers

This commit is contained in:
2023-10-26 16:49:16 +07:00
parent f9f5990a4a
commit bd407bb933
10 changed files with 140 additions and 5 deletions
+25 -5
View File
@@ -1,15 +1,35 @@
import styled from 'styled-components';
import styled, { css } from 'styled-components';
const Button = styled.button`
interface IButtonStyle {
styled?: 'primary' | 'secondary';
}
const Button = styled.button<IButtonStyle>`
padding: 10px 20px;
background-color: var(--primary-color);
color: var(--light-text);
text-transform: uppercase;
font-weight: 500;
font-weight: 600;
cursor: pointer;
border-radius: var(--radius-md);
${(props) =>
props.styled === 'primary' &&
css`
background-color: var(--primary-color);
color: var(--light-text);
`}
${(props) =>
props.styled === 'secondary' &&
css`
background-color: var(--secondary-btn-color);
`}
`;
Button.defaultProps = {
styled: 'primary',
};
export default Button;