Skip to content

Commit 4a42db8

Browse files
committed
refactor: migrate footer to tailwindcss
1 parent 4474759 commit 4a42db8

File tree

2 files changed

+17
-65
lines changed

2 files changed

+17
-65
lines changed

web/src/components/ExternalLink.tsx

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

web/src/layout/Footer/index.tsx

Lines changed: 17 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,40 @@
11
import React from "react";
2-
import styled, { css } from "styled-components";
3-
4-
import { landscapeStyle } from "styles/landscapeStyle";
5-
import { hoverShortTransitionTiming } from "styles/commonStyles";
2+
import clsx from "clsx";
3+
import { Link } from "react-router-dom";
64

75
import SecuredByKlerosLogo from "svgs/footer/secured-by-kleros.svg";
86

97
import { socialmedia } from "consts/socialmedia";
108

119
import LightButton from "components/LightButton";
12-
import { ExternalLink } from "components/ExternalLink";
13-
14-
const Container = styled.div`
15-
height: 114px;
16-
width: 100%;
17-
background-color: ${({ theme }) => (theme.name === "dark" ? theme.lightBlue : theme.primaryPurple)};
18-
display: flex;
19-
flex-direction: column;
20-
justify-content: center;
21-
align-items: center;
22-
padding: 8px;
23-
gap: 16px;
24-
25-
${landscapeStyle(
26-
() => css`
27-
height: 64px;
28-
flex-direction: row;
29-
justify-content: space-between;
30-
padding: 0 32px;
31-
`
32-
)}
33-
`;
34-
35-
const StyledSecuredByKlerosLogo = styled(SecuredByKlerosLogo)`
36-
${hoverShortTransitionTiming}
37-
min-height: 24px;
38-
39-
path {
40-
fill: ${({ theme }) => theme.white}BF;
41-
}
42-
43-
:hover path {
44-
fill: ${({ theme }) => theme.white};
45-
}
46-
`;
47-
48-
const StyledSocialMedia = styled.div`
49-
display: flex;
50-
51-
.button-svg {
52-
margin-right: 0;
53-
}
54-
`;
5510

5611
const SecuredByKleros: React.FC = () => (
57-
<ExternalLink to="https://kleros.io" target="_blank" rel="noreferrer">
58-
<StyledSecuredByKlerosLogo />
59-
</ExternalLink>
12+
<Link to="https://kleros.io" target="_blank" rel="noopener noreferrer">
13+
<SecuredByKlerosLogo className="min-h-6 transition duration-100 [&_path]:fill-white/75 hover:[&_path]:fill-white" />
14+
</Link>
6015
);
6116

6217
const SocialMedia = () => (
63-
<StyledSocialMedia>
18+
<div className="flex [&_.button-svg]:mr-0">
6419
{Object.values(socialmedia).map((site, i) => (
65-
<ExternalLink key={site.url} to={site.url} target="_blank" rel="noreferrer">
20+
<Link key={site.url} to={site.url} target="_blank" rel="noopener noreferrer">
6621
<LightButton Icon={site.icon} text="" />
67-
</ExternalLink>
22+
</Link>
6823
))}
69-
</StyledSocialMedia>
24+
</div>
7025
);
7126

7227
const Footer: React.FC = () => (
73-
<Container>
28+
<div
29+
className={clsx(
30+
"flex flex-col justify-center items-center gap-4 p-2 w-full h-[114px]",
31+
"bg-klerosUIComponentsPrimaryPurple dark:bg-klerosUIComponentsLightBlue",
32+
"lg:h-16 lg:flex-row lg:justify-between lg:px-8"
33+
)}
34+
>
7435
<SecuredByKleros />
7536
<SocialMedia />
76-
</Container>
37+
</div>
7738
);
7839

7940
export default Footer;

0 commit comments

Comments
 (0)