mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-03 22:16:54 +00:00
tweak(phone/contacts): Type safety for contacts state & variable rename
Renamed and type variable in setFilteredContacts to better represent its use
This commit is contained in:
1 parent
9610891a04
commit
7b1d30f265
2 files changed
+5
-12
No files matched your search
@@ -1,24 +1,17 @@
|
||||
import { atom } from 'recoil';
|
||||
import { Contact } from '../../../../../typings/contact';
|
||||
|
||||
export const contactsState = {
|
||||
contacts: atom({
|
||||
contacts: atom<Contact[]>({
|
||||
key: 'contactsList',
|
||||
default: [],
|
||||
}),
|
||||
showModal: atom({
|
||||
showModal: atom<boolean>({
|
||||
key: 'showModal',
|
||||
default: false,
|
||||
}),
|
||||
filterContacts: atom({
|
||||
filterContacts: atom<string>({
|
||||
key: 'filterContacts',
|
||||
default: '',
|
||||
}),
|
||||
showContactsModal: atom({
|
||||
key: 'showContactModal',
|
||||
default: false,
|
||||
}),
|
||||
contactDetail: atom({
|
||||
key: 'contactDetail',
|
||||
default: null,
|
||||
}),
|
||||
};
|
||||
@@ -3,7 +3,7 @@ import { contactsState } from './state';
|
||||
|
||||
interface FilterdContactsProps {
|
||||
filteredContacts: string;
|
||||
setFilteredContacts: (contact: any) => void;
|
||||
setFilteredContacts: (searchTerm: string) => void;
|
||||
}
|
||||
|
||||
export const useFilteredContacts = (): FilterdContactsProps => {
|
||||
|
||||
Reference in new issue
Block a user