Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redesign #71

Merged
merged 3 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 10 additions & 6 deletions src/components/Elements/FeatureCard/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
.card {
display: flex;
flex-direction: column;
align-items: center;
width: 100%;
margin: auto;
text-align: center;
box-shadow: 0 2px 5px 2px rgba(0, 0, 0, 0.2);
}

.icon {
margin-top: .5em;
width: 72px;
width: 8rem;
padding: 1rem;
height: auto;
color: #757575;
}

.button {
margin-bottom: 20px;
margin: 1em auto;
font-size: 16px;
padding: 0.5em 1em;
padding: 0.5rem 0.75rem;
border-radius: 1rem;
font-size: 0.75rem;
font-weight: 700;
margin: 1rem 0;
}
8 changes: 7 additions & 1 deletion src/components/Elements/FeatureCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
CardActions,
CardContent,
Typography,
useTheme,
} from '@mui/material';
import Image, { StaticImageData } from 'next/image';
import { useRouter } from 'next/router';
Expand All @@ -27,13 +28,14 @@ export const FeatureCard = ({
href,
}: FeatureCardProps) => {
const { push } = useRouter();
const theme = useTheme();

return (
<Card className={styles.card}>
<CardContent>
<Image className={styles.icon} src={image} alt='' />
</CardContent>
<Typography variant='h5' component='h2' gutterBottom>
<Typography variant='h1' gutterBottom>
{title}
</Typography>
<CardActions>
Expand All @@ -43,6 +45,10 @@ export const FeatureCard = ({
variant='text'
disabled={!enabled}
className={styles.button}
sx={{
background: '#e8eff7',
color: theme.palette.text.secondary,
}}
>
{buttonText}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Elements/RegionCard/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
display: flex;
gap: 1.5rem;
border-radius: 0.5rem;
max-width: 45rem;
max-width: 50rem;
padding: 1.5rem 2rem;
}

Expand Down
8 changes: 5 additions & 3 deletions src/components/Elements/StatusIndicator/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.container {
display: flex;
gap: 1rem;
flex-direction: row;
align-items: center;
justify-content: space-between;
flex-grow: 1;
padding: 0.5rem 0.75rem;
width: 100%;
border: 2px solid #efefef;
border-radius: 1rem;
}
14 changes: 10 additions & 4 deletions src/components/Elements/StatusIndicator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,21 @@ export const StatusIndicator = ({ state, label }: StatusIndicatorProps) => {
return (
<div className={styles.container}>
<Typography
variant='subtitle2'
sx={{ color: theme.palette.text.secondary }}
sx={{
color: theme.palette.text.primary,
fontSize: '0.8rem',
flexGrow: 1,
}}
>
{label}
</Typography>
{state === ApiState.CONNECTING || state === ApiState.CONNECT_INIT ? (
<CircularProgress size='1rem' />
<CircularProgress size='0.5rem' />
) : (
<CircleIcon color={state === ApiState.READY ? 'success' : 'error'} />
<CircleIcon
sx={{ width: '0.5rem', height: '0.5rem' }}
color={state === ApiState.READY ? 'success' : 'error'}
/>
)}
</div>
);
Expand Down
32 changes: 10 additions & 22 deletions src/components/Header/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,35 +1,23 @@
.header {
display: flex;
}

.logo {
display: flex;
position: relative;
justify-content: center;
align-items: center;
margin-bottom: 0.5rem;
width: 150px;
height: 70px;
}

.logo>img {
width: 100%;
height: 100%;
object-fit: contain;
}

.menu {
display: flex;
align-items: center;
justify-content: flex-end;
height: 5rem;
flex-grow: 1;
margin-right: 32 px;
margin-right: 3rem;
}

.connectWallet {
color: #181336;
background:linear-gradient(180deg, #E84D68 0%, #AD2B49 100%);
border-radius: 100px;
font-weight: 500;
text-transform: none;
padding: 0.5rem 1.25rem;
font-size: 0.8rem;
}

.connectWallet:hover {
opacity: 0.8;
}

.listWrapper {
Expand Down
23 changes: 14 additions & 9 deletions src/components/Header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
import { ExpandMore } from '@mui/icons-material';
import {
Box,
Button,
Collapse,
Divider,
Link,
List,
ListItemButton,
useTheme,
} from '@mui/material';
import { useInkathon } from '@scio-labs/use-inkathon';
import Image from 'next/image';
import React, { useEffect, useState } from 'react';

import Logo from '@/assets/logo.png';
import { useCoretimeApi, useRelayApi } from '@/contexts/apis';

import styles from './index.module.scss';
import { WalletModal } from '../Modals/WalletConnect';

export const Header = () => {
const theme = useTheme();

const { activeAccount, disconnect, accounts, setActiveAccount } =
useInkathon();
const [accountsOpen, openAccounts] = useState(false);
Expand All @@ -38,10 +39,14 @@ export const Header = () => {

return (
<>
<div className={styles.header}>
<Link href='/' className={styles.logo}>
<Image src={Logo} alt='logo' />
</Link>
<Box
sx={{
display: 'flex',
background: theme.palette.background.paper,
borderLeft: `1px solid ${theme.palette.divider}`,
borderBottom: `1px solid ${theme.palette.divider}`,
}}
>
<div className={styles.menu}>
{activeAccount ? (
<List component='div' className={styles.listWrapper}>
Expand Down Expand Up @@ -80,15 +85,15 @@ export const Header = () => {
</List>
) : (
<Button
variant='outlined'
variant='contained'
className={styles.connectWallet}
onClick={() => openWalletModal(true)}
>
Connect Wallet
</Button>
)}
</div>
</div>
</Box>
<WalletModal
open={walletModalOpen}
onClose={() => openWalletModal(false)}
Expand Down
14 changes: 5 additions & 9 deletions src/components/Layout/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,26 +1,22 @@
.layout {
display: flex;
flex-direction: column;
flex-direction: row;
width: 100%;
min-height: 100vh;
max-height: 100vh;
padding: 2rem 3rem;
}

.content {
display: flex;
flex-grow: 1;
}

.sidebar {
width: 12rem;
flex-direction: column;
}

.main {
display: flex;
flex-direction: column;
padding-left: 4rem;
padding-right: 5rem;
padding-top: 2rem;
padding: 2rem 4rem;
flex-grow: 1;
min-height: calc(100vh - 9rem);
max-height: calc(100vh - 9rem);
}
25 changes: 6 additions & 19 deletions src/components/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Divider, Paper, useTheme } from '@mui/material';
import { Paper } from '@mui/material';
import React, { ReactElement } from 'react';

import styles from './index.module.scss';
import { Banner } from '../Elements';
import { Header } from '../Header';
import { Sidebar } from '../Sidebar';

Expand All @@ -11,33 +10,21 @@ interface Props {
}

export const Layout = ({ children }: Props) => {
const theme = useTheme();
return (
<div className={styles.layout}>
<Header />
<Banner
content='The UI is still under active development and is released only for testing purposes!'
severity='error'
/>
<Sidebar />
<div className={styles.content}>
<div className={styles.sidebar}>
<Sidebar />
</div>
<Header />
<Paper
color='secondary'
sx={{
display: 'flex',
flexGrow: 1,
margin: '1rem 0.5rem 0 2rem',
borderTopLeftRadius: '1rem',
borderBottomLeftRadius: '1rem',
paddingTop: '1rem',
paddingBottom: '2rem',
margin: '1rem 2rem',
borderRadius: '1rem',
py: '1rem',
}}
>
<Divider
sx={{ borderWidth: '1px', borderColor: theme.palette.grey[100] }}
/>
<div className={styles.main}>{children}</div>
</Paper>
</div>
Expand Down
57 changes: 32 additions & 25 deletions src/components/Sidebar/index.module.scss
Original file line number Diff line number Diff line change
@@ -1,46 +1,53 @@
.sidebar {
display: flex;
flex-direction: column;
height: 100%;
justify-content: space-between;
width: 15rem;
background-color: white;
}

.menu-container {
.logoContainer {
display: flex;
flex-direction: column;
font-size: 16px;
gap: 2rem;
padding-left: 2rem;
padding-top: 1rem;
align-items: center;
height: 5rem;
padding: 1rem 0;
}

.menuItem {
display: flex;
gap: 10px;
cursor: pointer;
padding: 0;
margin: 0.75rem 0;
text-transform: capitalize;
font-weight: 700;
.logo {
width: 10rem;
height: 3rem;
}

.active {
text-decoration: underline;
.logo > img {
width: 100%;
height: 100%;
object-fit: contain;
}

.menuItem:hover {
opacity: 0.8;

.menuContainer {
display: flex;
flex-direction: column;
flex-grow: 1;
}

.statusContainer {
position: fixed;
bottom: 2rem;
display: flex;
flex-direction: column;
gap: 0.5rem;
}

.menuItem.disabled {
color: #ccc;
cursor: not-allowed;
.menuIcon {
width: 1.5rem;
}

.menuItem {
line-height: 1;
flex-grow: 1;
}

.active {
width: 0.5rem;
height: 0.5rem;
border-radius: 100%;
background-color: black;
}
Loading
Loading