Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(web): desktop responsiveness navbar, footer, community section, dashboard juror info, home page.. #1211

Merged
merged 29 commits into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
72d64dd
feat(web): navbar and footer for desktop
kemuru Sep 2, 2023
7968527
fix(web): merge conflicts and fix new bugs
kemuru Sep 2, 2023
9db8b0f
fix(web): better code structure, optimizations, community section, po…
kemuru Sep 2, 2023
d133b69
Merge branch 'dev' into feat(web)/desktop-navbar-and-responsiveness
kemuru Sep 2, 2023
0b69de6
fix: some layout adjustments
nhestrompia Sep 2, 2023
26e761b
fix(web): dont display chain on tablet
kemuru Sep 3, 2023
b810481
fix(web): css top property adjustment on navbar popups
kemuru Sep 3, 2023
d0612bc
fix(web): dashboard juror info desktop responsive
kemuru Sep 4, 2023
fbe85a3
Merge branch 'dev' into feat(web)/desktop-navbar-and-responsiveness
kemuru Sep 4, 2023
8cc0eb0
fix(web): make dashboard look less spacew on desktop
kemuru Sep 4, 2023
4a4e402
fix(web): accurate paddings and distances between components in desktop
kemuru Sep 4, 2023
36c736b
fix(web): show some separator in case of not being staked anywhere
kemuru Sep 4, 2023
758807d
fix(web): community section more tablet responsive
kemuru Sep 5, 2023
1700914
fix(web): bug in desktop view community section
kemuru Sep 5, 2023
61bae81
fix(web): stats paddings adjustments for desktop
kemuru Sep 6, 2023
6fd16e8
refactor(web): use different hook for window size
kemuru Sep 7, 2023
06eb085
feat(web): multiple changes to css across all frontend
kemuru Sep 9, 2023
d628e21
refactor(web): make website mobile first, landscape, portrait later, …
kemuru Sep 11, 2023
6d76597
fix(web): font-weight of wallet address and margin top on Navbar
kemuru Sep 11, 2023
f708cfe
fix(web): center vertically middle side component of desktop header
kemuru Sep 11, 2023
d05f196
fix(web): weird min-height property causing problems
kemuru Sep 11, 2023
d7c876c
refactor(web): remove classname syntax for boolean in styled components
kemuru Sep 11, 2023
92f09ad
refactor(web): remove header link classname
alcercu Sep 12, 2023
2407264
Merge branch 'dev' into feat(web)/desktop-navbar-and-responsiveness
alcercu Sep 12, 2023
bca7542
fix(web): useToggle instead of useState to avoid re-renders
alcercu Sep 12, 2023
505d322
Merge branch 'feat(web)/desktop-navbar-and-responsiveness' of github.…
alcercu Sep 12, 2023
0a7e5ce
fix(web): memoize mobile header context to improve performance
alcercu Sep 12, 2023
00fb81b
fix(web): weird lines beloe hero svgs fix
kemuru Sep 14, 2023
463722a
fix: merge conflicts, fix scrolling bugs, overlay component bugs
kemuru Sep 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions web/src/assets/svgs/icons/vea.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 0 additions & 10 deletions web/src/assets/svgs/socialmedia/twitter.svg

This file was deleted.

3 changes: 3 additions & 0 deletions web/src/assets/svgs/socialmedia/x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 41 additions & 4 deletions web/src/components/ConnectWallet/AccountDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
import React from "react";
import styled from "styled-components";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import { useAccount, useNetwork, useEnsAvatar, useEnsName } from "wagmi";
import Identicon from "react-identicons";
import { shortenAddress } from "utils/shortenAddress";

const Container = styled.div`
display: flex;
flex-direction: column;
justify-content: space-between;
height: auto;
align-items: flex-start;
gap: 8px;
align-items: center;
background-color: ${({ theme }) => theme.whiteBackground};
padding: 0px;

${landscapeStyle(
() => css`
background-color: ${({ theme }) => theme.whiteLowOpacity};
flex-direction: row;
align-content: center;
border-radius: 300px;
gap: 0px;
padding: 0 12px;
`
)}
`;

const AccountContainer = styled.div`
Expand All @@ -17,22 +34,36 @@ const AccountContainer = styled.div`
align-items: center;
width: fit-content;
gap: 8px;

> label {
color: ${({ theme }) => theme.primaryText};
font-size: 16px;
font-weight: 600;
}

${landscapeStyle(
() => css`
gap: 12px;
> label {
color: ${({ theme }) => theme.primaryText};
font-weight: 400;
font-size: 14px;
}
`
)}
`;
const ChainConnectionContainer = styled.div`
display: flex;
width: fit-content;
min-height: 32px;
display: flex;
align-items: center;
padding-left: 0px;
> label {
color: ${({ theme }) => theme.success};
font-size: 16px;
margin-right: 4px;

font-weight: 500;
}

