mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Merge pull request #11 from Re-Ignited-Development/tweak/contacts-app
Tweak/contacts app
This commit is contained in:
15 files changed
+399
-134
No files matched your search
@@ -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 };
|
||||
}
|
||||
Reference in new issue
Block a user