Merge pull request #3593 from bluewave-labs/feat/account-team-modals
feat(account): side-by-side name and password fields in Add Member modal
This commit is contained in:
2 files changed
+72
-66
No files matched your search
@@ -9,6 +9,7 @@ import { useAddTeamMemberForm } from "@/Hooks/useAddTeamMemberForm";
|
|||||||
import type { AddTeamMemberFormData } from "@/Validation/addTeamMember";
|
import type { AddTeamMemberFormData } from "@/Validation/addTeamMember";
|
||||||
import type { UserRole, User } from "@/Types/User";
|
import type { UserRole, User } from "@/Types/User";
|
||||||
import { usePost } from "@/Hooks/UseApi";
|
import { usePost } from "@/Hooks/UseApi";
|
||||||
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
|
|
||||||
interface AddTeamMemberDialogProps {
|
interface AddTeamMemberDialogProps {
|
||||||
open: boolean;
|
open: boolean;
|
||||||
@@ -82,38 +83,40 @@ export const AddTeamMemberDialog = ({
|
|||||||
maxWidth="sm"
|
maxWidth="sm"
|
||||||
fullWidth
|
fullWidth
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
||||||
gap={theme.spacing(4)}
|
<Stack
|
||||||
mt={theme.spacing(4)}
|
direction="row"
|
||||||
>
|
gap={theme.spacing(LAYOUT.XS)}
|
||||||
<Controller
|
>
|
||||||
name="firstName"
|
<Controller
|
||||||
control={control}
|
name="firstName"
|
||||||
render={({ field, fieldState }) => (
|
control={control}
|
||||||
<TextField
|
render={({ field, fieldState }) => (
|
||||||
{...field}
|
<TextField
|
||||||
fieldLabel={t("common.form.name.option.firstName.label")}
|
{...field}
|
||||||
placeholder={t("common.form.name.option.firstName.placeholder")}
|
fieldLabel={t("common.form.name.option.firstName.label")}
|
||||||
error={!!fieldState.error}
|
placeholder={t("common.form.name.option.firstName.placeholder")}
|
||||||
helperText={fieldState.error?.message ?? ""}
|
error={!!fieldState.error}
|
||||||
fullWidth
|
helperText={fieldState.error?.message ?? ""}
|
||||||
/>
|
sx={{ flex: 1 }}
|
||||||
)}
|
/>
|
||||||
/>
|
)}
|
||||||
<Controller
|
/>
|
||||||
name="lastName"
|
<Controller
|
||||||
control={control}
|
name="lastName"
|
||||||
render={({ field, fieldState }) => (
|
control={control}
|
||||||
<TextField
|
render={({ field, fieldState }) => (
|
||||||
{...field}
|
<TextField
|
||||||
fieldLabel={t("common.form.name.option.lastName.label")}
|
{...field}
|
||||||
placeholder={t("common.form.name.option.lastName.placeholder")}
|
fieldLabel={t("common.form.name.option.lastName.label")}
|
||||||
error={!!fieldState.error}
|
placeholder={t("common.form.name.option.lastName.placeholder")}
|
||||||
helperText={fieldState.error?.message ?? ""}
|
error={!!fieldState.error}
|
||||||
fullWidth
|
helperText={fieldState.error?.message ?? ""}
|
||||||
/>
|
sx={{ flex: 1 }}
|
||||||
)}
|
/>
|
||||||
/>
|
)}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
<Controller
|
<Controller
|
||||||
name="email"
|
name="email"
|
||||||
control={control}
|
control={control}
|
||||||
@@ -151,36 +154,41 @@ export const AddTeamMemberDialog = ({
|
|||||||
</Select>
|
</Select>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Controller
|
<Stack
|
||||||
name="password"
|
direction="row"
|
||||||
control={control}
|
gap={theme.spacing(LAYOUT.XS)}
|
||||||
render={({ field, fieldState }) => (
|
>
|
||||||
<TextField
|
<Controller
|
||||||
{...field}
|
name="password"
|
||||||
fieldLabel={t("pages.auth.common.form.option.password.label")}
|
control={control}
|
||||||
placeholder={t("pages.auth.common.form.option.password.placeholder")}
|
render={({ field, fieldState }) => (
|
||||||
type="password"
|
<TextField
|
||||||
error={!!fieldState.error}
|
{...field}
|
||||||
helperText={fieldState.error?.message ?? ""}
|
fieldLabel={t("pages.auth.common.form.option.password.label")}
|
||||||
fullWidth
|
placeholder={t("pages.auth.common.form.option.password.placeholder")}
|
||||||
/>
|
type="password"
|
||||||
)}
|
error={!!fieldState.error}
|
||||||
/>
|
helperText={fieldState.error?.message ?? ""}
|
||||||
<Controller
|
sx={{ flex: 1 }}
|
||||||
name="confirm"
|
/>
|
||||||
control={control}
|
)}
|
||||||
render={({ field, fieldState }) => (
|
/>
|
||||||
<TextField
|
<Controller
|
||||||
{...field}
|
name="confirm"
|
||||||
fieldLabel={t("pages.auth.common.form.option.confirmPassword.label")}
|
control={control}
|
||||||
placeholder={t("pages.auth.common.form.option.password.placeholder")}
|
render={({ field, fieldState }) => (
|
||||||
type="password"
|
<TextField
|
||||||
error={!!fieldState.error}
|
{...field}
|
||||||
helperText={fieldState.error?.message ?? ""}
|
fieldLabel={t("pages.auth.common.form.option.confirmPassword.label")}
|
||||||
fullWidth
|
placeholder={t("pages.auth.common.form.option.password.placeholder")}
|
||||||
/>
|
type="password"
|
||||||
)}
|
error={!!fieldState.error}
|
||||||
/>
|
helperText={fieldState.error?.message ?? ""}
|
||||||
|
sx={{ flex: 1 }}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Stack>
|
||||||
</Stack>
|
</Stack>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import type { UserRole } from "@/Types/User";
|
|||||||
import { useInviteForm } from "@/Hooks/useInviteForm";
|
import { useInviteForm } from "@/Hooks/useInviteForm";
|
||||||
import type { InviteFormData } from "@/Validation/invite";
|
import type { InviteFormData } from "@/Validation/invite";
|
||||||
import { usePost } from "@/Hooks/UseApi";
|
import { usePost } from "@/Hooks/UseApi";
|
||||||
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
||||||
|
|
||||||
const CLIENT_HOST = import.meta.env.VITE_APP_CLIENT_HOST;
|
const CLIENT_HOST = import.meta.env.VITE_APP_CLIENT_HOST;
|
||||||
|
|
||||||
@@ -95,10 +96,7 @@ export const InviteTeamMemberDialog = ({
|
|||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Stack
|
<Stack gap={theme.spacing(LAYOUT.XS)}>
|
||||||
gap={theme.spacing(4)}
|
|
||||||
mt={theme.spacing(4)}
|
|
||||||
>
|
|
||||||
<Controller
|
<Controller
|
||||||
name="email"
|
name="email"
|
||||||
control={control}
|
control={control}
|
||||||
|
|||||||
Reference in new issue
Block a user