Merge pull request #11 from Re-Ignited-Development/tweak/contacts-app

Tweak/contacts app
This commit is contained in:
Christopher Gjelten authored and GitHub committed 2020-10-16 20:21:23 +02:00
commit 9d7430f573
15 files changed
+399 -134

No files matched your search

+8
View File
@@ -5,4 +5,12 @@ export const contactsState = {
key: "contactsList",
default: [],
}),
showModal: atom({
key: 'showModal',
default: false
}),
filterContacts: atom({
key: 'filterContacts',
default: ""
})
};
@@ -5,6 +5,7 @@ interface Contact {
id: string;
display: string;
number: string;
img?: string
}
interface IUseContacts {
@@ -0,0 +1,7 @@
import { useRecoilState } from 'recoil';
import { contactsState } from './state';
export const useFilteredContacts = () => {
const [ filteredContacts, setFilteredContacts ] = useRecoilState(contactsState.filterContacts);
return { filteredContacts, setFilteredContacts };
}
@@ -0,0 +1,7 @@
import { useRecoilState } from 'recoil';
import { contactsState } from './state';
export const useModal = () => {
const [ showModal, setShowModal ] = useRecoilState(contactsState.showModal);
return { showModal, setShowModal };
}