Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/qol #1110

Merged
merged 4 commits into from
Jan 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions apps/game/client/cl_main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ RegisterNuiCB<{ keepGameFocus: boolean }>(
},
);

// If you want to remove controls from a external application this is the way to do it.
on(PhoneEvents.SET_GAME_FOCUS, (keepGameFocus: boolean) => {
if (global.isPhoneOpen) SetNuiFocusKeepInput(keepGameFocus);
});

/* * * * * * * * * * * * *
*
* PhoneAsItem Export Checker
Expand Down
17 changes: 15 additions & 2 deletions apps/phone/src/apps/contacts/components/List/ContactList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { useContactActions } from '@apps/contacts/hooks/useContactActions';
import { useMyPhoneNumber } from '@os/simcard/hooks/useMyPhoneNumber';
import { Phone, MessageSquare, Plus } from 'lucide-react';
import { List, ListItem, NPWDButton } from '@npwd/keyos';
import { initials } from '@utils/misc';

export const ContactList: React.FC = () => {
const filteredContacts = useFilteredContacts();
Expand Down Expand Up @@ -47,7 +48,7 @@ export const ContactList: React.FC = () => {
.sort()
.map((letter) => (
<div key={letter} className="relative">
<div className="sticky top-0 z-10 rounded-xl border-t border-b border-gray-200 bg-neutral-50 px-6 py-1 text-sm font-medium text-gray-500 dark:border-none dark:bg-neutral-800">
<div className="sticky top-0 z-10 rounded-xl border-b border-t border-gray-200 bg-neutral-50 px-6 py-1 text-sm font-medium text-gray-500 dark:border-none dark:bg-neutral-800">
<h3>{letter}</h3>
</div>
<List>
Expand Down Expand Up @@ -107,7 +108,19 @@ const ContactItem = (contact: Contact) => {
className="flex items-center justify-between focus:outline-none"
>
<div className="flex items-center space-x-2">
<img className="inline-block h-10 w-10 rounded-full" src={contact.avatar} alt="" />
{contact.avatar && contact.avatar.length > 0 ? (
<img
src={contact.avatar}
className="inline-block h-10 w-10 rounded-full"
alt={'avatar'}
/>
) : (
<div className="flex h-10 w-10 items-center justify-center rounded-full">
<span className="text-gray-600 dark:text-gray-300">
{initials(contact.display)}
</span>
</div>
)}
<div>
<p className="text-base font-medium text-neutral-900 dark:text-neutral-100">
{contact.display}
Expand Down
33 changes: 18 additions & 15 deletions apps/phone/src/apps/contacts/components/views/ContactInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import { useModal } from '@apps/contacts/hooks/useModal';
import { usePhone } from '@os/phone/hooks/usePhone';
import { cn } from '@utils/css';
import { initials } from '@utils/misc';

interface ContactInfoRouteParams {
mode: string;
Expand Down Expand Up @@ -161,7 +162,7 @@
if (addNumber) setNumber(addNumber);
if (avatarParam) setAvatar(avatarParam);
if (nameParam) setName(nameParam);
}, [addNumber, avatar, avatarParam, nameParam]);
}, [addNumber, avatarParam, nameParam]);

if (!ResourceConfig) return null;

Expand All @@ -174,17 +175,25 @@
/>
<button
onClick={() => history.goBack()}
className="mt-4 ml-4 rounded-md px-3 py-1 hover:dark:bg-neutral-800"
className="ml-4 mt-4 rounded-md px-3 py-1 hover:dark:bg-neutral-800"
>
<ArrowLeft className="h-6 w-6 dark:text-neutral-300" />
</button>
<div className="mx-auto w-9/12">
<div>
<img
src={avatar}
className="mx-auto h-24 w-24 rounded-full text-center"
alt="contact avatar"
/>
{avatar && avatar.length > 0 ? (
<img
src={avatar}
Dismissed Show dismissed Hide dismissed
Dismissed Show dismissed Hide dismissed
className="mx-auto h-24 w-24 rounded-full text-center"
alt={'avatar'}
/>
) : (
<div className="rounded-full-600 mx-auto h-24 w-24 text-center">
<span className="text-5xl text-gray-600 dark:text-gray-300">
{initials(contact.display)}
</span>
</div>
)}
</div>
<div className="mt-8 space-y-2">
<div className="text-sm font-medium text-neutral-400">{t('CONTACTS.FORM_NAME')}</div>
Expand Down Expand Up @@ -238,17 +247,11 @@

<div className="mt-8">
{contact ? (
<NPWDButton
onClick={handleContactUpdate}
className="w-full"
>
<NPWDButton onClick={handleContactUpdate} className="w-full">
{t('GENERIC.UPDATE')}
</NPWDButton>
) : (
<NPWDButton
onClick={handleContactAdd}
className="w-full"
>
<NPWDButton onClick={handleContactAdd} className="w-full">
{t('GENERIC.ADD')}
</NPWDButton>
)}
Expand Down
13 changes: 10 additions & 3 deletions apps/phone/src/apps/messages/components/list/MessageGroupItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { useContactActions } from '../../../contacts/hooks/useContactActions';
import { useContacts } from '../../../contacts/hooks/state';
import { Contact } from '@typings/contact';
import { ListItem } from '@npwd/keyos';
import { initials } from '@utils/misc';

interface IProps {
messageConversation: MessageConversation;
Expand Down Expand Up @@ -88,12 +89,18 @@ const MessageGroupItem = ({
<div>
{messageConversation.isGroupChat ? (
<MuiAvatar alt={messageConversation.label} />
) : (
) : getContact()?.avatar && getContact()?.avatar.length > 0 ? (
<img
alt={getContact()?.display ?? ''}
src={getContact()?.avatar}
className="h-8 w-8 rounded-full"
className="inline-block h-10 w-10 rounded-full"
alt={'avatar'}
/>
) : (
<div className="flex h-10 w-10 items-center justify-center rounded-full">
<span className="text-gray-600 dark:text-gray-300">
{initials(getContact()?.display)}
</span>
</div>
)}
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion apps/phone/src/locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@
"CURRENT_CALL_TITLE": "Current Phone Call",
"INCOMING_CALL_TITLE": "Incoming Phone Call",
"CURRENT_CALL_WITH": "In call with {{ transmitter }}",
"TRANSMITTER_IS_CALLING": "{{ transmitter }} is calling you!"
"TRANSMITTER_IS_CALLING": "{{ transmitter }} is calling you!",
"CALLING": "Calling {{ transmitter }}..."
},
"INPUT_PLACEHOLDER": "Enter a number",
"NAVBAR_HISTORY": "History",
Expand Down
105 changes: 59 additions & 46 deletions apps/phone/src/locale/sv.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"INCOMING": "Inkommande samtal"
},
"FEEDBACK": {
"ERROR_MYSELF": "Du kan inte ringa ditt egna telefon nummer!",
"ERROR_MYSELF": "Du kan inte ringa ditt egna telefonnummer!",
"ERROR": "Ett fel uppstod när det här samtalet slutfördes"
}
},
Expand All @@ -29,93 +29,96 @@
},
"SETTINGS": {
"PHONE_NUMBER": "Telefonnummer",
"PREVIEW_SOUND": "Spela upp",
"CATEGORY": {
"APPEARANCE": "Utseende",
"PHONE": "Telefon",
"ACTIONS": "Allmänt"
},
"OPTIONS": {
"ICONSET": "Ikon Set",
"ICONSET": "Ikonset",
"THEME": "Tema",
"LANGUAGE": "Språk",
"FRAME": "Ram",
"ZOOM": "Zoom",
"WALLPAPER": "Bakgrundsbild",
"RESET_SETTINGS": "Återställ inställningar",
"RESET_SETTINGS_DESC": "Detta kommer att rensa dina lokala data",
"RESET_SETTINGS_DESC": "Detta kommer att rensa dina inställningar",
"STREAMER_MODE": {
"TITLE": "Streamerläge",
"DESCRIPTION": "Göm bilder innan de visas"
},
"CUSTOM_WALLPAPER": {
"DIALOG_TITLE": "Anpassad bakgrundsbild",
"DIALOG_CONTENT": "Ställ in en anpassad bakgrund genom att ange webbadressen till bilden nedan!",
"DIALOG_PLACEHOLDER": "Bild URL",
"DIALOG_PLACEHOLDER": "Bildlänk",
"DIALOG_ERROR": "Ogiltig bild eller länk"
},
"CALL_VOLUME": "Samtalsvolym",
"RINGTONE": "Ringsignal",
"RINGTONE_VOLUME": "Ringsignal Volym",
"RINGTONE_VOLUME": "Ringsignalsvolym",
"NOTIFICATION": "Notifikation",
"NOTIFICATION_VOLUME": "Notifikation Volym",
"NOTIFICATION_FILTER": "Notifikation Filtrering"
"NOTIFICATION_VOLUME": "Notifikationsvolym",
"NOTIFICATION_FILTER": "Notifikationsfiltrering"
},
"MESSAGES": {
"INVALID_SETTINGS": "Felaktiga inställningar! Vänligen återställ i appen Inställningar.",
"SETTINGS_RESET": "Inställningarna har återställts!!"
"SETTINGS_RESET": "Inställningarna har återställts!"
},
"MARKETPLACE": {
"NOTIFICATION": "Notifikationer",
"NOTIFY_NEW_LISTING": "Notifikation för nya annonseringar"
}
},
"CAMERA": {
"SHARE_DESTINATION": "Vart vill du dela din bild?",
"COPY_IMAGE": "Kopiera bildens url här:",
"FAILED_TO_DELETE": "Bilden kunde inte tasbort :(",
"FAILED_TO_TAKE_PHOTO": "Bilden kunde inte sparas :("
"COPY_IMAGE": "Kopiera bildlänk",
"FAILED_TO_DELETE": "Bilden kunde inte tas bort.",
"FAILED_TO_TAKE_PHOTO": "Bilden kunde inte sparas."
},
"CONTACTS": {
"FEEDBACK": {
"ADD_FAILED": "Det gick inte att skapa kontakten!",
"ADD_SUCCESS": "Skapat ny kontakt!",
"UPDATE_FAILED": "Det gick inte att uppdatera kontakten!",
"UPDATE_SUCCESS": "Uppdaterat kontakten!",
"ADD_SUCCESS": "Kontakten skapades!",
"UPDATE_FAILED": "Det gick inte att uppdatera kontakten.",
"UPDATE_SUCCESS": "Kontakten sparades!",
"DELETE_FAILED": "Det gick inte att ta bort kontakten!",
"DELETE_SUCCESS": "Kontakt borttagen!",
"PAYMENTFAILED": "The payment failed!",
"PAYMENTSENT": "The payment sent!"
"DELETE_SUCCESS": "Kontakten togs bort!"
},
"AMOUNT": "How Much?",
"SENDMONEY": "Send Money",
"PLACEHOLDER_SEARCH_CONTACTS": "Sök kontakt...",
"FORM_NAME": "Namn",
"FORM_NUMBER": "Nummer",
"FORM_AVATAR": "Avatar URL",
"FORM_AVATAR": "Bildlänk",
"MODAL_BUTTON_ADD": "Lägg till kontakt"
},
"DIALER": {
"MESSAGES": {
"CURRENT_CALL_TITLE": "Aktuellt telefonsamtal",
"INCOMING_CALL_TITLE": "Inkommande samtal",
"CURRENT_CALL_WITH": "I samtal med {{ transmitter }}",
"TRANSMITTER_IS_CALLING": "{{ transmitter }} ringer dig!"
"TRANSMITTER_IS_CALLING": "{{ transmitter }} ringer dig!",
"CALLING": "Ringer {{ transmitter }}..."
},
"INPUT_PLACEHOLDER": "Ange ett nummer",
"NAVBAR_HISTORY": "Historik",
"NAVBAR_HISTORY": "Senaste",
"NAVBAR_DIAL": "Knappsats",
"NAVBAR_CONTACTS": "Kontakter",
"NO_HISTORY": "Du har ingen samtals historik"
"NO_HISTORY": "Du har ingen samtalshistorik"
},
"TWITTER": {
"FEEDBACK": {
"CREATE_PROFILE_SUCCESS": "Har skapat din profil",
"CREATE_PROFILE_FAILURE": "Det gick inte skapa en profil",
"EDIT_PROFILE_SUCCESS": "Du har uppdaterat din profil",
"EDIT_PROFILE_FAILURE": "Det gick inte uppdatera din profil",
"CREATE_FAILED": "Det gick inte skicka din tweet!",
"CREATE_PROFILE_SUCCESS": "Profilen skapades",
"CREATE_PROFILE_FAILURE": "Det gick inte skapa profilen",
"EDIT_PROFILE_SUCCESS": "Du uppdaterade din profil",
"EDIT_PROFILE_FAILURE": "Det gick inte uppdatera profilen",
"CREATE_FAILED": "Det gick inte att skicka din tweet!",
"RETWEET_FAILED": "Det gick inte att retweeta den här tweeten",
"RETWEET_EXISTS": "Du har redan retweetat den här tweeten!",
"LIKE_TWEET_FAILED": "Det gick inte att gilla tweeten",
"REPORT_TWEET_SUCCESS": "Du har rapporterat en tweet",
"REPORT_TWEET_FAILED": "Det gick inte rapportera tweeten",
"REPORT_TWEET_FAILED": "Det gick inte att rapportera tweeten",
"FETCH_TWEETS_FAILED": "Det gick inte att hämta tweets",
"DELETE_TWEET_FAILED": "Det gick inte tabort tweeten"
"DELETE_TWEET_FAILED": "Det gick inte ta bort tweeten"
},
"MESSAGES": {
"NEW_RETWEET_BROADCAST": "@{{ profile_name }} retweetade något!",
Expand All @@ -127,18 +130,15 @@
"REPORTED": " Rapporterad",
"REPORT": "Rapportera",
"IMAGE_PLACEHOLDER": "Infoga länk till bild / GIF",
"EDIT_DEFAULT_PROFILE_NAME": "Välj profil namn",
"EDIT_PROFILE_AVATAR": "Avatar URL",
"EDIT_DEFAULT_PROFILE_NAME": "Välj profilnamn",
"EDIT_PROFILE_AVATAR": "Profilbildslänk",
"AVATAR_CHOOSE_IMAGE": "Välj en bild",
"EDIT_PROFILE_NAME": "Profil namn",
"EDIT_PROFILE_BIO": "Bio",
"EDIT_PROFILE_LOCATION": "Plats",
"EDIT_PROFILE_JOB": "Jobb",
"EDIT_PROFILE_NAME": "Profilnamn",
"RETWEETED": "Retweetad",
"TWEET_MESSAGE_CHAR_LIMIT": "Meddelandet överskrider teckengränsen",
"TWEET_MESSAGE_NEW_LINE_LIMIT": "Meddelandet är över den nya radgränsen",
"TWEET_MESSAGE_PLACEHOLDER": "Vad gör du just nu?",
"SEARCH_TWEETS_PLACEHOLDER": "Sök på profil namn eller meddelande",
"SEARCH_TWEETS_PLACEHOLDER": "Sök på profilnamn eller meddelande",
"SEARCH_TWEETS": "Sök efter tweets",
"TIME_JUST_NOW": "Just nu",
"TIME_MINUTES": "m",
Expand All @@ -147,8 +147,9 @@
},
"MATCH": {
"MESSAGES": {
"PROFILE_MATCHED_AT": "Du matchade med: {{ matchedAt }}",
"PROFILE_LAST_ACTIVE": "Last Active: {{ lastActive }}",
"PROFILE_MATCHED_AT": "Ni matchade den {{ matchedAt }}",
"NEW_MATCH": "Ny matchning!",
"PROFILE_LAST_ACTIVE": "Senast inloggad den {{ lastActive }}",
"LIKED": "GILLA",
"NOPE": "NOPE"
},
Expand All @@ -163,8 +164,9 @@
"NEW_LIKE_FOUND": "Ny matchning hittad!"
},
"PROFILE_CONFIGURATION": "Appen är felaktigt konfigurerad - kan inte skapa profil. Kontakta en administratör.",
"EDIT_PROFILE_IMAGE": "Bild URL",
"EDIT_PROFILE_NAME": "Profil namn",
"EDIT_PROFILE_IMAGE": "Profilbildslänk",
"EDIT_PROFILE_CHOOSE_IMAGE": "Välj bild",
"EDIT_PROFILE_NAME": "Profilnamn",
"EDIT_PROFILE_BIO": "Bio",
"EDIT_PROFILE_LOCATION": "Plats",
"EDIT_PROFILE_JOB": "Jobb",
Expand Down Expand Up @@ -224,11 +226,21 @@
"SEARCH_PLACEHOLDER": "Sök meddelande...",
"DELETE_CONVERSATION": "Ta bort konverstationen",
"NEW_MESSAGE": "Meddelande...",
"NEW_MESSAGE_GROUP": "Telefon nummer...",
"GROUP_CHAT_LABEL": "Gruppchattetikett...",
"MEDIA_OPTION": "Kamera / Galleri",
"NEW_MESSAGE_GROUP": "Telefonnummer...",
"SHARE_IMAGE_TITLE": "Vill du dela denna bild?",
"SHARE_NOTE_TITLE": "Vill du dela denna anteckning?",
"SHARE_CONTACT_TITLE": "Vill du dela denna kontakt?",
"GROUP_CHAT_LABEL": "Gruppchattsetikett...",
"MEDIA_OPTION": "Dela en bild",
"CONTACT_OPTION": "Dela en kontakt",
"NOTE_OPTION": "Dela en anteckning",
"CHOOSE_CONTACT": "Välj kontakt",
"LOCATION_OPTION": "Dela din position",
"LOCATION_MESSAGE": "Position delad",
"LOCATION_TOOLTIP": "Sätt in i GPS",
"NOTE_TOOLTIP": "Visa anteckning",
"NEW_MESSAGE_GROUP_SUBMIT": "Skicka",
"INPUT_NAME_OR_NUMBER": "Sök kontakter eller skriv nummer och tryck enter",
"INPUT_NAME_OR_NUMBER": "Kontaktnamn eller nummer",
"ACTIONS_TITLE": "Allmänt",
"ME": "Jag"
},
Expand Down Expand Up @@ -288,6 +300,7 @@
"TITLE": "Titel",
"SEND": "Skicka",
"CONTENT": "Innehåll",
"SHARE": "Dela",
"WRITE_TO_CLIPBOARD_TOOLTIP": "Kopiera {{ content }}",
"WRITE_TO_CLIPBOARD_MESSAGE": "Kopierade {{content}} till urklipp!"
},
Expand All @@ -304,7 +317,7 @@
"APPS_TWITTER": "Twitter",
"APPS_MARKETPLACE": "Blocket",
"APPS_CAMERA": "Kamera",
"APPS_MATCH": "Matchmaker",
"APPS_MATCH": "Findr",
"APPS_CALCULATOR_COPIED": "Resultatet kopierades till urklipp!",
"APPS_DARKCHAT": "IRC",
"GENERIC_CLICK_TO_REVEAL": "Tryck för att visa",
Expand Down
Loading
Loading