Skip to content

Commit

Permalink
design: layout ui 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
SongInjae committed Oct 25, 2023
1 parent 94f78c6 commit 64c46d1
Show file tree
Hide file tree
Showing 7 changed files with 112 additions and 13 deletions.
12 changes: 0 additions & 12 deletions src/pages/Layout.tsx

This file was deleted.

11 changes: 11 additions & 0 deletions src/pages/Layout/Layout.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import styled from '@emotion/styled';

export const Container = styled.div`
width: 100vw;
height: 100vh;
display: flex;
`;

export const Content = styled.div`
flex-grow: 1;
`;
17 changes: 17 additions & 0 deletions src/pages/Layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { Outlet } from 'react-router-dom';

import { Container, Content } from './Layout.style';
import SideNav from './SideNav';

const Layout = () => {
return (
<Container>
<SideNav />
<Content>
<Outlet />
</Content>
</Container>
);
};

export default Layout;
43 changes: 43 additions & 0 deletions src/pages/Layout/SideNav.style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import Avatar from '@/components/common/Avatar/Avatar';
import Theme from '@/styles/Theme';
import { css } from '@emotion/css';
import styled from '@emotion/styled';

export const Container = styled.div`
width: 7rem;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
gap: 1rem;
padding: 1rem 0;
box-sizing: border-box;
background: ${Theme.color.logo_2};
color: ${Theme.color.gray};
`;

export const AvatarGroup = styled.div`
overflow: scroll;
flex-grow: 1;
display: flex;
flex-direction: column;
gap: 1rem;
width: 100%;
align-items: center;
`;
export const iconStyle = css`
display: block;
width: 2rem;
height: 2rem;
cursor: pointer;
`;
export const ProfileWrapper = styled.div`
display: flex;
flex-direction: column;
justify-content: center;
cursor: pointer;
`;
export const ProfileAvatar = styled(Avatar)``;
export const ProfileName = styled.div`
text-align: center;
`;
39 changes: 39 additions & 0 deletions src/pages/Layout/SideNav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import Avatar from '@/components/common/Avatar/Avatar';

import { FaBell, FaHome, FaPlusCircle } from 'react-icons/fa';

import {
AvatarGroup,
Container,
ProfileAvatar,
ProfileName,
ProfileWrapper,
iconStyle,
} from './SideNav.style';

interface SideNav {
name?: string;
}

const SideNav = ({ name = '무명' }: SideNav) => {
return (
<Container>
<AvatarGroup>
{Array(8)
.fill(null)
.map((_, index) => (
<Avatar key={index} avatarShape="normal" />
))}
</AvatarGroup>
<FaPlusCircle className={iconStyle} />
<FaHome className={iconStyle} />
<FaBell className={iconStyle} />
<ProfileWrapper>
<ProfileAvatar avatarShape="rectangle" />
<ProfileName>{name}</ProfileName>
</ProfileWrapper>
</Container>
);
};

export default SideNav;
2 changes: 1 addition & 1 deletion src/routes/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import App from '@/App';
import Layout from '@/pages/Layout';
import Layout from '@/pages/Layout/Layout';
import LoginPage from '@/pages/LoginPage/LoginPage';
import MainPage from '@/pages/MainPage';
import NotFoundPage from '@/pages/NotFoundPage';
Expand Down
1 change: 1 addition & 0 deletions src/styles/Theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const color = {
gray: '#d9d9d9',
indigo: '#003949',
logoTextColor: '#fafafa',
logo_2: 'linear-gradient(175deg, #031f2b -19.45%, #486282 55.68%, #9458b5 117.93%)',
} as const;

const componentStyle = {
Expand Down

0 comments on commit 64c46d1

Please sign in to comment.