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

Design changes and text fixes #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion frontend/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>Mandala - Security tokens mediator</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file added frontend/public/mandala.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 15 additions & 8 deletions frontend/src/components/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,29 @@ export const DashboardLayout = () => {
<Box>
<NavigationBar />

<Box
sx={{
display: "grid",
}}
>
{/* This is so that the sidebar stays here */}

<Box sx={{ display: "grid" }}>
<Box
sx={{
paddingTop: "80px",
minHeight: "100vh",
backgroundColor: "#f2f4f8",
position: "relative",
"&::before": {
content: '""',
position: "absolute",
top: 0,
left: 0,
right: 0,
bottom: 0,
backgroundImage: "url(/mandala.png)",
backgroundSize: "cover",
opacity: 0.15,
zIndex: -1,
},
}}
>
<Box
sx={{
position: "relative",
padding: "3rem",
height: "100%",
}}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const NavigationBar: React.FC = ({ ...props }) => {
{...props}
sx={({ zIndex }) => ({
zIndex: zIndex.drawer + 1,
backgroundColor: "#39429b",
})}
>
<Box
Expand Down
18 changes: 17 additions & 1 deletion frontend/src/pages/account/pages/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,26 @@ export const LoginPage: React.FC = () => {
loading={loading}
variant="contained"
onClick={form.handleSubmit(onLogin)}
sx={{
backgroundColor: "#39429b",
'&:hover': {
backgroundColor: "#1976d2",
},
}}
>
Login
</LoadingButton>
<Button onClick={() => navigate("/accounts/register")}>Register</Button>
<Button
sx={{
color: '#39429b',
backgroundColor: "#fff",
'&:hover': {
backgroundColor: "#fff",
},
}}
onClick={() => navigate("/accounts/register")}>
Register
</Button>
</Box>
);
};
6 changes: 6 additions & 0 deletions frontend/src/pages/account/pages/RegisterPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ export const RegisterPage: React.FC = () => {
loading={loading}
variant="contained"
onClick={form.handleSubmit(onRegister)}
sx={{
backgroundColor: "#39429b",
'&:hover': {
backgroundColor: "#1976d2",
},
}}
>
Register
</LoadingButton>
Expand Down
28 changes: 24 additions & 4 deletions frontend/src/pages/admin/pages/OrdersPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,23 +108,40 @@ export const OrdersPage: React.FC = () => {
}}
>
{!signer && (
<Button onClick={connectWallet}>Connect your wallet</Button>
<Button
sx={{
backgroundColor: "#39429b",
'&:hover': {
backgroundColor: "#1976d2",
},
color: "#fff"
}}
onClick={connectWallet}>
Connect your wallet
</Button>
)}

{signer && (
<React.Fragment>
<Typography
<Button
sx={{
fontSize: "24px",
fontWeight: "700",
backgroundColor: "#39429b",
opacity: ".7",
'&:hover': {
backgroundColor: "#1976d2",
},
...(tokenDetails && {
cursor: "pointer",
}),
color: '#fff',
marginBottom: "1rem",
}}
onClick={() => setTokenDetails(null as any)}
>
{tokenDetails ? "Go back to asset selection" : "Select an asset"}
</Typography>
</Button>

{!tokenDetails &&
SUPPORTED_ASSETS.map((supportedToken) => (
Expand All @@ -136,6 +153,7 @@ export const OrdersPage: React.FC = () => {
padding: "1rem",
width: "400px",
border: "1px solid #D9D9D9",
backgroundColor: "#82a8d9",
}}
onClick={loadToken(
ASSETS[supportedToken as "LFT" | "LFN"].address!
Expand All @@ -154,7 +172,7 @@ export const OrdersPage: React.FC = () => {
sx={{
fontSize: "14px",
fontWeight: "500",
opacity: ".5",
opacity: ".8",
}}
>
{ASSETS[supportedToken as "LFT" | "LFN"].address}
Expand All @@ -167,6 +185,8 @@ export const OrdersPage: React.FC = () => {
sx={{
width: "100%",
maxWidth: "1024px",
borderRadius: "1rem",
backgroundColor: "#D3D3D3",
}}
rows={tokenDetails.epochList}
columns={[
Expand Down
17 changes: 12 additions & 5 deletions frontend/src/pages/client/pages/HoldingsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,26 @@ export const HoldingsPage: React.FC = () => {
}}
>
{!signer && (
<Button variant="contained" onClick={web3Context.connectWallet}>
<Button
sx={{
backgroundColor: "#39429b",
'&:hover': {
backgroundColor: "#1976d2",
},
}}
variant="contained" onClick={web3Context.connectWallet}>
Connect your wallet
</Button>
)}
{SUPPORTED_ASSETS.map((supportedToken) => (
<Box
sx={{
borderRadius: "4px",
borderRadius: "1rem",
marginTop: "1rem",
padding: "1rem",
width: "400px",
border: "1px solid #D9D9D9",
backgroundColor: "#82a8d9",
}}
>
<Typography
Expand All @@ -87,7 +95,7 @@ export const HoldingsPage: React.FC = () => {
sx={{
fontSize: "14px",
fontWeight: "500",
opacity: ".5",
opacity: ".8",
}}
>
{ASSETS[supportedToken as "LFT" | "LFN"].address}
Expand All @@ -96,8 +104,7 @@ export const HoldingsPage: React.FC = () => {
<Typography
sx={{
fontSize: "14px",
fontWeight: "500",
opacity: ".5",
fontWeight: "700",
}}
>
Balance: {new Intl.NumberFormat('en-US').format(Number(balances[supportedToken]))} {supportedToken}
Expand Down
36 changes: 30 additions & 6 deletions frontend/src/pages/client/pages/PastTransactionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const PastTransactionsPage: React.FC = () => {
token: asset
})))
}
x = x.sort((a,b) => a.createdAt.getTime() - b.createdAt.getTime())
x = x.sort((a, b) => a.createdAt.getTime() - b.createdAt.getTime())
setHistory(x);
};

Expand All @@ -58,16 +58,18 @@ export const PastTransactionsPage: React.FC = () => {
if (signer) {
fetchHistory();
}
// eslint-disable-next-line
// eslint-disable-next-line
}, [signer]);

const columns: GridColDef[] = [
{ field: 'createdAt', type: 'dateTime', headerName: 'Created at', width: 260 },
{ field: 'token', headerName: 'For Token', width: 130 },
{ field: 'side', headerName: 'Side', width: 130 },
{ field: 'amount', headerName: 'Traded with', width: 130, renderCell: (params) => {
{
field: 'amount', headerName: 'Traded with', width: 130, renderCell: (params) => {
return <>{params.row.amount} {params.row.amountCurrency}</>
}, }
},
}
// {
// field: 'fullName',
// headerName: 'Full name',
Expand All @@ -87,12 +89,34 @@ export const PastTransactionsPage: React.FC = () => {
}}
>
{!signer && (
<Button variant="contained" onClick={web3Context.connectWallet}>
<Button
sx={{
backgroundColor: "#39429b",
'&:hover': {
backgroundColor: "#1976d2",
},
}}
variant="contained" onClick={web3Context.connectWallet}>
Connect your wallet
</Button>
)}
{signer && history && (
<DataGrid rows={history} columns={columns} />
<DataGrid
sx={{
borderRadius: "1rem",
backgroundColor: "#82a8d9",
'& .MuiDataGrid-columnHeaders': {
justifyContent: 'center',
alignItems: 'center',
},
'& .MuiDataGrid-columnHeaderTitle': {
fontWeight: 'bold',
fontSize: '1rem',
textAlign: 'center'
},
}}
rows={history}
columns={columns} />
)}
</Box>
</AuthenticatedOnly>
Expand Down
19 changes: 16 additions & 3 deletions frontend/src/pages/client/pages/components/InteractionsWidget.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const InteractionsWidget: React.FC = () => {
}, [web3Context]);

return (
<Card sx={{ width: 350 }}>
<Card sx={{ width: 350, borderRadius: "0.8rem" }}>
<CardContent>
<Box sx={{ borderBottom: 1, borderColor: "divider" }}>
<Tabs value={value} onChange={handleChange}>
Expand Down Expand Up @@ -195,7 +195,14 @@ export const InteractionsWidget: React.FC = () => {
<CardActions>
{!signer && (
<Button
sx={{ width: "100%" }}
sx=
{{
width: "100%",
backgroundColor: "#39429b",
'&:hover': {
backgroundColor: "#1976d2",
},
}}
variant="contained"
onClick={web3Context.connectWallet}
>
Expand All @@ -221,7 +228,13 @@ export const InteractionsWidget: React.FC = () => {
>
<LoadingButton
loading={loading}
sx={{ width: "100%" }}
sx={{
width: "100%",
backgroundColor: "#39429b",
'&:hover': {
backgroundColor: "#1976d2",
},
}}
variant="contained"
onClick={form.handleSubmit(confirm)}
>
Expand Down