Merged in feat/loy-513-update-edit-profile-button-positions (pull request #3447)
feat(LOY-513): Update button positions and simplify css * Update button positions and simplify css Approved-by: Matilda Landström
This commit is contained in:
@@ -1,3 +1,13 @@
|
|||||||
|
.container {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
gap: var(--Space-x4);
|
||||||
|
|
||||||
|
@media (min-width: 768px) {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.password,
|
.password,
|
||||||
.user {
|
.user {
|
||||||
align-self: flex-start;
|
align-self: flex-start;
|
||||||
@@ -7,7 +17,7 @@
|
|||||||
container-type: inline-size;
|
container-type: inline-size;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.sharedRow {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: var(--Space-x2);
|
gap: var(--Space-x2);
|
||||||
grid-template-columns: minmax(100px, 164px) 1fr;
|
grid-template-columns: minmax(100px, 164px) 1fr;
|
||||||
@@ -20,7 +30,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
@container addressContainer (max-width: 350px) {
|
@container addressContainer (max-width: 350px) {
|
||||||
.container {
|
.sharedRow {
|
||||||
grid-template-columns: 1fr;
|
grid-template-columns: 1fr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ export default function FormContent({ errors }: { errors: FieldErrors }) {
|
|||||||
const languageOptions = getLocalizedLanguageOptions(lang)
|
const languageOptions = getLocalizedLanguageOptions(lang)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className={styles.container}>
|
||||||
<section className={styles.user}>
|
<section className={styles.user}>
|
||||||
<header>
|
<header>
|
||||||
<Typography variant="Body/Paragraph/mdBold">
|
<Typography variant="Body/Paragraph/mdBold">
|
||||||
@@ -82,7 +82,7 @@ export default function FormContent({ errors }: { errors: FieldErrors }) {
|
|||||||
})}
|
})}
|
||||||
name="address.city"
|
name="address.city"
|
||||||
/>
|
/>
|
||||||
<div className={styles.container}>
|
<div className={styles.sharedRow}>
|
||||||
<FormInput
|
<FormInput
|
||||||
data-hj-suppress
|
data-hj-suppress
|
||||||
label={intl.formatMessage({
|
label={intl.formatMessage({
|
||||||
@@ -183,6 +183,6 @@ export default function FormContent({ errors }: { errors: FieldErrors }) {
|
|||||||
errorFormatter={formatFormErrorMessage}
|
errorFormatter={formatFormErrorMessage}
|
||||||
/>
|
/>
|
||||||
</section>
|
</section>
|
||||||
</>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,14 +1,7 @@
|
|||||||
.container {
|
.container {
|
||||||
display: grid;
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
gap: var(--Space-x3);
|
gap: var(--Space-x3);
|
||||||
grid-template-areas:
|
|
||||||
"title"
|
|
||||||
"form"
|
|
||||||
"buttons";
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
grid-area: title;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.welcome {
|
.welcome {
|
||||||
@@ -19,34 +12,16 @@
|
|||||||
color: var(--Text-Interactive-Default);
|
color: var(--Text-Interactive-Default);
|
||||||
}
|
}
|
||||||
|
|
||||||
.form {
|
|
||||||
display: grid;
|
|
||||||
gap: var(--Space-x5);
|
|
||||||
grid-area: form;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btnContainer {
|
.btnContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column-reverse;
|
flex-direction: column;
|
||||||
gap: var(--Space-x1);
|
gap: var(--Space-x1);
|
||||||
grid-area: buttons;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (min-width: 768px) {
|
@media screen and (min-width: 768px) {
|
||||||
.container {
|
|
||||||
grid-template-areas:
|
|
||||||
"title buttons"
|
|
||||||
"form form";
|
|
||||||
}
|
|
||||||
|
|
||||||
.form {
|
|
||||||
grid-template-columns: 1fr 1fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btnContainer {
|
.btnContainer {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
gap: var(--Space-x2);
|
gap: var(--Space-x2);
|
||||||
justify-self: flex-end;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,9 +122,7 @@ export default function Form({ user }: EditFormProps) {
|
|||||||
}, [trigger])
|
}, [trigger])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
|
||||||
<section className={styles.container}>
|
<section className={styles.container}>
|
||||||
<div className={styles.title}>
|
|
||||||
<Typography variant="Title/sm">
|
<Typography variant="Title/sm">
|
||||||
<span>
|
<span>
|
||||||
<h1 className={styles.welcome}>
|
<h1 className={styles.welcome}>
|
||||||
@@ -138,7 +136,17 @@ export default function Form({ user }: EditFormProps) {
|
|||||||
</h2>
|
</h2>
|
||||||
</span>
|
</span>
|
||||||
</Typography>
|
</Typography>
|
||||||
</div>
|
<form
|
||||||
|
/* @ts-expect-error Ignoring since ts doesn't recognize that tRPC parses FormData before reaching the route */
|
||||||
|
action={editProfile}
|
||||||
|
id={formId}
|
||||||
|
onSubmit={methods.handleSubmit(handleSubmit)}
|
||||||
|
>
|
||||||
|
<FormProvider {...methods}>
|
||||||
|
<FormContent errors={methods.formState.errors} />
|
||||||
|
</FormProvider>
|
||||||
|
</form>
|
||||||
|
<ChangeNameDisclaimer />
|
||||||
<div className={styles.btnContainer}>
|
<div className={styles.btnContainer}>
|
||||||
<Dialog
|
<Dialog
|
||||||
bodyText={intl.formatMessage({
|
bodyText={intl.formatMessage({
|
||||||
@@ -181,20 +189,6 @@ export default function Form({ user }: EditFormProps) {
|
|||||||
})}
|
})}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<form
|
|
||||||
/* @ts-expect-error Ignoring since ts doesn't recognize that tRPC parses FormData before reaching the route */
|
|
||||||
action={editProfile}
|
|
||||||
className={styles.form}
|
|
||||||
id={formId}
|
|
||||||
onSubmit={methods.handleSubmit(handleSubmit)}
|
|
||||||
>
|
|
||||||
<FormProvider {...methods}>
|
|
||||||
<FormContent errors={methods.formState.errors} />
|
|
||||||
</FormProvider>
|
|
||||||
</form>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<ChangeNameDisclaimer />
|
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user