Skip to content

Commit

Permalink
[#146] feat: Header 요소 변경
Browse files Browse the repository at this point in the history
- 서버 업데이트 시간
- 접속 중인 사람 수
  • Loading branch information
YiSoJeong committed Dec 19, 2020
1 parent f047ddd commit 3995e6d
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions frontend/src/components/molecules/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
/** @jsxRuntime classic */
import { jsx, css } from '@emotion/react';

import { ReactComponent as Dots } from '@assets/dots.svg';
import { ReactComponent as Check } from '@assets/check.svg';
import { HeaderLink, HeaderButton } from '@components/atoms';
import { useRecoilValue } from 'recoil';
import { pageState, staticMenuToggleState } from '@/stores';
import { timeSince } from '@/utils';

const headerCss = () => css`
width: 100%;
Expand Down Expand Up @@ -40,22 +39,18 @@ function Header({}: Props): JSX.Element {
const staticMenuToggle = useRecoilValue(staticMenuToggleState);
const selectedPage = useRecoilValue(pageState);

const date = `Updated ${timeSince(new Date())} ago`;
const people = `${3}명 접속중`;

return (
<div css={headerCss()}>
<div css={wrapperCss()}>
{!staticMenuToggle && <div css={menuMarginCss()} />}
<HeaderLink>{selectedPage?.title || 'Untitled'}</HeaderLink>
</div>
<div css={wrapperCss()}>
<HeaderButton>Share</HeaderButton>
<HeaderButton>
<Check />
Updates
</HeaderButton>
<HeaderButton>Favorite</HeaderButton>
<HeaderButton>
<Dots />
</HeaderButton>
<HeaderButton>{date}</HeaderButton>
<HeaderButton>{people}</HeaderButton>
</div>
</div>
);
Expand Down

0 comments on commit 3995e6d

Please sign in to comment.