Skip to content

Commit

Permalink
Feat/identifiers page (#36)
Browse files Browse the repository at this point in the history
* implement identifier list

* add inter font-family
  • Loading branch information
mehdi-torabiv authored Jul 15, 2024
1 parent 88a28be commit 9fe713b
Show file tree
Hide file tree
Showing 23 changed files with 124 additions and 6 deletions.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"dependencies": {
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@fontsource/inter": "^5.0.19",
"@fontsource/roboto": "^5.0.13",
"@mui/icons-material": "^5.16.0",
"@mui/material": "^5.16.0",
Expand Down
47 changes: 47 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,50 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

@font-face {
font-family: Inter;
font-weight: normal;
font-style: normal;
font-display: swap;
src: url('../lib/fonts/inter/Inter-VariableFont_slnt\,wght.ttf')
format('truetype');
}

@font-face {
font-family: Inter;
font-weight: bold;
font-style: bold;
font-display: swap;
src: url('../lib/fonts/inter/Inter-Bold.ttf') format('truetype');
}

@font-face {
font-family: Inter;
font-weight: medium;
font-style: medium;
font-display: swap;
src: url('../lib/fonts/inter/Inter-Medium.ttf') format('truetype');
}

@font-face {
font-family: Inter;
font-weight: light;
font-style: light;
font-display: swap;
src: url('../lib/fonts/inter/Inter-Light.ttf') format('truetype');
}

@font-face {
font-family: Roboto;
font-weight: normal;
font-style: normal;
font-display: swap;
src: url('../lib/fonts/roboto/roboto-v29-latin-regular.woff')
format('truetype');
}

*,
body {
font-family: Inter;
}
Binary file added src/libs/fonts/inter/Inter-Black.ttf
Binary file not shown.
Binary file added src/libs/fonts/inter/Inter-Bold.ttf
Binary file not shown.
Binary file added src/libs/fonts/inter/Inter-ExtraBold.ttf
Binary file not shown.
Binary file added src/libs/fonts/inter/Inter-ExtraLight.ttf
Binary file not shown.
Binary file added src/libs/fonts/inter/Inter-Light.ttf
Binary file not shown.
Binary file added src/libs/fonts/inter/Inter-Medium.ttf
Binary file not shown.
Binary file added src/libs/fonts/inter/Inter-Regular.ttf
Binary file not shown.
Binary file added src/libs/fonts/inter/Inter-SemiBold.ttf
Binary file not shown.
Binary file added src/libs/fonts/inter/Inter-Thin.ttf
Binary file not shown.
Binary file not shown.
Binary file added src/libs/fonts/roboto/roboto-v29-latin-300.woff
Binary file not shown.
Binary file added src/libs/fonts/roboto/roboto-v29-latin-300.woff2
Binary file not shown.
Binary file added src/libs/fonts/roboto/roboto-v29-latin-500.woff
Binary file not shown.
Binary file added src/libs/fonts/roboto/roboto-v29-latin-500.woff2
Binary file not shown.
Binary file added src/libs/fonts/roboto/roboto-v29-latin-700.woff
Binary file not shown.
Binary file added src/libs/fonts/roboto/roboto-v29-latin-700.woff2
Binary file not shown.
Binary file not shown.
Binary file not shown.
5 changes: 0 additions & 5 deletions src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import { ThemeProvider } from '@mui/material/styles';
import CssBaseline from '@mui/material/CssBaseline';
import theme from "./libs/theme";

import '@fontsource/roboto/300.css';
import '@fontsource/roboto/400.css';
import '@fontsource/roboto/500.css';
import '@fontsource/roboto/700.css';

const queryClient = new QueryClient({
defaultOptions: {
queries: {
Expand Down
71 changes: 70 additions & 1 deletion src/pages/Identifiers/Identifiers.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,77 @@
import { List, ListItem, ListItemText, ListItemSecondaryAction, Button, Typography, Divider, Paper, Box, Avatar } from '@mui/material';
import VerifiedIcon from '@mui/icons-material/Verified';
import { FaDiscord, FaTelegram, FaGoogle } from 'react-icons/fa';

const identifiers = [
{ name: 'Discord', icon: FaDiscord, verified: true, color: 'text-blue-500' },
{ name: 'Telegram', icon: FaTelegram, verified: false, color: 'text-blue-400' },
{ name: 'Google', icon: FaGoogle, verified: false, color: 'text-red-500' },
];

const handleRevoke = (identifier: string) => {
console.log(`Revoke attestation for ${identifier}`);
};

const handleConnect = (identifier: string) => {
console.log(`Connect identifier for ${identifier}`);
};

export function Identifiers() {
return (
<div>
dsajk
<Typography variant="h6" gutterBottom>
Identifiers
</Typography>
<List>
<ListItem>
<ListItemText primary="Identifier" />
<ListItemSecondaryAction>
<Typography variant="body2" style={{ marginRight: 40 }}>
Actions
</Typography>
</ListItemSecondaryAction>
</ListItem>
<Divider />
{identifiers.map((identifier, index) => (
<Box key={index} mb={2}>
<Paper elevation={1} className='rounded-xl py-2'>
<ListItem>
<Avatar>
<identifier.icon size={28} className={`${identifier.verified ? 'text-black' : 'text-white'}`} />
</Avatar>
<ListItemText
primary={
<div className="flex items-center">
{identifier.verified && <VerifiedIcon className={"text-blue-400 mr-2"} />}
{identifier.name}
</div>
}
style={{ marginLeft: 16 }}
/>
<ListItemSecondaryAction>
{identifier.verified ? (
<Button
variant="outlined"
color="error"
onClick={() => handleRevoke(identifier.name)}
>
Revoke
</Button>
) : (
<Button
variant="contained"
color="primary"
onClick={() => handleConnect(identifier.name)}
>
Connect
</Button>
)}
</ListItemSecondaryAction>
</ListItem>
</Paper>
</Box>
))}
</List>
</div>
);
}
Expand Down

0 comments on commit 9fe713b

Please sign in to comment.