mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +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 { atom } from 'recoil';
|
||||||
|
import { Contact } from '../../../../../typings/contact';
|
||||||
|
|
||||||
export const contactsState = {
|
export const contactsState = {
|
||||||
contacts: atom({
|
contacts: atom<Contact[]>({
|
||||||
key: 'contactsList',
|
key: 'contactsList',
|
||||||
default: [],
|
default: [],
|
||||||
}),
|
}),
|
||||||
showModal: atom({
|
showModal: atom<boolean>({
|
||||||
key: 'showModal',
|
key: 'showModal',
|
||||||
default: false,
|
default: false,
|
||||||
}),
|
}),
|
||||||
filterContacts: atom({
|
filterContacts: atom<string>({
|
||||||
key: 'filterContacts',
|
key: 'filterContacts',
|
||||||
default: '',
|
default: '',
|
||||||
}),
|
}),
|
||||||
showContactsModal: atom({
|
|
||||||
key: 'showContactModal',
|
|
||||||
default: false,
|
|
||||||
}),
|
|
||||||
contactDetail: atom({
|
|
||||||
key: 'contactDetail',
|
|
||||||
default: null,
|
|
||||||
}),
|
|
||||||
};
|
};
|
||||||
@@ -3,7 +3,7 @@ import { contactsState } from './state';
|
|||||||
|
|
||||||
interface FilterdContactsProps {
|
interface FilterdContactsProps {
|
||||||
filteredContacts: string;
|
filteredContacts: string;
|
||||||
setFilteredContacts: (contact: any) => void;
|
setFilteredContacts: (searchTerm: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const useFilteredContacts = (): FilterdContactsProps => {
|
export const useFilteredContacts = (): FilterdContactsProps => {
|
||||||
|
|||||||
Reference in new issue
Block a user