mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-22 20:01:59 +00:00
Add common component and helpers
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user