Skip to content

Commit

Permalink
Merge pull request #69 from RamboGj/feat-text-components
Browse files Browse the repository at this point in the history
Creating Text Components: H1, H2, H3, H4 + Body 1 - 3
  • Loading branch information
elliotBraem authored Jan 19, 2024
2 parents 4681ba4 + ba405e0 commit 2667f33
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 0 deletions.
18 changes: 18 additions & 0 deletions apps/builddao/widget/components/Text/H1.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const StyledH1 = styled.h1`
font-family: "Aekonik", sans-serif;
font-weight: 500;
font-size: 2rem;
line-height: 100%;
letter-spacing: 0;
color: ${(props) => `${props.textColor}`}
`;

function H1({ children, textColor}) {
return (
<StyledH1 textColor={textColor ?? "#FFFFFF"}>
{children}
</StyledH1>
)
}

return { H1 }
18 changes: 18 additions & 0 deletions apps/builddao/widget/components/Text/H2.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const StyledH2 = styled.h2`
font-family: "Aekonik", sans-serif;
font-weight: 500;
font-size: 1.625rem;
line-height: 120%;
letter-spacing: 0;
color: ${(props) => `${props.textColor}`}
`;

function H2({ children, textColor }) {
return (
<StyledH2 textColor={textColor ?? "#FFFFFF"}>
{children}
</StyledH2>
)
}

return { H2 }
18 changes: 18 additions & 0 deletions apps/builddao/widget/components/Text/H3.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const StyledH3 = styled.h3`
font-family: "Aekonik", sans-serif;
font-weight: 500;
font-size: 1.5rem;
line-height: 140%;
letter-spacing: 0;
color: ${(props) => `${props.textColor}`}
`;

function H3({ children, textColor }) {
return (
<StyledH3 textColor={textColor ?? "#FFFFFF"}>
{children}
</StyledH3>
)
}

return { H3 }
18 changes: 18 additions & 0 deletions apps/builddao/widget/components/Text/H4.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const StyledH4 = styled.h4`
font-family: "Aekonik", sans-serif;
font-weight: 500;
font-size: 1.125rem;
line-height: 160%;
letter-spacing: 0;
color: ${(props) => `${props.textColor}`}
`;

function H4({ children, textColor }) {
return (
<StyledH4 textColor={textColor ?? "#FFFFFF"}>
{children}
</StyledH4>
)
}

return { H4 }
45 changes: 45 additions & 0 deletions apps/builddao/widget/components/Text/P.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
const StyledParagraph = styled.p`
font-family: "Aekonik", sans-serif;
font-weight: 500;
letter-spacing: 0;
color: ${(props) => `${props.textColor}`};
font-size: ${(props) => {
switch (props.pType) {
case "p1":
return "1rem";
case "p2":
return "0.875rem";
case "p3":
return "0.8125rem";
default:
return "";
}
}};
line-height: ${(props) => {
switch (props.pType) {
case "p1":
return "170%";
case "p2":
return "170%";
case "p3":
return "auto";
default:
return "";
}
}};
`;

function P({ children, pType, textColor }) {
const defaults = {
pType: pType ?? "p1",
textColor: textColor ?? "#000000",
};

return (
<StyledParagraph pType={defaults.pType} textColor={defaults.textColor}>
{children}
</StyledParagraph>
);
}

return { P };

0 comments on commit 2667f33

Please sign in to comment.