Skip to content

Commit f23a29d

Browse files
committed
fix: abstract divider, few style issues
1 parent 0cba9be commit f23a29d

File tree

10 files changed

+35
-56
lines changed

10 files changed

+35
-56
lines changed

web/src/components/DisputePreview/DisputeContext.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import ReactMarkdown from "components/ReactMarkdown";
1313
import { StyledSkeleton } from "components/StyledSkeleton";
1414

1515
import AliasDisplay from "./Alias";
16+
import { Divider } from "../Divider";
1617

1718
const StyledH1 = styled.h1`
1819
margin: 0;
@@ -60,14 +61,6 @@ const AliasesContainer = styled.div`
6061
gap: ${responsiveSize(8, 20)};
6162
`;
6263

63-
const Divider = styled.hr`
64-
width: 100%;
65-
display: flex;
66-
border: none;
67-
height: 1px;
68-
background-color: ${({ theme }) => theme.stroke};
69-
margin: 0;
70-
`;
7164
interface IDisputeContext {
7265
disputeDetails?: DisputeDetails;
7366
isRpcError?: boolean;

web/src/components/Divider.tsx

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import styled from "styled-components";
2+
3+
export const Divider = styled.hr`
4+
display: flex;
5+
width: 100%;
6+
border: none;
7+
height: 1px;
8+
background-color: ${({ theme }) => theme.stroke};
9+
margin: 0;
10+
`;

web/src/components/Popup/Description/SwapSuccess.tsx

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import PnkIcon from "svgs/tokens/pnk.svg";
77
import { responsiveSize } from "styles/responsiveSize";
88

99
import LightButton from "components/LightButton";
10+
import { Divider } from "components/Divider";
1011
import { Token } from "pages/GetPnk/Swap/TokenSelect";
1112

1213
const Container = styled.div`
@@ -50,14 +51,10 @@ const StyledButton = styled(LightButton)`
5051
padding-top: 0px;
5152
`;
5253

53-
const Divider = styled.hr`
54-
width: 100%;
55-
display: flex;
56-
border: none;
57-
height: 1px;
58-
background-color: ${({ theme }) => theme.stroke};
54+
const StyledDivider = styled(Divider)`
5955
margin: ${responsiveSize(32, 64)} 0px 0px;
6056
`;
57+
6158
interface ISwapSuccess {
6259
hash: string;
6360
amount: string;
@@ -83,7 +80,7 @@ const SwapSuccess: React.FC<ISwapSuccess> = ({ hash, amount, isClaim, from, to }
8380
Bridge from &nbsp;<small>Ethereum</small>&nbsp; to &nbsp;<small>Arbitrum</small>
8481
</Subtitle>
8582
)}
86-
<Divider />
83+
<StyledDivider />
8784
<StyledButton
8885
onClick={() => window.open(baseUrl, "_blank", "rel=noopener noreferrer")}
8986
text={"View transaction on Etherscan"}

web/src/components/Verdict/FinalDecision.tsx

+3-6
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import LightButton from "../LightButton";
2323

2424
import AnswerDisplay from "./Answer";
2525
import VerdictBanner from "./VerdictBanner";
26+
import { Divider } from "../Divider";
2627

2728
const Container = styled.div`
2829
width: 100%;
@@ -54,11 +55,7 @@ const StyledButton = styled(LightButton)`
5455
padding-top: 0px;
5556
`;
5657

57-
const Divider = styled.hr`
58-
display: flex;
59-
border: none;
60-
height: 1px;
61-
background-color: ${({ theme }) => theme.stroke};
58+
const StyledDivider = styled(Divider)`
6259
margin: ${responsiveSize(16, 32)} 0px;
6360
`;
6461

@@ -107,7 +104,7 @@ const FinalDecision: React.FC<IFinalDecision> = ({ arbitrable }) => {
107104
<AnswerDisplay {...{ answer, currentRuling }} />
108105
</JuryContainer>
109106
)}
110-
<Divider />
107+
<StyledDivider />
111108
{isLoading && !isDisconnected ? (
112109
<Skeleton width={250} height={20} />
113110
) : (

web/src/pages/Cases/CaseDetails/Overview/index.tsx

+1-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { DisputeContext } from "components/DisputePreview/DisputeContext";
1717
import { Policies } from "components/DisputePreview/Policies";
1818
import DisputeInfo from "components/DisputeView/DisputeInfo";
1919
import Verdict from "components/Verdict/index";
20+
import { Divider } from "components/Divider";
2021

2122
const Container = styled.div`
2223
width: 100%;
@@ -27,15 +28,6 @@ const Container = styled.div`
2728
padding: ${responsiveSize(16, 32)};
2829
`;
2930

