Commit 4505dda8 by Syed Abdul Rahman

legend wrapper spacing fix

parent 4d7406c1
...@@ -23,6 +23,10 @@ ...@@ -23,6 +23,10 @@
{ {
"id": "5647", "id": "5647",
"email": "anas@krds.fr" "email": "anas@krds.fr"
},
{
"id": "ad86",
"email": "test@gmail.com"
} }
], ],
"selectedSeats": [ "selectedSeats": [
...@@ -50,15 +54,15 @@ ...@@ -50,15 +54,15 @@
"selected": [ "selected": [
{ {
"row": 8, "row": 8,
"seat": 1 "seat": 5
}, },
{ {
"row": 8, "row": 8,
"seat": 2 "seat": 6
}, },
{ {
"row": 8, "row": 7,
"seat": 3 "seat": 7
} }
] ]
}, },
...@@ -133,6 +137,20 @@ ...@@ -133,6 +137,20 @@
"seat": 3 "seat": 3
} }
] ]
},
{
"id": "ad86",
"userid": "ad86",
"selected": [
{
"row": 4,
"seat": 7
},
{
"row": 4,
"seat": 8
}
]
} }
] ]
} }
\ No newline at end of file
...@@ -16,19 +16,25 @@ export const Primary = { ...@@ -16,19 +16,25 @@ export const Primary = {
<> <>
<h2 style={{ fontFamily: 'Poppins-Medium', color: 'white' }}>Size</h2> <h2 style={{ fontFamily: 'Poppins-Medium', color: 'white' }}>Size</h2>
<Space> <Space>
<Button size={'sm'}>Small</Button> <Button size={'sm'} variant="primary">
<Button size={'md'}>Medium</Button> Small
<Button size={'lg'}>Large</Button> </Button>
<Button size={'md'} variant="primary">
Medium
</Button>
<Button size={'lg'} variant="primary">
Large
</Button>
</Space> </Space>
<h2 style={{ fontFamily: 'Poppins-Medium', color: 'white' }}>Loader</h2> <h2 style={{ fontFamily: 'Poppins-Medium', color: 'white' }}>Loader</h2>
<Space> <Space>
<Button size={'sm'} loading={true}> <Button size={'sm'} loading={true} variant="primary">
Button Button
</Button> </Button>
<Button size={'md'} loading={true}> <Button size={'md'} loading={true} variant="primary">
Button Button
</Button> </Button>
<Button size={'lg'} loading={true}> <Button size={'lg'} loading={true} variant="primary">
Button Button
</Button> </Button>
</Space> </Space>
...@@ -36,13 +42,13 @@ export const Primary = { ...@@ -36,13 +42,13 @@ export const Primary = {
Disabled Disabled
</h2> </h2>
<Space> <Space>
<Button size={'sm'} disabled={true}> <Button size={'sm'} disabled={true} variant="primary">
Button Button
</Button> </Button>
<Button size={'md'} disabled={true}> <Button size={'md'} disabled={true} variant="primary">
Button Button
</Button> </Button>
<Button size={'lg'} disabled={true}> <Button size={'lg'} disabled={true} variant="primary">
Button Button
</Button> </Button>
</Space> </Space>
...@@ -50,13 +56,13 @@ export const Primary = { ...@@ -50,13 +56,13 @@ export const Primary = {
Loading & Disabled Loading & Disabled
</h2> </h2>
<Space> <Space>
<Button size={'sm'} disabled={true} loading={true}> <Button size={'sm'} disabled={true} loading={true} variant="primary">
Button Button
</Button> </Button>
<Button size={'md'} disabled={true} loading={true}> <Button size={'md'} disabled={true} loading={true} variant="primary">
Button Button
</Button> </Button>
<Button size={'lg'} disabled={true} loading={true}> <Button size={'lg'} disabled={true} loading={true} variant="primary">
Button Button
</Button> </Button>
</Space> </Space>
......
...@@ -9,9 +9,12 @@ const Button = ({ loading, size, disabled, children, variant, ...props }) => { ...@@ -9,9 +9,12 @@ const Button = ({ loading, size, disabled, children, variant, ...props }) => {
}`} }`}
{...props}> {...props}>
{loading && ( {loading && (
<>
<div className={`${styles.loader} ${styles[`loader-${size}`]}`}></div> <div className={`${styles.loader} ${styles[`loader-${size}`]}`}></div>
<span>please wait...</span>
</>
)} )}
{children} {!loading && children}
</button> </button>
); );
}; };
...@@ -22,5 +25,6 @@ Button.propTypes = { ...@@ -22,5 +25,6 @@ Button.propTypes = {
children: PropTypes.node.isRequired, children: PropTypes.node.isRequired,
disabled: PropTypes.bool, disabled: PropTypes.bool,
size: PropTypes.string, size: PropTypes.string,
loading: PropTypes.bool loading: PropTypes.bool,
variant: PropTypes.oneOf(['primary', 'secondary'])
}; };
...@@ -92,3 +92,8 @@ ...@@ -92,3 +92,8 @@
transform: rotate(360deg); transform: rotate(360deg);
} }
} }
.button:has(.loader) {
opacity: 0.4;
pointer-events: none;
}
...@@ -21,10 +21,9 @@ const Input = ({ name, label, error = '', ...inputPprops }) => { ...@@ -21,10 +21,9 @@ const Input = ({ name, label, error = '', ...inputPprops }) => {
}; };
Input.propTypes = { Input.propTypes = {
onChange: PropTypes.func.isRequired, label: PropTypes.string,
type: PropTypes.string, name: PropTypes.string,
value: PropTypes.string, error: PropTypes.string
placeholder: PropTypes.string
}; };
export default Input; export default Input;
import Input from './Index'; import Input from './Index';
export default { export default {
title: "component/Base/Input", title: 'component/Base/Input',
tags: ["autodocs"], tags: ['autodocs'],
component: Input, component: Input,
argTypes: { argTypes: {
onChange: { action: "changing" }, onChange: { action: 'changing' }
type: {
control: {
type: 'select'
},
options: ["text", "number"]
} }
} };
}
export const Default = { export const Default = {
args: { args: {
placeholder: "Placeholder", placeholder: 'Placeholder'
} }
} };
\ No newline at end of file
...@@ -19,3 +19,8 @@ ...@@ -19,3 +19,8 @@
border: none; border: none;
outline: none; outline: none;
} }
.errorText {
color: red;
font-family: 'Inter-Medium';
}
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
width: 15px; width: 15px;
height: 15px; height: 15px;
border-radius: 50%; border-radius: 50%;
background-color: rgb(151, 155, 155); background-color: rgb(108, 91, 133);
} }
.available { .available {
......
...@@ -5,7 +5,8 @@ export default { ...@@ -5,7 +5,8 @@ export default {
component: BookingWrapper, component: BookingWrapper,
argTypes: { argTypes: {
onSeatAdd: { action: 'Seat Add' }, onSeatAdd: { action: 'Seat Add' },
onSeatRemove: { action: 'Seat Remove' } onSeatRemove: { action: 'Seat Remove' },
onSeatsConfirm: { action: 'seat confirm' }
} }
}; };
......
...@@ -109,5 +109,5 @@ BookingWrapper.propTypes = { ...@@ -109,5 +109,5 @@ BookingWrapper.propTypes = {
onSeatAdd: PropTypes.func.isRequired, onSeatAdd: PropTypes.func.isRequired,
onSeatRemove: PropTypes.func.isRequired, onSeatRemove: PropTypes.func.isRequired,
onSeatsConfirm: PropTypes.func.isRequired, onSeatsConfirm: PropTypes.func.isRequired,
buttonState: PropTypes.bool.isRequired isDisabled: PropTypes.bool.isRequired
}; };
...@@ -48,13 +48,13 @@ ...@@ -48,13 +48,13 @@
} }
.btn-wrapper { .btn-wrapper {
padding: 1.5em 0; padding-top: 3rem;
} }
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.seat { .seat {
width: 1.8em; width: 1.6em;
height: 1.8em; height: 1.6em;
} }
.seat-row { .seat-row {
......
...@@ -3,10 +3,12 @@ import styles from './styles.module.css'; ...@@ -3,10 +3,12 @@ import styles from './styles.module.css';
const LegendWrapper = (props) => { const LegendWrapper = (props) => {
return ( return (
<div className={styles.LegendWrapper}> <div className={styles.LegendWrapper}>
<div className={styles.columnWrapper}>
<Legend type="selected">Selected</Legend> <Legend type="selected">Selected</Legend>
<Legend type="reserved">Reserved</Legend> <Legend type="reserved">Reserved</Legend>
<Legend type="available">Available</Legend> <Legend type="available">Available</Legend>
</div> </div>
</div>
); );
}; };
......
.LegendWrapper { .LegendWrapper {
gap: 1rem;
background-color: #3444c5;
display: flex;
flex-direction: column;
justify-content: flex-end;
height: max(12vh, 70px);
}
.columnWrapper {
display: flex; display: flex;
gap: 1rem; gap: 1rem;
justify-content: center; justify-content: center;
...@@ -7,7 +17,7 @@ ...@@ -7,7 +17,7 @@
} }
@media screen and (min-width: 768px) { @media screen and (min-width: 768px) {
.LegendWrapper { .columnWrapper {
gap: 4rem; gap: 4rem;
} }
} }
...@@ -2,13 +2,24 @@ import PropTypes from 'prop-types'; ...@@ -2,13 +2,24 @@ import PropTypes from 'prop-types';
import Input from '@Base/Input/Index'; import Input from '@Base/Input/Index';
import Button from '@Base/Button/Index'; import Button from '@Base/Button/Index';
import styles from './styles.module.css'; import styles from './styles.module.css';
import { useState } from 'react';
const Login = ({ onSubmit }) => { const Login = ({ onSubmit }) => {
const handleSubmit = (e) => { const [isLoading, setIsLoading] = useState(false);
const handleSubmit = async (e) => {
e.preventDefault(); e.preventDefault();
const formData = new FormData(e.target); const formData = new FormData(e.target);
const data = { ...Object.fromEntries(formData) }; const data = { ...Object.fromEntries(formData) };
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (regex.test(data.email)) {
setIsLoading(true);
setTimeout(() => {
setIsLoading(false);
onSubmit(data?.email); onSubmit(data?.email);
}, 1000);
} else {
return;
}
}; };
return ( return (
...@@ -27,7 +38,9 @@ const Login = ({ onSubmit }) => { ...@@ -27,7 +38,9 @@ const Login = ({ onSubmit }) => {
type="email" type="email"
placeholder="Enter email" placeholder="Enter email"
/> />
<Button size={'md'}>Confirm</Button> <Button size={'md'} loading={isLoading}>
Confirm
</Button>
</form> </form>
</section> </section>
</div> </div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment