-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.tsx
38 lines (31 loc) · 864 Bytes
/
index.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
'use client'
import { FC, useCallback } from 'react'
import { Button, Typography } from '@mui/material'
import { useRouter } from 'next/navigation'
import { HeaderContainer, RootContainer } from './styled'
import { IContentFeedProps } from './types'
const ContentFeed: FC<IContentFeedProps> = () => {
const router = useRouter()
const onNewPost = useCallback(() => {
router.push('/new-post')
}, [router])
return (
<RootContainer>
<HeaderContainer>
<Typography component="h4" variant="h4">
Content Feed
</Typography>
<Button
variant="outlined"
color="inherit"
onClick={onNewPost}
disableRipple
sx={{ maxWidth: 'fit-content' }}
>
New Post
</Button>
</HeaderContainer>
</RootContainer>
)
}
export default ContentFeed