mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
tweak(phone/call-modal): Tweaked appearance of call modal (#178)
Correct actions will now display if calling another player. Also added ringing flavor text when the person calling is the transmitter.
This commit is contained in:
15 files changed
+248
-136
No files matched your search
@@ -46,7 +46,8 @@ InjectDebugData([
|
||||
{
|
||||
id: 3,
|
||||
display: 'Chip',
|
||||
number: '111-1111',
|
||||
number: '603-275-8373',
|
||||
avatar: 'http://i.tasoagc.dev/2QYV',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
|
||||
@@ -9,10 +9,11 @@ interface IUseContacts {
|
||||
getDisplayByNumber: (number: string) => string;
|
||||
getContactByNumber: (number: string) => Contact | null;
|
||||
getContact: (id: number) => Contact | null;
|
||||
getPictureByNumber: (number: string) => string | null;
|
||||
}
|
||||
|
||||
export const useContacts = (): IUseContacts => {
|
||||
const contacts = useRecoilValue(contactsState.contacts);
|
||||
const contacts = useRecoilValue<Contact[]>(contactsState.contacts);
|
||||
|
||||
const getDisplayByNumber = useCallback(
|
||||
(number: string) => {
|
||||
@@ -22,6 +23,14 @@ export const useContacts = (): IUseContacts => {
|
||||
[contacts],
|
||||
);
|
||||
|
||||
const getPictureByNumber = useCallback(
|
||||
(number: string) => {
|
||||
const found = contacts.find((contact) => contact.number === number);
|
||||
return found ? found.avatar : null;
|
||||
},
|
||||
[contacts],
|
||||
);
|
||||
|
||||
const getContactByNumber = useCallback(
|
||||
(number: string): Contact | null => {
|
||||
for (const contact of contacts) {
|
||||
@@ -42,5 +51,5 @@ export const useContacts = (): IUseContacts => {
|
||||
[contacts],
|
||||
);
|
||||
|
||||
return { contacts, getDisplayByNumber, getContact, getContactByNumber };
|
||||
return { contacts, getDisplayByNumber, getContact, getContactByNumber, getPictureByNumber };
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
const getBackgroundPath = (bg: string) => `media/backgrounds/${bg}`;
|
||||
|
||||
export default getBackgroundPath;
|
||||
Reference in new issue
Block a user