mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 06:28:51 +00:00
Task/improve hardcoded styles and types (#107)
* Add working notifications with only twitter for now * feat(notification-bar): I didnt copy from NP * feat(notifications): Collapse when no more notifications after closing one * Improve overall messages styling code * Improve Routing performance * improve use keyboard hook * Remove unused returns * Button hover color :) * Button hover color :) x2 * Added hover style to containedPrimary msg btn * Replace custom components for custom theme providers for Messages and Contacts apps * Improve createAppThemeProvider * Improve createAppThemeProvider * Final housekeeping for messages styles * Change placeholder to label in Contacts app text fields * Fix alerts style with navigation and fix calc copy alerrt * Split Phone code for snackbar * Add more options and style Context Menu * Enable Sellout theme provider and make it work with light themes
This commit is contained in:
1 parent
75e23b783c
commit
4acb214ec9
56 files changed
+738
-578
No files matched your search
@@ -1,3 +0,0 @@
|
||||
#contact-app .Mui-focused::after {
|
||||
border-bottom: #2196f3 solid 4px;
|
||||
}
|
||||
@@ -8,6 +8,23 @@ import { Route } from 'react-router-dom';
|
||||
|
||||
import ContactsInfoPage from './views/ContactInfo';
|
||||
import { ContactPage } from './views/ContactsPage';
|
||||
import { ContactsThemeProvider } from '../providers/ContactsThemeProvider';
|
||||
|
||||
export const ContactsApp = () => {
|
||||
const contacts = useApp('CONTACTS');
|
||||
|
||||
return (
|
||||
<ContactsThemeProvider>
|
||||
<AppWrapper id='contact-app'>
|
||||
<AppTitle app={contacts} />
|
||||
<AppContent>
|
||||
<Route path='/contacts/' exact component={ContactPage} />
|
||||
<Route path='/contacts/:id' exact component={ContactsInfoPage} />
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
</ContactsThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
@@ -33,17 +50,3 @@ InjectDebugData([
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
export const ContactsApp = () => {
|
||||
const contacts = useApp('CONTACTS');
|
||||
|
||||
return (
|
||||
<AppWrapper id='contact-app'>
|
||||
<AppTitle app={contacts} />
|
||||
<AppContent>
|
||||
<Route path='/contacts/' exact component={ContactPage} />
|
||||
<Route path='/contacts/:id' exact component={ContactsInfoPage} />
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
);
|
||||
};
|
||||
@@ -7,17 +7,12 @@ import {
|
||||
List,
|
||||
ListItem,
|
||||
} from '@material-ui/core';
|
||||
|
||||
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
|
||||
|
||||
import PhoneIcon from '@material-ui/icons/Phone';
|
||||
import ChatIcon from '@material-ui/icons/Chat';
|
||||
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
||||
import { useContacts } from '../../hooks/useContacts';
|
||||
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
|
||||
import '../Contact.css';
|
||||
import { SearchContacts } from './SearchContacts';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import {
|
||||
Avatar as MuiAvatar,
|
||||
Box,
|
||||
Button,
|
||||
Paper,
|
||||
TextField,
|
||||
@@ -43,28 +44,6 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||
inputProps: {
|
||||
fontSize: 22,
|
||||
},
|
||||
updateButton: {
|
||||
background: '#2196f3',
|
||||
width: 150,
|
||||
height: 45,
|
||||
fontSize: 16,
|
||||
marginTop: 29,
|
||||
marginBottom: 29,
|
||||
},
|
||||
deleteButton: {
|
||||
background: '#d32f2f',
|
||||
width: 150,
|
||||
height: 40,
|
||||
fontSize: 16,
|
||||
},
|
||||
saveButton: {
|
||||
background: theme.palette.success.dark,
|
||||
color: '#fff',
|
||||
width: 150,
|
||||
height: 45,
|
||||
fontsize: 22,
|
||||
marginTop: theme.spacing(2),
|
||||
},
|
||||
}));
|
||||
|
||||
const ContactsInfoPage = () => {
|
||||
@@ -96,7 +75,7 @@ const ContactsInfoPage = () => {
|
||||
number,
|
||||
avatar,
|
||||
});
|
||||
history.goBack()
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
const handleContactSave = () => {
|
||||
@@ -111,7 +90,7 @@ const ContactsInfoPage = () => {
|
||||
number,
|
||||
avatar,
|
||||
});
|
||||
history.goBack()
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
const handleContactDelete = () => {
|
||||
@@ -123,7 +102,7 @@ const ContactsInfoPage = () => {
|
||||
Nui.send('phone:deleteContact', {
|
||||
id: contact.id,
|
||||
});
|
||||
history.goBack()
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -137,7 +116,7 @@ const ContactsInfoPage = () => {
|
||||
className={classes.input}
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
placeholder={t('APPS_CONTACT_FORM_NAME')}
|
||||
label={t('APPS_CONTACT_FORM_NAME')}
|
||||
fullWidth
|
||||
inputProps={{
|
||||
className: classes.inputProps,
|
||||
@@ -147,7 +126,7 @@ const ContactsInfoPage = () => {
|
||||
className={classes.input}
|
||||
value={number}
|
||||
onChange={(e) => setNumber(e.target.value)}
|
||||
placeholder={t('APPS_CONTACT_FORM_NUMBER')}
|
||||
label={t('APPS_CONTACT_FORM_NUMBER')}
|
||||
fullWidth
|
||||
inputProps={{
|
||||
className: classes.inputProps,
|
||||
@@ -155,7 +134,7 @@ const ContactsInfoPage = () => {
|
||||
/>
|
||||
<TextField
|
||||
className={classes.input}
|
||||
placeholder={t('APPS_CONTACT_FORM_AVATAR')}
|
||||
label={t('APPS_CONTACT_FORM_AVATAR')}
|
||||
fullWidth
|
||||
value={avatar}
|
||||
onChange={(e) => setAvatar(e.target.value)}
|
||||
@@ -165,28 +144,38 @@ const ContactsInfoPage = () => {
|
||||
/>
|
||||
{/* Display if fetched contact */}
|
||||
{contact && (
|
||||
<div style={{ display: 'block' }}>
|
||||
<Button
|
||||
onClick={handleContactSave}
|
||||
className={classes.updateButton}
|
||||
>
|
||||
{t('GENERIC_UPDATE')}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={handleContactDelete}
|
||||
className={classes.deleteButton}
|
||||
>
|
||||
{t('GENERIC_DELETE')}
|
||||
</Button>
|
||||
</div>
|
||||
<>
|
||||
<Box py={1} display='block'>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
onClick={handleContactSave}
|
||||
>
|
||||
{t('GENERIC_UPDATE')}
|
||||
</Button>
|
||||
</Box>
|
||||
<Box py={1} display='block'>
|
||||
<Button
|
||||
variant='contained'
|
||||
color='secondary'
|
||||
onClick={handleContactDelete}
|
||||
>
|
||||
{t('GENERIC_DELETE')}
|
||||
</Button>
|
||||
</Box>
|
||||
</>
|
||||
)}
|
||||
{/* Display if no fetched contact */}
|
||||
{!contact && (
|
||||
<div style={{ display: 'block' }}>
|
||||
<Button onClick={handleContactAdd} className={classes.saveButton}>
|
||||
<Box display='block'>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
onClick={handleContactAdd}
|
||||
>
|
||||
{t('APPS_CONTACT_MODAL_BUTTON_ADD')}
|
||||
</Button>
|
||||
</div>
|
||||
</Box>
|
||||
)}
|
||||
</div>
|
||||
</Paper>
|
||||
|
||||
@@ -26,8 +26,8 @@ export const ContactPage = () => {
|
||||
<>
|
||||
<ContactList />
|
||||
<Fab
|
||||
color='primary'
|
||||
onClick={() => history.push('/contacts/-1')}
|
||||
style={{ backgroundColor: '#2196f3', color: '#fff' }}
|
||||
className={classes.absolute}
|
||||
>
|
||||
<PersonAddIcon />
|
||||
|
||||
Reference in new issue
Block a user