Skip to content

Commit 4eb4d87

Browse files
authored
Merge pull request #73 from compolabs/feat/dummy-error
[1197] Add unser construction page
2 parents 76a2058 + 479eadc commit 4eb4d87

File tree

5 files changed

+77
-16
lines changed

5 files changed

+77
-16
lines changed

src/App.tsx

+14-7
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ import { Column } from "@components/Flex";
77

88
import Header from "./components/Header";
99
import { usePrivateKeyAsAuth } from "./hooks/usePrivateKeyAsAuth";
10+
import UnderConstruction from "./screens/Errors/UnderConstruction";
1011
import Faucet from "./screens/Faucet";
1112
import TradeScreen from "./screens/TradeScreen";
12-
import { ROUTES } from "./constants";
13+
import { isProduction, ROUTES } from "./constants";
1314

14-
const Root = styled(Column)`
15-
width: 100%;
16-
align-items: center;
17-
background: ${({ theme }) => theme.colors.bgPrimary};
18-
height: 100vh;
19-
`;
15+
const isUnderConstruction = isProduction;
2016

2117
const App: React.FC = observer(() => {
2218
usePrivateKeyAsAuth();
2319

20+
if (isUnderConstruction) {
21+
return <UnderConstruction />;
22+
}
23+
2424
return (
2525
<Root>
2626
<Header />
@@ -37,3 +37,10 @@ const App: React.FC = observer(() => {
3737
});
3838

3939
export default App;
40+
41+
const Root = styled(Column)`
42+
width: 100%;
43+
align-items: center;
44+
background: ${({ theme }) => theme.colors.bgPrimary};
45+
height: 100vh;
46+
`;

src/components/Loader.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ interface Props {
1010
size?: number;
1111
hideText?: boolean;
1212
text?: string;
13+
className?: string;
1314
}
1415

15-
const Loader: React.FC<Props> = ({ size = 64, hideText, text = "Loading" }) => {
16+
const Loader: React.FC<Props> = ({ size = 64, hideText, text = "Loading", className }) => {
1617
return (
17-
<SmartFlex gap="8px" height="100%" width="100%" center column>
18+
<SmartFlex className={className} gap="8px" height="100%" width="100%" center column>
1819
<LoaderLogoImage alt="loader" height={size} src={sparkLogoIcon} width={size} />
1920
{!hideText && <Text primary>{text}</Text>}
2021
</SmartFlex>

src/constants/index.ts

+9-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export const CHARTS_STORAGE = "https://tv-backend-v4.herokuapp.com/";
1414
export const DEFAULT_DECIMALS = 9;
1515
export const USDC_DECIMALS = 6;
1616

17+
export const TWITTER_LINK = "https://twitter.com/Sprkfi";
18+
export const GITHUB_LINK = "https://github.com/compolabs/spark";
19+
export const DOCS_LINK = "https://docs.sprk.fi";
20+
1721
type TMenuItem = {
1822
title: string;
1923
route?: string;
@@ -23,11 +27,13 @@ type TMenuItem = {
2327
export const MENU_ITEMS: Array<TMenuItem> = [
2428
{ title: "TRADE", route: ROUTES.ROOT },
2529
{ title: "FAUCET", route: ROUTES.FAUCET },
26-
{ title: "DOCS", link: "https://docs.sprk.fi" },
27-
{ title: "GITHUB", link: "https://github.com/compolabs/spark" },
28-
{ title: "TWITTER", link: "https://twitter.com/Sprkfi" },
30+
{ title: "DOCS", link: DOCS_LINK },
31+
{ title: "GITHUB", link: GITHUB_LINK },
32+
{ title: "TWITTER", link: TWITTER_LINK },
2933
];
3034

35+
export const isProduction = window.location.host === "app.sprk.fi";
36+
3137
export const FUEL_CONFIG = {
3238
connectors: [
3339
new FuelWalletConnector(),
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import React, { useEffect } from "react";
2+
import styled from "@emotion/styled";
3+
4+
import Text, { TEXT_TYPES } from "@components/Text";
5+
import Button from "@src/components/Button";
6+
import Loader from "@src/components/Loader";
7+
import { SmartFlex } from "@src/components/SmartFlex";
8+
import { DOCS_LINK, TWITTER_LINK } from "@src/constants";
9+
10+
const UnderConstruction: React.FC = () => {
11+
useEffect(() => {
12+
document.title = `Spark | Work in progress...`;
13+
}, []);
14+
15+
return (
16+
<SmartFlex gap="16px" width="100%" center column>
17+
<LoaderStyled hideText />
18+
<Text type={TEXT_TYPES.H} primary>
19+
🛠️ Website Under Maintenance 🛠️
20+
</Text>
21+
<SmartFlex gap="12px" center column>
22+
<Text type={TEXT_TYPES.BODY} secondary>
23+
Our website is currently undergoing maintenance.
24+
</Text>
25+
<Text type={TEXT_TYPES.BODY} secondary>
26+
We are working hard to fix the current issues and improve the site.
27+
</Text>
28+
<Text type={TEXT_TYPES.BODY} secondary>
29+
Please check back later. We will let you know as soon as everything is ready!
30+
</Text>
31+
</SmartFlex>
32+
<SmartFlex gap="16px" center>
33+
<a href={TWITTER_LINK} rel="noreferrer noopener" target="_blank">
34+
<Button green>Twitter</Button>
35+
</a>
36+
<a href={DOCS_LINK} rel="noreferrer noopener" target="_blank">
37+
<Button green>Docs</Button>
38+
</a>
39+
</SmartFlex>
40+
</SmartFlex>
41+
);
42+
};
43+
44+
export default UnderConstruction;
45+
46+
const LoaderStyled = styled(Loader)`
47+
height: fit-content;
48+
`;

src/screens/TradeScreen/StatusBar/StatusBar.tsx

+3-4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { observer } from "mobx-react";
44

55
import { Row } from "@components/Flex";
66
import Text, { TEXT_TYPES } from "@components/Text";
7+
import { TWITTER_LINK } from "@src/constants";
78

89
import tweets from "./tweets";
910

@@ -17,7 +18,7 @@ const StatusBar: React.FC = observer(() => {
1718
return (
1819
<Root>
1920
<Row alignItems="center" mainAxisSize="fit-content" style={{ flex: 1 }}>
20-
<a href="https://twitter.com/Sprkfi" rel="noreferrer noopener" target="_blank">
21+
<a href={TWITTER_LINK} rel="noreferrer noopener" target="_blank">
2122
<LinkText type={TEXT_TYPES.SUPPORTING}>Twitter</LinkText>
2223
</a>
2324
</Row>
@@ -89,12 +90,10 @@ const Divider = styled.div`
8990

9091
const LinkText = styled(Text)`
9192
${TEXT_TYPES.SUPPORTING};
92-
transition: .4s;
93+
transition: 0.4s;
9394
cursor: pointer;
9495
9596
&:hover {
9697
color: ${({ theme }) => theme.colors.textPrimary};
9798
}
98-
;
99-
}
10099
`;

0 commit comments

Comments
 (0)