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

Create reusable heading components #1239

Merged
merged 8 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 16 additions & 0 deletions frontend/src/Components/H1/H1.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@import 'src/constants';

@import 'src/mixins';

.header {
font-size: 1.875rem;
line-height: 2.25rem;
letter-spacing: -0.05rem;
font-weight: 800;
padding-bottom: 0.5rem;

@include for-desktop-up {
robines marked this conversation as resolved.
Show resolved Hide resolved
font-size: 2.25rem;
line-height: 2.5rem;
}
}
11 changes: 11 additions & 0 deletions frontend/src/Components/H1/H1.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import classNames from 'classnames';
import styles from './H1.module.scss';
import React from 'react';

interface Props extends React.HTMLAttributes<HTMLHeadingElement> {
className?: string;
}

export function H1({ className, ...props }: Props) {
return <h1 className={classNames(styles.header, className)} {...props} />;
}
1 change: 1 addition & 0 deletions frontend/src/Components/H1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { H1 } from './H1';
11 changes: 11 additions & 0 deletions frontend/src/Components/H2/H2.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import 'src/constants';

@import 'src/mixins';

.header {
font-size: 1.875rem;
line-height: 2.25rem;
letter-spacing: -0.05rem;
font-weight: 600;
padding-bottom: 0.5rem;
}
11 changes: 11 additions & 0 deletions frontend/src/Components/H2/H2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import classNames from 'classnames';
import styles from './H2.module.scss';
import React from 'react';

interface Props extends React.HTMLAttributes<HTMLHeadingElement> {
className?: string;
}

export function H2({ className, ...props }: Props) {
return <h2 className={classNames(styles.header, className)} {...props} />;
}
1 change: 1 addition & 0 deletions frontend/src/Components/H2/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { H2 } from './H2';
11 changes: 11 additions & 0 deletions frontend/src/Components/H3/H3.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import 'src/constants';

@import 'src/mixins';

.header {
font-size: 1.5rem;
line-height: 2rem;
letter-spacing: -0.05rem;
font-weight: 600;
padding-bottom: 0.25rem;
}
11 changes: 11 additions & 0 deletions frontend/src/Components/H3/H3.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import classNames from 'classnames';
import styles from './H3.module.scss';
import React from 'react';

interface Props extends React.HTMLAttributes<HTMLHeadingElement> {
className?: string;
}

export function H3({ className, ...props }: Props) {
return <h3 className={classNames(styles.header, className)} {...props} />;
}
1 change: 1 addition & 0 deletions frontend/src/Components/H3/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { H3 } from './H3';
11 changes: 11 additions & 0 deletions frontend/src/Components/H4/H4.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import 'src/constants';

@import 'src/mixins';

.header {
font-size: 1.25rem;
line-height: 1.75rem;
letter-spacing: -0.05rem;
font-weight: 600;
padding-bottom: 0.25rem;
}
11 changes: 11 additions & 0 deletions frontend/src/Components/H4/H4.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import classNames from 'classnames';
import styles from './H4.module.scss';
import React from 'react';

interface Props extends React.HTMLAttributes<HTMLHeadingElement> {
className?: string;
}

export function H4({ className, ...props }: Props) {
return <h4 className={classNames(styles.header, className)} {...props} />;
}
1 change: 1 addition & 0 deletions frontend/src/Components/H4/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { H4 } from './H4';
11 changes: 11 additions & 0 deletions frontend/src/Components/H5/H5.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
@import 'src/constants';

@import 'src/mixins';

.header {
font-size: 1.125rem;
line-height: 1.75rem;
letter-spacing: -0.05rem;
font-weight: 600;
padding-bottom: 0.25rem;
}
11 changes: 11 additions & 0 deletions frontend/src/Components/H5/H5.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import classNames from 'classnames';
import styles from './H5.module.scss';
import React from 'react';

interface Props extends React.HTMLAttributes<HTMLHeadingElement> {
className?: string;
}

export function H5({ className, ...props }: Props) {
return <h5 className={classNames(styles.header, className)} {...props} />;
}
1 change: 1 addition & 0 deletions frontend/src/Components/H5/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { H5 } from './H5';
10 changes: 10 additions & 0 deletions frontend/src/Components/H6/H6.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@import 'src/constants';

@import 'src/mixins';

.header {
font-size: 1rem;
line-height: 1.5rem;
letter-spacing: -0.05rem;
font-weight: 600;
}
11 changes: 11 additions & 0 deletions frontend/src/Components/H6/H6.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import classNames from 'classnames';
import styles from './H6.module.scss';
import React from 'react';

interface Props extends React.HTMLAttributes<HTMLHeadingElement> {
className?: string;
}

export function H6({ className, ...props }: Props) {
return <h6 className={classNames(styles.header, className)} {...props} />;
}
1 change: 1 addition & 0 deletions frontend/src/Components/H6/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { H6 } from './H6';
6 changes: 6 additions & 0 deletions frontend/src/Components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ export { EventQuery } from './EventQuery';
export { ExpandableHeader } from './ExpandableHeader';
export { ExpandableList } from './ExpandableList';
export { Footer } from './Footer';
export { H1 } from './H1';
export { H2 } from './H2';
export { H3 } from './H3';
export { H4 } from './H4';
export { H5 } from './H5';
export { H6 } from './H6';
export { IconButton } from './IconButton';
export { Image } from './Image';
export { ImageCard } from './ImageCard';
Expand Down
11 changes: 10 additions & 1 deletion frontend/src/Pages/ComponentPage/ComponentPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button, Countdown, InputField, ProgressBar, RadioButton, ToolTip } from '~/Components';
import { Button, Countdown, H1, H2, H3, H4, H5, H6, InputField, ProgressBar, RadioButton, ToolTip } from '~/Components';
import { Checkbox } from '~/Components/Checkbox';
import { Link } from '~/Components/Link';
import { List } from '~/Components/List';
Expand All @@ -15,6 +15,15 @@ import styles from './ComponentPage.module.scss';
export function ComponentPage() {
return (
<div className={styles.wrapper}>
<H1>Heading 1</H1>
<H2>Heading 2</H2>
<H3>Heading 3</H3>
<H4>Heading 4</H4>
<H5>Heading 5</H5>
<H6>Heading 6</H6>

<br />

<MultiSelect
options={[
{
Expand Down
Loading