mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
more formatting
This commit is contained in:
1 parent
046447b0fb
commit
f552c1212c
157 files changed
+635
-1579
No files matched your search
@@ -15,11 +15,11 @@ export const ContactsApp = () => {
|
||||
|
||||
return (
|
||||
<ContactsThemeProvider>
|
||||
<AppWrapper id='contact-app'>
|
||||
<AppWrapper id="contact-app">
|
||||
<AppTitle app={contacts} />
|
||||
<AppContent>
|
||||
<Route path='/contacts/' exact component={ContactPage} />
|
||||
<Route path='/contacts/:id' exact component={ContactsInfoPage} />
|
||||
<Route path="/contacts/" exact component={ContactPage} />
|
||||
<Route path="/contacts/:id" exact component={ContactsInfoPage} />
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
</ContactsThemeProvider>
|
||||
|
||||
@@ -56,8 +56,7 @@ export const ContactList = () => {
|
||||
{contacts
|
||||
.filter(
|
||||
(contact) =>
|
||||
contact.display.match(filteredRegEx) ||
|
||||
contact.number.match(filteredRegEx)
|
||||
contact.display.match(filteredRegEx) || contact.number.match(filteredRegEx),
|
||||
)
|
||||
.map((contact) => (
|
||||
<ListItem key={contact.id} divider>
|
||||
@@ -65,25 +64,17 @@ export const ContactList = () => {
|
||||
{contact.avatar ? (
|
||||
<MuiAvatar src={contact.avatar} />
|
||||
) : (
|
||||
<MuiAvatar>
|
||||
{contact.display.slice(0, 1).toUpperCase()}
|
||||
</MuiAvatar>
|
||||
<MuiAvatar>{contact.display.slice(0, 1).toUpperCase()}</MuiAvatar>
|
||||
)}
|
||||
</ListItemAvatar>
|
||||
<ListItemText
|
||||
primary={contact.display}
|
||||
secondary={contact.number}
|
||||
/>
|
||||
<ListItemText primary={contact.display} secondary={contact.number} />
|
||||
<Button onClick={() => startCall(contact.number)}>
|
||||
<PhoneIcon />
|
||||
</Button>
|
||||
<Button onClick={() => handleMessage(contact.number)}>
|
||||
<ChatIcon />
|
||||
</Button>
|
||||
<Button
|
||||
style={{ margin: -15 }}
|
||||
onClick={() => openContactInfo(contact.id)}
|
||||
>
|
||||
<Button style={{ margin: -15 }} onClick={() => openContactInfo(contact.id)}>
|
||||
<MoreVertIcon />
|
||||
</Button>
|
||||
</ListItem>
|
||||
|
||||
@@ -53,7 +53,7 @@ const useStyles = makeStyles((theme: Theme) =>
|
||||
alignItems: 'center',
|
||||
justifyContent: 'center',
|
||||
},
|
||||
})
|
||||
}),
|
||||
);
|
||||
|
||||
export const SearchContacts = () => {
|
||||
|
||||
@@ -1,11 +1,5 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
Avatar as MuiAvatar,
|
||||
Box,
|
||||
Button,
|
||||
Paper,
|
||||
TextField,
|
||||
} from '@material-ui/core';
|
||||
import { Avatar as MuiAvatar, Box, Button, Paper, TextField } from '@material-ui/core';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHistory, useParams } from 'react-router-dom';
|
||||
@@ -123,7 +117,7 @@ const ContactsInfoPage = () => {
|
||||
return (
|
||||
<Paper className={classes.root} square>
|
||||
<Button style={{ margin: 10 }} onClick={() => history.goBack()}>
|
||||
<ArrowBackIcon fontSize='large' />
|
||||
<ArrowBackIcon fontSize="large" />
|
||||
</Button>
|
||||
<div className={classes.listContainer}>
|
||||
<MuiAvatar className={classes.avatar} src={avatar} />
|
||||
@@ -161,21 +155,13 @@ const ContactsInfoPage = () => {
|
||||
{/* Display if fetched contact */}
|
||||
{contact && (
|
||||
<>
|
||||
<Box py={1} display='block'>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
onClick={handleContactSave}
|
||||
>
|
||||
<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}
|
||||
>
|
||||
<Box py={1} display="block">
|
||||
<Button variant="contained" color="secondary" onClick={handleContactDelete}>
|
||||
{t('GENERIC_DELETE')}
|
||||
</Button>
|
||||
</Box>
|
||||
@@ -183,12 +169,8 @@ const ContactsInfoPage = () => {
|
||||
)}
|
||||
{/* Display if no fetched contact */}
|
||||
{!contact && (
|
||||
<Box display='block'>
|
||||
<Button
|
||||
color='primary'
|
||||
variant='contained'
|
||||
onClick={handleContactAdd}
|
||||
>
|
||||
<Box display="block">
|
||||
<Button color="primary" variant="contained" onClick={handleContactAdd}>
|
||||
{t('APPS_CONTACT_MODAL_BUTTON_ADD')}
|
||||
</Button>
|
||||
</Box>
|
||||
|
||||
@@ -26,7 +26,7 @@ export const ContactPage = () => {
|
||||
<>
|
||||
<ContactList />
|
||||
<Fab
|
||||
color='primary'
|
||||
color="primary"
|
||||
onClick={() => history.push('/contacts/-1')}
|
||||
className={classes.absolute}
|
||||
>
|
||||
|
||||
@@ -17,7 +17,7 @@ export const useContacts = (): IUseContacts => {
|
||||
const found = contacts.find((contact) => contact.number === number);
|
||||
return found ? found.display : number;
|
||||
},
|
||||
[contacts]
|
||||
[contacts],
|
||||
);
|
||||
const getContact = useCallback(
|
||||
(id: number): Contact | null => {
|
||||
@@ -25,7 +25,7 @@ export const useContacts = (): IUseContacts => {
|
||||
if (contact.id === id) return contact;
|
||||
}
|
||||
},
|
||||
[contacts]
|
||||
[contacts],
|
||||
);
|
||||
return { contacts, getDisplayByNumber, getContact };
|
||||
};
|
||||
@@ -8,7 +8,7 @@ interface FilterdContactsProps {
|
||||
|
||||
export const useFilteredContacts = (): FilterdContactsProps => {
|
||||
const [filteredContacts, setFilteredContacts] = useRecoilState(
|
||||
contactsState.filterContacts
|
||||
contactsState.filterContacts,
|
||||
);
|
||||
return { filteredContacts, setFilteredContacts };
|
||||
};
|
||||
Reference in new issue
Block a user