Skip to content

Commit 0dd543c

Browse files
authored
Merge pull request #1211 from kleros/feat(web)/desktop-navbar-and-responsiveness
feat(web): desktop responsiveness navbar, footer, community section, dashboard juror info, home page..
2 parents 0c056c0 + 463722a commit 0dd543c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+856
-284
lines changed

web/src/assets/svgs/header/header-darkmode-desktop.svg renamed to web/src/assets/svgs/hero/hero-darkmode-desktop.svg

Lines changed: 2 additions & 1 deletion
Loading

web/src/assets/svgs/header/header-darkmode-mobile.svg renamed to web/src/assets/svgs/hero/hero-darkmode-mobile.svg

Lines changed: 1 addition & 1 deletion
Loading

web/src/assets/svgs/header/header-lightmode-desktop.svg renamed to web/src/assets/svgs/hero/hero-lightmode-desktop.svg

Lines changed: 1 addition & 1 deletion
Loading

web/src/assets/svgs/header/header-lightmode-mobile.svg renamed to web/src/assets/svgs/hero/hero-lightmode-mobile.svg

Lines changed: 1 addition & 1 deletion
Loading

web/src/assets/svgs/icons/vea.svg

Lines changed: 5 additions & 0 deletions
Loading

web/src/assets/svgs/socialmedia/twitter.svg

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Loading

web/src/components/ConnectWallet/AccountDisplay.tsx

Lines changed: 41 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,31 @@
11
import React from "react";
2-
import styled from "styled-components";
2+
import styled, { css } from "styled-components";
3+
import { landscapeStyle } from "styles/landscapeStyle";
34
import { useAccount, useNetwork, useEnsAvatar, useEnsName } from "wagmi";
45
import Identicon from "react-identicons";
56
import { shortenAddress } from "utils/shortenAddress";
67

78
const Container = styled.div`
89
display: flex;
910
flex-direction: column;
11+
justify-content: space-between;
12+
height: auto;
1013
align-items: flex-start;
1114
gap: 8px;
15+
align-items: center;
16+
background-color: ${({ theme }) => theme.whiteBackground};
17+
padding: 0px;
18+
19+
${landscapeStyle(
20+
() => css`
21+
background-color: ${({ theme }) => theme.whiteLowOpacity};
22+
flex-direction: row;
23+
align-content: center;
24+
border-radius: 300px;
25+
gap: 0px;
26+
padding: 0 12px;
27+
`
28+
)}
1229
`;
1330

