-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
dongha
committed
Apr 10, 2021
1 parent
a0be7de
commit 8f3bea9
Showing
18 changed files
with
150 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React, { ReactElement, useContext, useMemo } from 'react'; | ||
import styled from '@emotion/styled'; | ||
import MemberContext from 'components/MemberProvider/MemberContext'; | ||
import Icon from 'components/Icon'; | ||
import UserAvatar from 'components/UserAvatar'; | ||
import { useRouter } from 'next/router'; | ||
import { IconTypes } from 'components/Icon/Icon'; | ||
import Link from 'next/link'; | ||
|
||
const TAB_LIST = [ | ||
{ name: 'home', path: '/' }, | ||
{ name: 'explore', path: '/explore' }, | ||
{ name: 'newPost', path: '/newPost' }, | ||
{ name: 'activity', path: '/accounts/activity' }, | ||
]; | ||
|
||
function Footer(): ReactElement { | ||
const { member } = useContext(MemberContext); | ||
const { pathname } = useRouter(); | ||
const tabList = useMemo( | ||
() => TAB_LIST.map(({ name, path }) => ({ name: path === pathname ? `${name}Filled` : name, path })), | ||
[pathname], | ||
); | ||
return ( | ||
<Nav> | ||
{tabList.map(({ name, path }) => | ||
name === 'newPost' ? ( | ||
<Button> | ||
<Icon name={name as IconTypes} size="big" key={`${name}Icon`} /> | ||
</Button> | ||
) : ( | ||
<Link href={path}> | ||
<Tab> | ||
<Icon name={name as IconTypes} size="big" key={`${name}Icon`} /> | ||
</Tab> | ||
</Link> | ||
), | ||
)} | ||
<Link href={`/profiles/${member?.displayId}`}> | ||
<Tab> | ||
<UserAvatar size="small" thumbnail={member?.profileImageUrl} /> | ||
</Tab> | ||
</Link> | ||
</Nav> | ||
); | ||
} | ||
|
||
export default Footer; | ||
|
||
const Nav = styled.nav` | ||
height: 44px; | ||
background-color: white; | ||
display: flex; | ||
`; | ||
|
||
const Tab = styled.a` | ||
all: unset; | ||
cursor: pointer; | ||
height: 100%; | ||
flex: 1 1 auto; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
`; | ||
|
||
const Button = Tab.withComponent('button'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
export { default } from './Footer'; | ||
export * from './Footer'; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
export { ReactComponent as menu } from './menu.svg'; | ||
export { ReactComponent as home } from './home.svg'; | ||
export { ReactComponent as homeFilled } from './home-filled.svg'; | ||
export { ReactComponent as activity } from './activity.svg'; | ||
export { ReactComponent as search } from './search.svg'; | ||
export { ReactComponent as activityFilled } from './activity-filled.svg'; | ||
export { ReactComponent as explore } from './explore.svg'; | ||
export { ReactComponent as exploreFilled } from './explore-filled.svg'; | ||
export { ReactComponent as favorite } from './favorite.svg'; | ||
export { ReactComponent as comment } from './comment.svg'; | ||
export { ReactComponent as share } from './share.svg'; | ||
export { ReactComponent as bookmark } from './bookmark.svg'; | ||
export { ReactComponent as newpost } from './newpost.svg'; | ||
export { ReactComponent as newPost } from './newpost.svg'; | ||
export { ReactComponent as back } from './back.svg'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import React, { ReactElement, ReactNode } from 'react'; | ||
import styled from '@emotion/styled'; | ||
|
||
export type LayoutProps = { | ||
header: ReactNode; | ||
footer: ReactNode; | ||
children: ReactElement; | ||
}; | ||
|
||
function Layout({ header, footer, children }: LayoutProps): ReactElement { | ||
return ( | ||
<Container> | ||
{header} | ||
<ChildrenContainer>{children}</ChildrenContainer> | ||
{footer} | ||
</Container> | ||
); | ||
} | ||
|
||
export default Layout; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
height: 100%; | ||
flex-direction: column; | ||
`; | ||
|
||
const ChildrenContainer = styled.div` | ||
flex: 1 1 auto; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
module.exports = { | ||
const withImages = require('next-images'); | ||
|
||
module.exports = withImages({ | ||
webpack(config) { | ||
config.module.rules.push({ | ||
config.module.rules.unshift({ | ||
test: /\.svg$/, | ||
use: ['@svgr/webpack'], | ||
}); | ||
|
||
return config; | ||
}, | ||
}; | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React, { ReactElement } from 'react'; | ||
|
||
function Activity(): ReactElement { | ||
return <div>Activity</div>; | ||
} | ||
|
||
export default Activity; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React, { ReactElement } from 'react'; | ||
|
||
function Explore(): ReactElement { | ||
return <div>Explore</div>; | ||
} | ||
|
||
export default Explore; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import React, { ReactElement } from 'react'; | ||
|
||
function Index(): ReactElement { | ||
return <div>Index</div>; | ||
return <div>test</div>; | ||
} | ||
|
||
export default Index; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React, { ReactElement } from 'react'; | ||
import { useRouter } from 'next/router'; | ||
|
||
export type ProfileProps = {}; | ||
|
||
function Profile({}: ProfileProps): ReactElement { | ||
const router = useRouter(); | ||
const { displayId } = router.query; | ||
return <div>{displayId}</div>; | ||
} | ||
|
||
export default Profile; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.