mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Add contacts referal after creating from dialer
This commit is contained in:
3 files changed
+13
-7
No files matched your search
@@ -21,7 +21,8 @@ interface ContactInfoRouteParams {
|
||||
}
|
||||
|
||||
interface ContactInfoRouteQuery {
|
||||
addNumber: string;
|
||||
addNumber?: string;
|
||||
referal?: string;
|
||||
}
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
@@ -59,7 +60,7 @@ const ContactsInfoPage = () => {
|
||||
const { getContact } = useContacts();
|
||||
|
||||
const { id } = useParams<ContactInfoRouteParams>();
|
||||
const { addNumber } = useQueryParams<ContactInfoRouteQuery>();
|
||||
const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({ referal: '/contacts' });
|
||||
|
||||
const contact = getContact(parseInt(id));
|
||||
|
||||
@@ -87,7 +88,7 @@ const ContactsInfoPage = () => {
|
||||
number,
|
||||
avatar,
|
||||
});
|
||||
history.replace('/contacts');
|
||||
history.replace(referal);
|
||||
};
|
||||
|
||||
const handleContactSave = () => {
|
||||
|
||||
@@ -39,7 +39,7 @@ export const DialerInput = () => {
|
||||
};
|
||||
|
||||
const handleNewContact = (number: string) => {
|
||||
history.push(`/contacts/-1/?addNumber=${number}`)
|
||||
history.push(`/contacts/-1/?addNumber=${number}&referal=/phone/contacts`)
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user