Skip to content

Commit 9e13596

Browse files
committed
chore(web): abstract styledimage, small style change
1 parent 2e9b91d commit 9e13596

File tree

14 files changed

+40
-49
lines changed

14 files changed

+40
-49
lines changed

web/src/components/Popup/MiniGuides/Appeal/CrowdfundAppeal.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import CrowdfundAppealSvg from "tsx:assets/svgs/mini-guides/appeal/crowdfund-appeal.svg";
4-
import ImageRenderer from "../ImageRenderer";
4+
import { StyledImage } from "../PageContentsTemplate";
55

66
const StyledCrowdfundAppealSvg = styled(CrowdfundAppealSvg)`
77
[class$="rect-bg"] {
@@ -33,6 +33,6 @@ const StyledCrowdfundAppealSvg = styled(CrowdfundAppealSvg)`
3333
}
3434
`;
3535

36-
const CrowdfundAppeal: React.FC = () => <ImageRenderer image={StyledCrowdfundAppealSvg} />;
36+
const CrowdfundAppeal: React.FC = () => <StyledImage as={StyledCrowdfundAppealSvg} />;
3737

3838
export default CrowdfundAppeal;

web/src/components/Popup/MiniGuides/Appeal/PayoffSimulator.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import PayoffSimulatorSvg from "tsx:assets/svgs/mini-guides/appeal/payoff-simulator.svg";
4-
import ImageRenderer from "../ImageRenderer";
4+
import { StyledImage } from "../PageContentsTemplate";
55

66
const StyledPayoffSimulatorSvg = styled(PayoffSimulatorSvg)`
77
[class$="circle-1"] {
@@ -72,6 +72,6 @@ const StyledPayoffSimulatorSvg = styled(PayoffSimulatorSvg)`
7272
}
7373
`;
7474

75-
const PayoffSimulator: React.FC = () => <ImageRenderer image={StyledPayoffSimulatorSvg} />;
75+
const PayoffSimulator: React.FC = () => <StyledImage as={StyledPayoffSimulatorSvg} />;
7676

7777
export default PayoffSimulator;

web/src/components/Popup/MiniGuides/Appeal/StageOne.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import StageOneSvg from "tsx:assets/svgs/mini-guides/appeal/stage-one.svg";
4-
import ImageRenderer from "../ImageRenderer";
4+
import { StyledImage } from "../PageContentsTemplate";
55

66
const StyledStageOneSvg = styled(StageOneSvg)`
77
[class$="rect-1"],
@@ -69,6 +69,6 @@ const StyledStageOneSvg = styled(StageOneSvg)`
6969
}
7070
`;
7171

72-
const StageOne: React.FC = () => <ImageRenderer image={StyledStageOneSvg} />;
72+
const StageOne: React.FC = () => <StyledImage as={StyledStageOneSvg} />;
7373

7474
export default StageOne;

web/src/components/Popup/MiniGuides/Appeal/StageTwo.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import StageTwoSvg from "tsx:assets/svgs/mini-guides/appeal/stage-two.svg";
4-
import ImageRenderer from "../ImageRenderer";
4+
import { StyledImage } from "../PageContentsTemplate";
55

66
const StyledStageTwoSvg = styled(StageTwoSvg)`
77
[class$="rect-1"] {
@@ -50,6 +50,6 @@ const StyledStageTwoSvg = styled(StageTwoSvg)`
5050
}
5151
`;
5252

53-
const StageTwo: React.FC = () => <ImageRenderer image={StyledStageTwoSvg} />;
53+
const StageTwo: React.FC = () => <StyledImage as={StyledStageTwoSvg} />;
5454

5555
export default StageTwo;

web/src/components/Popup/MiniGuides/BinaryVoting/VotingModule.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import VotingModuleSvg from "tsx:assets/svgs/mini-guides/binary-voting/voting-module.svg";
4-
import ImageRenderer from "../ImageRenderer";
4+
import { StyledImage } from "../PageContentsTemplate";
55

66
const StyledVotingModuleSvg = styled(VotingModuleSvg)`
77
[class$="rect-1"],
@@ -34,6 +34,6 @@ const StyledVotingModuleSvg = styled(VotingModuleSvg)`
3434
}
3535
`;
3636

37-
const VotingModule: React.FC = () => <ImageRenderer image={StyledVotingModuleSvg} />;
37+
const VotingModule: React.FC = () => <StyledImage as={StyledVotingModuleSvg} />;
3838

3939
export default VotingModule;

web/src/components/Popup/MiniGuides/ImageRenderer.tsx

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

web/src/components/Popup/MiniGuides/Onboarding/HowItWorks.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import HowItWorksSvg from "tsx:assets/svgs/mini-guides/onboarding/how-it-works.svg";
4-
import ImageRenderer from "../ImageRenderer";
4+
import { StyledImage } from "../PageContentsTemplate";
55

66
const StyledHowItWorksSvg = styled(HowItWorksSvg)`
77
[class$="rect-1"],
@@ -19,6 +19,6 @@ const StyledHowItWorksSvg = styled(HowItWorksSvg)`
1919
}
2020
`;
2121