30-
const Divider = styled.hr`
31-
width: 100%;
32-
display: flex;
33-
border: none;
34-
height: 1px;
35-
background-color: ${({ theme }) => theme.stroke};
36-
margin: 0;
37-
`;
38-
3931
interface IOverview {
4032
arbitrable?: `0x${string}`;
4133
courtID?: string;

web/src/pages/Courts/CourtDetails/Info.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ const Container = styled.div`
66
display: flex;
77
align-items: flex-start;
88
gap: 8px;
9-
padding-top: 4px;
109
`;
1110

1211
const StyledSpan = styled.span`

web/src/pages/Courts/CourtDetails/StakePanel/SimulatorPopup/index.tsx

+11-7
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import Header from "./Header";
2727
import QuantityToSimulate from "./QuantityToSimulate";
2828
import Info from "../../Info";
2929
import WithHelpTooltip from "components/WithHelpTooltip";
30+
import { Divider } from "components/Divider";
3031

3132
const Container = styled.div`
3233
display: flex;
@@ -62,10 +63,7 @@ const IconWrapper = styled.div`
6263
}
6364
`;
6465

65-
const Divider = styled.hr`
66-
display: flex;
67-
border: none;
68-
height: 1px;
66+
const StyledDivider = styled(Divider)`
6967
background-color: ${({ theme }) => theme.mediumBlue};
7068
margin: 12px 0 8px 0;
7169
`;
@@ -108,6 +106,10 @@ const StyledArrowRightIcon = styled(ArrowRightIcon)<{ isStaking: boolean }>`
108106
fill: ${({ theme, isStaking }) => (isStaking ? theme.success : theme.warning)};
109107
`;
110108

109+
const InfoContainer = styled.div`
110+
padding-top: 4px;
111+
`;
112+
111113
function beautifyStatNumber(value: number): string {
112114
const absValue = Math.abs(value);
113115

@@ -268,7 +270,7 @@ const SimulatorPopup: React.FC<ISimulatorPopup> = ({ amountToStake, isStaking })
268270
return (
269271
<Container>
270272
<Header />
271-
<Divider />
273+
<StyledDivider />
272274
<QuantityToSimulate {...{ jurorCurrentEffectiveStake, jurorCurrentSpecificStake, isStaking, amountToStake }} />
273275
<ItemsContainer>
274276
{simulatorItems.map((item, index) => (
@@ -298,8 +300,10 @@ const SimulatorPopup: React.FC<ISimulatorPopup> = ({ amountToStake, isStaking })
298300
</SimulatorItem>
299301
))}
300302
</ItemsContainer>
301-
<Divider />
302-
<Info />
303+
<StyledDivider />
304+
<InfoContainer>
305+
<Info />
306+
</InfoContainer>
303307
</Container>
304308
);
305309
};

web/src/pages/Courts/CourtDetails/Stats.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,12 @@ const StyledAccordion = styled(Accordion)`
4141
justify-content: unset;
4242
background-color: ${({ theme }) => theme.whiteBackground} !important;
4343
border: 1px solid ${({ theme }) => theme.stroke} !important;
44-
color: ${({ theme }) => theme.primaryText} !important;
4544
> svg {
4645
fill: ${({ theme }) => theme.primaryText} !important;
4746
}
47+
> p {
48+
color: ${({ theme }) => theme.primaryText};
49+
}
4850
}
4951
//adds padding to body container
5052
> * > div > div {

web/src/pages/Courts/CourtDetails/index.tsx

+1-8
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import HowItWorks from "components/HowItWorks";
2020
import LatestCases from "components/LatestCases";
2121
import Staking from "components/Popup/MiniGuides/Staking";
2222
import { StyledSkeleton } from "components/StyledSkeleton";
23+
import { Divider } from "components/Divider";
2324

2425
import Description from "./Description";
2526
import StakePanel from "./StakePanel";
@@ -77,14 +78,6 @@ const StyledBreadcrumb = styled(Breadcrumb)`
7778
}
7879
`;
7980

80-
const Divider = styled.hr`
81-
width: 100%;
82-
border: none;
83-
height: 1px;
84-
background-color: ${({ theme }) => theme.stroke};
85-
margin: 0;
86-
`;
87-
8881
const CourtDetails: React.FC = () => {
8982
const { id } = useParams();
9083
const { data: policy } = useCourtPolicy(id);

web/src/pages/Resolver/Preview/index.tsx

+1-9
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { responsiveSize } from "styles/responsiveSize";
1313
import { DisputeContext } from "components/DisputePreview/DisputeContext";
1414
import { Policies } from "components/DisputePreview/Policies";
1515
import DisputeInfo from "components/DisputeView/DisputeInfo";
16+
import { Divider } from "components/Divider";
1617

1718
import NavigationButtons from "../NavigationButtons";
1819

@@ -39,15 +40,6 @@ const PreviewContainer = styled.div`
3940
padding: ${responsiveSize(16, 32)};
4041
`;
4142

42-
const Divider = styled.hr`
43-
width: 100%;
44-
display: flex;
45-
border: none;
46-
height: 1px;
47-
background-color: ${({ theme }) => theme.stroke};
48-
margin: 0;
49-
`;
50-
5143
const Header = styled.h2`
5244
margin-bottom: 32px;
5345
width: 84vw;

0 commit comments

Comments
 (0)