Skip to content

Commit

Permalink
feat: Main-TodoTitle layer 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
NaGyeong-Park committed Nov 25, 2022
1 parent f44b079 commit 16db1f8
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
4 changes: 2 additions & 2 deletions client/src/components/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ interface StyleProps {
fontSize?: string;
fontWeight?: string;
fontFamily?: string;
margin?: string;
}

interface Props extends StyleProps {
Expand All @@ -17,11 +18,10 @@ const StyledText = styled.p<StyleProps>`
font-family: ${({ fontFamily }) => fontFamily};
font-size: ${({ fontSize }) => fontSize};
font-weight: ${({ fontWeight }) => fontWeight};
margin: ${({ margin }) => margin};
`;

const Text: FC<Props> = ({ text, ...props }) => {
console.log(props);

return <StyledText {...props}>{text}</StyledText>;
};

Expand Down
9 changes: 9 additions & 0 deletions client/src/container/TodoTitle.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { ReactElement } from 'react';
import Text from '../components/Text';

import { Todo } from '../core/todo/index';

const TodoTitle = ({ activeTodo }: { activeTodo: Todo }): ReactElement => {
return <Text text={activeTodo.title} fontSize={'54px'} fontWeight={'700'} margin={'35px 0'} />;
};
export default TodoTitle;
2 changes: 2 additions & 0 deletions client/src/page/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from 'styled-components';
import TodoStatus from '../container/TodoStatus';
import { mockTodosData } from '../util/GlobalState';
import { ReactElement } from 'react';
import TodoTitle from '../container/TodoTitle';

const Wrapper = styled.div`
height: 90vh;
Expand All @@ -18,6 +19,7 @@ const Main = (): ReactElement => {
return (
<Wrapper>
<TodoStatus activeTodo={todosArray[0]} />
<TodoTitle activeTodo={todosArray[0]} />
</Wrapper>
);
};
Expand Down
2 changes: 1 addition & 1 deletion client/src/util/GlobalState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export const readWriteAtom = atom(
export const mockTodosData = atom([
{
id: '0',
title: 'default title',
title: '다람쥐 헌 쳇바퀴에 올라타',
content: 'default content',
owner: 'default user',
importance: 1,
Expand Down

0 comments on commit 16db1f8

Please sign in to comment.