Skip to content

Commit

Permalink
feat(login): login page styles update (#299)
Browse files Browse the repository at this point in the history
## Description

This PR implements the styles like it is in the designs. There is a
connect wallet button now which will trigger the Leo Wallet
 
## Related Issues

closes #298 

## Changes Made

- [FE] Login page changes 
- [FE] Moved the links constant to separate file
  • Loading branch information
Mautjee authored Feb 9, 2024
1 parent 7065265 commit 08f0c1b
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 31 deletions.
6 changes: 0 additions & 6 deletions src/assets/text/about.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,3 @@ export const about = {
`Happy hunting, recruit.`,
],
};
export const wordsToLinkAbout: Record<string, string> = {
"Kryha Labs": "https://kryha.io",
Aleo: "https://aleo.org",
zPass: "https://zpass.aleo.org/",
Obscura: "htpps://https://obscura.build/",
};
2 changes: 2 additions & 0 deletions src/assets/text/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export const auth = {
weUseYourWallet: "We use your Leo Wallet to verify you are a human.",
weTransferToYourWallet:
"We also use it to transfer your won Aleo credits to.",
connectWallet: "Connecting wallet",
loginDescription: "We use Leo Wallet to verify you are a human.",
};
5 changes: 3 additions & 2 deletions src/assets/text/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { about, wordsToLinkAbout } from "./about.js";
import { about } from "./about.js";
import { achievements } from "./achievements.js";
import { auth } from "./auth.js";
import { chat } from "./chat.js";
import { general } from "./general.js";
import { homepage } from "./homepage.js";
import { howToPlay } from "./how-to-play.js";
import { leaderboard } from "./leaderboard.js";
import { wordsToLink } from "./links.js";
import { lobby } from "./lobby.js";
import { matchPrompts } from "./match-prompts.js";
import { match } from "./match.js";
Expand All @@ -19,7 +20,7 @@ export const text = {
about,
general,
navigation,
wordsToLinkAbout,
wordsToLink,
lobby,
termsAndConditions,
match,
Expand Down
7 changes: 7 additions & 0 deletions src/assets/text/links.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const wordsToLink: Record<string, string> = {
"Kryha Labs": "https://kryha.io",
Aleo: "https://aleo.org",
zPass: "https://zpass.aleo.org/",
Obscura: "htpps://https://obscura.build/",
"Leo Wallet": "https://www.leo.app/",
};
44 changes: 23 additions & 21 deletions src/components/authentication/login-loading.tsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
import { Stack, Typography } from "@mui/material";
import Image from "next/image";

import { text } from "~/assets/text/index.js";
import { default as spinner } from "~/assets/images/spinner.gif";

import { text } from "~/assets/text/index.js";
import { PageLayout } from "~/containers/page-layout/index.js";
import { processTextToLink } from "~/utils/links.jsx";
import { styles } from "./styles.js";

const SPINNER_SIZE = 34;
export const LoginLoading = () => {
return (
<PageLayout title={text.auth.connectWallet}>
<Stack alignItems="center" gap={4}>
<Stack alignItems="center" gap={2}>
<Typography variant="body1">
{processTextToLink(text.auth.loginDescription, text.wordsToLink)}
</Typography>
</Stack>

// TODO: update styles
export const LoginLoading = () => (
<Stack sx={styles.wrapper}>
<Stack sx={styles.container}>
<Stack sx={styles.progress}>
<Image
src={spinner}
alt="spinner"
width={SPINNER_SIZE}
height={SPINNER_SIZE}
/>
</Stack>
<Stack sx={styles.text}>
<Typography variant="h5">{text.auth.weUseYourWallet}</Typography>
<Typography variant="h5">{text.auth.weTransferToYourWallet}</Typography>
<Stack sx={styles.progress}>
<Image
src={spinner}
alt="spinner"
width={SPINNER_SIZE}
height={SPINNER_SIZE}
/>
</Stack>
</Stack>
</Stack>
</Stack>
);
</PageLayout>
);
};
2 changes: 1 addition & 1 deletion src/pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const About = () => (
pt={key === 0 ? 0 : 5}
sx={styles.body}
>
{processTextToLink(content, text.wordsToLinkAbout)}
{processTextToLink(content, text.wordsToLink)}
</Typography>
))}
<Stack pt="100px" />
Expand Down
2 changes: 1 addition & 1 deletion src/pages/terms-and-conditions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const TermsAndConditions = () => (
pt={key === 0 ? 0 : 5}
sx={styles.body}
>
{processTextToLink(content, text.wordsToLinkAbout)}
{processTextToLink(content, text.wordsToLink)}
</Typography>
))}
<Stack pt="100px" />
Expand Down

0 comments on commit 08f0c1b

Please sign in to comment.