:before {
content: "";
width: 8px;
Expand All @@ -41,6 +72,12 @@ const ChainConnectionContainer = styled.div`
border-radius: 50%;
background-color: ${({ theme }) => theme.success};
}

${landscapeStyle(
() => css`
display: none;
`
)}
`;

const StyledIdenticon = styled(Identicon)<{ size: `${number}` }>`
Expand Down
18 changes: 1 addition & 17 deletions web/src/components/ConnectWallet/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import React from "react";
import styled from "styled-components";
import { useAccount, useNetwork, useSwitchNetwork } from "wagmi";
import { useWeb3Modal } from "@web3modal/react";
import { Button } from "@kleros/ui-components-library";
import { SUPPORTED_CHAINS, DEFAULT_CHAIN } from "consts/chains";
import AccountDisplay from "./AccountDisplay";
import { DisconnectWalletButton } from "layout/Header/navbar/Menu/Settings/General";

const Container = styled.div`
display: flex;
gap: 16px;
justify-content: space-between;
flex-wrap: wrap;
align-items: center;
`;

export const SwitchChainButton: React.FC = () => {
const { switchNetwork, isLoading } = useSwitchNetwork();
Expand Down Expand Up @@ -49,13 +39,7 @@ const ConnectWallet: React.FC = () => {
if (isConnected) {
if (chain && chain.id !== DEFAULT_CHAIN) {
return <SwitchChainButton />;
} else
return (
<Container>
<AccountDisplay />
<DisconnectWalletButton />
</Container>
);
} else return <AccountDisplay />;
} else return <ConnectButton />;
};

Expand Down
71 changes: 61 additions & 10 deletions web/src/components/EvidenceCard.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from "react";
import styled from "styled-components";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import Identicon from "react-identicons";
import { Card } from "@kleros/ui-components-library";
import AttachmentIcon from "svgs/icons/attachment.svg";
Expand All @@ -13,7 +14,7 @@ const StyledCard = styled(Card)`
`;

const TextContainer = styled.div`
padding: 8px;
padding: calc(8px + (24 - 8) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
> * {
overflow-wrap: break-word;
margin: 0;
Expand All @@ -32,8 +33,8 @@ const BottomShade = styled.div`
background-color: ${({ theme }) => theme.lightBlue};
display: flex;
align-items: center;
gap: 8px;
padding: 8px;
gap: 16px;
padding: 12px calc(8px + (24 - 8) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
> * {
flex-basis: 1;
flex-shrink: 0;
Expand All @@ -42,15 +43,62 @@ const BottomShade = styled.div`
`;

const StyledA = styled.a`
display: flex;
margin-left: auto;
margin-right: 8px;
gap: calc(5px + (6 - 5) * (min(max(100vw, 375px), 1250px) - 375px) / 875);

${landscapeStyle(
() => css`
> svg {
width: 16px;
fill: ${({ theme }) => theme.primaryBlue};
}
`
)}
`;

const AccountContainer = styled.div`
display: flex;
> svg {
width: 16px;
fill: ${({ theme }) => theme.primaryBlue};
flex-direction: row;
gap: 8px;
align-items: center;

canvas {
width: 24px;
height: 24px;
}

> * {
flex-basis: 1;
flex-shrink: 0;
margin: 0;
}
`;

const DesktopText = styled.span`
display: none;
${landscapeStyle(
() => css`
display: inline;
`
)}
`;

const MobileText = styled.span`
${landscapeStyle(
() => css`
display: none;
`
)}
`;

const AttachedFileText: React.FC = () => (
<>
<DesktopText>View attached file</DesktopText>
<MobileText>File</MobileText>
</>
);

interface IEvidenceCard {
evidence: string;
sender: string;
Expand All @@ -73,11 +121,14 @@ const EvidenceCard: React.FC<IEvidenceCard> = ({ evidence, sender, index }) => {
)}
</TextContainer>
<BottomShade>
<Identicon size="24" string={sender} />
<p>{shortenAddress(sender)}</p>
<AccountContainer>
<Identicon size="24" string={sender} />
<p>{shortenAddress(sender)}</p>
</AccountContainer>
{data && typeof data.fileURI !== "undefined" && (
<StyledA href={`${IPFS_GATEWAY}${data.fileURI}`} target="_blank" rel="noreferrer">
<AttachmentIcon />
<AttachedFileText />
</StyledA>
)}
</BottomShade>
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export const Overlay = styled.div`
width: 100vw;
height: 100vh;
background-color: ${({ theme }) => theme.blackLowOpacity};
z-index: 0;
z-index: 1;
`;
11 changes: 10 additions & 1 deletion web/src/components/Popup/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useRef } from "react";
import styled from "styled-components";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import { Button } from "@kleros/ui-components-library";
import { Overlay } from "components/Overlay";
import StakeWithdraw from "./Description/StakeWithdraw";
Expand Down Expand Up @@ -44,6 +45,8 @@ const Container = styled.div`
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-height: 80vh;
overflow-y: auto;

z-index: 10;
flex-direction: column;
Expand All @@ -59,6 +62,12 @@ const Container = styled.div`
svg {
visibility: visible;
}

${landscapeStyle(
() => css`
overflow-y: hidden;
`
)}
`;

const VoteDescriptionContainer = styled.div`
Expand Down
10 changes: 9 additions & 1 deletion web/src/components/StatDisplay.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import React from "react";
import styled, { useTheme } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import styled, { useTheme, css } from "styled-components";

const Container = styled.div`
display: flex;
max-width: 196px;
align-items: center;
gap: 8px;

${landscapeStyle(
() => css`
margin-bottom: calc(16px + (30 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
`
)}
`;

const SVGContainer = styled.div<{ iconColor: string; backgroundColor: string }>`
Expand Down
6 changes: 2 additions & 4 deletions web/src/components/Verdict/DisputeTimeline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@ const Container = styled.div`
display: flex;
position: relative;
margin-left: 8px;
flex-direction: column;
`;

const StyledTimeline = styled(CustomTimeline)`
width: 100%;
margin-bottom: 32px;
`;

const EnforcementContainer = styled.div`
position: absolute;
bottom: 0;
display: flex;
gap: 8px;
margin-bottom: 8px;
margin-top: calc(12px + (24 - 12) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
fill: ${({ theme }) => theme.secondaryText};

small {
Expand Down
Loading