diff --git a/phone/src/apps/contacts/components/ContactsApp.tsx b/phone/src/apps/contacts/components/ContactsApp.tsx index 354b144..506be6a 100644 --- a/phone/src/apps/contacts/components/ContactsApp.tsx +++ b/phone/src/apps/contacts/components/ContactsApp.tsx @@ -6,7 +6,6 @@ import { ContactList } from './List/ContactList'; import { useApp } from '../../../os/apps/hooks/useApps'; import { AddContactModal } from './ContactModal'; import { useModal } from '../hooks/useModal'; -import { SearchContacts } from './List/SearchContacts'; import PersonAddIcon from '@material-ui/icons/PersonAdd'; import Fab from '@material-ui/core/Fab'; import { InfoModal } from './modal/InfoModal'; @@ -48,7 +47,6 @@ export const ContactsApp = () => { return ( -
diff --git a/phone/src/apps/contacts/components/List/ContactList.tsx b/phone/src/apps/contacts/components/List/ContactList.tsx index 9c0553e..da9e14d 100644 --- a/phone/src/apps/contacts/components/List/ContactList.tsx +++ b/phone/src/apps/contacts/components/List/ContactList.tsx @@ -20,18 +20,18 @@ import { useContactDetail } from '../../hooks/useContactDetail'; import Nui from '../../../../os/nui-events/utils/Nui'; import '../Contact.css'; +import { SearchContacts } from './SearchContacts'; export const ContactList = () => { const { filteredContacts } = useFilteredContacts(); const { setShowContactModal } = useContactModal(); - const { contactDetail, setContactDetail } = useContactDetail(); + const { setContactDetail } = useContactDetail(); const contacts = useContacts(); const openContactInfo = (contact) => { setShowContactModal(true); setContactDetail(contact); - console.log('CONTACT', contactDetail); }; const startCall = (number) => { console.log(number); @@ -40,50 +40,54 @@ export const ContactList = () => { }); }; - const filteredRegEx = new RegExp(filteredContacts, "gi") + const filteredRegEx = new RegExp(filteredContacts, 'gi'); return ( - - {contacts.contacts - .filter( - (contact) => - contact.display.match(filteredRegEx) || contact.number.match(filteredRegEx) - ) - .map((contact) => ( - <> - - - {contact.avatar ? ( - - ) : ( - - {contact.display.slice(0, 1).toUpperCase()} - - )} - - - - - - - - ))} - + <> + + + {contacts.contacts + .filter( + (contact) => + contact.display.match(filteredRegEx) || + contact.number.match(filteredRegEx) + ) + .map((contact) => ( + <> + + + {contact.avatar ? ( + + ) : ( + + {contact.display.slice(0, 1).toUpperCase()} + + )} + + + + + + + + ))} + + ); }; diff --git a/phone/src/apps/contacts/components/List/SearchContacts.tsx b/phone/src/apps/contacts/components/List/SearchContacts.tsx index 2fad490..2628bde 100644 --- a/phone/src/apps/contacts/components/List/SearchContacts.tsx +++ b/phone/src/apps/contacts/components/List/SearchContacts.tsx @@ -3,7 +3,6 @@ import { InputBase } from '@material-ui/core'; import SearchIcon from '@material-ui/icons/Search'; import { createStyles, - fade, Theme, makeStyles, } from '@material-ui/core/styles'; @@ -15,7 +14,7 @@ import { useFilteredContacts } from '../../hooks/useFilteredContacts'; const useStyles = makeStyles((theme: Theme) => createStyles({ bg: { - backgroundColor: '#232323', + backgroundColor: theme.palette.background.paper, display: 'flex', height: 60, justifyContent: 'center', @@ -25,14 +24,13 @@ const useStyles = makeStyles((theme: Theme) => fontSize: 20, }, inputRoot: { - color: '#fff', fontSize: 18, + border: '1px solid', + borderColor: theme.palette.divider, }, inputInput: { padding: theme.spacing(1, 4, 1, 4), transition: theme.transitions.create('width'), - width: '100%', - [theme.breakpoints.up('sm')]: { width: '13ch', '&:focus': { @@ -43,10 +41,6 @@ const useStyles = makeStyles((theme: Theme) => search: { position: 'relative', borderRadius: theme.shape.borderRadius, - backgroundColor: fade(theme.palette.common.white, 0.15), - '&:hover': { - backgroundColor: fade(theme.palette.common.white, 0.25), - }, marginLeft: 0, width: '100%', [theme.breakpoints.up('sm')]: { @@ -75,16 +69,17 @@ export const SearchContacts = () => {
- +
setFilteredContacts(e.target.value)} + fullWidth + onChange={(e) => setFilteredContacts(e.target.value)} placeholder={t('APPS_CONTACT_PLACEHOLDER_SEARCH_CONTACTS')} classes={{ root: classes.inputRoot, input: classes.inputInput, }} - inputProps={{ 'aria-label': 'search', 'autoFocus': true }} + inputProps={{ 'aria-label': 'search', autoFocus: true }} />
diff --git a/phone/src/apps/dialer/components/DialPadGrid.tsx b/phone/src/apps/dialer/components/DialPadGrid.tsx index daff0e6..d59fadb 100644 --- a/phone/src/apps/dialer/components/DialPadGrid.tsx +++ b/phone/src/apps/dialer/components/DialPadGrid.tsx @@ -19,7 +19,7 @@ const ButtonItem = ({ label, onClick }: IBtnItem) => { const classes = useStyles(); return ( - @@ -30,7 +30,7 @@ export const DialGrid = () => { const { add, removeOne, clear} = useContext(DialInputCtx) return ( - + add(1)} /> add(2)} /> diff --git a/phone/src/apps/dialer/components/DialerApp.tsx b/phone/src/apps/dialer/components/DialerApp.tsx index fe2c3c8..7be6360 100644 --- a/phone/src/apps/dialer/components/DialerApp.tsx +++ b/phone/src/apps/dialer/components/DialerApp.tsx @@ -9,6 +9,7 @@ import DialPage from './views/DialPage'; import DialerNavBar from './DialerNavBar'; import { useDialHistory } from '../hooks/useDialHistory'; import InjectDebugData from '../../../os/debug/InjectDebugData'; +import { ContactList } from '../../contacts/components/List/ContactList'; InjectDebugData([ { @@ -41,10 +42,10 @@ export const DialerApp = () => { - + - {/**/} + diff --git a/phone/src/apps/dialer/components/DialerNavBar.tsx b/phone/src/apps/dialer/components/DialerNavBar.tsx index 6951e4f..4e0bdb5 100644 --- a/phone/src/apps/dialer/components/DialerNavBar.tsx +++ b/phone/src/apps/dialer/components/DialerNavBar.tsx @@ -1,9 +1,10 @@ -import React, { ChangeEvent, useState } from 'react'; +import React, { useState } from 'react'; import { BottomNavigation, BottomNavigationAction } from '@material-ui/core'; -import { Link } from 'react-router-dom'; +import { NavLink, useLocation } from 'react-router-dom'; import { makeStyles, Theme } from '@material-ui/core/styles'; import PhoneIcon from '@material-ui/icons/Phone'; -import { History } from '@material-ui/icons'; +import PersonIcon from '@material-ui/icons/Person'; +import HistoryIcon from '@material-ui/icons/History'; const useStyles = makeStyles((theme: Theme) => ({ root: { @@ -17,10 +18,10 @@ const useStyles = makeStyles((theme: Theme) => ({ const DialerNavBar = () => { const classes = useStyles(); + const { pathname } = useLocation(); + const [page, setPage] = useState(pathname); - const [page, setPage] = useState(0); - - const handleChange = (event: ChangeEvent<{}>, newPage) => { + const handleChange = (_e, newPage) => { setPage(newPage); }; @@ -33,15 +34,26 @@ const DialerNavBar = () => { > } + value='/phone' + component={NavLink} + icon={} to='/phone' /> } to='/phone/dial' - label='Call' + /> + } + to='/phone/contacts' /> ); diff --git a/phone/src/apps/dialer/components/views/DialPage.tsx b/phone/src/apps/dialer/components/views/DialPage.tsx index 619a79c..f191265 100644 --- a/phone/src/apps/dialer/components/views/DialPage.tsx +++ b/phone/src/apps/dialer/components/views/DialPage.tsx @@ -2,8 +2,8 @@ import React, { useState } from 'react'; import { makeStyles, Theme } from '@material-ui/core/styles'; import DialGrid from '../DialPadGrid'; import { DialerInput } from '../DialerInput'; -import ContactSearch from '../ContactSearch'; import { DialInputCtx } from '../../context/InputContext'; +import { useQueryParams } from '../../../../common/hooks/useQueryParams'; const useStyles = makeStyles((theme: Theme) => ({ root: { @@ -16,8 +16,9 @@ const useStyles = makeStyles((theme: Theme) => ({ const DialPage = () => { const classes = useStyles(); - - const [inputVal, setInputVal] = useState(''); + const query = useQueryParams(); + const queryNumber = query.number; + const [inputVal, setInputVal] = useState(queryNumber || ''); return (
@@ -29,7 +30,6 @@ const DialPage = () => { clear: () => setInputVal(''), }} > - diff --git a/phone/src/config/default.json b/phone/src/config/default.json index 3b638b2..cc08737 100644 --- a/phone/src/config/default.json +++ b/phone/src/config/default.json @@ -1,12 +1,7 @@ { "cellProvider": "AT&T", "language": "en", - "wallpapers": [ - "beach.jpg", - "minimal.jpg", - "surf.jpg", - "waves.jpg" - ], + "wallpapers": ["beach.jpg", "minimal.jpg", "surf.jpg", "waves.jpg"], "defaultSettings": { "wallpaper": "minimal.png", "frame": "s10.png", @@ -25,7 +20,10 @@ "themes": { "default-dark": { "palette": { - "type": "dark" + "type": "dark", + "primary": { + "main": "#a6d4fa" + } } }, "default-light": { @@ -37,6 +35,9 @@ "common": {}, "palette": { "type": "dark", + "primary": { + "main": "#a6d4fa" + }, "background": { "paper": "#1c1c1c", "default": "#121212",