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): style my courts (in dashboard) for desktop version #1305

Merged
merged 33 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
13aa860
feat(web): add debug info to desktop version in help component
kemuru Oct 27, 2023
9b8a25a
feat(web): set some structure basis for the desktop my courts section
kemuru Oct 29, 2023
bea87be
fix(web): some gap between court name and stake data
kemuru Oct 30, 2023
3aeedd5
Merge branch 'dev' into feat(web)/mobile-version-my-courts-dashboard
jaybuidl Oct 30, 2023
1e917ed
Merge branch 'dev' into feat(web)/mobile-version-my-courts-dashboard
kemuru Oct 31, 2023
873399d
feat(web): add how it works miniguide to dashboard, style header for …
kemuru Oct 31, 2023
aefcc48
feat(web): hide share juror score button if you have 0 cases
kemuru Oct 31, 2023
be3968b
fix(web): correction on topjurors styling
kemuru Oct 31, 2023
1751626
feat(web): slight adjustment topjurors mobile component
kemuru Oct 31, 2023
7a7eef6
feat(web): create new query for juror stakes, change whole structure …
kemuru Oct 31, 2023
aec9451
feat(web): add skeleton to evidencecard and empty evidence message
kemuru Oct 31, 2023
a5f70c0
fix(web): modularization of components, mobilecard, desktopcard, styl…
kemuru Oct 31, 2023
176bf73
feat(web): styling for mobile, code optimizations
kemuru Nov 1, 2023
255f03d
chore(web): code smell
kemuru Nov 1, 2023
d164898
fix(web): style adjustment in stake and lockedstake components
kemuru Nov 1, 2023
4543d99
feat(web): add onboarding mini guides, link it to help component, abs…
kemuru Nov 2, 2023
0d48369
fix(web): padding adjustment in mobile
kemuru Nov 2, 2023
dd450c2
fix(web): style onboarding guides for both dark and light mode
kemuru Nov 2, 2023
de8a73e
feat(web): add staking mini guides, howitworks component abstraction,…
kemuru Nov 2, 2023
0d340ba
feat(web): add appeal mini guides, link it to appeal tab
kemuru Nov 3, 2023
09b1a14
chore(web): code abstractions, refactors
kemuru Nov 3, 2023
dbe008d
chore(web): more abstractions
kemuru Nov 3, 2023
7bfbe00
feat(web): create ranked voting and binary voting miniguides
kemuru Nov 3, 2023
d0d1087
feat(web): link all the miniguides to onboarding miniguide, create me…
kemuru Nov 3, 2023
1ab08e2
feat(web): hide onboarding miniguide if subminiguide is open
kemuru Nov 3, 2023
2a42fc7
chore(web): abstract more code
kemuru Nov 3, 2023
abc0ac5
fix(web): add isonboarding variable to pagecontentstemplate
kemuru Nov 3, 2023
2e9b91d
chore(web): remove duplicated svgs for each theme, pass colors as par…
kemuru Nov 4, 2023
9e13596
chore(web): abstract styledimage, small style change
kemuru Nov 4, 2023
b6ef17b
chore(web): simplify pnklogo into one styled component and one svg
kemuru Nov 4, 2023
b9d1f53
chore(web): modals width adjustment on mobile
kemuru Nov 4, 2023
97d263d
feat(web): style cases page, courts page
kemuru Nov 7, 2023
25c969b
chore(web): move dropdown to the left, searchbar to the right
kemuru Nov 7, 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
10 changes: 10 additions & 0 deletions web/src/assets/svgs/mini-guides/appeal/crowdfund-appeal.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: 45 additions & 0 deletions web/src/assets/svgs/mini-guides/appeal/payoff-simulator.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions web/src/assets/svgs/mini-guides/appeal/stage-one.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions web/src/assets/svgs/mini-guides/appeal/stage-two.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions web/src/assets/svgs/mini-guides/binary-voting/voting-module.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions web/src/assets/svgs/mini-guides/onboarding/how-it-works.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
81 changes: 81 additions & 0 deletions web/src/assets/svgs/mini-guides/onboarding/what-do-i-need.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions web/src/assets/svgs/mini-guides/ranked-voting/voting-module.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
107 changes: 107 additions & 0 deletions web/src/assets/svgs/mini-guides/staking/court-header.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 72 additions & 0 deletions web/src/assets/svgs/mini-guides/staking/juror-rewards.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions web/src/assets/svgs/mini-guides/staking/notifications.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions web/src/assets/svgs/mini-guides/staking/staking-section.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: 5 additions & 5 deletions web/src/assets/svgs/styled/pnk.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 27 additions & 11 deletions web/src/components/CasesDisplay/Search.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,30 @@
import React, { useMemo, useState } from "react";
import styled, { css } from "styled-components";
import { landscapeStyle } from "styles/landscapeStyle";
import { useNavigate, useParams } from "react-router-dom";
import { useDebounce } from "react-use";
import styled from "styled-components";
import Skeleton from "react-loading-skeleton";
import { Searchbar, DropdownCascader } from "@kleros/ui-components-library";
import { rootCourtToItems, useCourtTree } from "queries/useCourtTree";
import { isUndefined } from "utils/index";
import { decodeURIFilter, encodeURIFilter, useRootPath } from "utils/uri";

