Skip to content

Commit 73b2e75

Browse files
committed
created files edit reset password component, pod and style. User interface created
1 parent 9e34853 commit 73b2e75

File tree

5 files changed

+104
-3
lines changed

5 files changed

+104
-3
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import React from 'react';
2+
import * as innerClasses from './edit-reset-password.styles';
3+
import { useWithTheme } from '#core/theme';
4+
import { Button, IconButton, TextField } from '@mui/material';
5+
import { Visibility, VisibilityOff, ContentCopy } from '@mui/icons-material';
6+
import { usePassword } from '../create/use-password.hook';
7+
8+
interface Props {
9+
id: string;
10+
}
11+
12+
export const EditResetPasswordComponent: React.FC<Props> = props => {
13+
const { id } = props;
14+
15+
const { showPassword, toggleShowPassword } = usePassword();
16+
const classes = useWithTheme(innerClasses);
17+
return (
18+
<div className={classes.root}>
19+
<div className={classes.sectionContainer}>
20+
<h6>Usuario: ${id}</h6>
21+
<div className={classes.passwordFieldContainer}>
22+
<TextField
23+
name="contraseña"
24+
label="Nueva Contraseña"
25+
type={showPassword ? 'text' : 'password'}
26+
slotProps={{
27+
input: {
28+
endAdornment: (
29+
<IconButton onClick={toggleShowPassword}>
30+
{showPassword ? <VisibilityOff /> : <Visibility />}
31+
</IconButton>
32+
),
33+
},
34+
}}
35+
/>
36+
<IconButton onClick={() => {}} className={classes.icon}>
37+
<ContentCopy />
38+
</IconButton>
39+
</div>
40+
41+
<div className={classes.buttonContainer}>
42+
<Button type="submit" variant="contained">
43+
Resetear Clave de Usuario
44+
</Button>
45+
</div>
46+
</div>
47+
</div>
48+
);
49+
};
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
import React from 'react';
2+
import { EditResetPasswordComponent } from './edit-reset-password.component';
23

3-
export const EditResetPassword: React.FC = () => {
4-
return <h3>Reset Password</h3>;
4+
interface Props {
5+
id: string;
6+
}
7+
8+
export const EditResetPassword: React.FC<Props> = props => {
9+
const { id } = props;
10+
return <EditResetPasswordComponent id={id} />;
511
};
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { css } from '@emotion/css';
2+
import { Theme } from '@mui/material';
3+
4+
export const root = (theme: Theme) => css`
5+
width: 100%;
6+
display: flex;
7+
flex-direction: column;
8+
gap: ${theme.spacing(4)};
9+
`;
10+
11+
export const sectionContainer = (theme: Theme) => css`
12+
border: 1px solid ${theme.palette.grey[300]};
13+
border-radius: 4px;
14+
padding: ${theme.spacing(3)};
15+
display: flex;
16+
flex-direction: column;
17+
justify-content: center;
18+
min-height: 200px;
19+
gap: 16px;
20+
`;
21+
22+
export const passwordFieldContainer = css`
23+
display: flex;
24+
justify-content: center;
25+
gap: 16px;
26+
27+
@media (max-width: 768px) {
28+
grid-template-columns: 1fr;
29+
}
30+
`;
31+
32+
export const buttonContainer = css`
33+
display: flex;
34+
justify-content: center;
35+
gap: 16px;
36+
`;
37+
38+
export const icon = css`
39+
justify-self: flex-start;
40+
41+
@media (max-width: 768px) {
42+
justify-self: center;
43+
}
44+
`;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
export * from './edit-reset-password.pod';
2+
export * from './edit-reset-password.component';
3+
export * from './edit-reset-password.styles';

src/scenes/_auth/edit-user/edit-user.scene.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const UserScene: React.FC = () => {
3030
<EditUserSheet id={id} />
3131
</TabPanel>
3232
<TabPanel value={activeTab} index={TabIndex.RESET_PASSWORD}>
33-
<EditResetPassword />
33+
<EditResetPassword id={id} />
3434
</TabPanel>
3535
</Paper>
3636
</div>

0 commit comments

Comments
 (0)