Skip to content
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
15 changes: 15 additions & 0 deletions src/components/Heading/Heading.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { ComponentMeta, ComponentStory } from '@storybook/react';
import { Heading } from './Heading';

export default {
title: 'Heading',
component: Heading,
args: {
as: 'h1',
children: 'Heading Text',
},
} as ComponentMeta<typeof Heading>;

const Template: ComponentStory<typeof Heading> = (args) => <Heading {...args} />;

export const Default = Template.bind({});
13 changes: 13 additions & 0 deletions src/components/Heading/Heading.styled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import styled from '@emotion/styled';
import { pxToRem, media } from 'utils';

export const StyledHeading = styled.h1`
font-size: ${pxToRem(32)};
color: ${({ theme }) => theme.color.primaryOrange};
font-weight: bold;
padding-top: ${pxToRem(16)};

${media.mobile} {
font-size: ${pxToRem(26)};
}
`;
10 changes: 10 additions & 0 deletions src/components/Heading/Heading.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { HeadingProps } from './Heading.types';
import { StyledHeading } from './Heading.styled';

export const Heading = ({ as, className, children }: HeadingProps): JSX.Element => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

className에 a11yHidden이 들어간경우를 제외하면 필요없을것 같다는 팀원들의 이야기가 있었음

return (
<StyledHeading as={as} className={className}>
{children}
</StyledHeading>
);
};
5 changes: 5 additions & 0 deletions src/components/Heading/Heading.types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface HeadingProps {
as: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
className?: string;
children: React.ReactNode;
}
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * from './CookingInfo/CookingInfo';
export * from './Logo/Logo';
export * from './Loading/Loading';
export * from './Heading/Heading';
export * from './Layout/Layout';
export * from './Header/Header';
export * from './EmptyPage/EmptyPage';
Expand Down