1431
const AccountContainer = styled.div`
@@ -17,22 +34,36 @@ const AccountContainer = styled.div`
1734
align-items: center;
1835
width: fit-content;
1936
gap: 8px;
37+
2038
> label {
21-
color: ${({ theme }) => theme.primaryText};
2239
font-size: 16px;
2340
font-weight: 600;
2441
}
42+
43+
${landscapeStyle(
44+
() => css`
45+
gap: 12px;
46+
> label {
47+
color: ${({ theme }) => theme.primaryText};
48+
font-weight: 400;
49+
font-size: 14px;
50+
}
51+
`
52+
)}
2553
`;
2654
const ChainConnectionContainer = styled.div`
55+
display: flex;
2756
width: fit-content;
2857
min-height: 32px;
29-
display: flex;
3058
align-items: center;
59+
padding-left: 0px;
3160
> label {
3261
color: ${({ theme }) => theme.success};
3362
font-size: 16px;
34-
margin-right: 4px;
63+
64+
font-weight: 500;
3565
}
66+
3667
:before {
3768
content: "";
3869
width: 8px;
@@ -41,6 +72,12 @@ const ChainConnectionContainer = styled.div`
4172
border-radius: 50%;
4273
background-color: ${({ theme }) => theme.success};
4374
}
75+
76+
${landscapeStyle(
77+
() => css`
78+
display: none;
79+
`
80+
)}
4481
`;
4582

4683
const StyledIdenticon = styled(Identicon)<{ size: `${number}` }>`

web/src/components/ConnectWallet/index.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
import React from "react";
2-
import styled from "styled-components";
32
import { useAccount, useNetwork, useSwitchNetwork } from "wagmi";
43
import { useWeb3Modal } from "@web3modal/react";
54
import { Button } from "@kleros/ui-components-library";
65
import { SUPPORTED_CHAINS, DEFAULT_CHAIN } from "consts/chains";
76
import AccountDisplay from "./AccountDisplay";
8-
import { DisconnectWalletButton } from "layout/Header/navbar/Menu/Settings/General";
9-
10-
const Container = styled.div`
11-
display: flex;
12-
gap: 16px;
13-
justify-content: space-between;
14-
flex-wrap: wrap;
15-
align-items: center;
16-
`;
177

188
export const SwitchChainButton: React.FC = () => {
199
const { switchNetwork, isLoading } = useSwitchNetwork();
@@ -49,13 +39,7 @@ const ConnectWallet: React.FC = () => {
4939
if (isConnected) {
5040
if (chain && chain.id !== DEFAULT_CHAIN) {
5141
return <SwitchChainButton />;
52-
} else
53-
return (
54-
<Container>
55-
<AccountDisplay />
56-
<DisconnectWalletButton />
57-
</Container>
58-
);
42+
} else return <AccountDisplay />;
5943
} else return <ConnectButton />;
6044
};
6145

web/src/components/EvidenceCard.tsx

Lines changed: 61 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React from "react";
2-
import styled from "styled-components";
2+
import styled, { css } from "styled-components";
3+
import { landscapeStyle } from "styles/landscapeStyle";
34
import Identicon from "react-identicons";
45
import { Card } from "@kleros/ui-components-library";
56
import AttachmentIcon from "svgs/icons/attachment.svg";
@@ -13,7 +14,7 @@ const StyledCard = styled(Card)`
1314
`;
1415

1516
const TextContainer = styled.div`
16-
padding: 8px;
17+
padding: calc(8px + (24 - 8) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
1718
> * {
1819
overflow-wrap: break-word;
1920
margin: 0;
@@ -32,8 +33,8 @@ const BottomShade = styled.div`
3233
background-color: ${({ theme }) => theme.lightBlue};
3334
display: flex;
3435
align-items: center;
35-
gap: 8px;
36-
padding: 8px;
36+
gap: 16px;
37+
padding: 12px calc(8px + (24 - 8) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
3738
> * {
3839
flex-basis: 1;
3940
flex-shrink: 0;
@@ -42,15 +43,62 @@ const BottomShade = styled.div`
4243
`;
4344

4445
const StyledA = styled.a`
46+
display: flex;
4547
margin-left: auto;
46-
margin-right: 8px;
48+
gap: calc(5px + (6 - 5) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
49+
50+
${landscapeStyle(
51+
() => css`
52+
> svg {
53+
width: 16px;
54+
fill: ${({ theme }) => theme.primaryBlue};
55+
}
56+
`
57+
)}
58+
`;
59+
60+
const AccountContainer = styled.div`
4761
display: flex;
48-
> svg {
49-
width: 16px;
50-
fill: ${({ theme }) => theme.primaryBlue};
62+
flex-direction: row;
63+
gap: 8px;
64+
align-items: center;
65+
66+
canvas {
67+
width: 24px;
68+
height: 24px;
69+
}
70+
71+
> * {
72+
flex-basis: 1;
73+
flex-shrink: 0;
74+
margin: 0;
5175
}
5276
`;
5377

78+
const DesktopText = styled.span`
79+
display: none;
80+
${landscapeStyle(
81+
() => css`
82+
display: inline;
83+
`
84+
)}
85+
`;
86+
87+
const MobileText = styled.span`
88+
${landscapeStyle(
89+
() => css`
90+
display: none;
91+
`
92+
)}
93+
`;
94+
95+
const AttachedFileText: React.FC = () => (
96+
<>
97+
<DesktopText>View attached file</DesktopText>
98+
<MobileText>File</MobileText>
99+
</>
100+
);
101+
54102
interface IEvidenceCard {
55103
evidence: string;
56104
sender: string;
@@ -73,11 +121,14 @@ const EvidenceCard: React.FC<IEvidenceCard> = ({ evidence, sender, index }) => {
73121
)}
74122
</TextContainer>
75123
<BottomShade>
76-
<Identicon size="24" string={sender} />
77-
<p>{shortenAddress(sender)}</p>
124+
<AccountContainer>
125+
<Identicon size="24" string={sender} />
126+
<p>{shortenAddress(sender)}</p>
127+
</AccountContainer>
78128
{data && typeof data.fileURI !== "undefined" && (
79129
<StyledA href={`${IPFS_GATEWAY}${data.fileURI}`} target="_blank" rel="noreferrer">
80130
<AttachmentIcon />
131+
<AttachedFileText />
81132
</StyledA>
82133
)}
83134
</BottomShade>

0 commit comments

Comments
 (0)