Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Solved lint issues

atyabbin92d4329aaca3
diff --git a/infra/staff/src/components/UserComponent.tsx b/infra/staff/src/components/UserComponent.tsx
index e808f133da..f26e9431a4 100644
--- a/infra/staff/src/components/UserComponent.tsx
+++ b/infra/staff/src/components/UserComponent.tsx
@@ -37,7 +37,7 @@ const UserComponent: React.FC<UserComponentProps> = ({ userData }) => {
const [is2FADisabled, setIs2FADisabled] = React.useState(false);
const [updateSubscriptionOpen, setUpdateSubscriptionOpen] =
React.useState(false);
- const [changeEmailOpen, setChangeEmailOpen] = React.useState(false);
+ const [changeEmailOpen, setChangeEmailOpen] = React.useState(false);
const [DisablePasskeysOpen, setDisablePasskeysOpen] = React.useState(false);
React.useEffect(() => {
@@ -54,7 +54,7 @@ const UserComponent: React.FC<UserComponentProps> = ({ userData }) => {
};
const handleCloseChangeEmail = () => {
- setChangeEmailOpen(false);
+ setChangeEmailOpen(false);
};
const handleDeleteAccountClick = () => {
@@ -91,17 +91,16 @@ const UserComponent: React.FC<UserComponentProps> = ({ userData }) => {
};
const handleOpenDisablePasskeys = () => {
- setDisablePasskeysOpen(true);
+ setDisablePasskeysOpen(true);
};
const handleCloseDisablePasskeys = () => {
- setDisablePasskeysOpen(false);
+ setDisablePasskeysOpen(false);
};
const handleDisablePasskeys = () => {
-
console.log("Close family action");
- handleOpenDisablePasskeys();
+ handleOpenDisablePasskeys();
};
if (!userData) {
@@ -112,26 +111,24 @@ const UserComponent: React.FC<UserComponentProps> = ({ userData }) => {
<Grid container spacing={6} justifyContent="center">
{Object.entries(userData).map(([title, data]) => (
<Grid item xs={12} sm={10} md={6} key={title}>
- <TableContainer
- component={Paper}
- variant="outlined"
- sx={{
- backgroundColor: "#F1F1F3",
- minHeight: 300,
- display: "flex",
- flexDirection: "column",
- marginBottom: "20px",
- height: "100%",
- width: "100%",
- padding: "13px",
- overflowX: "hidden", // Prevent horizontal scrolling
- "&:not(:last-child)": {
- marginBottom: "40px",
- },
- }}
- >
-
-
+ <TableContainer
+ component={Paper}
+ variant="outlined"
+ sx={{
+ backgroundColor: "#F1F1F3",
+ minHeight: 300,
+ display: "flex",
+ flexDirection: "column",
+ marginBottom: "20px",
+ height: "100%",
+ width: "100%",
+ padding: "13px",
+ overflowX: "hidden", // Prevent horizontal scrolling
+ "&:not(:last-child)": {
+ marginBottom: "40px",
+ },
+ }}
+ >
<Box
sx={{
display: "flex",
@@ -167,21 +164,25 @@ const UserComponent: React.FC<UserComponentProps> = ({ userData }) => {
aria-label="edit"
onClick={handleEditSubscription}
>
- <EditIcon style={{ color: "black", marginRight: "15px", }} />
+ <EditIcon
+ style={{
+ color: "black",
+ marginRight: "15px",
+ }}
+ />
</IconButton>
)}
</Box>
<Table
- sx={{
- width: "100%",
- tableLayout: "fixed", // Ensure table layout is fixed
- height: "100%",
- borderBottom: "none",
- }}
- aria-label={title}
- >
-
+ sx={{
+ width: "100%",
+ tableLayout: "fixed", // Ensure table layout is fixed
+ height: "100%",
+ borderBottom: "none",
+ }}
+ aria-label={title}
+ >
<TableBody>
{Object.entries(
data as Record<string, string>,
@@ -232,7 +233,6 @@ const UserComponent: React.FC<UserComponentProps> = ({ userData }) => {
<EditIcon
style={{
color: "black",
-
}}
/>
</IconButton>
@@ -252,58 +252,75 @@ const UserComponent: React.FC<UserComponentProps> = ({ userData }) => {
value === "Disabled" ? (
<Typography
sx={{
-
-
width: "100%",
paddingLeft:
"1px",
-
}}
>
{value}
</Typography>
) : (
<Box
- sx={{
- display: "flex",
- alignItems: "center",
- justifyContent: "right",
- width: "100%",
- paddingRight: "50px",
- }}
- >
- <Typography
- sx={{
- marginRight: "1px",
- }}
- >
- {value}
- </Typography>
- {value === "Enabled" && (
- <Switch
- checked={twoFactorEnabled}
- onChange={(e) => {
- const isChecked = e.target.checked;
- setTwoFactorEnabled(isChecked);
- if (!isChecked) {
- handleOpenDisable2FA();
- }
- }}
- sx={{
- "& .MuiSwitch-switchBase.Mui-checked": {
- color: "#00B33C",
- "&:hover": {
- backgroundColor: "rgba(0, 179, 60, 0.08)",
- },
- },
- "& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track": {
- backgroundColor: "#00B33C",
- },
- }}
- />
- )}
- </Box>
-
+ sx={{
+ display: "flex",
+ alignItems:
+ "center",
+ justifyContent:
+ "right",
+ width: "100%",
+ paddingRight:
+ "50px",
+ }}
+ >
+ <Typography
+ sx={{
+ marginRight:
+ "1px",
+ }}
+ >
+ {value}
+ </Typography>
+ {value ===
+ "Enabled" && (
+ <Switch
+ checked={
+ twoFactorEnabled
+ }
+ onChange={(
+ e,
+ ) => {
+ const isChecked =
+ e
+ .target
+ .checked;
+ setTwoFactorEnabled(
+ isChecked,
+ );
+ if (
+ !isChecked
+ ) {
+ handleOpenDisable2FA();
+ }
+ }}
+ sx={{
+ "& .MuiSwitch-switchBase.Mui-checked":
+ {
+ color: "#00B33C",
+ "&:hover":
+ {
+ backgroundColor:
+ "rgba(0, 179, 60, 0.08)",
+ },
+ },
+ "& .MuiSwitch-switchBase.Mui-checked + .MuiSwitch-track":
+ {
+ backgroundColor:
+ "#00B33C",
+ },
+ }}
+ />
+ )}
+ </Box>
)
) : (
<Typography>
@@ -324,32 +341,27 @@ const UserComponent: React.FC<UserComponentProps> = ({ userData }) => {
</Grid>
))}
-
<DeleteAccount
open={deleteAccountOpen}
handleClose={handleCloseDeleteAccount}
/>
-
<Disable2FA
open={disable2FAOpen}
handleClose={handleCancelDisable2FA}
handleDisable2FA={handleDisable2FA}
/>
-
<UpdateSubscription
open={updateSubscriptionOpen}
onClose={handleCloseUpdateSubscription}
/>
-
<ChangeEmail
open={changeEmailOpen}
onClose={handleCloseChangeEmail}
/>
-
<DisablePasskeys
open={DisablePasskeysOpen}
handleClose={handleCloseDisablePasskeys}