= {
- welcome: { type: 'channel' },
- general: { type: 'channel' },
- random: { type: 'channel' },
- 'vitalik.eth': { type: 'chat' },
- 'pvl.eth': { type: 'chat' },
- 'Climate Change': { type: 'group-chat' },
-}
-
-export const Navbar = (props: Props) => {
- const { enableMembers } = props
-
- const { state, dispatch } = useAppState()
- const { params } = useMatch(':id')! // eslint-disable-line @typescript-eslint/no-non-null-assertion
-
- const chat = chats[params.id!]
-
- const renderIdentity = () => {
- if (chat.type == 'channel') {
- return (
-
-
-
- #general
-
- 2 pinned messages | General discussions about CryptoKitties.
-
-
-
- )
- }
-
- if (chat.type == 'group-chat') {
- return (
-
-
-
- Climate Change
-
- 3 pinned messages | 5 members
-
-
-
- )
- }
-
- return (
-
-
-
- pvl.eth
-
- 0x63FaC9201494f0bd17B9892B9fae4d52fe3BD377
-
-
-
- )
- }
-
- const renderMenuItems = () => {
- if (chat.type === 'channel') {
- return (
- <>
- }>
- For 15 min
- For 1 hour
- For 8 hours
- For 24 hours
- Until I turn it back on
-
- }>
- Mark as Read
-
- >
- )
- }
- return (
- <>
- {chat.type === 'chat' && (
- }>
- View Profile
-
- )}
- {chat.type === 'group-chat' && (
- }>Edit Group
- )}
-
- {chat.type === 'group-chat' && (
- }>
- Customize Chat
-
- )}
- }>
- For 15 min
- For 1 hour
- For 8 hours
- For 24 hours
- Until I turn it back on
-
- }>Mark as Read
- }>
- Last 24 hours
- Last 2 days
- Last 3 days
- Last 7 days
-
-
- {chat.type === 'chat' && (
- } danger>
- Delete Chat
-
- )}
- {chat.type === 'group-chat' && (
- } danger>
- Leave Chat
-
- )}
- >
- )
- }
-
- return (
-
- {renderIdentity()}
-
-
- {enableMembers && (
- dispatch({ type: 'TOGGLE_MEMBERS' })}
- >
-
-
- )}
-
-
-
-
-
- {renderMenuItems()}
-
-
-
-
-
-
-
-
-
- )
-}
-
-const NavbarWrapper = styled('div', {
- display: 'flex',
- alignItems: 'center',
- justifyContent: 'space-between',
- padding: '10px 16px',
-})