Update common file

This commit is contained in:
2023-11-30 10:37:50 +07:00
parent 28f15cec31
commit 5aec68dfce
13 changed files with 106 additions and 10 deletions
+24 -4
View File
@@ -1,4 +1,11 @@
import styled from 'styled-components';
import styled, { css } from 'styled-components';
// Types
import { TDirection } from '@type/common';
interface IStyledFormRow {
direction?: TDirection;
}
// Styled
import Button from '@commonStyle/Button';
@@ -16,11 +23,20 @@ const StyledActionBtn = styled.div`
gap: 100px;
`;
const StyledFormRow = styled.div`
const StyledFormRow = styled.div<IStyledFormRow>`
display: flex;
justify-content: space-between;
align-items: center;
gap: 100px;
${(props) =>
props.direction === 'horizontal'
? css`
align-items: center;
gap: 100px;
`
: css`
flex-direction: column;
gap: 15px;
`}
`;
const Label = styled.label`
@@ -45,4 +61,8 @@ const FormBtn = styled(Button)`
}
`;
StyledFormRow.defaultProps = {
direction: 'horizontal',
};
export { StyledForm, StyledActionBtn, StyledFormRow, Label, Error, FormBtn };