mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
added UI for choosing a default profile name
This commit is contained in:
1 parent
9261025b4f
commit
8000cc3d3f
4 files changed
+89
-3
No files matched your search
@@ -20,6 +20,7 @@ import { useProfile } from '../hooks/useProfile';
|
||||
import ProfilePrompt from './profile/ProfilePrompt';
|
||||
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||
import { TwitterThemeProvider } from '../providers/TwitterThemeProvider';
|
||||
import DefaultProfilePrompt from './profile/DefaultProfilePrompt';
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
backgroundModal: {
|
||||
@@ -42,12 +43,15 @@ export const TwitterApp = () => {
|
||||
|
||||
// before any other action can be taken by the user we force
|
||||
// them have a profile name
|
||||
const promptProfileName = profile && (!profile.profile_name || !profile.profile_name.trim());
|
||||
let promptProfileName = profile && (!profile.profile_name || !profile.profile_name.trim());
|
||||
promptProfileName = true;
|
||||
|
||||
const openModal = () => setModalVisible(true);
|
||||
const handlePageChange = (e, page) => setActivePage(page);
|
||||
const showTweetButton = !promptProfileName && activePage === 0;
|
||||
|
||||
const defaultProfileNames = ['test_user', '123-456-7890'];
|
||||
|
||||
return (
|
||||
<TwitterThemeProvider>
|
||||
<AppWrapper id="twitter-app">
|
||||
@@ -56,7 +60,10 @@ export const TwitterApp = () => {
|
||||
<TwitterTitle />
|
||||
<AppContent>
|
||||
{promptProfileName ? (
|
||||
<ProfilePrompt />
|
||||
<DefaultProfilePrompt
|
||||
updateEvent="phone:updateTwitterProfile"
|
||||
defaultProfileNames={defaultProfileNames}
|
||||
/>
|
||||
) : (
|
||||
<Switch>
|
||||
<Route path="/twitter" exact component={TweetListContainer} />
|
||||
|
||||
Reference in new issue
Block a user