mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Add dialer app theme | Add new contact button from dialer after you type number
This commit is contained in:
7 files changed
+76
-29
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
Avatar as MuiAvatar,
|
||||
Box,
|
||||
@@ -13,12 +13,17 @@ import { useContacts } from '../../hooks/useContacts';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
|
||||
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
|
||||
|
||||
interface ContactInfoRouteParams {
|
||||
mode: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
interface ContactInfoRouteQuery {
|
||||
addNumber: string;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
root: {
|
||||
height: '100%',
|
||||
@@ -54,6 +59,7 @@ const ContactsInfoPage = () => {
|
||||
const { getContact } = useContacts();
|
||||
|
||||
const { id } = useParams<ContactInfoRouteParams>();
|
||||
const { addNumber } = useQueryParams<ContactInfoRouteQuery>();
|
||||
|
||||
const contact = getContact(parseInt(id));
|
||||
|
||||
@@ -64,6 +70,12 @@ const ContactsInfoPage = () => {
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
useEffect(() => {
|
||||
if (addNumber) {
|
||||
setNumber(addNumber);
|
||||
}
|
||||
}, [addNumber]);
|
||||
|
||||
const handleContactAdd = () => {
|
||||
LogDebugEvent({
|
||||
action: 'Handling Contact Add',
|
||||
@@ -113,6 +125,7 @@ const ContactsInfoPage = () => {
|
||||
<div className={classes.listContainer}>
|
||||
<MuiAvatar className={classes.avatar} src={avatar} />
|
||||
<TextField
|
||||
autoFocus
|
||||
className={classes.input}
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
|
||||
Reference in new issue
Block a user