const Container = styled.div`
display: flex;
flex-direction: column;
gap: 4px;

${landscapeStyle(
() =>
css`
flex-direction: row;
gap: calc(4px + (22 - 4) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
`
)}
`;

const SearchBarContainer = styled.div`
width: 100%;
display: flex;
flex-wrap: wrap;
gap: 8px;
Expand Down Expand Up @@ -54,15 +70,7 @@ const Search: React.FC = () => {
}, [courtTreeData]);

return (
<div>
<Container>
<StyledSearchbar
type="text"
placeholder="Search By ID"
value={search}
onChange={(e) => setSearch(e.target.value)}
/>
</Container>
<Container>
{items ? (
<DropdownCascader
items={items}
Expand All @@ -76,7 +84,15 @@ const Search: React.FC = () => {
) : (
<Skeleton width={240} height={42} />
)}
</div>
<SearchBarContainer>
<StyledSearchbar
type="text"
placeholder="Search By ID"
value={search}
onChange={(e) => setSearch(e.target.value)}
/>
</SearchBarContainer>
</Container>
);
};

Expand Down
10 changes: 7 additions & 3 deletions web/src/components/CasesDisplay/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ const FieldWrapper = styled.div`
`;

const SeparatorLabel = styled.label`
margin-left: 8px;
margin-right: 8px;
margin: 0 8px;
color: ${({ theme }) => theme.primaryText};
`;

const StyledLabel = styled.label`
color: ${({ theme }) => theme.primaryText};
`;

const Field: React.FC<{ label: string; value: string }> = ({ label, value }) => (
<FieldWrapper>
<label>{label}</label>
<StyledLabel>{label}</StyledLabel>
<small>{value}</small>
</FieldWrapper>
);
Expand Down
3 changes: 2 additions & 1 deletion web/src/components/CasesDisplay/StatsAndFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ const Container = styled.div`
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 8px;
margin-top: 11px;
justify-content: space-between;
`;

const StatsAndFilters: React.FC<IStats> = ({ totalDisputes, closedDisputes }) => (
Expand Down
17 changes: 12 additions & 5 deletions web/src/components/CasesDisplay/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@ import Search from "./Search";
import StatsAndFilters from "./StatsAndFilters";
import CasesGrid, { ICasesGrid } from "./CasesGrid";

const StyledHR = styled.hr`
margin-top: 24px;
margin-bottom: 24px;
const Divider = styled.hr`
display: flex;
border: none;
height: 1px;
background-color: ${({ theme }) => theme.stroke};
margin: calc(20px + (24 - 20) * (min(max(100vw, 375px), 1250px) - 375px) / 875) 0;
`;

const StyledTitle = styled.h1`
margin-bottom: calc(16px + (48 - 16) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
`;

interface ICasesDisplay extends ICasesGrid {
Expand All @@ -29,10 +36,10 @@ const CasesDisplay: React.FC<ICasesDisplay> = ({
}) => {
return (
<div {...{ className }}>
<h1>{title}</h1>
<StyledTitle>{title}</StyledTitle>
<Search />
<StatsAndFilters totalDisputes={numberDisputes ?? 0} closedDisputes={numberClosedDisputes ?? 0} />
<StyledHR />
<Divider />

{disputes?.length === 0 ? (
<h1>No cases found</h1>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
import React from "react";
import styled from "styled-components";
import { useToggle } from "react-use";
import BookOpenIcon from "tsx:assets/svgs/icons/book-open.svg";
import Level from "components/Popup/MiniGuides/Level";

const Container = styled.div`
display: flex;
align-items: center;
gap: 8px;
color: ${({ theme }) => theme.primaryBlue};

&,
& * {
cursor: pointer;
}

&:hover {
text-decoration: underline;
}

svg {
path {
fill: ${({ theme }) => theme.primaryBlue};
Expand All @@ -25,15 +28,20 @@ const StyledLabel = styled.label`
color: ${({ theme }) => theme.primaryBlue};
`;

const HowItWorks: React.FC = () => {
const [isLevelMiniGuidesOpen, toggleIsLevelMiniGuidesOpen] = useToggle(false);
interface IHowItWorks {
isMiniGuideOpen: boolean;
toggleMiniGuide: () => void;
MiniGuideComponent: React.ComponentType<{ toggleMiniGuide: () => void }>;
}

const HowItWorks: React.FC<IHowItWorks> = ({ isMiniGuideOpen, toggleMiniGuide, MiniGuideComponent }) => {
return (
<>
<Container onClick={() => toggleIsLevelMiniGuidesOpen()}>
<Container onClick={toggleMiniGuide}>
<BookOpenIcon />
<StyledLabel> How it works </StyledLabel>
</Container>
{isLevelMiniGuidesOpen && <Level {...{ toggleIsLevelMiniGuidesOpen }} />}
{isMiniGuideOpen && <MiniGuideComponent toggleMiniGuide={toggleMiniGuide} />}
</>
);
};
Expand Down
38 changes: 38 additions & 0 deletions web/src/components/Popup/MiniGuides/Appeal/CrowdfundAppeal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from "react";
import styled from "styled-components";
import CrowdfundAppealSvg from "tsx:assets/svgs/mini-guides/appeal/crowdfund-appeal.svg";
import { StyledImage } from "../PageContentsTemplate";

const StyledCrowdfundAppealSvg = styled(CrowdfundAppealSvg)`
[class$="rect-bg"] {
fill: ${({ theme }) => theme.whiteBackground};
stroke: ${({ theme }) => theme.stroke};
}

[class$="path-1"],
[class$="path-2"],
[class$="path-3"] {
fill: ${({ theme }) => theme.primaryText};
}

[class$="rect-fg"] {
fill: ${({ theme }) => theme.whiteBackground};
stroke: ${({ theme }) => theme.stroke};
}

[class$="rect-accent"] {
fill: ${({ theme }) => theme.primaryBlue};
}

[class$="path-4"] {
fill: ${({ theme }) => theme.whiteBackground};
}

[class$="path-5"] {
fill: ${({ theme }) => theme.secondaryText};
}
`;

const CrowdfundAppeal: React.FC = () => <StyledImage as={StyledCrowdfundAppealSvg} />;

export default CrowdfundAppeal;
77 changes: 77 additions & 0 deletions web/src/components/Popup/MiniGuides/Appeal/PayoffSimulator.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
import React from "react";
import styled from "styled-components";
import PayoffSimulatorSvg from "tsx:assets/svgs/mini-guides/appeal/payoff-simulator.svg";
import { StyledImage } from "../PageContentsTemplate";

const StyledPayoffSimulatorSvg = styled(PayoffSimulatorSvg)`
[class$="circle-1"] {
fill: ${({ theme }) => theme.successLight};
}

[class$="rect-2"] {
fill: ${({ theme }) => theme.mediumBlue};
}

[class$="circle-2"] {
fill: ${({ theme }) => theme.mediumPurple};
}

[class$="rect-1"],
[class$="rect-5"] {
fill: ${({ theme }) => theme.whiteBackground};
stroke: ${({ theme }) => theme.stroke};
}

[class$="rect-6"],
[class$="rect-7"],
[class$="rect-8"] {
fill: ${({ theme }) => theme.white};
}

[class$="path-2"] {
fill: ${({ theme }) => theme.success};
}

[class$="path-3"],
[class$="path-16"] {
fill: ${({ theme }) => theme.secondaryPurple};
}

[class$="path-11"],
[class$="path-13"] {
fill: ${({ theme }) => theme.whiteBackground};
}

[class$="path-4"],
[class$="path-5"],
[class$="path-6"],
[class$="path-7"],
[class$="path-8"],
[class$="path-9"],
[class$="path-10"],
[class$="path-12"],
[class$="path-14"],
[class$="path-15"],
[class$="path-17"] {
fill: ${({ theme }) => theme.primaryText};
}

[class$="rect-3"],
[class$="rect-4"] {
fill: ${({ theme }) => theme.primaryBlue};
}

[class$="line-1"],
[class$="line-2"],
[class$="path-1"] {
stroke: ${({ theme }) => theme.mediumBlue};
}

[class$="path-1"] {
fill: ${({ theme }) => theme.lightBlue};
}
`;

const PayoffSimulator: React.FC = () => <StyledImage as={StyledPayoffSimulatorSvg} />;

export default PayoffSimulator;
74 changes: 74 additions & 0 deletions web/src/components/Popup/MiniGuides/Appeal/StageOne.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import React from "react";
import styled from "styled-components";
import StageOneSvg from "tsx:assets/svgs/mini-guides/appeal/stage-one.svg";
import { StyledImage } from "../PageContentsTemplate";

const StyledStageOneSvg = styled(StageOneSvg)`
[class$="rect-1"],
[class$="rect-2"],
[class$="rect-6"],
[class$="circle-1"],
[class$="circle-2"] {
fill: ${({ theme }) => theme.whiteBackground};
}

[class$="rect-4"],
[class$="rect-8"] {
fill: ${({ theme }) => theme.stroke};
}

[class$="rect-5"],
[class$="path-9"],
[class$="path-10"] {
fill: ${({ theme }) => theme.secondaryPurple};
}

[class$="rect-9"],
[class$="circle-3"] {
fill: ${({ theme }) => theme.primaryBlue};
}

[class$="rect-10"] {
fill: ${({ theme }) => theme.lightBlue};
stroke: ${({ theme }) => theme.mediumBlue};
}

[class$="rect-11"],
[class$="rect-12"] {
fill: ${({ theme }) => theme.white};
}

[class$="path-2"],
[class$="path-6"] {
fill: ${({ theme }) => theme.primaryText};
}

[class$="path-1"],
[class$="path-5"] {
fill: ${({ theme }) => theme.secondaryText};
}

[class$="path-3"],
[class$="path-4"] {
fill: ${({ theme }) => theme.success};
}

[class$="path-7"],
[class$="path-8"] {
fill: ${({ theme }) => theme.warning};
}

[class$="rect-3"],
[class$="rect-7"],
[class$="circle-1"] {
stroke: ${({ theme }) => theme.stroke};
}

[class$="circle-2"] {
stroke: ${({ theme }) => theme.primaryBlue};
}
`;

const StageOne: React.FC = () => <StyledImage as={StyledStageOneSvg} />;

export default StageOne;
Loading