Skip to content

Commit b021335

Browse files
committed
refactor(web): simplify directory structure
1 parent d5747dc commit b021335

File tree

14 files changed

+78
-84
lines changed

14 files changed

+78
-84
lines changed

web/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
"src": "./src",
1111
"assets": "./src/assets",
1212
"components": "./src/components",
13+
"context": "./src/context",
14+
"layout": "./src/layout",
1315
"consts": "./src/consts",
1416
"hooks": "./src/hooks",
1517
"pages": "./src/pages",

web/src/app.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import { Routes, Route } from "react-router-dom";
3-
import StyledComponentsProvider from "components/StyledComponentsProvider";
4-
import Layout from "components/layout";
3+
import StyledComponentsProvider from "context/StyledComponentsProvider";
4+
import Layout from "layout/index";
55
import Home from "./pages/home";
66

77
const App: React.FC = () => (

web/src/components/layout/footer/SecuredByKleros.tsx

Lines changed: 0 additions & 15 deletions
This file was deleted.

web/src/components/layout/footer/SocialMedia.tsx

Lines changed: 0 additions & 25 deletions
This file was deleted.

web/src/components/layout/footer/index.tsx

Lines changed: 0 additions & 24 deletions
This file was deleted.

web/src/components/layout/header/KlerosCourt.tsx

Lines changed: 0 additions & 16 deletions
This file was deleted.

web/src/layout/footer/index.tsx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
import React from "react";
2+
import styled from "styled-components";
3+
import SecuredByKlerosLogo from "svgs/footer/secured-by-kleros.svg";
4+
import { socialmedia } from "consts/socialmedia";
5+
6+
const Container = styled.div`
7+
height: 80px;
8+
width: 100vw;
9+
background-color: ${({ theme }) => theme.primaryPurple};
10+
display: flex;
11+
flex-direction: column;
12+
align-items: center;
13+
justify-content: center;
14+
gap: 16px;
15+
16+
.secured-by-kleros {
17+
min-height: 24px;
18+
}
19+
20+
.socialmedia {
21+
display: flex;
22+
gap: 16px;
23+
justify-content: center;
24+
25+
a {
26+
display: inline-block;
27+
}
28+
}
29+
`;
30+
31+
const SecuredByKleros: React.FC = () => (
32+
<a
33+
className="secured-by-kleros"
34+
href="https://kleros.io"
35+
target="_blank"
36+
rel="noreferrer"
37+
>
38+
<SecuredByKlerosLogo />
39+
</a>
40+
);
41+
42+
const SocialMedia = () => (
43+
<div className="socialmedia">
44+
{Object.values(socialmedia).map((site, i) => (
45+
<a key={i} href={site.url} target="_blank" rel="noreferrer">
46+
{site.icon}
47+
</a>
48+
))}
49+
</div>
50+
);
51+
52+
const Footer: React.FC = () => (
53+
<Container>
54+
<SecuredByKleros />
55+
<SocialMedia />
56+
</Container>
57+
);
58+
59+
export default Footer;

web/src/components/layout/header/index.tsx renamed to web/src/layout/header/index.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React, { useState, useRef } from "react";
22
import styled from "styled-components";
3+
import { Link } from "react-router-dom";
34
import HamburgerIcon from "svgs/header/hamburger.svg";
5+
import KlerosCourtLogo from "svgs/header/kleros-court.svg";
46
import { useFocusOutside } from "hooks/useFocusOutside";
57
import LightButton from "components/LightButton";
6-
import KlerosCourt from "./KlerosCourt";
78
import NavBar from "./navbar";
89

910
const Container = styled.div`
@@ -17,6 +18,10 @@ const Container = styled.div`
1718
display: flex;
1819
align-items: center;
1920
justify-content: space-between;
21+
22+
.kleros-court-link {
23+
min-height: 48px;
24+
}
2025
`;
2126

2227
const StyledLightButton = styled(LightButton)`
@@ -30,7 +35,9 @@ const Header: React.FC = () => {
3035
useFocusOutside(containerRef, () => setIsOpen(false));
3136
return (
3237
<Container>
33-
<KlerosCourt />
38+
<Link className="kleros-court-link" to={"/"}>
39+
<KlerosCourtLogo />
40+
</Link>
3441
<div ref={containerRef}>
3542
<NavBar {...{ isOpen }} />
3643
<StyledLightButton
File renamed without changes.

web/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
"components*": [
1515
"./src/components*"
1616
],
17+
"context*": [
18+
"./src/context*"
19+
],
20+
"layout*": [
21+
"./src/layout*"
22+
],
1723
"consts*": [
1824
"./src/consts*"
1925
],

0 commit comments

Comments
 (0)