Skip to content

Commit 156b861

Browse files
committed
update login
1 parent a122b95 commit 156b861

File tree

1 file changed

+41
-8
lines changed

1 file changed

+41
-8
lines changed

components/magicLink/login.tsx

Lines changed: 41 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,26 @@ import { supported, create, get, parseCreationOptionsFromJSON, parseRequestOptio
44
import { useEffect, useState } from 'react';
55
import objectPath from 'object-path';
66

7+
import Avatar from '@mui/material/Avatar';
78
import Box from '@mui/material/Box';
89
import Button from '@mui/material/Button';
910
import CircularProgress from '@mui/material/CircularProgress';
11+
import DeleteIcon from '@mui/icons-material/Delete';
12+
import EditIcon from '@mui/icons-material/Edit';
1013
import Grid from "@mui/material/Grid";
1114
import HowToRegIcon from '@mui/icons-material/HowToReg';
1215
import KeyIcon from '@mui/icons-material/Key';
1316
import Link from '@mui/material/Link';
17+
import List from '@mui/material/List';
18+
import ListItem from '@mui/material/ListItem';
19+
import ListItemAvatar from '@mui/material/ListItemAvatar';
20+
import ListItemText from '@mui/material/ListItemText';
1421
import PersonIcon from '@mui/icons-material/Person';
1522
import ReplayIcon from '@mui/icons-material/Replay';
1623
import Stack from '@mui/material/Stack';
1724
import TextField from '@mui/material/TextField';
25+
import Typography from '@mui/material/Typography';
26+
import VisibilityIcon from '@mui/icons-material/Visibility';
1827

1928
export default function Login({ challenge, clinical=false, authonly=false, client='', setEmail, locations=[] }: { challenge: string, clinical: boolean, authonly: boolean, client?: string, setEmail?: any, locations?: any }) {
2029
const router = useRouter();
@@ -237,20 +246,44 @@ export default function Login({ challenge, clinical=false, authonly=false, clien
237246
<div>
238247
{clientExist ? (
239248
<div>
240-
<p>Sign Into {client}</p>
241-
<p>To access the following resource URLs:</p>
242-
<ul>
249+
<Typography variant="h6" component="div">Sign In To {client}</Typography>
250+
<Typography variant="body1" component="div">For access to the following resources:</Typography>
251+
<List>
243252
{
244253
locations.map((value: any, index:number) => {
245-
return <li key={index}>
246-
{value.locations.join(', ')} [{value.actions.join(', ')}], Purpose: {value.purpose}
247-
</li>
254+
return <ListItem key={index}>
255+
{
256+
value.actions.map((value0: string, index0: number) => {
257+
{
258+
if (value0 === 'read') {
259+
return <ListItemAvatar><Avatar><VisibilityIcon/></Avatar></ListItemAvatar>
260+
}
261+
if (value0 === 'write') {
262+
return <ListItemAvatar><Avatar><EditIcon/></Avatar></ListItemAvatar>
263+
}
264+
if (value0 === 'delete') {
265+
return <ListItemAvatar><Avatar><DeleteIcon/></Avatar></ListItemAvatar>
266+
}
267+
}
268+
})
269+
}
270+
<ListItemText>
271+
<Typography variant="body2" component="div">Purpose: {value.purpose}</Typography>
272+
{
273+
value.locations.map((value1: string, index1: number) => {
274+
{
275+
return <Typography variant="caption" component="div">{value1}</Typography>
276+
}
277+
})
278+
}
279+
</ListItemText>
280+
</ListItem>
248281
})
249282
}
250-
</ul>
283+
</List>
251284
</div>
252285
) : (
253-
<p>Sign In</p>
286+
<Typography variant="h6" component="div">Sign In</Typography>
254287
)}
255288
</div>
256289
) : (

0 commit comments

Comments
 (0)