Skip to content

Commit

Permalink
Update frontend layout
Browse files Browse the repository at this point in the history
  • Loading branch information
aelassas committed Dec 13, 2024
1 parent d770d20 commit 0be74aa
Show file tree
Hide file tree
Showing 6 changed files with 113 additions and 106 deletions.
2 changes: 1 addition & 1 deletion frontend/src/assets/css/checkout.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ div.checkout {
flex: 1 0 auto;
flex-direction: row;
justify-content: center;
margin: 80px 0 200px 0;
transform: translate3d(0, 0, 0);
min-height: 100vh;
margin: 80px 0 200px 0;
}

@media only screen and (width <=960px) {
Expand Down
1 change: 1 addition & 0 deletions frontend/src/assets/css/contact.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ div.contact {
flex: 1 0 auto;
align-items: center;
transform: translate3d(0, 0, 0);
min-height: 100vh;
}

div.contact .form {
Expand Down
13 changes: 6 additions & 7 deletions frontend/src/assets/css/footer.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,34 @@ div.footer ul.links li:hover {
text-decoration: underline;
}

div.footer div.contact {
div.footer div.footer-contact {
display: flex;
flex-direction: row;
align-items: center;
margin: 10px 0;
}

div.footer div.contact .icon {
div.footer div.footer-contact .icon {
color: #525252;
margin-right: 5px;
}

div.footer div.contact a {
div.footer div.footer-contact a {
text-decoration: none;
color: #1a1a1a;
}

div.footer div.contact a:hover {
div.footer div.footer-contact a:hover {
/* opacity: 0.85; */
text-decoration: underline;

}

div.footer div.contact .social-icon {
div.footer div.footer-contact .social-icon {
color: #525252;
margin-right: 12px;
}

div.footer div.contact .social-icon:hover{
div.footer div.footer-contact .social-icon:hover{
color: #1a1a1a;
}

Expand Down
2 changes: 2 additions & 0 deletions frontend/src/assets/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ div.settings {
align-items: center;
margin: 45px 0;
transform: translate3d(0, 0, 0);
margin: 80px 0 200px 0;
min-height: 100vh;
}

div.settings .settings-form-wrapper {
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ const Footer = () => {
<li onClick={() => navigate('/contact')}>{strings.CONTACT}</li>
<li onClick={() => navigate('/faq')}>{strings.FAQ}</li>
</ul>
<div className="contact">
<div className="footer-contact">
<MailOutline className="icon" />
<a href="mailto:[email protected]">[email protected]</a>
</div>
<div className="contact">
<div className="footer-contact">
<Link href="https://www.facebook.com/" target="_blank"><FacebookIcon className="social-icon" /></Link>
<Link href="https://x.com/" target="_blank"><X className="social-icon" /></Link>
<Link href="https://www.linkedin.com/" target="_blank"><LinkedIn className="social-icon" /></Link>
Expand Down
197 changes: 101 additions & 96 deletions frontend/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import Backdrop from '@/components/SimpleBackdrop'
import DatePicker from '@/components/DatePicker'
import Avatar from '@/components/Avatar'
import * as helper from '@/common/helper'
import DriverLicense from '@/components/DriverLicense'
import Footer from '@/components/Footer'

import '@/assets/css/settings.css'
import DriverLicense from '@/components/DriverLicense'

const Settings = () => {
const navigate = useNavigate()
Expand Down Expand Up @@ -178,103 +179,107 @@ const Settings = () => {
return (
<Layout onLoad={onLoad} user={user} strict>
{visible && user && (
<div className="settings">

<Paper className="settings-form settings-form-wrapper" elevation={10}>
<form onSubmit={handleSubmit}>
<Avatar
loggedUser={user}
user={user}
size="large"
readonly={false}
onBeforeUpload={onBeforeUpload}
onChange={onAvatarChange}
color="disabled"
className="avatar-ctn"
/>
<FormControl fullWidth margin="dense">
<InputLabel className="required">{commonStrings.FULL_NAME}</InputLabel>
<Input type="text" required onChange={handleFullNameChange} autoComplete="off" value={fullName} />
</FormControl>
<FormControl fullWidth margin="dense">
<InputLabel className="required">{commonStrings.EMAIL}</InputLabel>
<Input type="text" value={user.email} disabled />
</FormControl>
<FormControl fullWidth margin="dense">
<InputLabel className="required">{commonStrings.PHONE}</InputLabel>
<Input type="text" required error={!phoneValid} onChange={handlePhoneChange} autoComplete="off" value={phone} />
<FormHelperText error={!phoneValid}>{(!phoneValid && commonStrings.PHONE_NOT_VALID) || ''}</FormHelperText>
</FormControl>
<FormControl fullWidth margin="dense">
<DatePicker
label={commonStrings.BIRTH_DATE}
value={birthDate}
variant="standard"
required
onChange={(_birthDate) => {
if (_birthDate) {
const _birthDateValid = validateBirthDate(_birthDate)

setBirthDate(_birthDate)
setBirthDateValid(_birthDateValid)
}
}}
language={user.language}
<>
<div className="settings">

<Paper className="settings-form settings-form-wrapper" elevation={10}>
<form onSubmit={handleSubmit}>
<Avatar
loggedUser={user}
user={user}
size="large"
readonly={false}
onBeforeUpload={onBeforeUpload}
onChange={onAvatarChange}
color="disabled"
className="avatar-ctn"
/>
<FormHelperText error={!birthDateValid}>{(!birthDateValid && commonStrings.BIRTH_DATE_NOT_VALID) || ''}</FormHelperText>
<FormControl fullWidth margin="dense">
<InputLabel className="required">{commonStrings.FULL_NAME}</InputLabel>
<Input type="text" required onChange={handleFullNameChange} autoComplete="off" value={fullName} />
</FormControl>
<FormControl fullWidth margin="dense">
<InputLabel className="required">{commonStrings.EMAIL}</InputLabel>
<Input type="text" value={user.email} disabled />
</FormControl>
<FormControl fullWidth margin="dense">
<InputLabel className="required">{commonStrings.PHONE}</InputLabel>
<Input type="text" required error={!phoneValid} onChange={handlePhoneChange} autoComplete="off" value={phone} />
<FormHelperText error={!phoneValid}>{(!phoneValid && commonStrings.PHONE_NOT_VALID) || ''}</FormHelperText>
</FormControl>
<FormControl fullWidth margin="dense">
<DatePicker
label={commonStrings.BIRTH_DATE}
value={birthDate}
variant="standard"
required
onChange={(_birthDate) => {
if (_birthDate) {
const _birthDateValid = validateBirthDate(_birthDate)

setBirthDate(_birthDate)
setBirthDateValid(_birthDateValid)
}
}}
language={user.language}
/>
<FormHelperText error={!birthDateValid}>{(!birthDateValid && commonStrings.BIRTH_DATE_NOT_VALID) || ''}</FormHelperText>
</FormControl>
<FormControl fullWidth margin="dense">
<InputLabel>{commonStrings.LOCATION}</InputLabel>
<Input id="location" type="text" onChange={handleLocationChange} autoComplete="off" value={location} />
</FormControl>
<FormControl fullWidth margin="dense">
<InputLabel>{commonStrings.BIO}</InputLabel>
<Input id="bio" type="text" onChange={handleBioChange} autoComplete="off" value={bio} />
</FormControl>
<div className="buttons">
<Button
variant="contained"
className="btn-primary btn-margin btn-margin-bottom"
size="small"
onClick={(e) => {
e.preventDefault()
navigate('/change-password')
}}
>
{commonStrings.RESET_PASSWORD}
</Button>
<Button type="submit" variant="contained" className="btn-primary btn-margin-bottom">
{commonStrings.SAVE}
</Button>
<Button
variant="outlined"
color="primary"
className="btn-secondary btn-margin-bottom"
size="small"
onClick={(e) => {
e.preventDefault()
navigate('/')
}}
>
{commonStrings.CANCEL}
</Button>
</div>
</form>
</Paper>

<Paper className="settings-form settings-form-wrapper" elevation={10}>
<h1 className="settings-form-title">{commonStrings.DRIVER_LICENSE}</h1>
<DriverLicense user={user} />
</Paper>

<Paper className="settings-net settings-net-wrapper" elevation={10}>
<h1 className="settings-form-title">{strings.NETWORK_SETTINGS}</h1>
<FormControl component="fieldset">
<FormControlLabel control={<Switch checked={enableEmailNotifications} onChange={handleEmailNotificationsChange} />} label={strings.SETTINGS_EMAIL_NOTIFICATIONS} />
</FormControl>
<FormControl fullWidth margin="dense">
<InputLabel>{commonStrings.LOCATION}</InputLabel>
<Input id="location" type="text" onChange={handleLocationChange} autoComplete="off" value={location} />
</FormControl>
<FormControl fullWidth margin="dense">
<InputLabel>{commonStrings.BIO}</InputLabel>
<Input id="bio" type="text" onChange={handleBioChange} autoComplete="off" value={bio} />
</FormControl>
<div className="buttons">
<Button
variant="contained"
className="btn-primary btn-margin btn-margin-bottom"
size="small"
onClick={(e) => {
e.preventDefault()
navigate('/change-password')
}}
>
{commonStrings.RESET_PASSWORD}
</Button>
<Button type="submit" variant="contained" className="btn-primary btn-margin-bottom" size="small">
{commonStrings.SAVE}
</Button>
<Button
variant="outlined"
color="primary"
className="btn-secondary btn-margin-bottom"
size="small"
onClick={(e) => {
e.preventDefault()
navigate('/')
}}
>
{commonStrings.CANCEL}
</Button>
</div>
</form>
</Paper>

<Paper className="settings-form settings-form-wrapper" elevation={10}>
<h1 className="settings-form-title">{commonStrings.DRIVER_LICENSE}</h1>
<DriverLicense user={user} />
</Paper>

<Paper className="settings-net settings-net-wrapper" elevation={10}>
<h1 className="settings-form-title">{strings.NETWORK_SETTINGS}</h1>
<FormControl component="fieldset">
<FormControlLabel control={<Switch checked={enableEmailNotifications} onChange={handleEmailNotificationsChange} />} label={strings.SETTINGS_EMAIL_NOTIFICATIONS} />
</FormControl>
</Paper>

</div>
</Paper>

</div>

<Footer />
</>
)}
{loading && <Backdrop text={commonStrings.PLEASE_WAIT} />}
</Layout>
Expand Down

0 comments on commit 0be74aa

Please sign in to comment.