Merge pull request #694 from bluewave-labs/fix/account-tabs-refactor
Account tab panels refactor
This commit is contained in:
4 files changed
+93
-171
No files matched your search
@@ -98,16 +98,17 @@ const PasswordPanel = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TabPanel value="password">
|
<TabPanel value="password">
|
||||||
<form
|
<Stack
|
||||||
|
component="form"
|
||||||
onSubmit={handleSubmit}
|
onSubmit={handleSubmit}
|
||||||
className="edit-password-form"
|
|
||||||
noValidate
|
noValidate
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
|
gap={theme.gap.xl}
|
||||||
>
|
>
|
||||||
<div className="edit-password-form__wrapper">
|
<Stack direction="row">
|
||||||
<Stack>
|
<Box flex={0.9}>
|
||||||
<Typography component="h1">Current password</Typography>
|
<Typography component="h1">Current password</Typography>
|
||||||
</Stack>
|
</Box>
|
||||||
<Field
|
<Field
|
||||||
type="password"
|
type="password"
|
||||||
id="edit-current-password"
|
id="edit-current-password"
|
||||||
@@ -117,11 +118,11 @@ const PasswordPanel = () => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors[idToName["edit-current-password"]]}
|
error={errors[idToName["edit-current-password"]]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Stack>
|
||||||
<div className="edit-password-form__wrapper">
|
<Stack direction="row">
|
||||||
<Stack>
|
<Box flex={0.9}>
|
||||||
<Typography component="h1">New password</Typography>
|
<Typography component="h1">New password</Typography>
|
||||||
</Stack>
|
</Box>
|
||||||
<Field
|
<Field
|
||||||
type="password"
|
type="password"
|
||||||
id="edit-new-password"
|
id="edit-new-password"
|
||||||
@@ -131,11 +132,11 @@ const PasswordPanel = () => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors[idToName["edit-new-password"]]}
|
error={errors[idToName["edit-new-password"]]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Stack>
|
||||||
<div className="edit-password-form__wrapper">
|
<Stack direction="row">
|
||||||
<Stack>
|
<Box flex={0.9}>
|
||||||
<Typography component="h1">Confirm new password</Typography>
|
<Typography component="h1">Confirm new password</Typography>
|
||||||
</Stack>
|
</Box>
|
||||||
<Field
|
<Field
|
||||||
type="password"
|
type="password"
|
||||||
id="edit-confirm-password"
|
id="edit-confirm-password"
|
||||||
@@ -145,33 +146,32 @@ const PasswordPanel = () => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors[idToName["edit-confirm-password"]]}
|
error={errors[idToName["edit-confirm-password"]]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Stack>
|
||||||
<div className="edit-password-form__wrapper">
|
<Stack direction="row">
|
||||||
<Stack></Stack>
|
<Box flex={0.9}></Box>
|
||||||
<Box sx={{ flex: 1 }}>
|
<Box sx={{ flex: 1 }}>
|
||||||
<Alert
|
<Alert
|
||||||
variant="warning"
|
variant="warning"
|
||||||
body="New password must contain at least 8 characters and must have at least one uppercase letter, one number and one symbol."
|
body="New password must contain at least 8 characters and must have at least one uppercase letter, one number and one symbol."
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</div>
|
|
||||||
<Divider aria-hidden="true" width="0" />
|
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
|
||||||
<Box width="fit-content">
|
|
||||||
<ButtonSpinner
|
|
||||||
level="primary"
|
|
||||||
label="Save"
|
|
||||||
onClick={handleSubmit}
|
|
||||||
isLoading={isLoading}
|
|
||||||
loadingText="Saving..."
|
|
||||||
disabled={Object.keys(errors).length !== 0 && true}
|
|
||||||
sx={{
|
|
||||||
paddingX: theme.gap.xl,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
<Stack direction="row" justifyContent="flex-end">
|
||||||
|
<ButtonSpinner
|
||||||
|
level="primary"
|
||||||
|
label="Save"
|
||||||
|
onClick={handleSubmit}
|
||||||
|
isLoading={isLoading}
|
||||||
|
loadingText="Saving..."
|
||||||
|
disabled={Object.keys(errors).length !== 0 && true}
|
||||||
|
sx={{
|
||||||
|
paddingX: theme.gap.large,
|
||||||
|
width: "fit-content",
|
||||||
|
mt: theme.gap.xl,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
|
</Stack>
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -217,11 +217,17 @@ const ProfilePanel = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TabPanel value="profile">
|
<TabPanel value="profile">
|
||||||
<form className="edit-profile-form" noValidate spellCheck="false">
|
<Stack
|
||||||
<div className="edit-profile-form__wrapper">
|
component="form"
|
||||||
<Stack>
|
className="edit-profile-form"
|
||||||
|
noValidate
|
||||||
|
spellCheck="false"
|
||||||
|
gap={theme.gap.xl}
|
||||||
|
>
|
||||||
|
<Stack direction="row">
|
||||||
|
<Box flex={0.9}>
|
||||||
<Typography component="h1">First name</Typography>
|
<Typography component="h1">First name</Typography>
|
||||||
</Stack>
|
</Box>
|
||||||
<Field
|
<Field
|
||||||
id="edit-first-name"
|
id="edit-first-name"
|
||||||
value={localData.firstName}
|
value={localData.firstName}
|
||||||
@@ -230,11 +236,11 @@ const ProfilePanel = () => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors[idToName["edit-first-name"]]}
|
error={errors[idToName["edit-first-name"]]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Stack>
|
||||||
<div className="edit-profile-form__wrapper">
|
<Stack direction="row">
|
||||||
<Stack>
|
<Box flex={0.9}>
|
||||||
<Typography component="h1">Last name</Typography>
|
<Typography component="h1">Last name</Typography>
|
||||||
</Stack>
|
</Box>
|
||||||
<Field
|
<Field
|
||||||
id="edit-last-name"
|
id="edit-last-name"
|
||||||
placeholder="Enter your last name"
|
placeholder="Enter your last name"
|
||||||
@@ -243,11 +249,11 @@ const ProfilePanel = () => {
|
|||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
error={errors[idToName["edit-last-name"]]}
|
error={errors[idToName["edit-last-name"]]}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Stack>
|
||||||
<div className="edit-profile-form__wrapper">
|
<Stack direction="row">
|
||||||
<Stack>
|
<Stack flex={0.9}>
|
||||||
<Typography component="h1">Email</Typography>
|
<Typography component="h1">Email</Typography>
|
||||||
<Typography component="p">
|
<Typography component="p" sx={{ opacity: 0.6 }}>
|
||||||
This is your current email address — it cannot be changed.
|
This is your current email address — it cannot be changed.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
@@ -256,20 +262,19 @@ const ProfilePanel = () => {
|
|||||||
value={user.email}
|
value={user.email}
|
||||||
placeholder="Enter your email"
|
placeholder="Enter your email"
|
||||||
autoComplete="email"
|
autoComplete="email"
|
||||||
// TODO - add onChange
|
|
||||||
onChange={() => logger.warn("disabled")}
|
onChange={() => logger.warn("disabled")}
|
||||||
// error={errors[idToName["edit-email"]]}
|
// error={errors[idToName["edit-email"]]}
|
||||||
disabled={true}
|
disabled={true}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Stack>
|
||||||
<div className="edit-profile-form__wrapper">
|
<Stack direction="row">
|
||||||
<Stack>
|
<Stack flex={0.9}>
|
||||||
<Typography component="h1">Your photo</Typography>
|
<Typography component="h1">Your photo</Typography>
|
||||||
<Typography component="p">
|
<Typography component="p" sx={{ opacity: 0.6 }}>
|
||||||
This photo will be displayed in your profile page.
|
This photo will be displayed in your profile page.
|
||||||
</Typography>
|
</Typography>
|
||||||
</Stack>
|
</Stack>
|
||||||
<Stack className="row-stack" direction="row" alignItems="center">
|
<Stack direction="row" alignItems="center" flex={1}>
|
||||||
<Avatar
|
<Avatar
|
||||||
src={
|
src={
|
||||||
localData?.deleteProfileImage
|
localData?.deleteProfileImage
|
||||||
@@ -294,10 +299,9 @@ const ProfilePanel = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</div>
|
</Stack>
|
||||||
<Divider
|
<Divider
|
||||||
aria-hidden="true"
|
aria-hidden="true"
|
||||||
className="short-divider"
|
|
||||||
width="0"
|
width="0"
|
||||||
sx={{ marginY: theme.spacing(1) }}
|
sx={{ marginY: theme.spacing(1) }}
|
||||||
/>
|
/>
|
||||||
@@ -313,31 +317,33 @@ const ProfilePanel = () => {
|
|||||||
Object.keys(errors).length !== 0 && !errors?.picture && true
|
Object.keys(errors).length !== 0 && !errors?.picture && true
|
||||||
}
|
}
|
||||||
sx={{
|
sx={{
|
||||||
paddingX: "40px",
|
paddingX: theme.gap.large,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Box>
|
</Box>
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
</Stack>
|
||||||
<Divider aria-hidden="true" />
|
<Divider aria-hidden="true" sx={{ marginY: theme.spacing(6) }} />
|
||||||
<form className="delete-profile-form" noValidate spellCheck="false">
|
<Stack
|
||||||
<div className="delete-profile-form__wrapper">
|
component="form"
|
||||||
<Stack direction="column" gap="8px">
|
noValidate
|
||||||
<Typography component="h1">Delete account</Typography>
|
spellCheck="false"
|
||||||
<Typography component="p">
|
gap={theme.gap.small}
|
||||||
Note that deleting your account will remove all data from our
|
>
|
||||||
system. This is permanent and non-recoverable.
|
<Box>
|
||||||
</Typography>
|
<Typography component="h1">Delete account</Typography>
|
||||||
<Box sx={{ mt: theme.spacing(2) }}>
|
<Typography component="p" sx={{ opacity: 0.6 }}>
|
||||||
<Button
|
Note that deleting your account will remove all data from our
|
||||||
level="error"
|
system. This is permanent and non-recoverable.
|
||||||
label="Delete account"
|
</Typography>
|
||||||
onClick={() => setIsOpen("delete")}
|
</Box>
|
||||||
/>
|
<Button
|
||||||
</Box>
|
level="error"
|
||||||
</Stack>
|
label="Delete account"
|
||||||
</div>
|
onClick={() => setIsOpen("delete")}
|
||||||
</form>
|
sx={{ width: "fit-content", mt: theme.gap.small }}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
{/* TODO - Update ModalPopup Component with @mui for reusability */}
|
{/* TODO - Update ModalPopup Component with @mui for reusability */}
|
||||||
<Modal
|
<Modal
|
||||||
aria-labelledby="modal-delete-account"
|
aria-labelledby="modal-delete-account"
|
||||||
|
|||||||
@@ -131,9 +131,6 @@ const TeamPanel = () => {
|
|||||||
};
|
};
|
||||||
const handleRename = () => {};
|
const handleRename = () => {};
|
||||||
|
|
||||||
//TODO - implement save team function
|
|
||||||
const handleSaveTeam = () => {};
|
|
||||||
|
|
||||||
// INVITE MEMBER
|
// INVITE MEMBER
|
||||||
const [isOpen, setIsOpen] = useState(false);
|
const [isOpen, setIsOpen] = useState(false);
|
||||||
|
|
||||||
@@ -200,12 +197,11 @@ const TeamPanel = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<TabPanel value="team">
|
<TabPanel value="team">
|
||||||
<form className="edit-organization-form">
|
<Stack component="form">
|
||||||
<Box sx={{ alignSelf: "flex-start" }}>
|
<Box sx={{ alignSelf: "flex-start" }}>
|
||||||
<Typography component="h1">Organization name</Typography>
|
<Typography component="h1">Organization name</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
<Stack
|
<Stack
|
||||||
className="row-stack"
|
|
||||||
direction="row"
|
direction="row"
|
||||||
justifyContent="flex-end"
|
justifyContent="flex-end"
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
@@ -245,21 +241,13 @@ const TeamPanel = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
</form>
|
</Stack>
|
||||||
<Divider
|
<Divider aria-hidden="true" sx={{ marginY: theme.spacing(4) }} />
|
||||||
aria-hidden="true"
|
<Stack
|
||||||
className="short-divider"
|
component="form"
|
||||||
sx={{ marginY: theme.spacing(4) }}
|
|
||||||
/>
|
|
||||||
<form
|
|
||||||
className="edit-team-form"
|
|
||||||
noValidate
|
noValidate
|
||||||
spellCheck="false"
|
spellCheck="false"
|
||||||
style={{
|
gap={theme.gap.large}
|
||||||
display: "flex",
|
|
||||||
flexDirection: "column",
|
|
||||||
gap: theme.gap.large,
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<Typography component="h1">Team members</Typography>
|
<Typography component="h1">Team members</Typography>
|
||||||
<Stack direction="row" justifyContent="space-between">
|
<Stack direction="row" justifyContent="space-between">
|
||||||
@@ -307,22 +295,7 @@ const TeamPanel = () => {
|
|||||||
/>
|
/>
|
||||||
</Stack>
|
</Stack>
|
||||||
<BasicTable data={tableData} paginated={false} reversed={true} />
|
<BasicTable data={tableData} paginated={false} reversed={true} />
|
||||||
<Stack direction="row" justifyContent="flex-end">
|
</Stack>
|
||||||
<Box width="fit-content">
|
|
||||||
<ButtonSpinner
|
|
||||||
level="primary"
|
|
||||||
label="Save"
|
|
||||||
onClick={handleSaveTeam}
|
|
||||||
isLoading={false}
|
|
||||||
loadingText="Saving..."
|
|
||||||
disabled={true}
|
|
||||||
sx={{
|
|
||||||
paddingX: "40px",
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Box>
|
|
||||||
</Stack>
|
|
||||||
</form>
|
|
||||||
<Modal
|
<Modal
|
||||||
aria-labelledby="modal-invite-member"
|
aria-labelledby="modal-invite-member"
|
||||||
aria-describedby="invite-member-to-team"
|
aria-describedby="invite-member-to-team"
|
||||||
|
|||||||
@@ -15,18 +15,10 @@
|
|||||||
.account h1.MuiTypography-root {
|
.account h1.MuiTypography-root {
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
}
|
}
|
||||||
.account .MuiStack-root:not(.table-stack) {
|
|
||||||
flex: 1;
|
|
||||||
-webkit-flex: 1;
|
|
||||||
-ms-flex: 1;
|
|
||||||
}
|
|
||||||
.account .MuiTabPanel-root {
|
.account .MuiTabPanel-root {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
}
|
}
|
||||||
.account .MuiDivider-root:not(.short-divider) {
|
|
||||||
margin: 50px 0;
|
|
||||||
}
|
|
||||||
.account .MuiDivider-root,
|
.account .MuiDivider-root,
|
||||||
.account .MuiButtonGroup-root button {
|
.account .MuiButtonGroup-root button {
|
||||||
border-color: var(--env-var-color-16);
|
border-color: var(--env-var-color-16);
|
||||||
@@ -34,50 +26,14 @@
|
|||||||
.account button:not(.MuiIconButton-root) {
|
.account button:not(.MuiIconButton-root) {
|
||||||
height: 34px;
|
height: 34px;
|
||||||
}
|
}
|
||||||
.account [class$="-form"] {
|
.account .field {
|
||||||
width: inherit;
|
flex: 1;
|
||||||
}
|
|
||||||
.account [class$="__wrapper"],
|
|
||||||
.account [class$="__wrapper compact"] {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: flex-start;
|
|
||||||
}
|
|
||||||
.edit-profile-form__wrapper > .MuiStack-root:not(.row-stack),
|
|
||||||
.edit-password-form__wrapper > .MuiStack-root:not(.row-stack) {
|
|
||||||
flex-direction: column;
|
|
||||||
gap: 8px;
|
|
||||||
margin-right: 10px;
|
|
||||||
}
|
|
||||||
.edit-profile-form__wrapper p.MuiTypography-root,
|
|
||||||
.delete-profile-form__wrapper p.MuiTypography-root {
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
}
|
||||||
#modal-delete-account,
|
#modal-delete-account,
|
||||||
#modal-edit-org-name,
|
#modal-edit-org-name,
|
||||||
#modal-invite-member {
|
#modal-invite-member {
|
||||||
font-size: var(--env-var-font-size-large);
|
font-size: var(--env-var-font-size-large);
|
||||||
}
|
}
|
||||||
.edit-profile-form__wrapper:not(:first-of-type),
|
|
||||||
.edit-password-form__wrapper:not(:first-of-type),
|
|
||||||
.edit-team-form__wrapper:not(:first-of-type) {
|
|
||||||
margin-top: var(--env-var-spacing-4);
|
|
||||||
}
|
|
||||||
.edit-team-form__wrapper.compact {
|
|
||||||
margin-top: var(--env-var-spacing-3);
|
|
||||||
justify-content: flex-start;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* for testing, will remove later */
|
|
||||||
@media only screen and (max-width: 1600px) {
|
|
||||||
.edit-profile-form__wrapper .MuiStack-root:not(.row-stack),
|
|
||||||
.edit-password-form__wrapper .MuiStack-root:not(.row-stack),
|
|
||||||
.edit-organization-form__wrapper .MuiStack-root:not(.row-stack) {
|
|
||||||
margin-right: 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.account .MuiStack-root:has(span.MuiTypography-root.input-error) {
|
.account .MuiStack-root:has(span.MuiTypography-root.input-error) {
|
||||||
position: relative;
|
position: relative;
|
||||||
@@ -87,22 +43,9 @@
|
|||||||
top: 100%;
|
top: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit-profile-form__wrapper .MuiFormControl-root,
|
.account .MuiTable-root .MuiTableBody-root .MuiTableCell-root {
|
||||||
.edit-password-form__wrapper .MuiFormControl-root {
|
color: var(--env-var-color-25);
|
||||||
width: 100%;
|
|
||||||
}
|
}
|
||||||
.edit-profile-form__wrapper .MuiStack-root:has(.MuiFormControl-root),
|
.account .MuiTableBody-root .MuiTableCell-root {
|
||||||
.edit-password-form__wrapper .MuiStack-root:has(.MuiFormControl-root) {
|
padding: var(--env-var-spacing-1-plus) var(--env-var-spacing-2);
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.edit-organization-form {
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
.edit-team-form .MuiTableCell-root {
|
|
||||||
color: var(--env-var-color-25) !important;
|
|
||||||
}
|
|
||||||
.edit-team-form .MuiTableBody-root .MuiTableCell-root {
|
|
||||||
padding: var(--env-var-spacing-1-plus) var(--env-var-spacing-2) !important;
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user