Skip to content

Commit

Permalink
feat(Typography): created typography reusables component
Browse files Browse the repository at this point in the history
  • Loading branch information
mazkaaa committed Mar 15, 2023
1 parent c3e3fa3 commit 9bff317
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 11 deletions.
21 changes: 12 additions & 9 deletions components/reusables/typography/h1/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React from 'react'
import React from "react";
import { TypographyInterface } from "../index.interface";

interface H1Interface {
className?: string | undefined
children: any
}
const H1 = (props: H1Interface) => {
return <h1 className={"text-3xl font-bold " + props.className}>{props.children}</h1>;
}
const H1 = (props: TypographyInterface) => {
const fontIsBold = props.fontBold ? "font-bold" : "font-extralight";

export default H1
return (
<h1 className={`text-3xl ${fontIsBold} ${props.className}`}>
{props.children}
</h1>
);
};

export default H1;
10 changes: 8 additions & 2 deletions components/reusables/typography/h2/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import React from "react";
import { TypographyInterface } from "../index.interface";

const H2 = ({ children }: any) => {
return <h1 className="text-2xl font-bold">{children}</h1>;
const H2 = (props: TypographyInterface) => {
const fontIsBold = props.fontBold ? "font-bold" : "font-extralight";
return (
<h2 className={`text-lg ${fontIsBold} ${props.className}`}>
{props.children}
</h2>
);
};

export default H2;
13 changes: 13 additions & 0 deletions components/reusables/typography/h3/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from "react";
import { TypographyInterface } from "../index.interface";

const H3 = (props: TypographyInterface) => {
const fontIsBold = props.fontBold ? "font-bold" : "font-extralight";
return (
<h3 className={`text-lg ${fontIsBold} ${props.className}`}>
{props.children}
</h3>
);
};

export default H3;
14 changes: 14 additions & 0 deletions components/reusables/typography/h4/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import { TypographyInterface } from "../index.interface";

const H4 = (props: TypographyInterface) => {
const fontIsBold = props.fontBold ? "font-bold" : "font-extralight";

return (
<h4 className={`text-lg ${fontIsBold} ${props.className}`}>
{props.children}
</h4>
);
};

export default H4;
14 changes: 14 additions & 0 deletions components/reusables/typography/h5/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import React from "react";
import { TypographyInterface } from "../index.interface";

const H5 = (props: TypographyInterface) => {
const fontIsBold = props.fontBold ? "font-bold" : "font-extralight";

return (
<h5 className={`text-lg ${fontIsBold} ${props.className}`}>
{props.children}
</h5>
);
};

export default H5;
5 changes: 5 additions & 0 deletions components/reusables/typography/index.interface.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface TypographyInterface {
children: any;
className?: string | undefined;
fontBold?: boolean | true;
}

0 comments on commit 9bff317

Please sign in to comment.