-
-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(phone/messages): initial messages ui update
- Loading branch information
Showing
14 changed files
with
316 additions
and
275 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
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,48 +1,49 @@ | ||
import React from 'react'; | ||
import { AppWrapper } from '@ui/components'; | ||
import { AppTitle } from '@ui/components/AppTitle'; | ||
import { AppContent } from '@ui/components/AppContent'; | ||
import { useApp } from '@os/apps/hooks/useApps'; | ||
import {AppWrapper} from '@ui/components'; | ||
import {AppTitle} from '@ui/components/AppTitle'; | ||
import {AppContent} from '@ui/components/AppContent'; | ||
import {useApp} from '@os/apps/hooks/useApps'; | ||
import MessageGroupModal from './modal/MessageGroupModal'; | ||
import MessagesList from './list/MessagesList'; | ||
import { Route, Switch, useHistory } from 'react-router-dom'; | ||
import { MessageModal } from './modal/MessageModal'; | ||
import {Route, Switch, useHistory, useLocation} from 'react-router-dom'; | ||
import {MessageModal} from './modal/MessageModal'; | ||
import NewMessageGroupButton from './form/NewMessageGroupButton'; | ||
import { MessagesThemeProvider } from '../providers/MessagesThemeProvider'; | ||
import { LoadingSpinner } from '@ui/components/LoadingSpinner'; | ||
import { WordFilterProvider } from '@os/wordfilter/providers/WordFilterProvider'; | ||
import {MessagesThemeProvider} from '../providers/MessagesThemeProvider'; | ||
import {LoadingSpinner} from '@ui/components/LoadingSpinner'; | ||
import {WordFilterProvider} from '@os/wordfilter/providers/WordFilterProvider'; | ||
|
||
export const MessagesApp = () => { | ||
const messages = useApp('MESSAGES'); | ||
const history = useHistory(); | ||
const messages = useApp('MESSAGES'); | ||
const history = useHistory(); | ||
const {pathname} = useLocation(); | ||
|
||
return ( | ||
<MessagesThemeProvider> | ||
<AppWrapper id="messages-app"> | ||
<WordFilterProvider> | ||
<AppTitle app={messages} /> | ||
<AppContent> | ||
<React.Suspense fallback={<LoadingSpinner />}> | ||
<Switch> | ||
<Route path="/messages/conversations/:groupId"> | ||
<MessageModal /> | ||
</Route> | ||
<Route exact path="/messages"> | ||
<MessagesList /> | ||
</Route> | ||
</Switch> | ||
<Switch> | ||
<Route exact path={['/messages/new/:phoneNumber', '/messages/new']}> | ||
<MessageGroupModal /> | ||
</Route> | ||
</Switch> | ||
</React.Suspense> | ||
</AppContent> | ||
<Route exact path="/messages"> | ||
<NewMessageGroupButton onClick={() => history.push('/messages/new')} /> | ||
</Route> | ||
</WordFilterProvider> | ||
</AppWrapper> | ||
</MessagesThemeProvider> | ||
); | ||
return ( | ||
<MessagesThemeProvider> | ||
<AppWrapper id="messages-app"> | ||
<WordFilterProvider> | ||
{pathname === '/messages' && <AppTitle app={messages}/>} | ||
<AppContent> | ||
<React.Suspense fallback={<LoadingSpinner/>}> | ||
<Switch> | ||
<Route path="/messages/conversations/:groupId"> | ||
<MessageModal/> | ||
</Route> | ||
<Route exact path="/messages"> | ||
<MessagesList/> | ||
</Route> | ||
</Switch> | ||
<Switch> | ||
<Route exact path={['/messages/new/:phoneNumber', '/messages/new']}> | ||
<MessageGroupModal/> | ||
</Route> | ||
</Switch> | ||
</React.Suspense> | ||
</AppContent> | ||
<Route exact path="/messages"> | ||
<NewMessageGroupButton onClick={() => history.push('/messages/new')}/> | ||
</Route> | ||
</WordFilterProvider> | ||
</AppWrapper> | ||
</MessagesThemeProvider> | ||
); | ||
}; |
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
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
Oops, something went wrong.