22-
const HowItWorks: React.FC = () => <ImageRenderer image={StyledHowItWorksSvg} />;
22+
const HowItWorks: React.FC = () => <StyledImage as={StyledHowItWorksSvg} />;
2323

2424
export default HowItWorks;

web/src/components/Popup/MiniGuides/Onboarding/WhatDoINeed.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import WhatDoINeedSvg from "tsx:assets/svgs/mini-guides/onboarding/what-do-i-need.svg";
4-
import ImageRenderer from "../ImageRenderer";
4+
import { StyledImage } from "../PageContentsTemplate";
55

66
const StyledWhatDoINeedSvg = styled(WhatDoINeedSvg)`
77
[class$="rect-1"] {
@@ -70,6 +70,6 @@ const StyledWhatDoINeedSvg = styled(WhatDoINeedSvg)`
7070
}
7171
`;
7272

73-
const WhatDoINeed: React.FC = () => <ImageRenderer image={StyledWhatDoINeedSvg} />;
73+
const WhatDoINeed: React.FC = () => <StyledImage as={StyledWhatDoINeedSvg} />;
7474

7575
export default WhatDoINeed;

web/src/components/Popup/MiniGuides/PageContentsTemplate.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useState } from "react";
2-
import styled from "styled-components";
2+
import styled, { css } from "styled-components";
3+
import { landscapeStyle } from "styles/landscapeStyle";
34
import MainStructureTemplate from "./MainStructureTemplate";
45

56
export const ParagraphsContainer = styled.div`
@@ -18,6 +19,16 @@ export const LeftContentContainer = styled.div`
1819
flex-direction: column;
1920
`;
2021

22+
export const StyledImage = styled.div`
23+
width: calc(260px + (460 - 260) * (min(max(100vw, 375px), 1250px) - 375px) / 875);
24+
25+
${landscapeStyle(
26+
() => css`
27+
width: 389px;
28+
`
29+
)}
30+
`;
31+
2132
const LinksContainer = styled.div`
2233
display: flex;
2334
flex-direction: column;

web/src/components/Popup/MiniGuides/RankedVoting/VotingModule.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from "react";
22
import styled from "styled-components";
33
import VotingModuleSvg from "tsx:assets/svgs/mini-guides/ranked-voting/voting-module.svg";
4-
import ImageRenderer from "../ImageRenderer";
4+
import { StyledImage } from "../PageContentsTemplate";
55

66
const StyledVotingModuleSvg = styled(VotingModuleSvg)`
77
[class$="path-1"],
@@ -49,13 +49,16 @@ const StyledVotingModuleSvg = styled(VotingModuleSvg)`
4949
fill: ${({ theme }) => theme.primaryBlue};
5050
}
5151
52-
[class$="path-9"],
5352
[class$="path-11"],
5453
[class$="path-2"],
5554
[class$="path-6"] {
5655
fill: ${({ theme }) => theme.primaryText};
5756
}
5857
58+
[class$="path-9"] {
59+
fill: ${({ theme }) => theme.secondaryText};
60+
}
61+
5962
[class$="path-10"] {
6063
fill: ${({ theme }) => theme.error};
6164
}
@@ -65,6 +68,6 @@ const StyledVotingModuleSvg = styled(VotingModuleSvg)`
6568
}
6669
`;
6770

68-
const VotingModule: React.FC = () => <ImageRenderer image={StyledVotingModuleSvg} />;
71+
const VotingModule: React.FC = () => <StyledImage as={StyledVotingModuleSvg} />;
6972

7073
export default VotingModule;

0 commit comments

Comments
 (0)