mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Compare commits
34
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3076a45fb | ||
|
|
62aaaea368 | ||
|
|
9896f2384e | ||
|
|
289207beb9 | ||
|
|
8bfdc1b8b2 | ||
|
|
d315d72e93 | ||
|
|
2992a644fe | ||
|
|
2b633c9e80 | ||
|
|
dab4c1eaf7 | ||
|
|
48e0dd2443 | ||
|
|
3157cafd5a | ||
|
|
c82a48b012 | ||
|
|
4d46566811 | ||
|
|
ee7e3a3ae1 | ||
|
|
31241c7e8f | ||
|
|
5f2dce2dda | ||
|
|
107dc43624 | ||
|
|
f27e486ff5 | ||
|
|
a88286f97a | ||
|
|
baf6dedb6f | ||
|
|
c5115777c5 | ||
|
|
d95cd8d4bc | ||
|
|
632e27e0fa | ||
|
|
853b335ef9 | ||
|
|
6b865f2e73 | ||
|
|
b02b19be5f | ||
|
|
0bb9b6738f | ||
|
|
a6f98d7ac0 | ||
|
|
5ce6cf2d4a | ||
|
|
2e4d752cd3 | ||
|
|
2cd3e9e93d | ||
|
|
98efed4e64 | ||
|
|
de10ce92b2 | ||
|
|
5654e1f46f |
No files matched your search
@@ -27,6 +27,10 @@
|
|||||||
"enableImages": true,
|
"enableImages": true,
|
||||||
"maxImages": 3
|
"maxImages": 3
|
||||||
},
|
},
|
||||||
|
"match": {
|
||||||
|
"generateProfileNameFromUsers": true,
|
||||||
|
"allowEdtiableProfileName": true
|
||||||
|
},
|
||||||
"bank": {
|
"bank": {
|
||||||
"showNotifications": true
|
"showNotifications": true
|
||||||
},
|
},
|
||||||
|
|||||||
+69
-44
@@ -1,15 +1,13 @@
|
|||||||
# comment this out if your server has a different table/location for phone_number
|
# comment this out if your server has a different table/location for phone_number
|
||||||
# or if it already exists in the users table
|
# or if it already exists in the users table
|
||||||
ALTER TABLE `users` ADD COLUMN `phone_number` VARCHAR(20) DEFAULT NULL;
|
ALTER TABLE `users` ADD COLUMN `phone_number` VARCHAR(20) DEFAULT NULL;
|
||||||
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('phone', 'Phone', 1, 0, 1);
|
|
||||||
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('dphone', 'Destroyed Phone', 1, 0, 1);
|
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS npwd_phone_contacts (
|
CREATE TABLE IF NOT EXISTS `npwd_phone_contacts` (
|
||||||
id int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
identifier varchar(60) DEFAULT NULL,
|
`identifier` varchar(48) DEFAULT NULL,
|
||||||
avatar varchar(512) DEFAULT NULL,
|
`avatar` varchar(512) DEFAULT NULL,
|
||||||
number varchar(10) DEFAULT NULL,
|
`number` varchar(10) DEFAULT NULL,
|
||||||
display varchar(60) NOT NULL DEFAULT '',
|
`display` varchar(60) NOT NULL DEFAULT '',
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -19,7 +17,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
|
|||||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
`likes` int NOT NULL DEFAULT '0',
|
`likes` int NOT NULL DEFAULT '0',
|
||||||
`identifier` varchar(40) NOT NULL,
|
`identifier` varchar(48) NOT NULL,
|
||||||
`visible` tinyint NOT NULL DEFAULT '1',
|
`visible` tinyint NOT NULL DEFAULT '1',
|
||||||
`images` varchar(1000) DEFAULT '',
|
`images` varchar(1000) DEFAULT '',
|
||||||
`retweet` int DEFAULT NULL,
|
`retweet` int DEFAULT NULL,
|
||||||
@@ -30,7 +28,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
|
|||||||
CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` (
|
CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`profile_name` varchar(90) NOT NULL,
|
`profile_name` varchar(90) NOT NULL,
|
||||||
`identifier` varchar(40) NOT NULL,
|
`identifier` varchar(48) NOT NULL,
|
||||||
# Default Profile avatar can be set here
|
# Default Profile avatar can be set here
|
||||||
`avatar_url` varchar(255) DEFAULT 'https://beta.iodine.gg/QrEvq.png',
|
`avatar_url` varchar(255) DEFAULT 'https://beta.iodine.gg/QrEvq.png',
|
||||||
`bio` varchar(512) DEFAULT NULL,
|
`bio` varchar(512) DEFAULT NULL,
|
||||||
@@ -54,33 +52,60 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
|
|||||||
CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
|
CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
|
||||||
);
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `npwd_match_profiles` (
|
||||||
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
|
`identifier` varchar(48) NOT NULL,
|
||||||
|
`name` varchar(90) NOT NULL,
|
||||||
|
`image` varchar(255) NOT NULL,
|
||||||
|
`bio` varchar(512) DEFAULT NULL,
|
||||||
|
`location` varchar(45) DEFAULT NULL,
|
||||||
|
`job` varchar(45) DEFAULT NULL,
|
||||||
|
`tags` varchar(255) NOT NULL DEFAULT '',
|
||||||
|
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
UNIQUE KEY `name_UNIQUE` (`name`),
|
||||||
|
UNIQUE KEY `identifier_UNIQUE` (`identifier`)
|
||||||
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS npwd_notes (
|
CREATE TABLE IF NOT EXISTS `npwd_match_views` (
|
||||||
id int(11) NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
identifier varchar(255) NOT NULL,
|
`identifier` varchar(48) NOT NULL,
|
||||||
title varchar(255) NOT NULL,
|
`profile` int NOT NULL,
|
||||||
content varchar(255) NOT NULL,
|
`liked` tinyint DEFAULT '0',
|
||||||
|
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `match_profile_idx` (`profile`),
|
||||||
|
CONSTRAINT `match_profile` FOREIGN KEY (`profile`) REFERENCES `npwd_match_profiles` (`id`)
|
||||||
|
);
|
||||||
|
|
||||||
|
CREATE TABLE IF NOT EXISTS `npwd_notes` (
|
||||||
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`identifier` varchar(48) NOT NULL,
|
||||||
|
`title` varchar(255) NOT NULL,
|
||||||
|
`content` varchar(255) NOT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS npwd_marketplace_listings (
|
CREATE TABLE IF NOT EXISTS `npwd_marketplace_listings` (
|
||||||
id int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
identifier varchar(255) DEFAULT NULL,
|
`identifier` varchar(48) DEFAULT NULL,
|
||||||
username varchar(255) DEFAULT NULL,
|
`username` varchar(255) DEFAULT NULL,
|
||||||
name varchar(50) DEFAULT NULL,
|
`name` varchar(50) DEFAULT NULL,
|
||||||
number varchar(255) NOT NULL,
|
`number` varchar(255) NOT NULL,
|
||||||
title varchar(255) DEFAULT NULL,
|
`title` varchar(255) DEFAULT NULL,
|
||||||
url varchar(255) DEFAULT NULL,
|
`url` varchar(255) DEFAULT NULL,
|
||||||
description varchar(255) NOT NULL,
|
`description` varchar(255) NOT NULL,
|
||||||
createdAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
updatedAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS npwd_marketplace_reports (
|
CREATE TABLE IF NOT EXISTS `npwd_marketplace_reports` (
|
||||||
id int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
listing_id int(11) DEFAULT NULL,
|
`listing_id` int(11) DEFAULT NULL,
|
||||||
profile varchar(255) DEFAULT NULL,
|
`profile` varchar(255) DEFAULT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -98,11 +123,11 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` (
|
|||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `npwd_messages_groups` (
|
CREATE TABLE IF NOT EXISTS `npwd_messages_groups` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`user_identifier` varchar(40) NOT NULL,
|
`user_identifier` varchar(48) NOT NULL,
|
||||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
`group_id` varchar(512) NOT NULL,
|
`group_id` varchar(512) NOT NULL,
|
||||||
`participant_identifier` varchar(40) NOT NULL,
|
`participant_identifier` varchar(48) NOT NULL,
|
||||||
`label` varchar(60) DEFAULT '',
|
`label` varchar(60) DEFAULT '',
|
||||||
`unreadCount` int(11) NOT NULL DEFAULT 0,
|
`unreadCount` int(11) NOT NULL DEFAULT 0,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
@@ -110,7 +135,7 @@ CREATE TABLE IF NOT EXISTS `npwd_messages_groups` (
|
|||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `npwd_messages_labels` (
|
CREATE TABLE IF NOT EXISTS `npwd_messages_labels` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`user_identifier` varchar(40) NOT NULL,
|
`user_identifier` varchar(48) NOT NULL,
|
||||||
`label` varchar(60) NOT NULL,
|
`label` varchar(60) NOT NULL,
|
||||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
@@ -121,7 +146,7 @@ CREATE TABLE IF NOT EXISTS `npwd_messages_labels` (
|
|||||||
CREATE TABLE IF NOT EXISTS `npwd_messages` (
|
CREATE TABLE IF NOT EXISTS `npwd_messages` (
|
||||||
`id` int NOT NULL AUTO_INCREMENT,
|
`id` int NOT NULL AUTO_INCREMENT,
|
||||||
`message` varchar(512) NOT NULL,
|
`message` varchar(512) NOT NULL,
|
||||||
`user_identifier` varchar(40) NOT NULL,
|
`user_identifier` varchar(48) NOT NULL,
|
||||||
`group_id` varchar(512) NOT NULL,
|
`group_id` varchar(512) NOT NULL,
|
||||||
`isRead` tinyint NOT NULL DEFAULT '0',
|
`isRead` tinyint NOT NULL DEFAULT '0',
|
||||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
@@ -130,20 +155,20 @@ CREATE TABLE IF NOT EXISTS `npwd_messages` (
|
|||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS npwd_calls (
|
CREATE TABLE IF NOT EXISTS `npwd_calls` (
|
||||||
id int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
identifier varchar(255) DEFAULT NULL,
|
`identifier` varchar(48) DEFAULT NULL,
|
||||||
transmitter varchar(255) NOT NULL,
|
`transmitter` varchar(255) NOT NULL,
|
||||||
receiver varchar(255) NOT NULL,
|
`receiver` varchar(255) NOT NULL,
|
||||||
is_accepted tinyint(4) DEFAULT 0,
|
`is_accepted` tinyint(4) DEFAULT 0,
|
||||||
start varchar(255) DEFAULT NULL,
|
`start` varchar(255) DEFAULT NULL,
|
||||||
end varchar(255) DEFAULT NULL,
|
end varchar(255) DEFAULT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS npwd_phone_gallery (
|
CREATE TABLE IF NOT EXISTS npwd_phone_gallery (
|
||||||
id int(11) NOT NULL AUTO_INCREMENT,
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
identifier varchar(255) DEFAULT NULL,
|
`identifier` varchar(48) DEFAULT NULL,
|
||||||
image varchar(255) DEFAULT NULL,
|
`image` varchar(255) DEFAULT NULL,
|
||||||
PRIMARY KEY (id)
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
+7
-3
@@ -15,7 +15,8 @@ import { useApps } from './os/apps/hooks/useApps';
|
|||||||
|
|
||||||
import { useContactsService } from './apps/contacts/hooks/useContactsService';
|
import { useContactsService } from './apps/contacts/hooks/useContactsService';
|
||||||
import { useTwitterService } from './apps/twitter/hooks/useTwitterService';
|
import { useTwitterService } from './apps/twitter/hooks/useTwitterService';
|
||||||
import { useSelloutService } from './apps/sellout/hooks/useSelloutService';
|
import { useMatchService } from './apps/match/hooks/useMatchService';
|
||||||
|
import { useMarketplaceService } from './apps/marketplace/hooks/useMarketplaceService';
|
||||||
import { useBankService } from './apps/bank/hooks/useBankService';
|
import { useBankService } from './apps/bank/hooks/useBankService';
|
||||||
import { useMessagesService } from './apps/messages/hooks/useMessageService';
|
import { useMessagesService } from './apps/messages/hooks/useMessageService';
|
||||||
import { useNotesService } from './apps/notes/hooks/useNotesService';
|
import { useNotesService } from './apps/notes/hooks/useNotesService';
|
||||||
@@ -66,7 +67,8 @@ function Phone() {
|
|||||||
useSimcardService();
|
useSimcardService();
|
||||||
useContactsService();
|
useContactsService();
|
||||||
useTwitterService();
|
useTwitterService();
|
||||||
useSelloutService();
|
useMatchService();
|
||||||
|
useMarketplaceService();
|
||||||
useBankService();
|
useBankService();
|
||||||
useMessagesService();
|
useMessagesService();
|
||||||
useNotesService();
|
useNotesService();
|
||||||
@@ -102,7 +104,9 @@ function Phone() {
|
|||||||
id="phone"
|
id="phone"
|
||||||
className="PhoneScreen"
|
className="PhoneScreen"
|
||||||
style={{
|
style={{
|
||||||
backgroundImage: `url(media/backgrounds/${settings.wallpaper.value})`,
|
backgroundImage: settings.customWallpaper
|
||||||
|
? `url(${settings.customWallpaper})`
|
||||||
|
: `url(media/backgrounds/${settings.wallpaper.value})`,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{isPhoneReady ? (
|
{isPhoneReady ? (
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import { useSetRecoilState } from 'recoil';
|
|||||||
import { useBankNotification } from './useBankNotification';
|
import { useBankNotification } from './useBankNotification';
|
||||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { BankEvents } from '../../../../../typings/bank';
|
||||||
|
import { PhoneEvents } from '../../../../../typings/phone';
|
||||||
|
|
||||||
export const useBankService = () => {
|
export const useBankService = () => {
|
||||||
const setTransaction = useSetRecoilState(bankState.transactions);
|
const setTransaction = useSetRecoilState(bankState.transactions);
|
||||||
@@ -21,9 +23,9 @@ export const useBankService = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useNuiEvent('BANK', 'setTransaction', setTransaction);
|
useNuiEvent('BANK', BankEvents.SEND_TRANSFERS, setTransaction);
|
||||||
useNuiEvent('BANK', 'setCredentials', setCredentials);
|
useNuiEvent('BANK', BankEvents.SEND_CREDENTIALS, setCredentials);
|
||||||
useNuiEvent('BANK', 'setAlert', handleAddAlert);
|
useNuiEvent('BANK', BankEvents.SEND_ALERT, handleAddAlert);
|
||||||
useNuiEvent('BANK', 'setNotification', setNotification);
|
useNuiEvent('BANK', BankEvents.SEND_NOTIFICATION, setNotification);
|
||||||
return { useTransactions, useCredentials, useBankNotification };
|
return { useTransactions, useCredentials, useBankNotification };
|
||||||
};
|
};
|
||||||
@@ -5,11 +5,12 @@ import { GalleryGrid } from './grid/GalleryGrid';
|
|||||||
import { GalleryModal } from './modal/GalleryModal';
|
import { GalleryModal } from './modal/GalleryModal';
|
||||||
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||||
import { Route, Switch } from 'react-router-dom';
|
import { Route, Switch } from 'react-router-dom';
|
||||||
|
import { PhotoEvents } from '../../../../../typings/photo';
|
||||||
|
|
||||||
InjectDebugData([
|
InjectDebugData([
|
||||||
{
|
{
|
||||||
app: 'CAMERA',
|
app: 'CAMERA',
|
||||||
method: 'setPhotos',
|
method: PhotoEvents.SEND_PHOTOS,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||||
import { photoState } from './state';
|
import { photoState } from './state';
|
||||||
|
import { PhotoEvents } from '../../../../../typings/photo';
|
||||||
|
|
||||||
export const usePhotoService = () => {
|
export const usePhotoService = () => {
|
||||||
const setPhotos = useSetRecoilState(photoState.photos);
|
const setPhotos = useSetRecoilState(photoState.photos);
|
||||||
useNuiEvent('CAMERA', 'setPhotos', setPhotos);
|
useNuiEvent('CAMERA', PhotoEvents.SEND_PHOTOS, setPhotos);
|
||||||
};
|
};
|
||||||
@@ -9,6 +9,7 @@ import { Route } from 'react-router-dom';
|
|||||||
import ContactsInfoPage from './views/ContactInfo';
|
import ContactsInfoPage from './views/ContactInfo';
|
||||||
import { ContactPage } from './views/ContactsPage';
|
import { ContactPage } from './views/ContactsPage';
|
||||||
import { ContactsThemeProvider } from '../providers/ContactsThemeProvider';
|
import { ContactsThemeProvider } from '../providers/ContactsThemeProvider';
|
||||||
|
import { ContactEvents } from '../../../../../typings/contact';
|
||||||
|
|
||||||
export const ContactsApp = () => {
|
export const ContactsApp = () => {
|
||||||
const contacts = useApp('CONTACTS');
|
const contacts = useApp('CONTACTS');
|
||||||
@@ -29,7 +30,7 @@ export const ContactsApp = () => {
|
|||||||
InjectDebugData([
|
InjectDebugData([
|
||||||
{
|
{
|
||||||
app: 'CONTACTS',
|
app: 'CONTACTS',
|
||||||
method: 'setContacts',
|
method: ContactEvents.SEND_CONTACTS,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { contactsState } from './state';
|
|||||||
import { useContacts } from './useContacts';
|
import { useContacts } from './useContacts';
|
||||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { ContactEvents } from '../../../../../typings/contact';
|
||||||
|
|
||||||
export const useContactsService = () => {
|
export const useContactsService = () => {
|
||||||
const setContacts = useSetRecoilState(contactsState.contacts);
|
const setContacts = useSetRecoilState(contactsState.contacts);
|
||||||
@@ -17,7 +18,7 @@ export const useContactsService = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useNuiEvent('CONTACTS', 'setContacts', setContacts);
|
useNuiEvent('CONTACTS', ContactEvents.SEND_CONTACTS, setContacts);
|
||||||
useNuiEvent('CONTACTS', 'setAlert', handleAddAlert);
|
useNuiEvent('CONTACTS', ContactEvents.SEND_ALERT, handleAddAlert);
|
||||||
return useContacts();
|
return useContacts();
|
||||||
};
|
};
|
||||||
@@ -11,6 +11,7 @@ import { useDialHistory } from '../hooks/useDialHistory';
|
|||||||
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||||
import { ContactList } from '../../contacts/components/List/ContactList';
|
import { ContactList } from '../../contacts/components/List/ContactList';
|
||||||
import { DialerThemeProvider } from '../providers/DialerThemeProvider';
|
import { DialerThemeProvider } from '../providers/DialerThemeProvider';
|
||||||
|
import { CallEvents } from '../../../../../typings/call';
|
||||||
|
|
||||||
export const DialerApp = () => {
|
export const DialerApp = () => {
|
||||||
const history = useDialHistory();
|
const history = useDialHistory();
|
||||||
@@ -40,7 +41,7 @@ export const DialerApp = () => {
|
|||||||
InjectDebugData([
|
InjectDebugData([
|
||||||
{
|
{
|
||||||
app: 'DIALER',
|
app: 'DIALER',
|
||||||
method: 'setHistory',
|
method: CallEvents.SET_CALL_HISTORY,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { DialInputCtx, IDialInputCtx } from '../context/InputContext';
|
|||||||
import Nui from '../../../os/nui-events/utils/Nui';
|
import Nui from '../../../os/nui-events/utils/Nui';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { CallEvents } from '../../../../../typings/call';
|
import { CallEvents } from '../../../../../typings/call';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -30,6 +31,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
|||||||
export const DialerInput = () => {
|
export const DialerInput = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const { inputVal, set } = useContext<IDialInputCtx>(DialInputCtx);
|
const { inputVal, set } = useContext<IDialInputCtx>(DialInputCtx);
|
||||||
|
|
||||||
@@ -46,10 +48,11 @@ export const DialerInput = () => {
|
|||||||
return (
|
return (
|
||||||
<Box component={Paper} className={classes.root}>
|
<Box component={Paper} className={classes.root}>
|
||||||
<InputBase
|
<InputBase
|
||||||
placeholder="Enter a number"
|
placeholder={t('APPS_DIALER_INPUT_PLACEHOLDER')}
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
value={inputVal}
|
value={inputVal}
|
||||||
onChange={(e) => set(e.target.value)}
|
onChange={(e) => set(e.target.value)}
|
||||||
|
type="number"
|
||||||
/>
|
/>
|
||||||
<IconButton color="primary" className={classes.iconBtn} disabled={inputVal <= ''}>
|
<IconButton color="primary" className={classes.iconBtn} disabled={inputVal <= ''}>
|
||||||
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
|
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
|
|||||||
import PhoneIcon from '@material-ui/icons/Phone';
|
import PhoneIcon from '@material-ui/icons/Phone';
|
||||||
import PersonIcon from '@material-ui/icons/Person';
|
import PersonIcon from '@material-ui/icons/Person';
|
||||||
import HistoryIcon from '@material-ui/icons/History';
|
import HistoryIcon from '@material-ui/icons/History';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme: Theme) => ({
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -20,6 +21,7 @@ const DialerNavBar = () => {
|
|||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const [page, setPage] = useState(pathname);
|
const [page, setPage] = useState(pathname);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const handleChange = (_e, newPage) => {
|
const handleChange = (_e, newPage) => {
|
||||||
setPage(newPage);
|
setPage(newPage);
|
||||||
@@ -28,14 +30,14 @@ const DialerNavBar = () => {
|
|||||||
return (
|
return (
|
||||||
<BottomNavigation value={page} onChange={handleChange} showLabels className={classes.root}>
|
<BottomNavigation value={page} onChange={handleChange} showLabels className={classes.root}>
|
||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
label="History"
|
label={t('APPS_DIALER_NAVBAR_HISTORY')}
|
||||||
value="/phone"
|
value="/phone"
|
||||||
component={NavLink}
|
component={NavLink}
|
||||||
icon={<HistoryIcon />}
|
icon={<HistoryIcon />}
|
||||||
to="/phone"
|
to="/phone"
|
||||||
/>
|
/>
|
||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
label="Dial"
|
label={t('APPS_DIALER_NAVBAR_DIAL')}
|
||||||
value="/phone/dial"
|
value="/phone/dial"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
component={NavLink}
|
component={NavLink}
|
||||||
@@ -43,7 +45,7 @@ const DialerNavBar = () => {
|
|||||||
to="/phone/dial"
|
to="/phone/dial"
|
||||||
/>
|
/>
|
||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
label="Contacts"
|
label={t('APPS_DIALER_NAVBAR_CONTACTS')}
|
||||||
value="/phone/contacts"
|
value="/phone/contacts"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
component={NavLink}
|
component={NavLink}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||||
import { dialState } from './state';
|
import { dialState } from './state';
|
||||||
|
import { CallEvents } from '../../../../../typings/call';
|
||||||
|
|
||||||
export const useDialService = () => {
|
export const useDialService = () => {
|
||||||
const setHistory = useSetRecoilState(dialState.history);
|
const setHistory = useSetRecoilState(dialState.history);
|
||||||
useNuiEvent('DIALER', 'setHistory', setHistory);
|
useNuiEvent('DIALER', CallEvents.SET_CALL_HISTORY, setHistory);
|
||||||
};
|
};
|
||||||
+14
-12
@@ -1,42 +1,44 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { AppWrapper } from '../../../ui/components/AppWrapper';
|
import { AppWrapper } from '../../../ui/components/AppWrapper';
|
||||||
import { AppContent } from '../../../ui/components/AppContent';
|
import { AppContent } from '../../../ui/components/AppContent';
|
||||||
import { SelloutTitle } from './SelloutTitle';
|
import { MarketplaceTitle } from './MarketplaceTitle';
|
||||||
import { SelloutListContainer } from './SelloutList/SelloutListContainer';
|
import { MarketplaceListContainer } from './SelloutList/MarketplaceListContainer';
|
||||||
import { NavigationBar } from './navigation/NavigationBar';
|
import { NavigationBar } from './navigation/NavigationBar';
|
||||||
import { Switch, Route } from 'react-router-dom';
|
import { Switch, Route } from 'react-router-dom';
|
||||||
import { ListingFormContainer } from './form/ListingFormContainer';
|
import { ListingFormContainer } from './form/ListingFormContainer';
|
||||||
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||||
import { SelloutThemeProvider } from '../providers/SelloutThemeProvider';
|
import { MarketplaceThemeProvider } from '../providers/MarketplaceThemeProvider';
|
||||||
|
import { MarketplaceEvents } from '../../../../../typings/marketplace';
|
||||||
|
|
||||||
export const SelloutApp = () => {
|
export const MarketplaceApp = () => {
|
||||||
return (
|
return (
|
||||||
<SelloutThemeProvider>
|
<MarketplaceThemeProvider>
|
||||||
<AppWrapper id="sellout-app">
|
<AppWrapper id="sellout-app">
|
||||||
<SelloutTitle />
|
<MarketplaceTitle />
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route path="/sellout" exact component={SelloutListContainer} />
|
<Route path="/marketplace" exact component={MarketplaceListContainer} />
|
||||||
<Route path="/sellout/new" component={ListingFormContainer} />
|
<Route path="/marketplace/new" component={ListingFormContainer} />
|
||||||
</Switch>
|
</Switch>
|
||||||
</AppContent>
|
</AppContent>
|
||||||
<NavigationBar />
|
<NavigationBar />
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
</SelloutThemeProvider>
|
</MarketplaceThemeProvider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
InjectDebugData([
|
InjectDebugData([
|
||||||
{
|
{
|
||||||
app: 'SELLOUT',
|
app: 'SELLOUT',
|
||||||
method: 'setListings',
|
method: MarketplaceEvents.SEND_LISTING,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
name: 'Some guy',
|
name: 'Some guy',
|
||||||
number: '111-1134',
|
number: '111-1134',
|
||||||
title: 'Car',
|
title: 'eeeeeeeeeeeeeeeeeeeeeeeee',
|
||||||
description: 'Selling this cool car',
|
description:
|
||||||
|
'skldfsdEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
|
||||||
url: 'https://beta.iodine.gg/706Y3.jpeg',
|
url: 'https://beta.iodine.gg/706Y3.jpeg',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
+1
-1
@@ -20,7 +20,7 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const SelloutTitle = () => {
|
export const MarketplaceTitle = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
||||||
File renamed without changes.
+10
-2
@@ -31,9 +31,17 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
background: theme.palette.background.default,
|
background: theme.palette.background.default,
|
||||||
marginBottom: 20,
|
marginBottom: 20,
|
||||||
},
|
},
|
||||||
|
listingContent: {
|
||||||
|
padding: 10,
|
||||||
|
minWidth: 100,
|
||||||
|
maxWidth: '100%',
|
||||||
|
width: '100%',
|
||||||
|
overflowWrap: 'break-word',
|
||||||
|
wordWrap: 'break-word',
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const SelloutItem = (listing: MarketplaceListing) => {
|
export const MarketplaceItem = (listing: MarketplaceListing) => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -62,7 +70,7 @@ export const SelloutItem = (listing: MarketplaceListing) => {
|
|||||||
</Typography>
|
</Typography>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Typography variant="h6" style={{ padding: 10 }}>
|
<Typography variant="body1" className={classes.listingContent}>
|
||||||
{listing.description}
|
{listing.description}
|
||||||
</Typography>
|
</Typography>
|
||||||
<ListingActions listing={listing} />
|
<ListingActions listing={listing} />
|
||||||
+3
-3
@@ -1,15 +1,15 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { List } from '../../../../ui/components/List';
|
import { List } from '../../../../ui/components/List';
|
||||||
import { useListing } from '../../hooks/useListing';
|
import { useListing } from '../../hooks/useListing';
|
||||||
import { SelloutItem } from './SelloutItem';
|
import { MarketplaceItem } from './MarketplaceItem';
|
||||||
|
|
||||||
export const SelloutList = () => {
|
export const MarketplaceList = () => {
|
||||||
const listings = useListing();
|
const listings = useListing();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<List>
|
<List>
|
||||||
{listings.map((listing) => (
|
{listings.map((listing) => (
|
||||||
<SelloutItem key={listing.id} {...listing} />
|
<MarketplaceItem key={listing.id} {...listing} />
|
||||||
))}
|
))}
|
||||||
</List>
|
</List>
|
||||||
);
|
);
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { MarketplaceList } from './MarketplaceList';
|
||||||
|
|
||||||
|
export const MarketplaceListContainer = () => {
|
||||||
|
return <MarketplaceList />;
|
||||||
|
};
|
||||||
+39
-12
@@ -1,7 +1,10 @@
|
|||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { makeStyles, Button, TextField } from '@material-ui/core';
|
import { makeStyles, Button, TextField, Typography } from '@material-ui/core';
|
||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
import { MarketplaceEvents } from '../../../../../../typings/marketplace';
|
import { MarketplaceEvents } from '../../../../../../typings/marketplace';
|
||||||
|
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useHistory } from 'react-router';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -29,17 +32,28 @@ const useStyles = makeStyles((theme) => ({
|
|||||||
|
|
||||||
export const ListingForm = () => {
|
export const ListingForm = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { addAlert } = useSnackbar();
|
||||||
|
const history = useHistory();
|
||||||
|
|
||||||
const [title, setTitle] = useState('');
|
const [title, setTitle] = useState('');
|
||||||
const [url, setUrl] = useState('');
|
const [url, setUrl] = useState('');
|
||||||
const [description, setDescription] = useState('');
|
const [description, setDescription] = useState('');
|
||||||
|
|
||||||
const addListing = () => {
|
const addListing = () => {
|
||||||
Nui.send(MarketplaceEvents.ADD_LISTING, {
|
if (title !== '' && description !== '') {
|
||||||
title,
|
Nui.send(MarketplaceEvents.ADD_LISTING, {
|
||||||
url,
|
title,
|
||||||
description,
|
url,
|
||||||
});
|
description,
|
||||||
|
});
|
||||||
|
history.push('/marketplace');
|
||||||
|
} else {
|
||||||
|
addAlert({
|
||||||
|
message: t('APPS_MARKETPLACE_REQUIRED_FIELDS'),
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -48,15 +62,22 @@ export const ListingForm = () => {
|
|||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
onChange={(e) => setTitle(e.target.value)}
|
onChange={(e) => setTitle(e.target.value)}
|
||||||
placeholder="Title on listing.."
|
label={t('GENERIC_REQUIRED')}
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
placeholder={t('APPS_MARKETPLACE_FORM_TITLE')}
|
||||||
|
inputProps={{
|
||||||
|
className: classes.textFieldInput,
|
||||||
|
maxLength: 25,
|
||||||
|
}}
|
||||||
style={{ width: '80%' }}
|
style={{ width: '80%' }}
|
||||||
size="medium"
|
size="medium"
|
||||||
|
InputLabelProps={{
|
||||||
|
shrink: true,
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
placeholder="Image URL"
|
placeholder={t('APPS_MARKETPLACE_FORM_IMAGE')}
|
||||||
onChange={(e) => setUrl(e.target.value)}
|
onChange={(e) => setUrl(e.target.value)}
|
||||||
inputProps={{ className: classes.textFieldInput }}
|
inputProps={{ className: classes.textFieldInput }}
|
||||||
style={{ width: '80%' }}
|
style={{ width: '80%' }}
|
||||||
@@ -67,15 +88,21 @@ export const ListingForm = () => {
|
|||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
onChange={(e) => setDescription(e.target.value)}
|
onChange={(e) => setDescription(e.target.value)}
|
||||||
placeholder="Description"
|
label={t('GENERIC_REQUIRED')}
|
||||||
inputProps={{ className: classes.multilineFieldInput }}
|
placeholder={t('APPS_MARKETPLACE_FORM_DESCRIPTION')}
|
||||||
|
inputProps={{
|
||||||
|
className: classes.multilineFieldInput,
|
||||||
|
maxLength: 130,
|
||||||
|
}}
|
||||||
style={{ width: '80%' }}
|
style={{ width: '80%' }}
|
||||||
size="medium"
|
size="medium"
|
||||||
|
InputLabelProps={{
|
||||||
|
shrink: true,
|
||||||
|
}}
|
||||||
multiline
|
multiline
|
||||||
rows={4}
|
rows={4}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Button onClick={addListing} className={classes.postButton}>
|
<Button onClick={addListing} className={classes.postButton}>
|
||||||
Post
|
Post
|
||||||
</Button>
|
</Button>
|
||||||
File renamed without changes.
+2
-2
@@ -31,9 +31,9 @@ export const NavigationBar = () => {
|
|||||||
<BottomNavigationAction
|
<BottomNavigationAction
|
||||||
component={Link}
|
component={Link}
|
||||||
icon={<FontAwesomeIcon icon={faHome} />}
|
icon={<FontAwesomeIcon icon={faHome} />}
|
||||||
to="/sellout"
|
to="/marketplace"
|
||||||
/>
|
/>
|
||||||
<BottomNavigationAction component={Link} icon={<AddCircleIcon />} to="/sellout/new" />
|
<BottomNavigationAction component={Link} icon={<AddCircleIcon />} to="/marketplace/new" />
|
||||||
</BottomNavigation>
|
</BottomNavigation>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
File renamed without changes.
File renamed without changes.
+4
-3
@@ -4,8 +4,9 @@ import { useListing } from './useListing';
|
|||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { MarketplaceEvents } from '../../../../../typings/marketplace';
|
||||||
|
|
||||||
export const useSelloutService = () => {
|
export const useMarketplaceService = () => {
|
||||||
const setSellout = useSetRecoilState(selloutState.listing);
|
const setSellout = useSetRecoilState(selloutState.listing);
|
||||||
const { addAlert } = useSnackbar();
|
const { addAlert } = useSnackbar();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -17,7 +18,7 @@ export const useSelloutService = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useNuiEvent('SELLOUT', 'setAlert', handleAddAlert);
|
useNuiEvent('SELLOUT', MarketplaceEvents.SEND_ALERT, handleAddAlert);
|
||||||
useNuiEvent('SELLOUT', 'setListings', setSellout);
|
useNuiEvent('SELLOUT', MarketplaceEvents.SEND_LISTING, setSellout);
|
||||||
return useListing();
|
return useListing();
|
||||||
};
|
};
|
||||||
File renamed without changes.
@@ -0,0 +1,5 @@
|
|||||||
|
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||||
|
|
||||||
|
import selloutTheme from '../marketplace.theme';
|
||||||
|
|
||||||
|
export const MarketplaceThemeProvider = createAppThemeProvider(selloutTheme);
|
||||||
@@ -0,0 +1,163 @@
|
|||||||
|
import React, { useState, useRef } from 'react';
|
||||||
|
import { Card, Fab, Box, Tooltip } from '@material-ui/core';
|
||||||
|
import CancelIcon from '@material-ui/icons/Clear';
|
||||||
|
import FireIcon from '@material-ui/icons/Whatshot';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import { FormattedProfile } from '../../../../../typings/match';
|
||||||
|
import Draggable from './Draggable';
|
||||||
|
import StatusDisplay from './StatusDisplay';
|
||||||
|
import Profile from './profile/Profile';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
position: 'absolute',
|
||||||
|
margin: '15px 15px 25px 15px',
|
||||||
|
height: 'calc(100% - 90px)',
|
||||||
|
width: 'calc(100% - 30px)',
|
||||||
|
overflow: 'hidden',
|
||||||
|
cursor: 'pointer',
|
||||||
|
},
|
||||||
|
media: {
|
||||||
|
height: '60%',
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
height: '40%',
|
||||||
|
},
|
||||||
|
status: {
|
||||||
|
position: 'absolute',
|
||||||
|
zIndex: 20,
|
||||||
|
padding: '5px 15px',
|
||||||
|
top: 40,
|
||||||
|
fontSize: '28px',
|
||||||
|
fontWeight: 'bold',
|
||||||
|
},
|
||||||
|
statusVisible: {
|
||||||
|
transition: 'opacity 0.25s ease-in-out',
|
||||||
|
},
|
||||||
|
// when a user swipes on a profile we need to hide the transition
|
||||||
|
// otherwise the status will be transitioning out when the next
|
||||||
|
// profile shows up
|
||||||
|
statusNull: {
|
||||||
|
transition: 'opacity 0s',
|
||||||
|
},
|
||||||
|
like: {
|
||||||
|
color: 'green',
|
||||||
|
border: '6px solid green',
|
||||||
|
left: 30,
|
||||||
|
transform: 'rotate(-18deg)',
|
||||||
|
},
|
||||||
|
nope: {
|
||||||
|
color: 'red',
|
||||||
|
border: '6px solid red',
|
||||||
|
right: 30,
|
||||||
|
transform: 'rotate(18deg)',
|
||||||
|
},
|
||||||
|
buttons: {
|
||||||
|
position: 'absolute',
|
||||||
|
bottom: '3px',
|
||||||
|
width: '100%',
|
||||||
|
height: '55px',
|
||||||
|
},
|
||||||
|
button: {
|
||||||
|
margin: '0px 15px',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
profile: FormattedProfile;
|
||||||
|
onSwipe: (id: number, liked: boolean) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
// this represents how far from the original mouse
|
||||||
|
// click a user has to drag the profile in order for
|
||||||
|
// it to be registered as a like or dislike
|
||||||
|
const DECISION_THRESHOLD_X_px = 150;
|
||||||
|
|
||||||
|
const ActiveProfile = ({ profile, onSwipe }: IProps) => {
|
||||||
|
const c = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [status, setStatus] = useState(null);
|
||||||
|
const statusRef = useRef(null);
|
||||||
|
const idRef = useRef(null);
|
||||||
|
|
||||||
|
// we are reading mutated state from the Draggable element so we
|
||||||
|
// keep track of it using a ref. Without this ref it will appear
|
||||||
|
// from React's point of view that the state is not updating
|
||||||
|
statusRef.current = status;
|
||||||
|
idRef.current = profile.id;
|
||||||
|
|
||||||
|
function onDrag(deltaX: number): void {
|
||||||
|
const hasDecision = status !== null;
|
||||||
|
if (!hasDecision && deltaX > DECISION_THRESHOLD_X_px) {
|
||||||
|
setStatus(true);
|
||||||
|
} else if (!hasDecision && deltaX < -DECISION_THRESHOLD_X_px) {
|
||||||
|
setStatus(false);
|
||||||
|
} else if (deltaX > -DECISION_THRESHOLD_X_px && deltaX < DECISION_THRESHOLD_X_px) {
|
||||||
|
setStatus(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// handles when user uses mouse to "swipe", or
|
||||||
|
// more specifically drag the card to one side or the other
|
||||||
|
const handleSwipe = () => {
|
||||||
|
onSwipe(idRef.current, statusRef.current);
|
||||||
|
setStatus(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
// these handlers are explicit and used for when the
|
||||||
|
// user clicks on buttons
|
||||||
|
const handleLike = () => {
|
||||||
|
onSwipe(idRef.current, true);
|
||||||
|
setStatus(null);
|
||||||
|
};
|
||||||
|
const handleNope = () => {
|
||||||
|
onSwipe(idRef.current, false);
|
||||||
|
setStatus(null);
|
||||||
|
};
|
||||||
|
|
||||||
|
const isLiked = status === true;
|
||||||
|
const notLiked = status === false;
|
||||||
|
|
||||||
|
const likeClass = `${c.status} ${isLiked ? c.statusVisible : c.statusNull} ${c.like}`;
|
||||||
|
const nopeClass = `${c.status} ${notLiked ? c.statusVisible : c.statusNull} ${c.nope}`;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Draggable id="active-profile" onDrag={onDrag} onDrop={handleSwipe}>
|
||||||
|
<Card raised className={c.root}>
|
||||||
|
<StatusDisplay className={likeClass} text={t('APPS_MATCH_LIKED')} visible={isLiked} />
|
||||||
|
<StatusDisplay className={nopeClass} text={t('APPS_MATCH_NOPE')} visible={notLiked} />
|
||||||
|
<Profile profile={profile} />
|
||||||
|
</Card>
|
||||||
|
</Draggable>
|
||||||
|
<Box className={c.buttons} display="flex" justifyContent="center">
|
||||||
|
<Tooltip title={t('APPS_MATCH_DISLIKE')} aria-label="dislike">
|
||||||
|
<Fab
|
||||||
|
size="large"
|
||||||
|
color="secondary"
|
||||||
|
aria-label="dislike"
|
||||||
|
onClick={handleNope}
|
||||||
|
className={c.button}
|
||||||
|
>
|
||||||
|
<CancelIcon />
|
||||||
|
</Fab>
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip title={t('APPS_MATCH_LIKE')} aria-label="like">
|
||||||
|
<Fab
|
||||||
|
size="large"
|
||||||
|
color="primary"
|
||||||
|
aria-label="like"
|
||||||
|
onClick={handleLike}
|
||||||
|
className={c.button}
|
||||||
|
>
|
||||||
|
<FireIcon />
|
||||||
|
</Fab>
|
||||||
|
</Tooltip>
|
||||||
|
</Box>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default ActiveProfile;
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Link } from 'react-router-dom';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
|
||||||
|
import HomeIcon from '@material-ui/icons/Whatshot';
|
||||||
|
import GroupIcon from '@material-ui/icons/Group';
|
||||||
|
import ProfileIcon from '@material-ui/icons/Person';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export function MatchBottomNavigation({ activePage, handleChange }) {
|
||||||
|
const classes = useStyles();
|
||||||
|
|
||||||
|
console.log(activePage);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<BottomNavigation value={activePage} onChange={handleChange} className={classes.root}>
|
||||||
|
<BottomNavigationAction component={Link} to="/match" icon={<HomeIcon />} />
|
||||||
|
<BottomNavigationAction component={Link} to="/match/matches" icon={<GroupIcon />} />
|
||||||
|
<BottomNavigationAction component={Link} to="/match/profile" icon={<ProfileIcon />} />
|
||||||
|
</BottomNavigation>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MatchBottomNavigation;
|
||||||
@@ -0,0 +1,61 @@
|
|||||||
|
import React, { useEffect, useRef } from 'react';
|
||||||
|
import { makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
|
import { LikeorDislikeDraggableElement } from '../utils/drag';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
position: 'relative',
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
like: {
|
||||||
|
position: 'absolute',
|
||||||
|
zIndex: 20,
|
||||||
|
padding: '5px 15px',
|
||||||
|
top: 100,
|
||||||
|
|
||||||
|
color: 'green',
|
||||||
|
border: '4px solid green',
|
||||||
|
right: 15,
|
||||||
|
},
|
||||||
|
nope: {
|
||||||
|
position: 'absolute',
|
||||||
|
zIndex: 20,
|
||||||
|
padding: '5px 15px',
|
||||||
|
top: 100,
|
||||||
|
|
||||||
|
color: 'red',
|
||||||
|
border: '4px solid red',
|
||||||
|
left: 15,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
id: string;
|
||||||
|
children: JSX.Element | JSX.Element[];
|
||||||
|
onDrag: (deltaX: number) => void;
|
||||||
|
onDrop: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
const MAX_ROTATION_DEG = 15;
|
||||||
|
|
||||||
|
function Draggable({ id, children, onDrag, onDrop }: IProps) {
|
||||||
|
const classes = useStyles();
|
||||||
|
const elementRef = useRef(null);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const drag = new LikeorDislikeDraggableElement(elementRef, MAX_ROTATION_DEG, onDrag, onDrop);
|
||||||
|
return () => drag.cleanup();
|
||||||
|
}, [elementRef]); // eslint-disable-line
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div ref={elementRef} key={id} id={id} className={classes.root}>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Draggable;
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { Box, Typography } from '@material-ui/core';
|
||||||
|
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
|
root: {
|
||||||
|
color: theme.palette.primary.main,
|
||||||
|
fontSize: theme.typography.fontSize,
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
paddingTop: '140px',
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
function NoProfiles() {
|
||||||
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<Box className={classes.root}>
|
||||||
|
<Typography variant="h5">{t('APPS_MATCH_NO_PROFILES')}</Typography>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default NoProfiles;
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Box, CircularProgress } from '@material-ui/core';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
},
|
||||||
|
progress: {
|
||||||
|
marginTop: '140px',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
function Loader() {
|
||||||
|
const classes = useStyles();
|
||||||
|
return (
|
||||||
|
<Box className={classes.root}>
|
||||||
|
<CircularProgress size={60} className={classes.progress} />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Loader;
|
||||||
@@ -0,0 +1,158 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { Route } from 'react-router-dom';
|
||||||
|
|
||||||
|
import { AppWrapper } from '../../../ui/components';
|
||||||
|
import { AppTitle } from '../../../ui/components/AppTitle';
|
||||||
|
import { AppContent } from '../../../ui/components/AppContent';
|
||||||
|
import { useApp } from '../../../os/apps/hooks/useApps';
|
||||||
|
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||||
|
import { MatchThemeProvider } from '../providers/MatchThemeProvider';
|
||||||
|
|
||||||
|
import Nui from '../../../os/nui-events/utils/Nui';
|
||||||
|
import MatchBottomNavigation from '../components/BottomNavigation';
|
||||||
|
import MatchPage from './views/MatchPage';
|
||||||
|
import ProfileEditor from './views/ProfileEditor';
|
||||||
|
import MatchList from './views/MatchList';
|
||||||
|
import { MatchEvents } from '../../../../../typings/match';
|
||||||
|
import { useProfile } from '../hooks/useProfile';
|
||||||
|
|
||||||
|
export const MatchApp = () => {
|
||||||
|
const match = useApp('MATCH');
|
||||||
|
const [activePage, setActivePage] = useState(0);
|
||||||
|
const { noProfileExists } = useProfile();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
Nui.send(MatchEvents.INITIALIZE);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handlePageChange = (e, page) => setActivePage(page);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MatchThemeProvider>
|
||||||
|
<AppWrapper id="contact-app">
|
||||||
|
<AppTitle app={match} />
|
||||||
|
{noProfileExists ? (
|
||||||
|
<AppContent>
|
||||||
|
<ProfileEditor />
|
||||||
|
</AppContent>
|
||||||
|
) : (
|
||||||
|
<>
|
||||||
|
<AppContent>
|
||||||
|
<Route path="/match/" exact component={MatchPage} />
|
||||||
|
<Route path="/match/matches" exact component={MatchList} />
|
||||||
|
<Route path="/match/profile" exact component={ProfileEditor} />
|
||||||
|
</AppContent>
|
||||||
|
<MatchBottomNavigation activePage={activePage} handleChange={handlePageChange} />
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
</AppWrapper>
|
||||||
|
</MatchThemeProvider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
InjectDebugData(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
app: 'MATCH',
|
||||||
|
method: MatchEvents.GET_PROFILES_SUCCESS,
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
image:
|
||||||
|
'https://cdn.vox-cdn.com/thumbor/9xCALlkm2Mc0HQk8kMr1Ui3YNbc=/0x0:5464x3070/920x613/filters:focal(2295x1098:3169x1972):format(webp)/cdn.vox-cdn.com/uploads/chorus_image/image/67031748/shutterstock_1450403549.0.jpg',
|
||||||
|
name: 'Person Alpha',
|
||||||
|
bio:
|
||||||
|
'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.',
|
||||||
|
createdAt: 1615932985,
|
||||||
|
updatedAt: 1615932985,
|
||||||
|
lastActive: 1616004986,
|
||||||
|
job: 'Gardener',
|
||||||
|
location: 'Grapeseed',
|
||||||
|
tags: 'gardening',
|
||||||
|
phoneNumber: '987-6543',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 2,
|
||||||
|
image:
|
||||||
|
'https://media.cntraveler.com/photos/5f8f09c3a078e9112956774d/16:9/w_1600%2Cc_limit/Chicago-GettyImages-1065188752.jpg',
|
||||||
|
name: 'Person Beta',
|
||||||
|
bio: 'l impedit quo minus id quod maxime placeat facere possimus',
|
||||||
|
createdAt: 1615846585,
|
||||||
|
updatedAt: 1615846585,
|
||||||
|
lastActive: 1615850185,
|
||||||
|
job: 'Mechanic',
|
||||||
|
location: 'Harmony',
|
||||||
|
tags: 'tinkering,robotics',
|
||||||
|
phoneNumber: '654-3219',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 3,
|
||||||
|
image: 'https://www.langan.com/wp-content/uploads/2019/02/Boston-996x554.jpg',
|
||||||
|
name: 'Person Charlie',
|
||||||
|
bio: 'ut aut reiciendis voluptatibus',
|
||||||
|
createdAt: 1615850185,
|
||||||
|
updatedAt: 1615850185,
|
||||||
|
lastActive: 1613607385,
|
||||||
|
job: 'Lawyer',
|
||||||
|
location: 'Los Santos',
|
||||||
|
tags: 'reading,coolstuff, coffee',
|
||||||
|
phoneNumber: '123-4567',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
app: 'MATCH',
|
||||||
|
method: MatchEvents.GET_MY_PROFILE_SUCCESS,
|
||||||
|
data: {
|
||||||
|
id: 4,
|
||||||
|
image:
|
||||||
|
'https://www.middlebury.edu/institute/sites/www.middlebury.edu.institute/files/styles/1040x585/public/2018-10/Nashville-skyline.jpg?fv=mS11EKrT&itok=HNhHqYUX',
|
||||||
|
name: 'Kire Says',
|
||||||
|
bio: "Kire's cool profile that has many cool things. And others.",
|
||||||
|
createdAt: 1615932985,
|
||||||
|
updatedAt: 1615932985,
|
||||||
|
lastActive: 1616004986,
|
||||||
|
job: 'Engineer',
|
||||||
|
location: 'Boston',
|
||||||
|
tags: 'code,books',
|
||||||
|
phoneNumber: '999-9999',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
app: 'MATCH',
|
||||||
|
method: MatchEvents.GET_MATCHES_SUCCESS,
|
||||||
|
data: [
|
||||||
|
{
|
||||||
|
id: 5,
|
||||||
|
image:
|
||||||
|
'https://media.cntraveler.com/photos/5f8f09c3a078e9112956774d/16:9/w_1600%2Cc_limit/Chicago-GettyImages-1065188752.jpg',
|
||||||
|
name: 'Person Delta',
|
||||||
|
bio: 'l impedit quo minus id quod maxime placeat facere possimus',
|
||||||
|
createdAt: 1615846585,
|
||||||
|
updatedAt: 1615846585,
|
||||||
|
lastActive: 1615850185,
|
||||||
|
matchedAt: 1613607385,
|
||||||
|
job: 'Mechanic',
|
||||||
|
location: 'Harmony',
|
||||||
|
tags: 'tinkering,robotics',
|
||||||
|
phoneNumber: '654-3219',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 6,
|
||||||
|
image: 'https://www.langan.com/wp-content/uploads/2019/02/Boston-996x554.jpg',
|
||||||
|
name: 'Person Echo',
|
||||||
|
bio: 'ut aut reiciendis voluptatibus',
|
||||||
|
createdAt: 1615850185,
|
||||||
|
updatedAt: 1615850185,
|
||||||
|
lastActive: 1613607385,
|
||||||
|
job: 'Lawyer',
|
||||||
|
location: 'Los Santos',
|
||||||
|
tags: 'reading,coolstuff, coffee',
|
||||||
|
phoneNumber: '123-4567',
|
||||||
|
matchedAt: 1613607385,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
200,
|
||||||
|
);
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Box, Typography } from '@material-ui/core';
|
||||||
|
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||||
|
|
||||||
|
const useStyles = makeStyles((theme: Theme) => ({
|
||||||
|
root: {
|
||||||
|
color: theme.palette.primary.main,
|
||||||
|
fontSize: theme.typography.fontSize,
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
display: 'flex',
|
||||||
|
justifyContent: 'center',
|
||||||
|
textAlign: 'center',
|
||||||
|
padding: '140px 15px 15px 15px',
|
||||||
|
},
|
||||||
|
}));
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
text: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
function PageText({ text }: IProps) {
|
||||||
|
const classes = useStyles();
|
||||||
|
return (
|
||||||
|
<Box className={classes.root}>
|
||||||
|
<Typography variant="h5">{text}</Typography>
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default PageText;
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Box } from '@material-ui/core';
|
||||||
|
|
||||||
|
function StatusDisplay({ className, visible, text }) {
|
||||||
|
const style = { opacity: visible ? '0.65' : '0.0' };
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box className={className} style={style}>
|
||||||
|
{text}
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default StatusDisplay;
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
import React, { useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useHistory } from 'react-router-dom';
|
||||||
|
import ListItemText from '@material-ui/core/ListItemText';
|
||||||
|
import { Box, Button, ListItem, makeStyles } from '@material-ui/core';
|
||||||
|
import PersonIcon from '@material-ui/icons/Person';
|
||||||
|
import ChatIcon from '@material-ui/icons/Chat';
|
||||||
|
|
||||||
|
import { FormattedMatch } from '../../../../../../typings/match';
|
||||||
|
import Profile from '../profile/Profile';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
profile: {
|
||||||
|
position: 'relative',
|
||||||
|
height: '90%',
|
||||||
|
marginTop: '15px',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
match: FormattedMatch;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const Match = ({ match }: IProps) => {
|
||||||
|
const history = useHistory();
|
||||||
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [showProfile, setShowProfile] = useState(false);
|
||||||
|
|
||||||
|
const handleMessage = () => {
|
||||||
|
history.push(`/messages/new/${match.phoneNumber}`);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleProfile = () => {
|
||||||
|
setShowProfile((show) => !show);
|
||||||
|
};
|
||||||
|
|
||||||
|
const secondaryText = t('APPS_MATCH_PROFILE_MATCHED_AT', {
|
||||||
|
matchedAt: match.matchedAtFormatted,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<ListItem divider>
|
||||||
|
<ListItemText primary={match.name} secondary={secondaryText} />
|
||||||
|
<Button onClick={handleProfile}>
|
||||||
|
<PersonIcon />
|
||||||
|
</Button>
|
||||||
|
<Button onClick={handleMessage}>
|
||||||
|
<ChatIcon />
|
||||||
|
</Button>
|
||||||
|
</ListItem>
|
||||||
|
{showProfile && (
|
||||||
|
<Box className={classes.profile}>
|
||||||
|
<Profile profile={match} />
|
||||||
|
</Box>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Match;
|
||||||
@@ -0,0 +1,78 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { CardContent, CardMedia, Chip, Typography } from '@material-ui/core';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import { FormattedProfile, FormattedMatch } from '../../../../../../typings/match';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {},
|
||||||
|
tags: {
|
||||||
|
position: 'absolute',
|
||||||
|
bottom: '40%',
|
||||||
|
},
|
||||||
|
tag: {
|
||||||
|
margin: '3px 3px 0px 0px',
|
||||||
|
opacity: '0.8',
|
||||||
|
},
|
||||||
|
media: {
|
||||||
|
height: '60%',
|
||||||
|
},
|
||||||
|
content: {
|
||||||
|
height: '40%',
|
||||||
|
overflowY: 'auto',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
profile: FormattedProfile | FormattedMatch;
|
||||||
|
}
|
||||||
|
|
||||||
|
const DEFAULT_IMAGE = 'https://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg';
|
||||||
|
|
||||||
|
const Profile = ({ profile }: IProps) => {
|
||||||
|
const c = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
function parseSecondaryBio(): string | undefined {
|
||||||
|
const { location, job } = profile;
|
||||||
|
if (location && job) {
|
||||||
|
return `${location} - ${job}`;
|
||||||
|
} else if (location) {
|
||||||
|
return location;
|
||||||
|
} else if (job) {
|
||||||
|
return job;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const bioSecondary = parseSecondaryBio();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<CardContent className={c.tags}>
|
||||||
|
{profile.tagList.map((tag) => (
|
||||||
|
<Chip className={c.tag} label={tag} color="primary" />
|
||||||
|
))}
|
||||||
|
</CardContent>
|
||||||
|
<CardMedia className={c.media} image={profile.image || DEFAULT_IMAGE} title={profile.name} />
|
||||||
|
<CardContent className={c.content}>
|
||||||
|
<Typography gutterBottom variant="h4" component="h2">
|
||||||
|
{profile.name}
|
||||||
|
</Typography>
|
||||||
|
<Typography gutterBottom color="textSecondary" component="p">
|
||||||
|
{t('APPS_MATCH_PROFILE_LAST_ACTIVE', { lastActive: profile.lastActiveFormatted })}
|
||||||
|
</Typography>
|
||||||
|
{bioSecondary && (
|
||||||
|
<Typography gutterBottom variant="body1" color="textSecondary" component="p">
|
||||||
|
{bioSecondary}
|
||||||
|
</Typography>
|
||||||
|
)}
|
||||||
|
<Typography variant="body2" color="textSecondary" component="p">
|
||||||
|
{profile.bio}
|
||||||
|
</Typography>
|
||||||
|
</CardContent>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Profile;
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
import React, { useState } from 'react';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
import {
|
||||||
|
Profile as IProfile,
|
||||||
|
FormattedProfile,
|
||||||
|
MatchEvents,
|
||||||
|
} from '../../../../../../typings/match';
|
||||||
|
import ProfileField from '../../../../ui/components/ProfileField';
|
||||||
|
import UpdateButton from '../../../../ui/components/UpdateButton';
|
||||||
|
import { Card } from '@material-ui/core';
|
||||||
|
import Profile from './Profile';
|
||||||
|
import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
||||||
|
import PageText from '../PageText';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
position: 'relative',
|
||||||
|
width: '100%',
|
||||||
|
height: 'calc(100% - 40px)',
|
||||||
|
padding: '15px',
|
||||||
|
},
|
||||||
|
card: {
|
||||||
|
position: 'absolute',
|
||||||
|
margin: '15px 15px 25px 15px',
|
||||||
|
height: 'calc(100% - 80px)',
|
||||||
|
width: 'calc(100% - 30px)',
|
||||||
|
overflow: 'hidden',
|
||||||
|
},
|
||||||
|
spacer: {
|
||||||
|
height: '8px',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
profile: FormattedProfile;
|
||||||
|
showPreview: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ProfileForm({ profile, showPreview }: IProps) {
|
||||||
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { config } = usePhone();
|
||||||
|
|
||||||
|
// note that this assumes we are defensively checking
|
||||||
|
// that profile is not null in a parent above this component.
|
||||||
|
// Annoyingling adding conditionals above this line to not render
|
||||||
|
// when profile === null results in a react error that different
|
||||||
|
// amounts of hooks are rendering
|
||||||
|
const [image, setImage] = useState(profile?.image || '');
|
||||||
|
const [name, setName] = useState(profile?.name || '');
|
||||||
|
const [bio, setBio] = useState(profile?.bio || '');
|
||||||
|
const [job, setJob] = useState(profile?.job || '');
|
||||||
|
const [location, setLocation] = useState(profile?.location || '');
|
||||||
|
const [tags, setTags] = useState(profile?.tags || '');
|
||||||
|
|
||||||
|
const update: FormattedProfile = {
|
||||||
|
...profile,
|
||||||
|
image,
|
||||||
|
name,
|
||||||
|
bio,
|
||||||
|
location,
|
||||||
|
job,
|
||||||
|
tagList: tags.split(',').map((tag) => tag.trim()),
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleUpdate = () => {
|
||||||
|
const updatedProfile: IProfile = {
|
||||||
|
...update,
|
||||||
|
name: update.name.trim(),
|
||||||
|
image: update.image.trim(),
|
||||||
|
tags: update.tagList.join(','),
|
||||||
|
};
|
||||||
|
const event = profile ? MatchEvents.UPDATE_MY_PROFILE : MatchEvents.CREATE_MY_PROFILE;
|
||||||
|
Nui.send(event, updatedProfile);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!profile && !config.match.allowEdtiableProfileName) {
|
||||||
|
return <PageText text={t('APPS_MATCH_PROFILE_CONFIGURATION')} />;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showPreview) {
|
||||||
|
return (
|
||||||
|
<Card raised className={classes.card}>
|
||||||
|
<Profile profile={update} />
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classes.root}>
|
||||||
|
<ProfileField
|
||||||
|
label={t('APPS_MATCH_EDIT_PROFILE_IMAGE')}
|
||||||
|
value={update.image}
|
||||||
|
handleChange={setImage}
|
||||||
|
allowChange
|
||||||
|
/>
|
||||||
|
<ProfileField
|
||||||
|
label={t('APPS_MATCH_EDIT_PROFILE_NAME')}
|
||||||
|
value={name}
|
||||||
|
handleChange={setName}
|
||||||
|
allowChange={config.match.allowEdtiableProfileName}
|
||||||
|
/>
|
||||||
|
<ProfileField
|
||||||
|
label={t('APPS_MATCH_EDIT_PROFILE_BIO')}
|
||||||
|
value={update.bio}
|
||||||
|
handleChange={setBio}
|
||||||
|
multiline
|
||||||
|
/>
|
||||||
|
<ProfileField
|
||||||
|
label={t('APPS_MATCH_EDIT_PROFILE_LOCATION')}
|
||||||
|
value={update.location}
|
||||||
|
handleChange={setLocation}
|
||||||
|
/>
|
||||||
|
<ProfileField
|
||||||
|
label={t('APPS_MATCH_EDIT_PROFILE_JOB')}
|
||||||
|
value={update.job}
|
||||||
|
handleChange={setJob}
|
||||||
|
/>
|
||||||
|
<ProfileField label={t('APPS_MATCH_EDIT_PROFILE_TAGS')} value={tags} handleChange={setTags} />
|
||||||
|
<UpdateButton handleClick={handleUpdate} loading={false} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ProfileForm;
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { Box, makeStyles } from '@material-ui/core';
|
||||||
|
|
||||||
|
import { useMatches } from '../../hooks/useMatches';
|
||||||
|
import Loader from '../Loader';
|
||||||
|
import PageText from '../PageText';
|
||||||
|
import Match from '../matches/Match';
|
||||||
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
import { MatchEvents } from '../../../../../../typings/match';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
height: '100%',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const MINIMUM_LOAD_TIME = 1500;
|
||||||
|
|
||||||
|
function MatchList() {
|
||||||
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { matches, error } = useMatches();
|
||||||
|
const [loaded, setLoaded] = useState(false);
|
||||||
|
|
||||||
|
// We make the conscious descion here to fetch matches everytime
|
||||||
|
// a user loads this page because this list is dependent on
|
||||||
|
// other player's database interactions (i.e. their likes/dislikes)
|
||||||
|
// not just the current players.
|
||||||
|
// This is less performant but means that we will always have the
|
||||||
|
// correct state when the player views this page
|
||||||
|
useEffect(() => {
|
||||||
|
Nui.send(MatchEvents.GET_MATCHES);
|
||||||
|
window.setTimeout(() => {
|
||||||
|
setLoaded(true);
|
||||||
|
}, MINIMUM_LOAD_TIME);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
if (error) return <PageText text={t('APPS_MATCH_MATCHES_ERROR')} />;
|
||||||
|
if (!loaded || !matches) return <Loader />;
|
||||||
|
if (matches.length === 0) return <PageText text={t('APPS_MATCH_NO_MATCHES')} />;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box className={classes.root}>
|
||||||
|
{matches.map((match) => (
|
||||||
|
<Match key={match.id} match={match} />
|
||||||
|
))}
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MatchList;
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import React, { useEffect, useState } from 'react';
|
||||||
|
import { Paper } from '@material-ui/core';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
import { useProfiles } from '../../hooks/useProfiles';
|
||||||
|
import Loader from '../Loader';
|
||||||
|
import PageText from '../PageText';
|
||||||
|
import ActiveProfile from '../ActiveProfile';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
overflow: 'hidden',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// set a minimum load time so the user doesn't see a flash
|
||||||
|
// of the loader and then the matches themselves
|
||||||
|
const MINIMUM_LOAD_TIME = 1250;
|
||||||
|
|
||||||
|
const MatchPage = () => {
|
||||||
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const { profiles, error, activeProfile, setViewed } = useProfiles();
|
||||||
|
const [loaded, setLoaded] = useState(false);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
window.setTimeout(() => {
|
||||||
|
setLoaded(true);
|
||||||
|
}, MINIMUM_LOAD_TIME);
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const handleSwipe = (id: number, liked: boolean) => {
|
||||||
|
// the user didn't choose (didn't swipe far enough)
|
||||||
|
if (liked === null) return;
|
||||||
|
|
||||||
|
setViewed(id, liked);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (error) return <PageText text={t('APPS_MATCH_PROFILES_ERROR')} />;
|
||||||
|
if (!loaded || !profiles) return <Loader />;
|
||||||
|
if (!activeProfile) return <PageText text={t('APPS_MATCH_NO_PROFILES')} />;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Paper className={classes.root} square>
|
||||||
|
<ActiveProfile profile={activeProfile} onSwipe={handleSwipe} />
|
||||||
|
</Paper>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MatchPage;
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
import React, { useState } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import { Box, FormControlLabel, Switch } from '@material-ui/core';
|
||||||
|
|
||||||
|
import { useProfile } from '../../hooks/useProfile';
|
||||||
|
import Loader from '../Loader';
|
||||||
|
import ProfileForm from '../profile/ProfileForm';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
height: '100%',
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
switch: {
|
||||||
|
marginLeft: '15px',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
function ProfileEditor() {
|
||||||
|
const { profile, noProfileExists } = useProfile();
|
||||||
|
const classes = useStyles();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [showPreview, setShowPreview] = useState(false);
|
||||||
|
|
||||||
|
const toggleSwitch = () => {
|
||||||
|
setShowPreview((preview) => !preview);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (!profile && !noProfileExists) return <Loader />;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Box className={classes.root}>
|
||||||
|
<Box className={classes.switch}>
|
||||||
|
<FormControlLabel
|
||||||
|
control={<Switch checked={showPreview} onChange={toggleSwitch} />}
|
||||||
|
label={t('APPS_MATCH_EDIT_PROFILE_PREVIEW')}
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<ProfileForm showPreview={showPreview} profile={profile} />
|
||||||
|
</Box>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ProfileEditor;
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
import { atom } from 'recoil';
|
||||||
|
|
||||||
|
export const matchState = {
|
||||||
|
profiles: atom({
|
||||||
|
key: 'profiles',
|
||||||
|
default: null,
|
||||||
|
}),
|
||||||
|
errorLoadingProfiles: atom({
|
||||||
|
key: 'errorLoadingProfiles',
|
||||||
|
default: false,
|
||||||
|
}),
|
||||||
|
matches: atom({
|
||||||
|
key: 'matches',
|
||||||
|
default: null,
|
||||||
|
}),
|
||||||
|
errorLoadingMatches: atom({
|
||||||
|
key: 'errorLoadingMatches',
|
||||||
|
default: false,
|
||||||
|
}),
|
||||||
|
myProfile: atom({
|
||||||
|
key: 'myProfile',
|
||||||
|
default: null,
|
||||||
|
}),
|
||||||
|
noProfileExists: atom({
|
||||||
|
key: 'noProfileExists',
|
||||||
|
default: false,
|
||||||
|
}),
|
||||||
|
};
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
import { useSetRecoilState } from 'recoil';
|
||||||
|
import { matchState } from './state';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import dayjs from 'dayjs';
|
||||||
|
|
||||||
|
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||||
|
import { Profile, FormattedProfile, Match, MatchEvents } from '../../../../../typings/match';
|
||||||
|
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
|
|
||||||
|
export const useMatchService = () => {
|
||||||
|
const { addAlert } = useSnackbar();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const setNoProfileExists = useSetRecoilState(matchState.noProfileExists);
|
||||||
|
const setProfiles = useSetRecoilState(matchState.profiles);
|
||||||
|
const setProfile = useSetRecoilState(matchState.myProfile);
|
||||||
|
const setMatches = useSetRecoilState(matchState.matches);
|
||||||
|
const setErrorLoadingMatches = useSetRecoilState(matchState.errorLoadingMatches);
|
||||||
|
const setErrorLoadingProfiles = useSetRecoilState(matchState.errorLoadingProfiles);
|
||||||
|
|
||||||
|
const handleAddAlert = ({ message, type }: IAlert) => {
|
||||||
|
addAlert({
|
||||||
|
message: t(message),
|
||||||
|
type,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
function formatProfile(profile: Profile): FormattedProfile | null {
|
||||||
|
return {
|
||||||
|
...profile,
|
||||||
|
tagList: profile.tags.split(',').filter((t) => t), // remove any empty tags
|
||||||
|
lastActiveFormatted: dayjs.unix(profile.lastActive).format(t('DATE_TIME_FORMAT')),
|
||||||
|
viewed: false,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const _setProfiles = (profiles: Profile[]): void => {
|
||||||
|
setProfiles(profiles.map(formatProfile));
|
||||||
|
};
|
||||||
|
const _setProfile = (profile: Profile) => {
|
||||||
|
if (!profile) {
|
||||||
|
setNoProfileExists(true);
|
||||||
|
} else {
|
||||||
|
setNoProfileExists(false);
|
||||||
|
setProfile(formatProfile(profile));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
const _handleGetProfilesFailed = (alert: IAlert): void => {
|
||||||
|
handleAddAlert(alert);
|
||||||
|
setErrorLoadingProfiles(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const _setMatches = (matches: Match[]): void => {
|
||||||
|
setMatches(
|
||||||
|
matches.map((match) => ({
|
||||||
|
...match,
|
||||||
|
tagList: match.tags.split(',').filter((t) => t), // remove any empty tags
|
||||||
|
lastActiveFormatted: dayjs.unix(match.lastActive).format(t('DATE_TIME_FORMAT')),
|
||||||
|
matchedAtFormatted: dayjs.unix(match.matchedAt).format(t('DATE_TIME_FORMAT')),
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const _handleGetMatchesFailed = (alert: IAlert): void => {
|
||||||
|
handleAddAlert(alert);
|
||||||
|
setErrorLoadingMatches(true);
|
||||||
|
};
|
||||||
|
|
||||||
|
const _handleUpdateProfile = (profile: Profile) => {
|
||||||
|
_setProfile(profile);
|
||||||
|
handleAddAlert({ message: 'APPS_MATCH_UPDATE_PROFILE_SUCCEEDED', type: 'info' });
|
||||||
|
};
|
||||||
|
|
||||||
|
useNuiEvent('MATCH', MatchEvents.GET_PROFILES_SUCCESS, _setProfiles);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.GET_PROFILES_FAILED, _handleGetProfilesFailed);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.GET_MY_PROFILE_SUCCESS, _setProfile);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.GET_MY_PROFILE_FAILED, handleAddAlert);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.GET_MATCHES_SUCCESS, _setMatches);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.GET_MATCHES_FAILED, _handleGetMatchesFailed);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.SAVE_LIKES_FAILED, handleAddAlert);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.NEW_MATCH, handleAddAlert);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.UPDATE_MY_PROFILE_SUCCESS, _handleUpdateProfile);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.UPDATE_MY_PROFILE_FAILED, handleAddAlert);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.CREATE_MY_PROFILE_SUCCESS, _handleUpdateProfile);
|
||||||
|
useNuiEvent('MATCH', MatchEvents.CREATE_MY_PROFILE_FAILED, handleAddAlert);
|
||||||
|
return {};
|
||||||
|
};
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
import { useRecoilValue } from 'recoil';
|
||||||
|
import { matchState } from './state';
|
||||||
|
|
||||||
|
import { FormattedMatch } from '../../../../../typings/match';
|
||||||
|
|
||||||
|
interface IUseMatches {
|
||||||
|
matches: FormattedMatch[];
|
||||||
|
error: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useMatches = (): IUseMatches => {
|
||||||
|
const matches = useRecoilValue<FormattedMatch[]>(matchState.matches);
|
||||||
|
const error = useRecoilValue(matchState.errorLoadingMatches);
|
||||||
|
return { matches, error };
|
||||||
|
};
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||||
|
import { matchState } from './state';
|
||||||
|
|
||||||
|
import { FormattedProfile } from '../../../../../typings/match';
|
||||||
|
|
||||||
|
interface IUseProfiles {
|
||||||
|
profile: FormattedProfile;
|
||||||
|
setProfile: (profile: FormattedProfile) => void;
|
||||||
|
noProfileExists: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useProfile = (): IUseProfiles => {
|
||||||
|
const [profile, setProfile] = useRecoilState<FormattedProfile>(matchState.myProfile);
|
||||||
|
const noProfileExists = useRecoilValue(matchState.noProfileExists);
|
||||||
|
return { profile, setProfile, noProfileExists };
|
||||||
|
};
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||||
|
import { matchState } from './state';
|
||||||
|
|
||||||
|
import { FormattedProfile, MatchEvents } from '../../../../../typings/match';
|
||||||
|
import Nui from '../../../os/nui-events/utils/Nui';
|
||||||
|
|
||||||
|
interface IUseProfiles {
|
||||||
|
profiles: FormattedProfile[];
|
||||||
|
activeProfile: FormattedProfile | null;
|
||||||
|
setViewed: (index: number, liked: boolean) => void;
|
||||||
|
error: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const useProfiles = (): IUseProfiles => {
|
||||||
|
const [profiles, setProfiles] = useRecoilState(matchState.profiles);
|
||||||
|
const error = useRecoilValue(matchState.errorLoadingProfiles);
|
||||||
|
|
||||||
|
const setViewed = (id: number, liked: boolean) => {
|
||||||
|
setProfiles((profiles) =>
|
||||||
|
profiles.map((profile) => {
|
||||||
|
if (id === profile.id) return { ...profile, viewed: true, liked };
|
||||||
|
return profile;
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
|
||||||
|
Nui.send(MatchEvents.SAVE_LIKES, [{ id, liked }]);
|
||||||
|
};
|
||||||
|
|
||||||
|
const filteredProfiles = profiles ? profiles.filter((profile) => !profile.viewed) : null;
|
||||||
|
const activeProfile = profiles ? filteredProfiles[0] : null;
|
||||||
|
|
||||||
|
return { profiles, activeProfile, error, setViewed };
|
||||||
|
};
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import { red, common } from '@material-ui/core/colors';
|
||||||
|
|
||||||
|
export const MATCH_APP_PRIMARY_COLOR = '#FE3B73';
|
||||||
|
export const MATCH_APP_TEXT_COLOR = common.white;
|
||||||
|
|
||||||
|
const theme = {
|
||||||
|
palette: {
|
||||||
|
primary: {
|
||||||
|
main: MATCH_APP_PRIMARY_COLOR,
|
||||||
|
dark: red[700],
|
||||||
|
light: red[300],
|
||||||
|
contrastText: MATCH_APP_TEXT_COLOR,
|
||||||
|
},
|
||||||
|
secondary: {
|
||||||
|
main: '#d32f2f',
|
||||||
|
light: '#eb4242',
|
||||||
|
dark: '#941212',
|
||||||
|
contrastText: MATCH_APP_TEXT_COLOR,
|
||||||
|
},
|
||||||
|
success: {
|
||||||
|
main: '#2196f3',
|
||||||
|
contrastText: MATCH_APP_TEXT_COLOR,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
export default theme;
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||||
|
|
||||||
|
import matchTheme from '../match.theme';
|
||||||
|
|
||||||
|
export const MatchThemeProvider = createAppThemeProvider(matchTheme);
|
||||||
@@ -0,0 +1,161 @@
|
|||||||
|
interface IDeltas {
|
||||||
|
deltaX: number;
|
||||||
|
deltaY: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given a React ref, which should point to some HTML element,
|
||||||
|
* add draggable functionality to that element so the user can
|
||||||
|
* interact with it.
|
||||||
|
*
|
||||||
|
* It should be noted that when using this in React that this
|
||||||
|
* class is directly mutating the DOM, not relying on React state
|
||||||
|
* to do so. This can cause some problems when relying on React
|
||||||
|
* state updates based on the values derived from this class. That
|
||||||
|
* is why we primarily use refs to interact with it.
|
||||||
|
*
|
||||||
|
* Order of operations:
|
||||||
|
* 1. User clicks "down" on element - this initializes event
|
||||||
|
* handlers and saves initial state
|
||||||
|
* 2. User moves mouse. Every mouse move event triggers a movement
|
||||||
|
* of the HTML element and also performs some logic to see how far
|
||||||
|
* we have moved
|
||||||
|
* 3. User "releases" mouse - cleanup event handlers and do logic
|
||||||
|
* to compare our final position to our initial position
|
||||||
|
*/
|
||||||
|
export class DraggableElement {
|
||||||
|
private element: HTMLElement;
|
||||||
|
|
||||||
|
private width: number = 0;
|
||||||
|
private initialX: number = 0;
|
||||||
|
private initialY: number = 0;
|
||||||
|
private mouseDownInitialX: number = 0;
|
||||||
|
private mouseDownInitialY: number = 0;
|
||||||
|
|
||||||
|
private useRotation: boolean;
|
||||||
|
private maxRotationDeg: null | number;
|
||||||
|
|
||||||
|
private updatedX: number = 0;
|
||||||
|
private updatedY: number = 0;
|
||||||
|
private mouseDownX: number = 0;
|
||||||
|
private mouseDownY: number = 0;
|
||||||
|
|
||||||
|
constructor(ref: React.MutableRefObject<any>, maxRotationDeg: number | null = null) {
|
||||||
|
this.element = ref.current;
|
||||||
|
this.width = this.element.clientWidth;
|
||||||
|
this.maxRotationDeg = maxRotationDeg;
|
||||||
|
this.useRotation = maxRotationDeg !== null;
|
||||||
|
|
||||||
|
this.element.onmousedown = this.onMouseDown;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMouseDown = (e: MouseEvent): void => {
|
||||||
|
e.preventDefault();
|
||||||
|
// get the mouse cursor position at startup:
|
||||||
|
this.mouseDownX = e.clientX;
|
||||||
|
this.mouseDownY = e.clientY;
|
||||||
|
|
||||||
|
// save where we initially started dragging from
|
||||||
|
// so we can do some math later
|
||||||
|
this.mouseDownInitialX = this.mouseDownX;
|
||||||
|
this.mouseDownInitialY = this.mouseDownY;
|
||||||
|
|
||||||
|
document.onmouseup = this.onMouseUp;
|
||||||
|
// call a function whenever the cursor moves:
|
||||||
|
document.onmousemove = this.onMouseMove;
|
||||||
|
};
|
||||||
|
|
||||||
|
onMouseMove = (e: MouseEvent): void => {
|
||||||
|
e.preventDefault();
|
||||||
|
const x = e.clientX;
|
||||||
|
const y = e.clientY;
|
||||||
|
this._onMouseMove(x, y);
|
||||||
|
};
|
||||||
|
|
||||||
|
_onMouseMove = (x: number, y: number): void => {
|
||||||
|
// calculate the new cursor position:
|
||||||
|
this.updatedX = this.mouseDownX - x;
|
||||||
|
this.updatedY = this.mouseDownY - y;
|
||||||
|
this.mouseDownX = x;
|
||||||
|
this.mouseDownY = y;
|
||||||
|
|
||||||
|
// set the element's new position:
|
||||||
|
this.element.style.top = this.element.offsetTop - this.updatedY + 'px';
|
||||||
|
this.element.style.left = this.element.offsetLeft - this.updatedX + 'px';
|
||||||
|
|
||||||
|
if (this.useRotation) {
|
||||||
|
const { deltaX } = this.deltas(this.mouseDownX, this.mouseDownY);
|
||||||
|
const pctWidth = deltaX / this.width;
|
||||||
|
const rotationDeg = -1 * this.maxRotationDeg * pctWidth;
|
||||||
|
|
||||||
|
this.element.style.webkitTransform = `rotate(${rotationDeg}deg)`;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
onMouseUp = (e: MouseEvent): void => {
|
||||||
|
e.preventDefault();
|
||||||
|
this._onMouseUp();
|
||||||
|
};
|
||||||
|
|
||||||
|
_onMouseUp = (): void => {
|
||||||
|
// stop moving when mouse button is released:
|
||||||
|
this.cleanup();
|
||||||
|
|
||||||
|
// revert back to intitial position
|
||||||
|
this.element.style.left = `${this.initialX}px`;
|
||||||
|
this.element.style.top = `${this.initialY}px`;
|
||||||
|
if (this.useRotation) {
|
||||||
|
this.element.style.webkitTransform = 'rotate(0deg)';
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
cleanup = (): void => {
|
||||||
|
document.onmouseup = null;
|
||||||
|
document.onmousemove = null;
|
||||||
|
};
|
||||||
|
|
||||||
|
deltas = (x: number, y: number): IDeltas => {
|
||||||
|
const deltaX = x - this.mouseDownInitialX;
|
||||||
|
const deltaY = y - this.mouseDownInitialX;
|
||||||
|
return { deltaX, deltaY };
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
type StatusChange = (deltaX: number) => void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This class adds hooks to the base DraggableElement class
|
||||||
|
* so we can update application state based on events
|
||||||
|
*/
|
||||||
|
export class LikeorDislikeDraggableElement extends DraggableElement {
|
||||||
|
private onDrag: StatusChange;
|
||||||
|
private onDrop: () => void;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
ref: React.MutableRefObject<any>,
|
||||||
|
maxRotationDeg: number,
|
||||||
|
onDrag: StatusChange,
|
||||||
|
onDrop: () => void,
|
||||||
|
) {
|
||||||
|
super(ref, maxRotationDeg);
|
||||||
|
|
||||||
|
this.onDrag = onDrag;
|
||||||
|
this.onDrop = onDrop;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMouseMove = (e: MouseEvent): void => {
|
||||||
|
e.preventDefault();
|
||||||
|
const x = e.clientX;
|
||||||
|
const y = e.clientY;
|
||||||
|
|
||||||
|
const { deltaX } = this.deltas(x, y);
|
||||||
|
|
||||||
|
this.onDrag(deltaX);
|
||||||
|
this._onMouseMove(x, y);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMouseUp = (): void => {
|
||||||
|
this.onDrop();
|
||||||
|
this._onMouseUp();
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -53,7 +53,7 @@ export const MessagesApp = () => {
|
|||||||
InjectDebugData([
|
InjectDebugData([
|
||||||
{
|
{
|
||||||
app: 'MESSAGES',
|
app: 'MESSAGES',
|
||||||
method: 'phone:fetchMessageGroupsSuccess',
|
method: MessageEvents.FETCH_MESSAGE_GROUPS_SUCCESS,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
groupId: '2',
|
groupId: '2',
|
||||||
@@ -93,7 +93,7 @@ InjectDebugData(
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
app: 'MESSAGES',
|
app: 'MESSAGES',
|
||||||
method: 'phone:fetchMessagesSuccess',
|
method: MessageEvents.FETCH_MESSAGES_SUCCESS,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|||||||
@@ -1,17 +1,19 @@
|
|||||||
import React, { useCallback, useEffect, useState } from 'react';
|
import React, { useCallback, useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Box, Button, TextField } from '@material-ui/core';
|
import { Box, Button, TextField } from '@material-ui/core';
|
||||||
|
|
||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
import { useHistory } from 'react-router-dom';
|
import { useHistory } from 'react-router-dom';
|
||||||
import { Autocomplete } from '@material-ui/lab';
|
import { Autocomplete } from '@material-ui/lab';
|
||||||
import { useContacts } from '../../../contacts/hooks/useContacts';
|
import { useContacts } from '../../../contacts/hooks/useContacts';
|
||||||
import { Contact } from '../../../../../../typings/contact';
|
import { Contact } from '../../../../../../typings/contact';
|
||||||
import { MessageEvents } from '../../../../../../typings/messages';
|
import { MessageEvents } from '../../../../../../typings/messages';
|
||||||
|
import { PHONE_NUMBER_REGEX } from '../../../../../../typings/phone';
|
||||||
|
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
|
||||||
|
|
||||||
const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { addAlert } = useSnackbar();
|
||||||
const [participants, setParticipants] = useState([]);
|
const [participants, setParticipants] = useState([]);
|
||||||
const [label, setLabel] = useState('');
|
const [label, setLabel] = useState('');
|
||||||
const { getContactByNumber, contacts } = useContacts();
|
const { getContactByNumber, contacts } = useContacts();
|
||||||
@@ -45,6 +47,10 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
|||||||
const onAutocompleteChange = (_e, value: any) => {
|
const onAutocompleteChange = (_e, value: any) => {
|
||||||
const lastIdx = value.length - 1;
|
const lastIdx = value.length - 1;
|
||||||
if (typeof value[lastIdx] === 'string') {
|
if (typeof value[lastIdx] === 'string') {
|
||||||
|
const isValid = PHONE_NUMBER_REGEX.test(value[lastIdx]);
|
||||||
|
if (!isValid) {
|
||||||
|
return addAlert({ message: t('APPS_MESSAGES_INVALID_PHONE_NUMBER'), type: 'error' });
|
||||||
|
}
|
||||||
value.splice(lastIdx, 1, { number: value[lastIdx] });
|
value.splice(lastIdx, 1, { number: value[lastIdx] });
|
||||||
setParticipants(value);
|
setParticipants(value);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { useCallback } from 'react';
|
|||||||
import Nui from '../../../os/nui-events/utils/Nui';
|
import Nui from '../../../os/nui-events/utils/Nui';
|
||||||
import { useLocation } from 'react-router';
|
import { useLocation } from 'react-router';
|
||||||
import { MessageEvents } from '../../../../../typings/messages';
|
import { MessageEvents } from '../../../../../typings/messages';
|
||||||
|
import { TOptionsBase } from 'i18next';
|
||||||
|
|
||||||
export const useMessagesService = () => {
|
export const useMessagesService = () => {
|
||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
@@ -22,9 +23,9 @@ export const useMessagesService = () => {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const handleAddAlert = useCallback(
|
const handleAddAlert = useCallback(
|
||||||
({ message, type }: IAlert) => {
|
({ message, type, options = {} }: IAlert & { options: TOptionsBase }) => {
|
||||||
addAlert({
|
addAlert({
|
||||||
message: t(`APPS_${message}`),
|
message: t(`${message}`, options),
|
||||||
type,
|
type,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ import useStyles from './notes.styles';
|
|||||||
import InjectDebugData from '../../os/debug/InjectDebugData';
|
import InjectDebugData from '../../os/debug/InjectDebugData';
|
||||||
import { NotesThemeProvider } from './providers/NotesThemeProvider';
|
import { NotesThemeProvider } from './providers/NotesThemeProvider';
|
||||||
import { Route, useHistory } from 'react-router-dom';
|
import { Route, useHistory } from 'react-router-dom';
|
||||||
|
import { NotesEvents } from '../../../../typings/notes';
|
||||||
|
|
||||||
export const NotesApp = () => {
|
export const NotesApp = () => {
|
||||||
const classes = useStyles();
|
const classes = useStyles();
|
||||||
@@ -43,7 +44,7 @@ export const NotesApp = () => {
|
|||||||
InjectDebugData([
|
InjectDebugData([
|
||||||
{
|
{
|
||||||
app: 'NOTES',
|
app: 'NOTES',
|
||||||
method: 'setNotes',
|
method: NotesEvents.SEND_NOTE,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 1,
|
id: 1,
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
|||||||
import { noteStates } from './state';
|
import { noteStates } from './state';
|
||||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { NotesEvents } from '../../../../../typings/notes';
|
||||||
|
|
||||||
export const useNotesService = () => {
|
export const useNotesService = () => {
|
||||||
const { addAlert } = useSnackbar();
|
const { addAlert } = useSnackbar();
|
||||||
@@ -16,6 +17,6 @@ export const useNotesService = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useNuiEvent('NOTES', 'setNotes', setNotes);
|
useNuiEvent('NOTES', NotesEvents.SEND_NOTE, setNotes);
|
||||||
useNuiEvent('NOTES', 'setAlert', handleAddAlert);
|
useNuiEvent('NOTES', NotesEvents.SEND_ALERT, handleAddAlert);
|
||||||
};
|
};
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { SelloutList } from './SelloutList';
|
|
||||||
|
|
||||||
export const SelloutListContainer = () => {
|
|
||||||
return <SelloutList />;
|
|
||||||
};
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
|
||||||
|
|
||||||
import selloutTheme from '../sellout.theme';
|
|
||||||
|
|
||||||
export const SelloutThemeProvider = createAppThemeProvider(selloutTheme);
|
|
||||||
@@ -10,7 +10,10 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
Typography,
|
Typography,
|
||||||
Switch,
|
Switch,
|
||||||
|
TextField,
|
||||||
} from '@material-ui/core';
|
} from '@material-ui/core';
|
||||||
|
import CreateIcon from '@material-ui/icons/Create';
|
||||||
|
import { PictureThumbnail } from '../../../ui/components/PictureThumbnail';
|
||||||
|
|
||||||
interface ISettingItem {
|
interface ISettingItem {
|
||||||
options?: any;
|
options?: any;
|
||||||
@@ -106,3 +109,15 @@ export const SettingItemIconAction = ({
|
|||||||
</ListItem>
|
</ListItem>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const SettingItemModal = ({ icon, label, secondary, onClick }) => (
|
||||||
|
<ListItem divider>
|
||||||
|
<ListItemIcon>{icon}</ListItemIcon>
|
||||||
|
<ListItemText primary={label} secondary={secondary} />
|
||||||
|
<ListItemSecondaryAction>
|
||||||
|
<IconButton onClick={onClick}>
|
||||||
|
<CreateIcon />
|
||||||
|
</IconButton>
|
||||||
|
</ListItemSecondaryAction>
|
||||||
|
</ListItem>
|
||||||
|
);
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import React from 'react';
|
import React, { useState } from 'react';
|
||||||
import { AppWrapper } from '../../../ui/components';
|
import { AppWrapper } from '../../../ui/components';
|
||||||
import { AppTitle } from '../../../ui/components/AppTitle';
|
import { AppTitle } from '../../../ui/components/AppTitle';
|
||||||
import { AppContent } from '../../../ui/components/AppContent';
|
import { AppContent } from '../../../ui/components/AppContent';
|
||||||
@@ -12,6 +12,7 @@ import {
|
|||||||
SettingItemIconAction,
|
SettingItemIconAction,
|
||||||
SettingItemSlider,
|
SettingItemSlider,
|
||||||
SettingSwitch,
|
SettingSwitch,
|
||||||
|
SettingItemModal,
|
||||||
} from './SettingItem';
|
} from './SettingItem';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import VisibilityOffIcon from '@material-ui/icons/VisibilityOff';
|
import VisibilityOffIcon from '@material-ui/icons/VisibilityOff';
|
||||||
@@ -28,12 +29,13 @@ import {
|
|||||||
Book,
|
Book,
|
||||||
DeleteForever,
|
DeleteForever,
|
||||||
} from '@material-ui/icons';
|
} from '@material-ui/icons';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
import { ListSubheader } from '@material-ui/core';
|
import { ListSubheader } from '@material-ui/core';
|
||||||
import { useResetSettings, useSettings } from '../hooks/useSettings';
|
import { useCustomWallpaperModal, useResetSettings, useSettings } from '../hooks/useSettings';
|
||||||
import { setClipboard } from '../../../os/phone/hooks/useClipboard';
|
import { setClipboard } from '../../../os/phone/hooks/useClipboard';
|
||||||
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
import { IContextMenuOption } from '../../../ui/components/ContextMenu';
|
import { IContextMenuOption } from '../../../ui/components/ContextMenu';
|
||||||
|
import WallpaperModal from './WallpaperModal';
|
||||||
|
|
||||||
const SubHeaderComp = (props: { text: string }) => (
|
const SubHeaderComp = (props: { text: string }) => (
|
||||||
<ListSubheader color="primary" component="div" disableSticky>
|
<ListSubheader color="primary" component="div" disableSticky>
|
||||||
@@ -41,12 +43,26 @@ const SubHeaderComp = (props: { text: string }) => (
|
|||||||
</ListSubheader>
|
</ListSubheader>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
backgroundModal: {
|
||||||
|
background: 'black',
|
||||||
|
opacity: '0.6',
|
||||||
|
position: 'absolute',
|
||||||
|
top: 0,
|
||||||
|
left: 0,
|
||||||
|
right: 0,
|
||||||
|
bottom: 0,
|
||||||
|
zIndex: 5,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
export const SettingsApp = () => {
|
export const SettingsApp = () => {
|
||||||
const settingsApp = useApp('SETTINGS');
|
const settingsApp = useApp('SETTINGS');
|
||||||
const [config] = useConfig();
|
const [config] = useConfig();
|
||||||
const simcard = useSimcard();
|
const simcard = useSimcard();
|
||||||
const [settings, setSettings] = useSettings();
|
const [settings, setSettings] = useSettings();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const { customWallpaperModal, setCustomWallpaperModal } = useCustomWallpaperModal();
|
||||||
|
|
||||||
const { addAlert } = useSnackbar();
|
const { addAlert } = useSnackbar();
|
||||||
|
|
||||||
@@ -123,9 +139,12 @@ export const SettingsApp = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||||
|
const classes = useStyles();
|
||||||
return (
|
return (
|
||||||
<AppWrapper>
|
<AppWrapper>
|
||||||
<AppTitle app={settingsApp} />
|
<AppTitle app={settingsApp} />
|
||||||
|
<WallpaperModal />
|
||||||
|
<div className={customWallpaperModal ? classes.backgroundModal : undefined} />
|
||||||
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
||||||
<List disablePadding subheader={<SubHeaderComp text={t('SETTINGS.CATEGORY.PHONE')} />}>
|
<List disablePadding subheader={<SubHeaderComp text={t('SETTINGS.CATEGORY.PHONE')} />}>
|
||||||
<SettingItemIconAction
|
<SettingItemIconAction
|
||||||
@@ -194,6 +213,13 @@ export const SettingsApp = () => {
|
|||||||
onClick={openMenu}
|
onClick={openMenu}
|
||||||
icon={<Wallpaper />}
|
icon={<Wallpaper />}
|
||||||
/>
|
/>
|
||||||
|
{/* CUSTOM BACKGROUND */}
|
||||||
|
<SettingItemModal
|
||||||
|
icon={<Wallpaper />}
|
||||||
|
label={t('APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER')}
|
||||||
|
secondary={settings.customWallpaper}
|
||||||
|
onClick={() => setCustomWallpaperModal(true)}
|
||||||
|
/>
|
||||||
<SettingItem
|
<SettingItem
|
||||||
label={t('APPS_SETTINGS_OPTION_FRAME')}
|
label={t('APPS_SETTINGS_OPTION_FRAME')}
|
||||||
value={settings.frame.label}
|
value={settings.frame.label}
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
import React, { useState } from 'react';
|
||||||
|
import Modal from '../../../ui/components/Modal';
|
||||||
|
import { useCustomWallpaperModal, useSettings } from '../hooks/useSettings';
|
||||||
|
import { Box, Button, TextField } from '@material-ui/core';
|
||||||
|
import { PictureThumbnail } from '../../../ui/components/PictureThumbnail';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import { StatusButton } from '../../../ui/components/StatusButton';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
input: {
|
||||||
|
marginTop: 10,
|
||||||
|
marginBottom: 10,
|
||||||
|
},
|
||||||
|
inputProps: {
|
||||||
|
fontSize: 18,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
export default function WallpaperModal() {
|
||||||
|
const { customWallpaperModal, setCustomWallpaperModal } = useCustomWallpaperModal();
|
||||||
|
const [settings, setSettings] = useSettings();
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [value, setValue] = useState(settings.customWallpaper ? settings.customWallpaper : '');
|
||||||
|
const classes = useStyles();
|
||||||
|
|
||||||
|
const isImage = (url) => {
|
||||||
|
return /(http(s?):)([/|.|\w|\s|-])*\.(?:jpg|png|jpeg|gif)/g.test(url);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleCloseModal = () => {
|
||||||
|
setCustomWallpaperModal(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSettingChange = (key: string | number, value: unknown) => {
|
||||||
|
setSettings({ ...settings, [key]: value });
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleNewWallpaper = () => {
|
||||||
|
handleSettingChange('customWallpaper', value);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleRemoveWallpaper = () => {
|
||||||
|
handleSettingChange('customWallpaper', '');
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Modal visible={customWallpaperModal} handleClose={handleCloseModal}>
|
||||||
|
<Box
|
||||||
|
display="flex"
|
||||||
|
justifyContent="center"
|
||||||
|
alignItems="center"
|
||||||
|
textAlign="center"
|
||||||
|
flexDirection="column"
|
||||||
|
>
|
||||||
|
{settings.customWallpaper && (
|
||||||
|
<PictureThumbnail src={settings.customWallpaper} alt="chipisbest" />
|
||||||
|
)}
|
||||||
|
<TextField
|
||||||
|
value={value}
|
||||||
|
variant="outlined"
|
||||||
|
className={classes.input}
|
||||||
|
onChange={(e) => setValue(e.currentTarget.value)}
|
||||||
|
inputProps={{
|
||||||
|
className: classes.inputProps,
|
||||||
|
}}
|
||||||
|
placeholder="Image URL"
|
||||||
|
/>
|
||||||
|
<Button
|
||||||
|
color="primary"
|
||||||
|
variant="contained"
|
||||||
|
disabled={!isImage(value)}
|
||||||
|
onClick={handleNewWallpaper}
|
||||||
|
style={{ marginBottom: 10 }}
|
||||||
|
>
|
||||||
|
{t('APPS_SETTINGS_SET_CUSTOM_WALLPAPER')}
|
||||||
|
</Button>
|
||||||
|
{settings.customWallpaper && (
|
||||||
|
<StatusButton color="error" variant="contained" onClick={handleRemoveWallpaper}>
|
||||||
|
{t('GENERIC_DELETE')}
|
||||||
|
</StatusButton>
|
||||||
|
)}
|
||||||
|
</Box>
|
||||||
|
</Modal>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -23,6 +23,7 @@ const settingsSchema: Schema = {
|
|||||||
properties: {
|
properties: {
|
||||||
language: { $ref: '/SettingOption' },
|
language: { $ref: '/SettingOption' },
|
||||||
wallpaper: { $ref: '/SettingOption' },
|
wallpaper: { $ref: '/SettingOption' },
|
||||||
|
customWallpaper: { type: 'string' },
|
||||||
frame: { $ref: '/SettingOption' },
|
frame: { $ref: '/SettingOption' },
|
||||||
theme: { $ref: '/SettingOption' },
|
theme: { $ref: '/SettingOption' },
|
||||||
zoom: { $ref: '/SettingOption' },
|
zoom: { $ref: '/SettingOption' },
|
||||||
@@ -63,6 +64,7 @@ export function isSettingsSchemaValid(): boolean {
|
|||||||
export interface IPhoneSettings {
|
export interface IPhoneSettings {
|
||||||
language: SettingOption;
|
language: SettingOption;
|
||||||
wallpaper: SettingOption;
|
wallpaper: SettingOption;
|
||||||
|
customWallpaper: string;
|
||||||
frame: SettingOption;
|
frame: SettingOption;
|
||||||
theme: SettingOption;
|
theme: SettingOption;
|
||||||
zoom: SettingOption;
|
zoom: SettingOption;
|
||||||
@@ -110,6 +112,11 @@ export const settingsState = atom({
|
|||||||
effects_UNSTABLE: [localStorageEffect(NPWD_STORAGE_KEY)],
|
effects_UNSTABLE: [localStorageEffect(NPWD_STORAGE_KEY)],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const customWallpaperState = atom({
|
||||||
|
key: 'customWallpaperState',
|
||||||
|
default: false,
|
||||||
|
});
|
||||||
|
|
||||||
export const useSettings = () => {
|
export const useSettings = () => {
|
||||||
return useRecoilState(settingsState);
|
return useRecoilState(settingsState);
|
||||||
};
|
};
|
||||||
@@ -117,3 +124,8 @@ export const useSettings = () => {
|
|||||||
export const useResetSettings = () => {
|
export const useResetSettings = () => {
|
||||||
return useResetRecoilState(settingsState);
|
return useResetRecoilState(settingsState);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const useCustomWallpaperModal = () => {
|
||||||
|
const [customWallpaperModal, setCustomWallpaperModal] = useRecoilState(customWallpaperState);
|
||||||
|
return { customWallpaperModal, setCustomWallpaperModal };
|
||||||
|
};
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { Switch, Route } from 'react-router-dom';
|
import { Switch, Route } from 'react-router-dom';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
|
||||||
import Nui from '../../../os/nui-events/utils/Nui';
|
|
||||||
import { AppWrapper } from '../../../ui/components';
|
import { AppWrapper } from '../../../ui/components';
|
||||||
import { AppContent } from '../../../ui/components/AppContent';
|
import { AppContent } from '../../../ui/components/AppContent';
|
||||||
import TweetListContainer from './tweet/TweetListContainer';
|
import TweetListContainer from './tweet/TweetListContainer';
|
||||||
@@ -78,7 +77,7 @@ export const TwitterApp = () => {
|
|||||||
InjectDebugData([
|
InjectDebugData([
|
||||||
{
|
{
|
||||||
app: 'TWITTER',
|
app: 'TWITTER',
|
||||||
method: 'getOrCreateTwitterProfile',
|
method: TwitterEvents.GET_OR_CREATE_PROFILE,
|
||||||
data: {
|
data: {
|
||||||
profile_name: 'Angular_Dev',
|
profile_name: 'Angular_Dev',
|
||||||
bio: 'Angular FTW',
|
bio: 'Angular FTW',
|
||||||
@@ -89,7 +88,7 @@ InjectDebugData([
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
app: 'TWITTER',
|
app: 'TWITTER',
|
||||||
method: 'fetchTweets',
|
method: TwitterEvents.FETCH_TWEETS,
|
||||||
data: [
|
data: [
|
||||||
{
|
{
|
||||||
id: 59,
|
id: 59,
|
||||||
@@ -150,7 +149,7 @@ InjectDebugData(
|
|||||||
[
|
[
|
||||||
{
|
{
|
||||||
app: 'TWITTER',
|
app: 'TWITTER',
|
||||||
method: 'createTweetBroadcast',
|
method: TwitterEvents.CREATE_TWEET_BROADCAST,
|
||||||
data: {
|
data: {
|
||||||
id: 111,
|
id: 111,
|
||||||
profile_id: 111,
|
profile_id: 111,
|
||||||
@@ -162,7 +161,7 @@ InjectDebugData(
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
app: 'TWITTER',
|
app: 'TWITTER',
|
||||||
method: 'createTweetBroadcast',
|
method: TwitterEvents.CREATE_TWEET_BROADCAST,
|
||||||
data: {
|
data: {
|
||||||
id: 111,
|
id: 111,
|
||||||
profile_id: 111,
|
profile_id: 111,
|
||||||
|
|||||||
@@ -1,45 +1,16 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React from 'react';
|
||||||
import { makeStyles } from '@material-ui/core/styles';
|
|
||||||
import { Fab } from '@material-ui/core';
|
|
||||||
import PublishIcon from '@material-ui/icons/Publish';
|
|
||||||
|
|
||||||
|
import UpdateButton from '../../../../ui/components/UpdateButton';
|
||||||
import { useProfile } from '../../hooks/useProfile';
|
import { useProfile } from '../../hooks/useProfile';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
interface IProps {
|
||||||
root: {
|
handleClick: () => void;
|
||||||
position: 'absolute',
|
}
|
||||||
bottom: '15px',
|
|
||||||
right: '15px',
|
|
||||||
},
|
|
||||||
button: {
|
|
||||||
background: '#00acee',
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const MINIMUM_LOAD_TIME = 750;
|
export function ProfileUpdateButton({ handleClick }: IProps) {
|
||||||
|
|
||||||
export function ProfileUpdateButton({ handleClick }) {
|
|
||||||
const classes = useStyles();
|
|
||||||
const [minimumLoadPassed, setMimimumLoadPassed] = useState(true);
|
|
||||||
const { updateProfileLoading } = useProfile();
|
const { updateProfileLoading } = useProfile();
|
||||||
|
|
||||||
useEffect(() => {
|
return <UpdateButton loading={updateProfileLoading} handleClick={handleClick} />;
|
||||||
setMimimumLoadPassed(false);
|
|
||||||
const timeout = window.setTimeout(() => {
|
|
||||||
setMimimumLoadPassed(true);
|
|
||||||
}, MINIMUM_LOAD_TIME);
|
|
||||||
return () => window.clearTimeout(timeout);
|
|
||||||
}, [updateProfileLoading]);
|
|
||||||
|
|
||||||
const isLoading = updateProfileLoading || !minimumLoadPassed;
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className={classes.root}>
|
|
||||||
<Fab className={classes.button} color="primary" onClick={handleClick} disabled={isLoading}>
|
|
||||||
<PublishIcon />
|
|
||||||
</Fab>
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default ProfileUpdateButton;
|
export default ProfileUpdateButton;
|
||||||
@@ -7,7 +7,7 @@ const useStyles = makeStyles(() => ({
|
|||||||
root: {
|
root: {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
bottom: '75px',
|
bottom: '75px',
|
||||||
right: '15px',
|
right: '10px',
|
||||||
},
|
},
|
||||||
button: {
|
button: {
|
||||||
background: '#00acee',
|
background: '#00acee',
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import { useTranslation } from 'react-i18next';
|
|||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
import { useProfile } from '../../hooks/useProfile';
|
import { useProfile } from '../../hooks/useProfile';
|
||||||
import Avatar from '../Avatar';
|
import Avatar from '../Avatar';
|
||||||
import ProfileField from './ProfileField';
|
|
||||||
import ProfileUpdateButton from '../buttons/ProfileUpdateButton';
|
import ProfileUpdateButton from '../buttons/ProfileUpdateButton';
|
||||||
import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
||||||
import { TwitterEvents } from '../../../../../../typings/twitter';
|
import { TwitterEvents } from '../../../../../../typings/twitter';
|
||||||
|
import ProfileField from '../../../../ui/components/ProfileField';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { makeStyles } from '@material-ui/core/styles';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||||
|
import ProfileField from '../../../../ui/components/ProfileField';
|
||||||
import { useProfile } from '../../hooks/useProfile';
|
import { useProfile } from '../../hooks/useProfile';
|
||||||
import ProfileField from './ProfileField';
|
|
||||||
import DefaultProfilePrompt from './DefaultProfilePrompt';
|
|
||||||
import ProfileUpdateButton from '../buttons/ProfileUpdateButton';
|
import ProfileUpdateButton from '../buttons/ProfileUpdateButton';
|
||||||
import { useRecoilValue } from 'recoil';
|
import { useRecoilValue } from 'recoil';
|
||||||
import { twitterState } from '../../hooks/state';
|
import { twitterState } from '../../hooks/state';
|
||||||
import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
import { usePhone } from '../../../../os/phone/hooks/usePhone';
|
||||||
import { TwitterEvents } from '../../../../../../typings/twitter';
|
import { TwitterEvents } from '../../../../../../typings/twitter';
|
||||||
|
import DefaultProfilePrompt from './DefaultProfilePrompt';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
|
|||||||
@@ -37,7 +37,12 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button aria-controls="simple-menu" aria-haspopup="true" onClick={_handleClick}>
|
<Button
|
||||||
|
aria-controls="simple-menu"
|
||||||
|
aria-haspopup="true"
|
||||||
|
onClick={_handleClick}
|
||||||
|
style={{ marginRight: 15 }}
|
||||||
|
>
|
||||||
<MoreIcon />
|
<MoreIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Menu
|
<Menu
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import { twitterState } from './state';
|
|||||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
import { useTwitterNotifications } from './useTwitterNotifications';
|
import { useTwitterNotifications } from './useTwitterNotifications';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Tweet, FormattedTweet, Profile } from '../../../../../typings/twitter';
|
import { Tweet, FormattedTweet, Profile, TwitterEvents } from '../../../../../typings/twitter';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform all necessary processing/transforms from the raw database
|
* Perform all necessary processing/transforms from the raw database
|
||||||
@@ -83,15 +83,15 @@ export const useTwitterService = () => {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
useNuiEvent(APP_TWITTER, 'getOrCreateTwitterProfile', setProfile);
|
useNuiEvent(APP_TWITTER, TwitterEvents.GET_OR_CREATE_PROFILE, setProfile);
|
||||||
useNuiEvent(APP_TWITTER, 'getOrCreateTwitterProfileNull', setDefaultProfileNames);
|
useNuiEvent(APP_TWITTER, TwitterEvents.GET_OR_CREATE_PROFILE_NULL, setDefaultProfileNames);
|
||||||
useNuiEvent(APP_TWITTER, 'phone:createProfileResult', handleAddAlert);
|
useNuiEvent(APP_TWITTER, TwitterEvents.CREATE_PROFILE_RESULT, handleAddAlert);
|
||||||
useNuiEvent(APP_TWITTER, 'updateProfileLoading', setUpdateProfileLoading);
|
useNuiEvent(APP_TWITTER, TwitterEvents.UPDATE_PROFILE_LOADING, setUpdateProfileLoading);
|
||||||
useNuiEvent(APP_TWITTER, 'updateProfileResult', handleAddAlert);
|
useNuiEvent(APP_TWITTER, TwitterEvents.UPDATE_PROFILE_RESULT, handleAddAlert);
|
||||||
useNuiEvent(APP_TWITTER, 'fetchTweets', _setTweets);
|
useNuiEvent(APP_TWITTER, TwitterEvents.FETCH_TWEETS, _setTweets);
|
||||||
useNuiEvent(APP_TWITTER, 'fetchTweetsFiltered', _setFilteredTweets);
|
useNuiEvent(APP_TWITTER, TwitterEvents.FETCH_TWEETS_FILTERED, _setFilteredTweets);
|
||||||
useNuiEvent(APP_TWITTER, 'createTweetLoading', setCreateLoading);
|
useNuiEvent(APP_TWITTER, TwitterEvents.CREATE_TWEET_LOADING, setCreateLoading);
|
||||||
useNuiEvent(APP_TWITTER, 'createTweetResult', handleAddAlert);
|
useNuiEvent(APP_TWITTER, TwitterEvents.CREATE_TWEET_RESULT, handleAddAlert);
|
||||||
useNuiEvent(APP_TWITTER, 'createTweetBroadcast', handleTweetBroadcast);
|
useNuiEvent(APP_TWITTER, TwitterEvents.CREATE_TWEET_BROADCAST, handleTweetBroadcast);
|
||||||
useNuiEvent(APP_TWITTER, 'phone:retweetExists', handleAddAlert);
|
useNuiEvent(APP_TWITTER, TwitterEvents.RETWEET_EXISTS, handleAddAlert);
|
||||||
};
|
};
|
||||||
@@ -27,6 +27,10 @@
|
|||||||
"enableImages": true,
|
"enableImages": true,
|
||||||
"maxImages": 3
|
"maxImages": 3
|
||||||
},
|
},
|
||||||
|
"match": {
|
||||||
|
"generateProfileNameFromUsers": true,
|
||||||
|
"allowEdtiableProfileName": true
|
||||||
|
},
|
||||||
"bank": {
|
"bank": {
|
||||||
"showNotifications": true
|
"showNotifications": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -144,6 +144,7 @@
|
|||||||
"label": "Project Error",
|
"label": "Project Error",
|
||||||
"value": "projecterror.jpg"
|
"value": "projecterror.jpg"
|
||||||
},
|
},
|
||||||
|
"customWallpaper": "",
|
||||||
"frame": {
|
"frame": {
|
||||||
"label": "Default",
|
"label": "Default",
|
||||||
"value": "default.png"
|
"value": "default.png"
|
||||||
@@ -190,6 +191,10 @@
|
|||||||
{
|
{
|
||||||
"label": "Default Light",
|
"label": "Default Light",
|
||||||
"value": "default-light"
|
"value": "default-light"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Kiddo Dark",
|
||||||
|
"value": "kiddo-dark"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"debug": {
|
"debug": {
|
||||||
|
|||||||
@@ -34,5 +34,20 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"divider": "rgba(255, 255, 255, 0.12)"
|
"divider": "rgba(255, 255, 255, 0.12)"
|
||||||
|
},
|
||||||
|
"kiddo-dark": {
|
||||||
|
"palette": {
|
||||||
|
"type": "dark",
|
||||||
|
"primary": {
|
||||||
|
"main": "#EBFEF3"
|
||||||
|
},
|
||||||
|
"secondary": {
|
||||||
|
"main": "#5E0035"
|
||||||
|
},
|
||||||
|
"background": {
|
||||||
|
"default": "#033A18",
|
||||||
|
"paper": "#011308"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -56,7 +56,11 @@
|
|||||||
"APPS_DIALER_ACCEPT_CALL": "Accept",
|
"APPS_DIALER_ACCEPT_CALL": "Accept",
|
||||||
"APPS_DIALER_REJECT_CALL": "Reject",
|
"APPS_DIALER_REJECT_CALL": "Reject",
|
||||||
"APPS_DIALER_END_CALL": "End",
|
"APPS_DIALER_END_CALL": "End",
|
||||||
|
"APPS_DIALER_INPUT_PLACEHOLDER": "Enter a number",
|
||||||
"APPS_DIALER_NO_HISTORY": "You have no call history",
|
"APPS_DIALER_NO_HISTORY": "You have no call history",
|
||||||
|
"APPS_DIALER_NAVBAR_HISTORY": "History",
|
||||||
|
"APPS_DIALER_NAVBAR_DIAL": "Dial",
|
||||||
|
"APPS_DIALER_NAVBAR_CONTACTS": "Contacts",
|
||||||
|
|
||||||
"APPS_TWITTER_TWEET": "Tweet",
|
"APPS_TWITTER_TWEET": "Tweet",
|
||||||
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "What's happening?",
|
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "What's happening?",
|
||||||
@@ -94,6 +98,36 @@
|
|||||||
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} retweeted someone!",
|
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} retweeted someone!",
|
||||||
"APPS_TWITTER_UNREAD_MESSAGES": "You have {{ count }} new tweets in your timeline!",
|
"APPS_TWITTER_UNREAD_MESSAGES": "You have {{ count }} new tweets in your timeline!",
|
||||||
|
|
||||||
|
"APPS_MATCH": "Matchmaker",
|
||||||
|
"APPS_MATCH_LIKED": "LIKE",
|
||||||
|
"APPS_MATCH_NOPE": "NOPE",
|
||||||
|
"APPS_MATCH_LIKE": "Like",
|
||||||
|
"APPS_MATCH_DISLIKE": "Dislike",
|
||||||
|
"APPS_MATCH_NO_PROFILES": "No Recent Profiles Found",
|
||||||
|
"APPS_MATCH_NO_MATCHES": "No matches Found",
|
||||||
|
"APPS_MATCH_PROFILES_ERROR": "Error loading profiles",
|
||||||
|
"APPS_MATCH_MATCHES_ERROR": "Error loading matches",
|
||||||
|
"APPS_MATCH_PROFILE_CONFIGURATION": "App is incorrectly configured - cannot create profile. Please contact an administrator.",
|
||||||
|
"APPS_MATCH_MY_PROFILE_ERROR": "Error loading profile",
|
||||||
|
"APPS_MATCH_PROFILE_LAST_ACTIVE": "Last Active: {{ lastActive }}",
|
||||||
|
"APPS_MATCH_PROFILE_MATCHED_AT": "Matched: {{ matchedAt }}",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_PREVIEW": "Show Preview",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_IMAGE": "Image URL",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_NAME": "Profile name",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_BIO": "Bio",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_LOCATION": "Location",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_JOB": "Job",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_TAGS": "Tags",
|
||||||
|
"APPS_MATCH_GET_MY_PROFILE_FAILED": "Failed to retrieve player's profile",
|
||||||
|
"APPS_MATCH_GET_PROFILES_FAILED": "Failed to retrieve profiles",
|
||||||
|
"APPS_MATCH_GET_MATCHES_FAILED": "Failed to retrieve matches",
|
||||||
|
"APPS_MATCH_UPDATE_PROFILE_SUCCEEDED": "Successfully updated profile",
|
||||||
|
"APPS_MATCH_UPDATE_PROFILE_FAILED": "Failed to update profile",
|
||||||
|
"APPS_MATCH_CREATE_PROFILE_FAILED": "Failed to create profile",
|
||||||
|
"APPS_MATCH_SAVE_LIKES_FAILED": "Failed to save likes",
|
||||||
|
"APPS_MATCH_SAVE_LIKES_SUCCEDED": "Successfully saved likes",
|
||||||
|
"APPS_MATCH_NEW_LIKE_FOUND": "New match found!",
|
||||||
|
|
||||||
"APPS_BANK_TRANSFER": "Transfer",
|
"APPS_BANK_TRANSFER": "Transfer",
|
||||||
"APPS_BANK_HOME_TITLE": "Welcome",
|
"APPS_BANK_HOME_TITLE": "Welcome",
|
||||||
"APPS_BANK_ACCOUNT_LINK": "Account",
|
"APPS_BANK_ACCOUNT_LINK": "Account",
|
||||||
@@ -115,6 +149,9 @@
|
|||||||
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "This message group already exists",
|
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "This message group already exists",
|
||||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED": "Failed to create message group",
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED": "Failed to create message group",
|
||||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "You cannot add yourself!",
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "You cannot add yourself!",
|
||||||
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_ALL_NUMBERS_FAILED": "None of the phone numbers could be found!",
|
||||||
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_ONE_NUMBER_FAILED": "{{ number }} is not a registered number",
|
||||||
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_SOME_NUMBERS_FAILED": "({{ numbers }}) are not registered numbers.",
|
||||||
"APPS_MESSAGES_INPUT_NAME_OR_NUMBER": "Search contacts or type number and press enter",
|
"APPS_MESSAGES_INPUT_NAME_OR_NUMBER": "Search contacts or type number and press enter",
|
||||||
"APPS_MESSAGES_UNREAD_MESSAGES": "You have {{ count }} unread messages",
|
"APPS_MESSAGES_UNREAD_MESSAGES": "You have {{ count }} unread messages",
|
||||||
"APPS_MESSAGES_MEMBERS_TITLE": "Members",
|
"APPS_MESSAGES_MEMBERS_TITLE": "Members",
|
||||||
@@ -147,6 +184,7 @@
|
|||||||
|
|
||||||
"APPS_SETTINGS_PHONE_NUMBER": "Phone Number",
|
"APPS_SETTINGS_PHONE_NUMBER": "Phone Number",
|
||||||
"APPS_SETTINGS_OPTION_WALLPAPER": "Wallpaper",
|
"APPS_SETTINGS_OPTION_WALLPAPER": "Wallpaper",
|
||||||
|
"APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER": "Custom Wallpaper",
|
||||||
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
||||||
"APPS_SETTINGS_OPTION_THEME": "Theme",
|
"APPS_SETTINGS_OPTION_THEME": "Theme",
|
||||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
||||||
@@ -157,18 +195,24 @@
|
|||||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notification Volume",
|
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notification Volume",
|
||||||
"APPS_SETTING_STREAMER_MODE_DESC": "Hide images before they are shown",
|
"APPS_SETTING_STREAMER_MODE_DESC": "Hide images before they are shown",
|
||||||
|
"APPS_SETTINGS_SET_CUSTOM_WALLPAPER": "Set new wallpaper",
|
||||||
|
|
||||||
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Successfully created a new listing",
|
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Successfully created a new listing",
|
||||||
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Failed to create a new listing",
|
"APPS_MARKETPLACE_CREATE_LISTING_FAILED": "Failed to create a new listing",
|
||||||
"APPS_MARKETPLACE_DELETE_LISTING_SUCCESS": "Successfully delete listing",
|
"APPS_MARKETPLACE_DELETE_LISTING_SUCCESS": "Successfully delete listing",
|
||||||
"APPS_MARKETPLACE_DELETE_LISTING_FAILED": "Failed to delete listing",
|
"APPS_MARKETPLACE_DELETE_LISTING_FAILED": "Failed to delete listing",
|
||||||
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "This listing has already been reported",
|
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "This listing has already been reported",
|
||||||
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Successfully reported listing",
|
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Successfully reported listing",
|
||||||
|
"APPS_MARKETPLACE_REQUIRED_FIELDS": "All required fields must be filled!",
|
||||||
|
"APPS_MARKETPLACE_FORM_TITLE": "Title",
|
||||||
|
"APPS_MARKETPLACE_FORM_IMAGE": "Image or URL",
|
||||||
|
"APPS_MARKETPLACE_FORM_DESCRIPTION": "Description",
|
||||||
|
|
||||||
"GENERIC_CLICK_TO_REVEAL": "Click to reveal",
|
"GENERIC_CLICK_TO_REVEAL": "Click to reveal",
|
||||||
"GENERIC_WAIT": "Please wait...",
|
"GENERIC_WAIT": "Please wait...",
|
||||||
"GENERIC_SAVE": "Save",
|
"GENERIC_SAVE": "Save",
|
||||||
"GENERIC_UPDATE": "Update",
|
"GENERIC_UPDATE": "Update",
|
||||||
|
"GENERIC_REQUIRED": "Required",
|
||||||
"GENERIC_DELETE": "Delete",
|
"GENERIC_DELETE": "Delete",
|
||||||
"GENERIC_REPORT": "Report",
|
"GENERIC_REPORT": "Report",
|
||||||
"GENERIC_CALL": "Call",
|
"GENERIC_CALL": "Call",
|
||||||
|
|||||||
@@ -2,6 +2,37 @@
|
|||||||
"translation": {
|
"translation": {
|
||||||
"DATE_FORMAT": "DD/MM/AAAA",
|
"DATE_FORMAT": "DD/MM/AAAA",
|
||||||
"DATE_TIME_FORMAT": "DD/MM/AAAA hh:mm A",
|
"DATE_TIME_FORMAT": "DD/MM/AAAA hh:mm A",
|
||||||
|
"SETTINGS": {
|
||||||
|
"CATEGORY": {
|
||||||
|
"APPEARANCE": "Apparence",
|
||||||
|
"PHONE": "Téléphone",
|
||||||
|
"ACTIONS": "Actions"
|
||||||
|
},
|
||||||
|
"OPTIONS": {
|
||||||
|
"LANGUAGE": "Langage",
|
||||||
|
"RESET_SETTINGS": "Réinitialiser",
|
||||||
|
"RESET_SETTINGS_DESC": "Cette action effacera toutes les données stockées"
|
||||||
|
},
|
||||||
|
"MESSAGES": {
|
||||||
|
"INVALID_SETTINGS": "Paramètres invalides stockés! Veuillez réinitialiser les paramètres.",
|
||||||
|
"SETTINGS_RESET": "Les paramètres ont été réinitialisés!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RELATIVE_TIME": {
|
||||||
|
"future": "dans %s",
|
||||||
|
"past": "%s plus tôt",
|
||||||
|
"s": "quelques secondes",
|
||||||
|
"m": "une minute",
|
||||||
|
"mm": "%d minutes",
|
||||||
|
"h": "une heure",
|
||||||
|
"hh": "%d heures",
|
||||||
|
"d": "un jour",
|
||||||
|
"dd": "%d jours",
|
||||||
|
"M": "un mois",
|
||||||
|
"MM": "%d mois",
|
||||||
|
"y": "un an",
|
||||||
|
"yy": "%d ans"
|
||||||
|
},
|
||||||
|
|
||||||
"COMING_SOON": "En cours...",
|
"COMING_SOON": "En cours...",
|
||||||
"INITIALIZING": "Initialisation",
|
"INITIALIZING": "Initialisation",
|
||||||
@@ -25,6 +56,7 @@
|
|||||||
"APPS_DIALER_ACCEPT_CALL": "Accepter",
|
"APPS_DIALER_ACCEPT_CALL": "Accepter",
|
||||||
"APPS_DIALER_REJECT_CALL": "Rejeter",
|
"APPS_DIALER_REJECT_CALL": "Rejeter",
|
||||||
"APPS_DIALER_END_CALL": "Raccrocher",
|
"APPS_DIALER_END_CALL": "Raccrocher",
|
||||||
|
"APPS_DIALER_NO_HISTORY": "Aucun historique d'appel",
|
||||||
|
|
||||||
"APPS_TWITTER_TWEET": "Tweet",
|
"APPS_TWITTER_TWEET": "Tweet",
|
||||||
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "Quoi de neuf ?",
|
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "Quoi de neuf ?",
|
||||||
@@ -44,10 +76,13 @@
|
|||||||
"APPS_TWITTER_CREATE_SUCCESS": "Tweet envoyé avec succès",
|
"APPS_TWITTER_CREATE_SUCCESS": "Tweet envoyé avec succès",
|
||||||
"APPS_TWITTER_CREATE_FAILED": "Erreur lors de l'envoi de votre tweet",
|
"APPS_TWITTER_CREATE_FAILED": "Erreur lors de l'envoi de votre tweet",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_AVATAR": "URL Photo de profil",
|
"APPS_TWITTER_EDIT_PROFILE_AVATAR": "URL Photo de profil",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_NAME": "Nom de profil",
|
"APPS_TWITTER_EDIT_PROFILE_NAME": "Pseudonyme",
|
||||||
|
"APPS_TWITTER_EDIT_DEFAULT_PROFILE_NAME": "Choisir un pseudonyme",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_BIO": "Bio",
|
"APPS_TWITTER_EDIT_PROFILE_BIO": "Bio",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_LOCATION": "Localisation",
|
"APPS_TWITTER_EDIT_PROFILE_LOCATION": "Localisation",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_JOB": "Job",
|
"APPS_TWITTER_EDIT_PROFILE_JOB": "Job",
|
||||||
|
"APPS_TWITTER_CREATE_PROFILE_SUCCESS": "Profil créé avec succès",
|
||||||
|
"APPS_TWITTER_CREATE_PROFILE_FAILURE": "Erreur lors de la création de votre profil",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_SUCCESS": "Votre profil a été mis à jour avec succès !",
|
"APPS_TWITTER_EDIT_PROFILE_SUCCESS": "Votre profil a été mis à jour avec succès !",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_FAILURE": "Erreur lors de la mise à jour de votre profil",
|
"APPS_TWITTER_EDIT_PROFILE_FAILURE": "Erreur lors de la mise à jour de votre profil",
|
||||||
"APPS_TWITTER_RETWEET_EXISTS": "Vous avez déjà retweeté ce tweet!",
|
"APPS_TWITTER_RETWEET_EXISTS": "Vous avez déjà retweeté ce tweet!",
|
||||||
@@ -58,6 +93,36 @@
|
|||||||
"APPS_TWITTER_NEW_BROADCAST": "Nouveau tweet de @{{ profile_name }}!",
|
"APPS_TWITTER_NEW_BROADCAST": "Nouveau tweet de @{{ profile_name }}!",
|
||||||
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} a rewteeté quelqu'un!",
|
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} a rewteeté quelqu'un!",
|
||||||
"APPS_TWITTER_UNREAD_MESSAGES": "Vous avez {{ count }} nouveaux tweets dans votre fil d'actualité!",
|
"APPS_TWITTER_UNREAD_MESSAGES": "Vous avez {{ count }} nouveaux tweets dans votre fil d'actualité!",
|
||||||
|
|
||||||
|
"APPS_MATCH": "Matchmaker",
|
||||||
|
"APPS_MATCH_LIKED": "LIKE",
|
||||||
|
"APPS_MATCH_NOPE": "NOPE",
|
||||||
|
"APPS_MATCH_LIKE": "Like",
|
||||||
|
"APPS_MATCH_DISLIKE": "Dislike",
|
||||||
|
"APPS_MATCH_NO_PROFILES": "Aucun profil récent trouvé",
|
||||||
|
"APPS_MATCH_NO_MATCHES": "Aucun match trouvé",
|
||||||
|
"APPS_MATCH_PROFILES_ERROR": "Erreur de chargement des profils",
|
||||||
|
"APPS_MATCH_MATCHES_ERROR": "Erreur de chargement des matchs",
|
||||||
|
"APPS_MATCH_PROFILE_CONFIGURATION": "L'application n'est pas correctement configurée - Veuillez contacter un administrateur.",
|
||||||
|
"APPS_MATCH_MY_PROFILE_ERROR": "Erreur de chargement du profil",
|
||||||
|
"APPS_MATCH_PROFILE_LAST_ACTIVE": "Dernière activité: {{ lastActive }}",
|
||||||
|
"APPS_MATCH_PROFILE_MATCHED_AT": "Matché: {{ matchedAt }}",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_PREVIEW": "Voir l'aperçu",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_IMAGE": "URL Photo de profil",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_NAME": "Pseudonyme",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_BIO": "Bio",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_LOCATION": "Localisation",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_JOB": "Job",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_TAGS": "Tags",
|
||||||
|
"APPS_MATCH_GET_MY_PROFILE_FAILED": "Impossible de recupérer le profil du joueur",
|
||||||
|
"APPS_MATCH_GET_PROFILES_FAILED": "Impossible de récupérer les profils",
|
||||||
|
"APPS_MATCH_GET_MATCHES_FAILED": "Impossible de récupérer les matches",
|
||||||
|
"APPS_MATCH_UPDATE_PROFILE_SUCCEEDED": "Profil mis à jour avec succès",
|
||||||
|
"APPS_MATCH_UPDATE_PROFILE_FAILED": "Erreur de mise à jour du profil",
|
||||||
|
"APPS_MATCH_CREATE_PROFILE_FAILED": "Échec de création du profil",
|
||||||
|
"APPS_MATCH_SAVE_LIKES_FAILED": "Impossible de sauvegarder les likes",
|
||||||
|
"APPS_MATCH_SAVE_LIKES_SUCCEDED": "Likes sauvegardés avec succès",
|
||||||
|
"APPS_MATCH_NEW_LIKE_FOUND": "Tu as un nouveau match!",
|
||||||
|
|
||||||
"APPS_BANK_TRANSFER": "Transfert",
|
"APPS_BANK_TRANSFER": "Transfert",
|
||||||
"APPS_BANK_HOME_TITLE": "Bienvenue",
|
"APPS_BANK_HOME_TITLE": "Bienvenue",
|
||||||
@@ -115,11 +180,13 @@
|
|||||||
"APPS_SETTINGS_OPTION_FRAME": "Coque",
|
"APPS_SETTINGS_OPTION_FRAME": "Coque",
|
||||||
"APPS_SETTINGS_OPTION_THEME": "Thème",
|
"APPS_SETTINGS_OPTION_THEME": "Thème",
|
||||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
||||||
|
"APPS_SETTINGS_OPTION_STREAMER_MODE": "Mode streamer",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONE": "Sonnerie",
|
"APPS_SETTINGS_OPTION_RINGTONE": "Sonnerie",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Volume de la sonnerie",
|
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Volume de la sonnerie",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtre de notification",
|
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtre de notification",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Volume des notifications",
|
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Volume des notifications",
|
||||||
|
"APPS_SETTING_STREAMER_MODE_DESC": "Masquer les images avant de les montrer",
|
||||||
|
|
||||||
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Nouvelle liste créée avec succès!",
|
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Nouvelle liste créée avec succès!",
|
||||||
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Échec lors de la création d'une nouvelle liste",
|
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Échec lors de la création d'une nouvelle liste",
|
||||||
@@ -128,6 +195,7 @@
|
|||||||
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "Cette liste a déjà été signalée",
|
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "Cette liste a déjà été signalée",
|
||||||
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Liste signalée avec succès",
|
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Liste signalée avec succès",
|
||||||
|
|
||||||
|
"GENERIC_CLICK_TO_REVEAL": "Cliquer pour afficher",
|
||||||
"GENERIC_WAIT": "Veuillez patienter...",
|
"GENERIC_WAIT": "Veuillez patienter...",
|
||||||
"GENERIC_SAVE": "Sauvegarder",
|
"GENERIC_SAVE": "Sauvegarder",
|
||||||
"GENERIC_UPDATE": "Mettre à jour",
|
"GENERIC_UPDATE": "Mettre à jour",
|
||||||
|
|||||||
+83
-15
@@ -2,6 +2,37 @@
|
|||||||
"translation": {
|
"translation": {
|
||||||
"DATE_FORMAT": "DD/MM/YYYY",
|
"DATE_FORMAT": "DD/MM/YYYY",
|
||||||
"DATE_TIME_FORMAT": "DD/MM/YYYY HH:MM",
|
"DATE_TIME_FORMAT": "DD/MM/YYYY HH:MM",
|
||||||
|
"SETTINGS": {
|
||||||
|
"CATEGORY": {
|
||||||
|
"APPEARANCE": "Utseende",
|
||||||
|
"PHONE": "Telefon",
|
||||||
|
"ACTIONS": "Handlinger"
|
||||||
|
},
|
||||||
|
"OPTIONS": {
|
||||||
|
"LANGUAGE": "Språk",
|
||||||
|
"RESET_SETTINGS": "Reset Settings",
|
||||||
|
"RESET_SETTINGS_DESC": "Dette vil slette all lagret data"
|
||||||
|
},
|
||||||
|
"MESSAGES": {
|
||||||
|
"INVALID_SETTINGS": "Invalid stored settings! Please reset in the Settings App.",
|
||||||
|
"SETTINGS_RESET": "Instillinger har blitt tilbakestilt"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RELATIVE_TIME": {
|
||||||
|
"future": "om %s",
|
||||||
|
"past": "%s siden",
|
||||||
|
"s": "om få sekunder",
|
||||||
|
"m": "ett minutt",
|
||||||
|
"mm": "%d minutter",
|
||||||
|
"h": "en time",
|
||||||
|
"hh": "%d timer",
|
||||||
|
"d": "en dag",
|
||||||
|
"dd": "%d dager",
|
||||||
|
"M": "en måned",
|
||||||
|
"MM": "%d måneder",
|
||||||
|
"y": "ett år",
|
||||||
|
"yy": "%d år"
|
||||||
|
},
|
||||||
|
|
||||||
"COMING_SOON": "Kommer snart...",
|
"COMING_SOON": "Kommer snart...",
|
||||||
"INITIALIZING": "Starter",
|
"INITIALIZING": "Starter",
|
||||||
@@ -25,9 +56,10 @@
|
|||||||
"APPS_DIALER_ACCEPT_CALL": "Svar",
|
"APPS_DIALER_ACCEPT_CALL": "Svar",
|
||||||
"APPS_DIALER_REJECT_CALL": "Avvis",
|
"APPS_DIALER_REJECT_CALL": "Avvis",
|
||||||
"APPS_DIALER_END_CALL": "Legg på",
|
"APPS_DIALER_END_CALL": "Legg på",
|
||||||
|
"APPS_DIALER_NO_HISTORY": "Du har ingen historikk",
|
||||||
|
|
||||||
"APPS_TWITTER_TWEET": "Tweet",
|
"APPS_TWITTER_TWEET": "Tweet",
|
||||||
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "Hva skjer'a",
|
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "Hva skjer'a brur?",
|
||||||
"APPS_TWITTER_IMAGE_PLACEHOLDER": "En link med bilde ditt",
|
"APPS_TWITTER_IMAGE_PLACEHOLDER": "En link med bilde ditt",
|
||||||
"APPS_TWITTER_SUBMIT_IMAGE": "Legg til media",
|
"APPS_TWITTER_SUBMIT_IMAGE": "Legg til media",
|
||||||
"APPS_TWITTER_CLOSE_IMAGE": "Lukk",
|
"APPS_TWITTER_CLOSE_IMAGE": "Lukk",
|
||||||
@@ -36,7 +68,7 @@
|
|||||||
"APPS_TWITTER_REPORT": "Rapporter",
|
"APPS_TWITTER_REPORT": "Rapporter",
|
||||||
"APPS_TWITTER_REPORTED": "Rapportert",
|
"APPS_TWITTER_REPORTED": "Rapportert",
|
||||||
"APPS_TWITTER_RETWEETED": "Retweeted",
|
"APPS_TWITTER_RETWEETED": "Retweeted",
|
||||||
"APPS_TWITTER_JUST_NOW": "Akkuratt nå",
|
"APPS_TWITTER_JUST_NOW": "Akkurat nå",
|
||||||
"APPS_TWITTER_SEARCH_TWEETS": "Søk etter tweets",
|
"APPS_TWITTER_SEARCH_TWEETS": "Søk etter tweets",
|
||||||
"APPS_TWITTER_SEARCH_TWEETS_PLACEHOLDER": "Søk etter profil eller melding",
|
"APPS_TWITTER_SEARCH_TWEETS_PLACEHOLDER": "Søk etter profil eller melding",
|
||||||
"APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT": "Meldingen er over grensen",
|
"APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT": "Meldingen er over grensen",
|
||||||
@@ -45,13 +77,16 @@
|
|||||||
"APPS_TWITTER_CREATE_FAILED": "Mislykket tweet",
|
"APPS_TWITTER_CREATE_FAILED": "Mislykket tweet",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_AVATAR": "Avatar URL",
|
"APPS_TWITTER_EDIT_PROFILE_AVATAR": "Avatar URL",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_NAME": "Brukernavn",
|
"APPS_TWITTER_EDIT_PROFILE_NAME": "Brukernavn",
|
||||||
|
"APPS_TWITTER_EDIT_DEFAULT_PROFILE_NAME": "Velg brukernavn",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_BIO": "Bio",
|
"APPS_TWITTER_EDIT_PROFILE_BIO": "Bio",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_LOCATION": "Lokasjon",
|
"APPS_TWITTER_EDIT_PROFILE_LOCATION": "Lokasjon",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_JOB": "Jobb",
|
"APPS_TWITTER_EDIT_PROFILE_JOB": "Jobb",
|
||||||
|
"APPS_TWITTER_CREATE_PROFILE_SUCCESS": "Profilen din er blitt opprettet",
|
||||||
|
"APPS_TWITTER_CREATE_PROFILE_FAILURE": "Klarte ikke opprette profilen",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_SUCCESS": "Profilen din har blitt oppdatert",
|
"APPS_TWITTER_EDIT_PROFILE_SUCCESS": "Profilen din har blitt oppdatert",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_FAILURE": "Klarte ikke å oppdatere profilen",
|
"APPS_TWITTER_EDIT_PROFILE_FAILURE": "Klarte ikke å oppdatere profilen",
|
||||||
"APPS_TWITTER_RETWEET_EXISTS": "Du har akkuratt retvitret denne tweeten",
|
"APPS_TWITTER_RETWEET_EXISTS": "Du har akkurat retvitret denne tweeten!",
|
||||||
"APPS_TWITTER_TIME_JUST_NOW": "Akkuratt nå",
|
"APPS_TWITTER_TIME_JUST_NOW": "Akkurat nå",
|
||||||
"APPS_TWITTER_TIME_MINUTES": "m",
|
"APPS_TWITTER_TIME_MINUTES": "m",
|
||||||
"APPS_TWITTER_TIME_HOURS": "t",
|
"APPS_TWITTER_TIME_HOURS": "t",
|
||||||
"APPS_TWITTER_TIME_DAYS": "d",
|
"APPS_TWITTER_TIME_DAYS": "d",
|
||||||
@@ -59,11 +94,41 @@
|
|||||||
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} retvitret noen!",
|
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} retvitret noen!",
|
||||||
"APPS_TWITTER_UNREAD_MESSAGES": "Du har {{ count }} nye tweets siden sist",
|
"APPS_TWITTER_UNREAD_MESSAGES": "Du har {{ count }} nye tweets siden sist",
|
||||||
|
|
||||||
|
"APPS_MATCH": "Matchmaker",
|
||||||
|
"APPS_MATCH_LIKED": "LIKE",
|
||||||
|
"APPS_MATCH_NOPE": "NOPE",
|
||||||
|
"APPS_MATCH_LIKE": "LIKE",
|
||||||
|
"APPS_MATCH_DISLIKE": "NOPE",
|
||||||
|
"APPS_MATCH_NO_PROFILES": "Ingen profiler funnet",
|
||||||
|
"APPS_MATCH_NO_MATCHES": "Fant ingen matches",
|
||||||
|
"APPS_MATCH_PROFILES_ERROR": "Klarte ikke laste profiler",
|
||||||
|
"APPS_MATCH_MATCHES_ERROR": "Klarte ikke laste matches",
|
||||||
|
"APPS_MATCH_PROFILE_CONFIGURATION": "Appen er ikke konfigurert riktig - kan ikke lage profil. Kontakt staten!",
|
||||||
|
"APPS_MATCH_MY_PROFILE_ERROR": "Kunne ikke lage profil!",
|
||||||
|
"APPS_MATCH_PROFILE_LAST_ACTIVE": "Sist kåt: {{ lastActive }}",
|
||||||
|
"APPS_MATCH_PROFILE_MATCHED_AT": "Matched: {{ matchedAt }}",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_PREVIEW": "Forhåndsvis",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_IMAGE": "Bilde URL",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_NAME": "Brukernavn",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_BIO": "Beskrivelse",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_LOCATION": "Plassering",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_JOB": "Jobb",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_TAGS": "Emneknagger",
|
||||||
|
"APPS_MATCH_GET_MY_PROFILE_FAILED": "Kunne ikke hente spillers profil",
|
||||||
|
"APPS_MATCH_GET_PROFILES_FAILED": "Kunne ikke laster profiler",
|
||||||
|
"APPS_MATCH_GET_MATCHES_FAILED": "Kunne ikke laste matches",
|
||||||
|
"APPS_MATCH_UPDATE_PROFILE_SUCCEEDED": "Profil opppdatert",
|
||||||
|
"APPS_MATCH_UPDATE_PROFILE_FAILED": "Klarte ikke oppdatere profil",
|
||||||
|
"APPS_MATCH_CREATE_PROFILE_FAILED": "Klarte ikke lage profil",
|
||||||
|
"APPS_MATCH_SAVE_LIKES_FAILED": "Kunne ikke lagre likes",
|
||||||
|
"APPS_MATCH_SAVE_LIKES_SUCCEDED": "Larget likes",
|
||||||
|
"APPS_MATCH_NEW_LIKE_FOUND": "Ny match!",
|
||||||
|
|
||||||
"APPS_BANK_TRANSFER": "Overføring",
|
"APPS_BANK_TRANSFER": "Overføring",
|
||||||
"APPS_BANK_HOME_TITLE": "Velkommen",
|
"APPS_BANK_HOME_TITLE": "Velkommen",
|
||||||
"APPS_BANK_ACCOUNT_LINK": "Konto",
|
"APPS_BANK_ACCOUNT_LINK": "Konto",
|
||||||
"APPS_BANK_TIME_JUST_NOW": "Akkuratt nå",
|
"APPS_BANK_TIME_JUST_NOW": "Akkurat nå",
|
||||||
"APPS_BANK_ACCOUNT_TITLE": "Konto oversikt",
|
"APPS_BANK_ACCOUNT_TITLE": "Kontooversikt",
|
||||||
"APPS_BANK_ACCOUNT_TRANSACTIONS": "Transaksjoner",
|
"APPS_BANK_ACCOUNT_TRANSACTIONS": "Transaksjoner",
|
||||||
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "Se alt",
|
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "Se alt",
|
||||||
"APPS_BANK_ACTIONS_TRANSFER": "Overføring",
|
"APPS_BANK_ACTIONS_TRANSFER": "Overføring",
|
||||||
@@ -73,14 +138,14 @@
|
|||||||
"APPS_MESSAGES_SEARCH_PLACEHOLDER": "Søk etter meldinger...",
|
"APPS_MESSAGES_SEARCH_PLACEHOLDER": "Søk etter meldinger...",
|
||||||
"APPS_MESSAGES_NEW_MESSAGE": "Melding...",
|
"APPS_MESSAGES_NEW_MESSAGE": "Melding...",
|
||||||
"APPS_MESSAGES_NEW_MESSAGE_FAILED:": "Kunne ikke sende melding",
|
"APPS_MESSAGES_NEW_MESSAGE_FAILED:": "Kunne ikke sende melding",
|
||||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP": "Telefonnummre...",
|
"APPS_MESSAGES_NEW_MESSAGE_GROUP": "Telefonnummer...",
|
||||||
"APPS_MESSAGES_GROUP_CHAT_LABEL": "Gruppesamtale navn...",
|
"APPS_MESSAGES_GROUP_CHAT_LABEL": "Navn på gruppe...",
|
||||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT": "Send",
|
"APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT": "Send",
|
||||||
"APPS_MESSAGES_INVALID_PHONE_NUMBER": "Inkorrekt telefonnummer",
|
"APPS_MESSAGES_INVALID_PHONE_NUMBER": "Feil telefonnummer",
|
||||||
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "Denne gruppesamtalen er allerede opprettet",
|
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "Denne gruppesamtalen er allerede opprettet",
|
||||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED": "Kunne ikke opprette gruppesamtale",
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED": "Kunne ikke opprette gruppesamtale",
|
||||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "Du kan ikke legge til deg selv!",
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "Du kan ikke legge til deg selv!",
|
||||||
"APPS_MESSAGES_INPUT_NAME_OR_NUMBER": "Søk etter kontakter eller skriv ett number og trykk enter",
|
"APPS_MESSAGES_INPUT_NAME_OR_NUMBER": "Søk etter kontakter eller skriv ett nummer og trykk enter",
|
||||||
"APPS_MESSAGES_UNREAD_MESSAGES": "Du har {{ count }} uleste meldinger",
|
"APPS_MESSAGES_UNREAD_MESSAGES": "Du har {{ count }} uleste meldinger",
|
||||||
"APPS_MESSAGES_MEMBERS_TITLE": "Medlemmer",
|
"APPS_MESSAGES_MEMBERS_TITLE": "Medlemmer",
|
||||||
"APPS_MESSAGES_ME": "Meg",
|
"APPS_MESSAGES_ME": "Meg",
|
||||||
@@ -108,26 +173,29 @@
|
|||||||
"APPS_NOTES_DELETE_SUCCESS": "Slettet notat!",
|
"APPS_NOTES_DELETE_SUCCESS": "Slettet notat!",
|
||||||
"APPS_NOTES_DELETE_FAILED": "Kunne ikke slette notatet!",
|
"APPS_NOTES_DELETE_FAILED": "Kunne ikke slette notatet!",
|
||||||
|
|
||||||
"APPS_CALCULATOR_COPIED": "Teskten ble kopiert til utklippstavle",
|
"APPS_CALCULATOR_COPIED": "Teskten ble kopiert",
|
||||||
|
|
||||||
"APPS_SETTINGS_PHONE_NUMBER": "Telefonnummer",
|
"APPS_SETTINGS_PHONE_NUMBER": "Telefonnummer",
|
||||||
"APPS_SETTINGS_OPTION_WALLPAPER": "Bakgrunn",
|
"APPS_SETTINGS_OPTION_WALLPAPER": "Bakgrunn",
|
||||||
"APPS_SETTINGS_OPTION_FRAME": "Deksel",
|
"APPS_SETTINGS_OPTION_FRAME": "Deksel",
|
||||||
"APPS_SETTINGS_OPTION_THEME": "Utseende",
|
"APPS_SETTINGS_OPTION_THEME": "Tema",
|
||||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
"APPS_SETTINGS_OPTION_ZOOM": "Forstørrelse",
|
||||||
|
"APPS_SETTINGS_OPTION_STREAMER_MODE": "Strømmemodus",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONE": "Ringetone",
|
"APPS_SETTINGS_OPTION_RINGTONE": "Ringetone",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Ringetone Volum",
|
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Ringetone Volum",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtrer notifikasjoner",
|
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtrer notifikasjoner",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notifikasjon",
|
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notifikasjon",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notifikasjons Volum",
|
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notifikasjons Volum",
|
||||||
|
"APPS_SETTING_STREAMER_MODE_DESC": "Skjul bilder før de vises",
|
||||||
|
|
||||||
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Opprettet ny annonse!",
|
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Opprettet ny annonse!",
|
||||||
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Kunne ikke opprette annonse!",
|
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Kunne ikke opprette annonse!",
|
||||||
"APPS_MARKETPLACE_DELETE_LISTING_SUCCESS": "Slettet annonse!",
|
"APPS_MARKETPLACE_DELETE_LISTING_SUCCESS": "Slettet annonse!",
|
||||||
"APPS_MARKETPLACE_DELETE_LISTING_FAILED": "Kunne ikke opprette annonse!",
|
"APPS_MARKETPLACE_DELETE_LISTING_FAILED": "Kunne ikke opprette annonse!",
|
||||||
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "Annonsen har allerede blitt rapportet",
|
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "Annonsen har allerede blitt rapportet",
|
||||||
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Annosen ble rapportet",
|
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Annonsen er rapportert",
|
||||||
|
|
||||||
|
"GENERIC_CLICK_TO_REVEAL": "Trykk for å se",
|
||||||
"GENERIC_WAIT": "Vennligst vent...",
|
"GENERIC_WAIT": "Vennligst vent...",
|
||||||
"GENERIC_SAVE": "Lagre",
|
"GENERIC_SAVE": "Lagre",
|
||||||
"GENERIC_UPDATE": "Oppdater",
|
"GENERIC_UPDATE": "Oppdater",
|
||||||
@@ -140,6 +208,6 @@
|
|||||||
"GENERIC_TITLE": "Tittel",
|
"GENERIC_TITLE": "Tittel",
|
||||||
"GENERIC_CONTENT": "Innhold",
|
"GENERIC_CONTENT": "Innhold",
|
||||||
"GENERIC_WRITE_TO_CLIPBOARD_TOOLTIP": "Kopier {{ content }}",
|
"GENERIC_WRITE_TO_CLIPBOARD_TOOLTIP": "Kopier {{ content }}",
|
||||||
"GENERIC_WRITE_TO_CLIPBOARD_MESSAGE": "Kopiert {{content}} to clipboard!"
|
"GENERIC_WRITE_TO_CLIPBOARD_MESSAGE": "Kopiert {{content}}!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+125
-43
@@ -1,7 +1,38 @@
|
|||||||
{
|
{
|
||||||
"translation": {
|
"translation": {
|
||||||
"DATE_FORMAT": "MM/DD/YYYY",
|
"DATE_FORMAT": "DD/MM/YYYY",
|
||||||
"DATE_TIME_FORMAT": "MM/DD/YYYY hh:mm A",
|
"DATE_TIME_FORMAT": "DD/MM/YYYY hh:mm A",
|
||||||
|
"SETTINGS": {
|
||||||
|
"CATEGORY": {
|
||||||
|
"APPEARANCE": "Aparência",
|
||||||
|
"PHONE": "Telefone",
|
||||||
|
"ACTIONS": "Ações"
|
||||||
|
},
|
||||||
|
"OPTIONS": {
|
||||||
|
"LANGUAGE": "Idioma",
|
||||||
|
"RESET_SETTINGS": "Redefinir as configurações",
|
||||||
|
"RESET_SETTINGS_DESC": "Isso limpará seus dados armazenados localmente"
|
||||||
|
},
|
||||||
|
"MESSAGES": {
|
||||||
|
"INVALID_SETTINGS": "Configurações armazenadas inválidas! Redefina no aplicativo Configurações.",
|
||||||
|
"SETTINGS_RESET": "As configurações foram redefinidas!"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"RELATIVE_TIME": {
|
||||||
|
"future": "em %s",
|
||||||
|
"past": "%s atrás",
|
||||||
|
"s": "alguns segundos",
|
||||||
|
"m": "um minuto",
|
||||||
|
"mm": "%d minutos",
|
||||||
|
"h": "uma hora",
|
||||||
|
"hh": "%d horas",
|
||||||
|
"d": "um dia",
|
||||||
|
"dd": "%d dias",
|
||||||
|
"M": "um mês",
|
||||||
|
"MM": "%d meses",
|
||||||
|
"y": "um ano",
|
||||||
|
"yy": "%d anos"
|
||||||
|
},
|
||||||
|
|
||||||
"COMING_SOON": "Em breve...",
|
"COMING_SOON": "Em breve...",
|
||||||
"INITIALIZING": "Inicializando",
|
"INITIALIZING": "Inicializando",
|
||||||
@@ -10,32 +41,38 @@
|
|||||||
"APPS_CONTACTS": "Contatos",
|
"APPS_CONTACTS": "Contatos",
|
||||||
"APPS_MESSAGES": "Mensagens",
|
"APPS_MESSAGES": "Mensagens",
|
||||||
"APPS_CALCULATOR": "Calculadora",
|
"APPS_CALCULATOR": "Calculadora",
|
||||||
"APPS_SETTINGS": "Configurações",
|
"APPS_SETTINGS": "Configurações",
|
||||||
"APPS_BANK": "Banco WhoDis",
|
"APPS_BANK": "Banco WhoDis",
|
||||||
"APPS_NOTES": "Notas",
|
"APPS_NOTES": "Notas",
|
||||||
"APPS_EXAMPLE": "Aplicativo de exemplo",
|
"APPS_EXAMPLE": "Aplicativo de exemplo",
|
||||||
"APPS_TWITTER": "Twitter",
|
"APPS_TWITTER": "Twitter",
|
||||||
"APPS_SELLOUT": "Market",
|
"APPS_SELLOUT": "Mercado",
|
||||||
"APPS_CAMERA": "Camera",
|
"APPS_CAMERA": "Camera",
|
||||||
|
|
||||||
"APPS_DIALER_INCOMING_CALL_TITLE": "Ligaçao",
|
"APPS_DIALER_INCOMING_CALL_TITLE": "Ligação",
|
||||||
"APPS_DIALER_CURRENT_CALL_TITLE": "Chamada atual",
|
"APPS_DIALER_CURRENT_CALL_TITLE": "Chamada atual",
|
||||||
"APPS_DIALER_CURRENT_CALL_WITH": "Em ligaçao com {{ transmitter }}",
|
"APPS_DIALER_CURRENT_CALL_WITH": "Em ligação com {{ transmitter }}",
|
||||||
"APPS_DIALER_TRANSMITTER_IS_CALLING": "{{ transmitter }} Esta te ligando!",
|
"APPS_DIALER_TRANSMITTER_IS_CALLING": "{{ transmitter }} Esta te ligando!",
|
||||||
"APPS_DIALER_ACCEPT_CALL": "Atender",
|
"APPS_DIALER_ACCEPT_CALL": "Atender",
|
||||||
"APPS_DIALER_REJECT_CALL": "Desligar",
|
"APPS_DIALER_REJECT_CALL": "Rejeitar",
|
||||||
"APPS_DIALER_END_CALL": "Fim",
|
"APPS_DIALER_END_CALL": "Fim",
|
||||||
|
"APPS_DIALER_INPUT_PLACEHOLDER": "Insira um númeror",
|
||||||
|
"APPS_DIALER_NO_HISTORY": "Você não tem histórico de chamadas",
|
||||||
|
"APPS_DIALER_NAVBAR_HISTORY": "Histórico",
|
||||||
|
"APPS_DIALER_NAVBAR_DIAL": "Discar",
|
||||||
|
"APPS_DIALER_NAVBAR_CONTACTS": "Contatos",
|
||||||
|
|
||||||
"APPS_TWITTER_TWEET": "Tweet",
|
"APPS_TWITTER_TWEET": "Tweet",
|
||||||
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "O que está acontecendo?",
|
"APPS_TWITTER_TWEET_MESSAGE_PLACEHOLDER": "O que está acontecendo?",
|
||||||
"APPS_TWITTER_IMAGE_PLACEHOLDER": "Link para sua foto de perfil",
|
"APPS_TWITTER_IMAGE_PLACEHOLDER": "Link da sua foto de perfil",
|
||||||
"APPS_TWITTER_SUBMIT_IMAGE": "Adcionar foto",
|
"APPS_TWITTER_SUBMIT_IMAGE": "Adcionar foto",
|
||||||
"APPS_TWITTER_CLOSE_IMAGE": "Fechar",
|
"APPS_TWITTER_CLOSE_IMAGE": "Fechar",
|
||||||
"APPS_TWITTER_CLOSE": "Fechar",
|
"APPS_TWITTER_CLOSE": "Fechar",
|
||||||
"APPS_TWITTER_DELETE": "Deletar",
|
"APPS_TWITTER_DELETE": "Deletar",
|
||||||
"APPS_TWITTER_REPORT": "Reportar",
|
"APPS_TWITTER_REPORT": "Reportar",
|
||||||
"APPS_TWITTER_REPORTED": " Reportado",
|
"APPS_TWITTER_REPORTED": " Reportado",
|
||||||
"APPS_TWITTER_JUST_NOW": "Agora",
|
"APPS_TWITTER_RETWEETED": "Retweetado",
|
||||||
|
"APPS_TWITTER_JUST_NOW": "Agora Mesmo",
|
||||||
"APPS_TWITTER_SEARCH_TWEETS": "Procurar por tweets",
|
"APPS_TWITTER_SEARCH_TWEETS": "Procurar por tweets",
|
||||||
"APPS_TWITTER_SEARCH_TWEETS_PLACEHOLDER": "Procurar por nome de perfil ou mensagem",
|
"APPS_TWITTER_SEARCH_TWEETS_PLACEHOLDER": "Procurar por nome de perfil ou mensagem",
|
||||||
"APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT": "Mensagem está ultrapassando o limite de caracteres",
|
"APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT": "Mensagem está ultrapassando o limite de caracteres",
|
||||||
@@ -44,34 +81,52 @@
|
|||||||
"APPS_TWITTER_CREATE_FAILED": "Seu tweet não foi enviado",
|
"APPS_TWITTER_CREATE_FAILED": "Seu tweet não foi enviado",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_AVATAR": "URL do Avatar",
|
"APPS_TWITTER_EDIT_PROFILE_AVATAR": "URL do Avatar",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_NAME": "Nome de perfil",
|
"APPS_TWITTER_EDIT_PROFILE_NAME": "Nome de perfil",
|
||||||
|
"APPS_TWITTER_EDIT_DEFAULT_PROFILE_NAME": "Escolher o nome do perfil",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_BIO": "Bio",
|
"APPS_TWITTER_EDIT_PROFILE_BIO": "Bio",
|
||||||
"APPS_MARKETPLACE_DELETE_LISTING_FAILED": "Falha em deletar lista",
|
|
||||||
"APPS_MARKETPLACE_DELETE_LISTING_SUCCESS": "Lista deletada com sucesso",
|
|
||||||
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "Esta lista ja foi reportada",
|
|
||||||
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Lista reportada com sucesso",
|
|
||||||
"APPS_TWITTER_EDIT_PROFILE_LOCATION": "Localização",
|
"APPS_TWITTER_EDIT_PROFILE_LOCATION": "Localização",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_JOB": "Emprego",
|
"APPS_TWITTER_EDIT_PROFILE_JOB": "Emprego",
|
||||||
|
"APPS_TWITTER_CREATE_PROFILE_SUCCESS": "Seu perfil foi criado com sucesso",
|
||||||
|
"APPS_TWITTER_CREATE_PROFILE_FAILURE": "Falha ao criar o seu perfil",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_SUCCESS": "Seu perfil foi atualizado com sucesso",
|
"APPS_TWITTER_EDIT_PROFILE_SUCCESS": "Seu perfil foi atualizado com sucesso",
|
||||||
"APPS_TWITTER_EDIT_PROFILE_FAILURE": "Não foi possivel atualizar seu perfil",
|
"APPS_TWITTER_EDIT_PROFILE_FAILURE": "Falha ao atualizar o seu perfil",
|
||||||
"APPS_TWITTER_TIME_JUST_NOW": "agora",
|
"APPS_TWITTER_RETWEET_EXISTS": "Você já retuitou este tweet!",
|
||||||
|
"APPS_TWITTER_TIME_JUST_NOW": "Agora mesmo",
|
||||||
"APPS_TWITTER_TIME_MINUTES": "m",
|
"APPS_TWITTER_TIME_MINUTES": "m",
|
||||||
"APPS_TWITTER_TIME_HOURS": "h",
|
"APPS_TWITTER_TIME_HOURS": "h",
|
||||||
"APPS_TWITTER_TIME_DAYS": "d",
|
"APPS_TWITTER_TIME_DAYS": "d",
|
||||||
"APPS_MESSAGES_ME": "Eu",
|
|
||||||
"APPS_MESSAGES_MEMBERS_TITLE": "Membros",
|
|
||||||
"APPS_TWITTER_NEW_BROADCAST": "Novo tweet de @{{ profile_name }}!",
|
"APPS_TWITTER_NEW_BROADCAST": "Novo tweet de @{{ profile_name }}!",
|
||||||
"APPS_TWITTER_UNREAD_MESSAGES": "Voce tem {{ count }} novos tweets na sua timeline!",
|
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} retuitou alguém!",
|
||||||
"APPS_MESSAGES_UNREAD_MESSAGES": "Voce tem {{ count }} Mensagens nao lidas",
|
"APPS_TWITTER_UNREAD_MESSAGES": "Você tem {{ count }} novos tweets em sua linha do tempo!",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtro de notificaçao",
|
|
||||||
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} Retweetou alguem!",
|
"APPS_MATCH": "Matchmaker",
|
||||||
"APPS_TWITTER_RETWEET_EXISTS": "Voce ja retweetou isso!",
|
"APPS_MATCH_LIKED": "CURTIR",
|
||||||
"APPS_TWITTER_RETWEETED": "Retweetado",
|
"APPS_MATCH_NOPE": "NÃO",
|
||||||
"GENERIC_CALL": "Call",
|
"APPS_MATCH_LIKE": "Curtir",
|
||||||
"GENERIC_MESSAGE": "Mensagem",
|
"APPS_MATCH_DISLIKE": "Não curtir",
|
||||||
"GENERIC_REPORT": "Reporte",
|
"APPS_MATCH_NO_PROFILES": "Nenhum perfil recente encontrado",
|
||||||
"GENERIC_WAIT": "Por favor aguarde...",
|
"APPS_MATCH_NO_MATCHES": "Nenhum match encontrado",
|
||||||
"GENERIC_WRITE_TO_CLIPBOARD_MESSAGE": "Copiado {{content}} para a área de transferência!!",
|
"APPS_MATCH_PROFILES_ERROR": "Erro ao carregar perfis",
|
||||||
"GENERIC_WRITE_TO_CLIPBOARD_TOOLTIP": "Copiar {{ content }}",
|
"APPS_MATCH_MATCHES_ERROR": "Erro ao carregar matches",
|
||||||
|
"APPS_MATCH_PROFILE_CONFIGURATION": "O aplicativo está configurado incorretamente - não foi possível criar o perfil. Entre em contato com um administrador.",
|
||||||
|
"APPS_MATCH_MY_PROFILE_ERROR": "Erro ao carregar o perfil.",
|
||||||
|
"APPS_MATCH_PROFILE_LAST_ACTIVE": "Última atividade:: {{ lastActive }}",
|
||||||
|
"APPS_MATCH_PROFILE_MATCHED_AT": "Matched: {{ matchedAt }}",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_PREVIEW": "Ver Preview",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_IMAGE": "URL da imagem",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_NAME": "Nome do perfil",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_BIO": "Bio",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_LOCATION": "Localização",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_JOB": "Emprego",
|
||||||
|
"APPS_MATCH_EDIT_PROFILE_TAGS": "Tags",
|
||||||
|
"APPS_MATCH_GET_MY_PROFILE_FAILED": "Falha ao recuperar o perfil do jogador",
|
||||||
|
"APPS_MATCH_GET_PROFILES_FAILED": "Falha ao recuperar perfis",
|
||||||
|
"APPS_MATCH_GET_MATCHES_FAILED": "Falha ao recuperar matches",
|
||||||
|
"APPS_MATCH_UPDATE_PROFILE_SUCCEEDED": "Perfil atualizado com sucesso",
|
||||||
|
"APPS_MATCH_UPDATE_PROFILE_FAILED": "Falha ao atualizar o seu pefil",
|
||||||
|
"APPS_MATCH_CREATE_PROFILE_FAILED": "Falha ao criar o seu perfil",
|
||||||
|
"APPS_MATCH_SAVE_LIKES_FAILED": "Falha ao salvar curtidas",
|
||||||
|
"APPS_MATCH_SAVE_LIKES_SUCCEDED": "Curtidas salvas com sucesso",
|
||||||
|
"APPS_MATCH_NEW_LIKE_FOUND": "Novo match encontrado!",
|
||||||
|
|
||||||
"APPS_BANK_TRANSFER": "Transferir",
|
"APPS_BANK_TRANSFER": "Transferir",
|
||||||
"APPS_BANK_HOME_TITLE": "Bem vindo",
|
"APPS_BANK_HOME_TITLE": "Bem vindo",
|
||||||
@@ -82,19 +137,25 @@
|
|||||||
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "Ver tudo",
|
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "Ver tudo",
|
||||||
"APPS_BANK_ACTIONS_TRANSFER": "Transferir",
|
"APPS_BANK_ACTIONS_TRANSFER": "Transferir",
|
||||||
"APPS_BANK_ALERT_TRANSFER_SUCCESS": "Transferencia realizada com sucesso!",
|
"APPS_BANK_ALERT_TRANSFER_SUCCESS": "Transferencia realizada com sucesso!",
|
||||||
"APPS_BANK_ALERT_TRANSFER_FAILURE": "Transferencia nao foi realizada",
|
"APPS_BANK_ALERT_TRANSFER_FAILURE": "Transferencia não foi realizada",
|
||||||
|
|
||||||
"APPS_MESSAGES_SEARCH_PLACEHOLDER": "Procurar mensagem...",
|
"APPS_MESSAGES_SEARCH_PLACEHOLDER": "Procurar mensagem...",
|
||||||
"APPS_MESSAGES_NEW_MESSAGE": "Mensagem...",
|
"APPS_MESSAGES_NEW_MESSAGE": "Mensagem...",
|
||||||
"APPS_MESSAGES_NEW_MESSAGE_FAILED:": "Mensagem nao pode ser enviada",
|
"APPS_MESSAGES_NEW_MESSAGE_FAILED:": "Mensagem não pode ser enviada",
|
||||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP": "Números de telefone...",
|
"APPS_MESSAGES_NEW_MESSAGE_GROUP": "Números de telefone...",
|
||||||
"APPS_MESSAGES_GROUP_CHAT_LABEL": "Nome do chat em grupo...",
|
"APPS_MESSAGES_GROUP_CHAT_LABEL": "Nome do chat em grupo...",
|
||||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT": "Enviar",
|
"APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT": "Enviar",
|
||||||
"APPS_MESSAGES_INVALID_PHONE_NUMBER": "Numero de telefone invalido: ",
|
"APPS_MESSAGES_INVALID_PHONE_NUMBER": "Numero de telefone inválido: ",
|
||||||
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "Esse grupo ja existe",
|
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "Esse grupo já existe",
|
||||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED": "Falha ao criar grupo de mensagens",
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED": "Falha ao criar grupo de mensagens",
|
||||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "Voce nao pode adcionar voce mesmo!",
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "Voce não pode adcionar você mesmo!",
|
||||||
"APPS_MESSAGES_INPUT_NAME_OR_NUMBER": "Procure por contatos ou numero e aperte enter",
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_ALL_NUMBERS_FAILED": "Nenhum dos números de telefone foi encontrado!",
|
||||||
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_ONE_NUMBER_FAILED": "{{ number }} não é um número registrado",
|
||||||
|
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_SOME_NUMBERS_FAILED": "({{ numbers }}) não são números registrados.",
|
||||||
|
"APPS_MESSAGES_INPUT_NAME_OR_NUMBER": "Pesquise contatos ou digite o número e pressione Enter",
|
||||||
|
"APPS_MESSAGES_UNREAD_MESSAGES": "Você tem {{ count }} mensagens não lidas",
|
||||||
|
"APPS_MESSAGES_MEMBERS_TITLE": "Membros",
|
||||||
|
"APPS_MESSAGES_ME": "Eu",
|
||||||
|
|
||||||
"APPS_CONTACT_FORM_NAME": "Nome",
|
"APPS_CONTACT_FORM_NAME": "Nome",
|
||||||
"APPS_CONTACT_FORM_NUMBER": "Número",
|
"APPS_CONTACT_FORM_NUMBER": "Número",
|
||||||
@@ -121,25 +182,46 @@
|
|||||||
|
|
||||||
"APPS_CALCULATOR_COPIED": "Resultado foi copiado para a área de transferência!",
|
"APPS_CALCULATOR_COPIED": "Resultado foi copiado para a área de transferência!",
|
||||||
|
|
||||||
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Lista sendo criada com sucesso",
|
|
||||||
"APPS_MARKETPALCE_CREATE_LISTING_FAILED": "Falha em criar nova lista",
|
|
||||||
|
|
||||||
"APPS_SETTINGS_PHONE_NUMBER": "Número de telefone",
|
"APPS_SETTINGS_PHONE_NUMBER": "Número de telefone",
|
||||||
"APPS_SETTINGS_OPTION_WALLPAPER": "Papel de parede",
|
"APPS_SETTINGS_OPTION_WALLPAPER": "Papel de parede",
|
||||||
|
"APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER": "Papel de parede customizado",
|
||||||
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
||||||
"APPS_SETTINGS_OPTION_THEME": "Tema",
|
"APPS_SETTINGS_OPTION_THEME": "Tema",
|
||||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
||||||
|
"APPS_SETTINGS_OPTION_STREAMER_MODE": "Modo Streamer",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONE": "Toque",
|
"APPS_SETTINGS_OPTION_RINGTONE": "Toque",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Volume do toque",
|
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Volume do toque",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notificaçao",
|
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtros de Notificação",
|
||||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Volume da notificaçao",
|
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notificação",
|
||||||
|
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Volume das notificações",
|
||||||
|
"APPS_SETTING_STREAMER_MODE_DESC": "Ocultar as imagens antes de serem mostradas",
|
||||||
|
"APPS_SETTINGS_SET_CUSTOM_WALLPAPER": "Definir novo papel de parede",
|
||||||
|
|
||||||
|
"APPS_MARKETPLACE_CREATE_LISTING_SUCCESS": "Lista sendo criada com sucesso",
|
||||||
|
"APPS_MARKETPLACE_CREATE_LISTING_FAILED": "Falha em criar nova lista",
|
||||||
|
"APPS_MARKETPLACE_DELETE_LISTING_SUCCESS": "Lista excluída com sucesso",
|
||||||
|
"APPS_MARKETPLACE_DELETE_LISTING_FAILED": "Falha ao excluir lista",
|
||||||
|
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "Esta lista já foi reportada",
|
||||||
|
"APPS_MARKETPLACE_REPORT_LISTING_SUCCESS": "Lista reportada com sucesso",
|
||||||
|
"APPS_MARKETPLACE_REQUIRED_FIELDS": "Todos os campos devem ser preenchidos!",
|
||||||
|
"APPS_MARKETPLACE_FORM_TITLE": "Título",
|
||||||
|
"APPS_MARKETPLACE_FORM_IMAGE": "Imagem ou URL",
|
||||||
|
"APPS_MARKETPLACE_FORM_DESCRIPTION": "Descrição",
|
||||||
|
|
||||||
|
"GENERIC_CLICK_TO_REVEAL": "Clique para revelar",
|
||||||
|
"GENERIC_WAIT": "Por favor, espere...",
|
||||||
"GENERIC_SAVE": "Salvar",
|
"GENERIC_SAVE": "Salvar",
|
||||||
"GENERIC_UPDATE": "Atualizar",
|
"GENERIC_UPDATE": "Atualizar",
|
||||||
"GENERIC_DELETE": "Deletar",
|
"GENERIC_REQUIRED": "Requerido",
|
||||||
|
"GENERIC_DELETE": "Apagar",
|
||||||
|
"GENERIC_REPORT": "Reportar",
|
||||||
|
"GENERIC_CALL": "Chamar",
|
||||||
|
"GENERIC_MESSAGE": "Mensagem",
|
||||||
"GENERIC_CLOSE": "Fechar",
|
"GENERIC_CLOSE": "Fechar",
|
||||||
"GENERIC_CANCEL": "Cancelar",
|
"GENERIC_CANCEL": "Cancelar",
|
||||||
"GENERIC_TITLE": "Titulo",
|
"GENERIC_TITLE": "Título",
|
||||||
"GENERIC_CONTENT": "Conteudo"
|
"GENERIC_CONTENT": "Conteúdo",
|
||||||
|
"GENERIC_WRITE_TO_CLIPBOARD_TOOLTIP": "Copiar {{ content }}",
|
||||||
|
"GENERIC_WRITE_TO_CLIPBOARD_MESSAGE": "{{content}} copiado(a) para a área de transferência!"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -13,6 +13,7 @@ import { faTwitter } from '@fortawesome/free-brands-svg-icons';
|
|||||||
import ContactsIcon from '@material-ui/icons/Contacts';
|
import ContactsIcon from '@material-ui/icons/Contacts';
|
||||||
import SettingsIcon from '@material-ui/icons/Settings';
|
import SettingsIcon from '@material-ui/icons/Settings';
|
||||||
import MessageIcon from '@material-ui/icons/Message';
|
import MessageIcon from '@material-ui/icons/Message';
|
||||||
|
import FireIcon from '@material-ui/icons/Whatshot';
|
||||||
import { CalculatorIcon } from '../../../apps/calculator/components/CalculatorIcon';
|
import { CalculatorIcon } from '../../../apps/calculator/components/CalculatorIcon';
|
||||||
import CameraAltIcon from '@material-ui/icons/CameraAlt';
|
import CameraAltIcon from '@material-ui/icons/CameraAlt';
|
||||||
import { DialerApp } from '../../../apps/dialer/components/DialerApp';
|
import { DialerApp } from '../../../apps/dialer/components/DialerApp';
|
||||||
@@ -21,9 +22,10 @@ import { CalculatorApp } from '../../../apps/calculator/components/CalculatorApp
|
|||||||
import { SettingsApp } from '../../../apps/settings/components/SettingsApp';
|
import { SettingsApp } from '../../../apps/settings/components/SettingsApp';
|
||||||
import { BankApp } from '../../../apps/bank/components/BankApp';
|
import { BankApp } from '../../../apps/bank/components/BankApp';
|
||||||
import { MessagesApp } from '../../../apps/messages/components/MessagesApp';
|
import { MessagesApp } from '../../../apps/messages/components/MessagesApp';
|
||||||
|
import { MatchApp } from '../../../apps/match/components/MatchApp';
|
||||||
import { TwitterApp } from '../../../apps/twitter/components/TwitterApp';
|
import { TwitterApp } from '../../../apps/twitter/components/TwitterApp';
|
||||||
import { ExampleApp } from '../../../apps/example/components/ExampleApp';
|
import { ExampleApp } from '../../../apps/example/components/ExampleApp';
|
||||||
import { SelloutApp } from '../../../apps/sellout/components/SelloutApp';
|
import { MarketplaceApp } from '../../../apps/marketplace/components/MarketplaceApp';
|
||||||
import { NotesApp } from '../../../apps/notes/NotesApp';
|
import { NotesApp } from '../../../apps/notes/NotesApp';
|
||||||
import CameraApp from '../../../apps/camera/components/CameraApp';
|
import CameraApp from '../../../apps/camera/components/CameraApp';
|
||||||
import { AppRoute } from '../components/AppRoute';
|
import { AppRoute } from '../components/AppRoute';
|
||||||
@@ -39,13 +41,14 @@ import {
|
|||||||
import {
|
import {
|
||||||
SELLOUT_APP_PRIMARY_COLOR,
|
SELLOUT_APP_PRIMARY_COLOR,
|
||||||
SELLOUT_APP_ICON_COLOR,
|
SELLOUT_APP_ICON_COLOR,
|
||||||
} from '../../../apps/sellout/sellout.theme';
|
} from '../../../apps/marketplace/marketplace.theme';
|
||||||
import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme';
|
import { NOTES_APP_ICON_COLOR, NOTES_APP_PRIMARY_COLOR } from '../../../apps/notes/notes.theme';
|
||||||
import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
|
import { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
|
||||||
import {
|
import {
|
||||||
TWITTER_APP_PRIMARY_COLOR,
|
TWITTER_APP_PRIMARY_COLOR,
|
||||||
TWITTER_APP_TEXT_COLOR,
|
TWITTER_APP_TEXT_COLOR,
|
||||||
} from '../../../apps/twitter/twitter.theme';
|
} from '../../../apps/twitter/twitter.theme';
|
||||||
|
import { MATCH_APP_PRIMARY_COLOR, MATCH_APP_TEXT_COLOR } from '../../../apps/match/match.theme';
|
||||||
|
|
||||||
export interface IAppConfig {
|
export interface IAppConfig {
|
||||||
id: string;
|
id: string;
|
||||||
@@ -109,7 +112,8 @@ export const APPS: IAppConfig[] = [
|
|||||||
path: '/settings',
|
path: '/settings',
|
||||||
Route: () => <AppRoute id="SETTINGS" path="/settings" component={SettingsApp} />,
|
Route: () => <AppRoute id="SETTINGS" path="/settings" component={SettingsApp} />,
|
||||||
},
|
},
|
||||||
{
|
/* Hiding the bank app while the bank resource gets done */
|
||||||
|
/*{
|
||||||
id: 'BANK',
|
id: 'BANK',
|
||||||
nameLocale: 'APPS_BANK',
|
nameLocale: 'APPS_BANK',
|
||||||
icon: <FontAwesomeIcon icon={faWonSign} />,
|
icon: <FontAwesomeIcon icon={faWonSign} />,
|
||||||
@@ -118,6 +122,16 @@ export const APPS: IAppConfig[] = [
|
|||||||
color: common.white,
|
color: common.white,
|
||||||
path: '/bank',
|
path: '/bank',
|
||||||
Route: () => <AppRoute id="BANK" path="/bank" component={BankApp} />,
|
Route: () => <AppRoute id="BANK" path="/bank" component={BankApp} />,
|
||||||
|
},*/
|
||||||
|
{
|
||||||
|
id: 'MATCH',
|
||||||
|
nameLocale: 'APPS_MATCH',
|
||||||
|
icon: <FireIcon fontSize="large" />,
|
||||||
|
notificationIcon: <FireIcon fontSize="small" />,
|
||||||
|
backgroundColor: MATCH_APP_PRIMARY_COLOR,
|
||||||
|
color: MATCH_APP_TEXT_COLOR,
|
||||||
|
path: '/match',
|
||||||
|
Route: () => <AppRoute id="MATCH" path="/match" component={MatchApp} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'TWITTER',
|
id: 'TWITTER',
|
||||||
@@ -136,8 +150,8 @@ export const APPS: IAppConfig[] = [
|
|||||||
notificationIcon: <FontAwesomeIcon icon={faAd} fixedWidth size="xs" />,
|
notificationIcon: <FontAwesomeIcon icon={faAd} fixedWidth size="xs" />,
|
||||||
backgroundColor: SELLOUT_APP_PRIMARY_COLOR,
|
backgroundColor: SELLOUT_APP_PRIMARY_COLOR,
|
||||||
color: SELLOUT_APP_ICON_COLOR,
|
color: SELLOUT_APP_ICON_COLOR,
|
||||||
path: '/sellout',
|
path: '/marketplace',
|
||||||
Route: () => <AppRoute id="SELLOUT" path="/sellout" component={SelloutApp} />,
|
Route: () => <AppRoute id="MARKETPLACE" path="/marketplace" component={MarketplaceApp} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'NOTES',
|
id: 'NOTES',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
|||||||
import { useNuiEvent } from '../../nui-events/hooks/useNuiEvent';
|
import { useNuiEvent } from '../../nui-events/hooks/useNuiEvent';
|
||||||
import { useSetRecoilState } from 'recoil';
|
import { useSetRecoilState } from 'recoil';
|
||||||
import { useCall } from './useCall';
|
import { useCall } from './useCall';
|
||||||
import { CallProps } from '../../../../../typings/call';
|
import { CallEvents, CallProps } from '../../../../../typings/call';
|
||||||
import InjectDebugData from '../../debug/InjectDebugData';
|
import InjectDebugData from '../../debug/InjectDebugData';
|
||||||
import { useCallModal } from './useCallModal';
|
import { useCallModal } from './useCallModal';
|
||||||
import { useHistory, useLocation } from 'react-router-dom';
|
import { useHistory, useLocation } from 'react-router-dom';
|
||||||
@@ -61,6 +61,6 @@ export const useCallService = () => {
|
|||||||
setCall(_call);
|
setCall(_call);
|
||||||
setNotification(_call);
|
setNotification(_call);
|
||||||
};
|
};
|
||||||
useNuiEvent<CallProps>('CALL', 'setCaller', _setCall, call);
|
useNuiEvent<CallProps>('CALL', CallEvents.SET_CALLER, _setCall, call);
|
||||||
useNuiEvent<boolean>('CALL', 'callModal', setModal);
|
useNuiEvent<boolean>('CALL', CallEvents.SET_CALL_MODAL, setModal);
|
||||||
};
|
};
|
||||||
@@ -16,6 +16,7 @@ import ArrowDropUpIcon from '@material-ui/icons/ArrowDropUp';
|
|||||||
import Default from '../../../config/default.json';
|
import Default from '../../../config/default.json';
|
||||||
import { useNotifications } from '../hooks/useNotifications';
|
import { useNotifications } from '../hooks/useNotifications';
|
||||||
import { NotificationItem } from './NotificationItem';
|
import { NotificationItem } from './NotificationItem';
|
||||||
|
import usePhoneTime from '../../phone/hooks/usePhoneTime';
|
||||||
|
|
||||||
const useStyles = makeStyles((theme) => ({
|
const useStyles = makeStyles((theme) => ({
|
||||||
root: {
|
root: {
|
||||||
@@ -74,6 +75,8 @@ export const NotificationBar = () => {
|
|||||||
setBarUncollapsed,
|
setBarUncollapsed,
|
||||||
} = useNotifications();
|
} = useNotifications();
|
||||||
|
|
||||||
|
const time = usePhoneTime();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Grid
|
<Grid
|
||||||
@@ -92,6 +95,13 @@ export const NotificationBar = () => {
|
|||||||
</Grid>
|
</Grid>
|
||||||
))}
|
))}
|
||||||
</Grid>
|
</Grid>
|
||||||
|
{time && (
|
||||||
|
<Grid item className={classes.item}>
|
||||||
|
<Typography className={classes.text} variant="button">
|
||||||
|
{time}
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
)}
|
||||||
<Grid container item wrap="nowrap" justify="flex-end" alignItems="center">
|
<Grid container item wrap="nowrap" justify="flex-end" alignItems="center">
|
||||||
<Grid item>
|
<Grid item>
|
||||||
<SignalIcon fontSize="small" />
|
<SignalIcon fontSize="small" />
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export const NotificationItem = ({
|
|||||||
}) => {
|
}) => {
|
||||||
const { title, icon, content, cantClose, onClick } = notification;
|
const { title, icon, content, cantClose, onClick } = notification;
|
||||||
const classes = useStyles({ cantClose });
|
const classes = useStyles({ cantClose });
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ListItem
|
<ListItem
|
||||||
divider
|
divider
|
||||||
|
|||||||
@@ -13,4 +13,8 @@ export const phoneState = {
|
|||||||
key: 'phoneReady',
|
key: 'phoneReady',
|
||||||
default: false,
|
default: false,
|
||||||
}),
|
}),
|
||||||
|
phoneTime: atom({
|
||||||
|
key: 'phoneTime',
|
||||||
|
default: null,
|
||||||
|
}),
|
||||||
};
|
};
|
||||||
@@ -6,7 +6,9 @@ export const usePhoneService = () => {
|
|||||||
const setVisibility = useSetRecoilState(phoneState.visibility);
|
const setVisibility = useSetRecoilState(phoneState.visibility);
|
||||||
const setPhoneConfig = useSetRecoilState(phoneState.phoneConfig);
|
const setPhoneConfig = useSetRecoilState(phoneState.phoneConfig);
|
||||||
const setPhoneReady = useSetRecoilState(phoneState.phoneReady);
|
const setPhoneReady = useSetRecoilState(phoneState.phoneReady);
|
||||||
|
const setPhoneTime = useSetRecoilState(phoneState.phoneTime);
|
||||||
useNuiEvent('PHONE', 'setVisibility', setVisibility);
|
useNuiEvent('PHONE', 'setVisibility', setVisibility);
|
||||||
useNuiEvent('PHONE', 'setPhoneReady', setPhoneReady);
|
useNuiEvent('PHONE', 'setPhoneReady', setPhoneReady);
|
||||||
useNuiEvent('PHONE', 'phoneConfig', setPhoneConfig);
|
useNuiEvent('PHONE', 'phoneConfig', setPhoneConfig);
|
||||||
|
useNuiEvent('PHONE', 'setTime', setPhoneTime);
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { useRecoilValue } from 'recoil';
|
||||||
|
import { phoneState } from './state';
|
||||||
|
|
||||||
|
const usePhoneTime = () => {
|
||||||
|
return useRecoilValue<null | string>(phoneState.phoneTime);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default usePhoneTime;
|
||||||
File renamed without changes.
@@ -0,0 +1,44 @@
|
|||||||
|
import React, { useState, useEffect } from 'react';
|
||||||
|
import { makeStyles } from '@material-ui/core/styles';
|
||||||
|
import { Fab } from '@material-ui/core';
|
||||||
|
import PublishIcon from '@material-ui/icons/Publish';
|
||||||
|
|
||||||
|
const useStyles = makeStyles({
|
||||||
|
root: {
|
||||||
|
position: 'absolute',
|
||||||
|
bottom: '15px',
|
||||||
|
right: '15px',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
const MINIMUM_LOAD_TIME = 750;
|
||||||
|
|
||||||
|
interface IProps {
|
||||||
|
handleClick: () => void;
|
||||||
|
loading: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ProfileUpdateButton({ handleClick, loading }: IProps) {
|
||||||
|
const classes = useStyles();
|
||||||
|
const [minimumLoadPassed, setMimimumLoadPassed] = useState(true);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setMimimumLoadPassed(false);
|
||||||
|
const timeout = window.setTimeout(() => {
|
||||||
|
setMimimumLoadPassed(true);
|
||||||
|
}, MINIMUM_LOAD_TIME);
|
||||||
|
return () => window.clearTimeout(timeout);
|
||||||
|
}, [loading]);
|
||||||
|
|
||||||
|
const isLoading = loading || !minimumLoadPassed;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className={classes.root}>
|
||||||
|
<Fab color="primary" onClick={handleClick} disabled={isLoading}>
|
||||||
|
<PublishIcon />
|
||||||
|
</Fab>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default ProfileUpdateButton;
|
||||||
@@ -6,7 +6,7 @@ export interface IAlert {
|
|||||||
type: AlertType;
|
type: AlertType;
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AlertType = 'success' | 'error' | 'info';
|
export type AlertType = 'success' | 'error' | 'info' | 'warning';
|
||||||
|
|
||||||
interface ISnackBar {
|
interface ISnackBar {
|
||||||
addAlert: ({ message, type }: IAlert) => void;
|
addAlert: ({ message, type }: IAlert) => void;
|
||||||
|
|||||||
+1
-8
@@ -11668,14 +11668,7 @@ react-app-polyfill@^2.0.0:
|
|||||||
regenerator-runtime "^0.13.7"
|
regenerator-runtime "^0.13.7"
|
||||||
whatwg-fetch "^3.4.1"
|
whatwg-fetch "^3.4.1"
|
||||||
|
|
||||||
react-app-rewired@^2.1.8:
|
react-dev-utils@^11.0.1:
|
||||||
version "2.1.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/react-app-rewired/-/react-app-rewired-2.1.8.tgz#e192f93b98daf96889418d33d3e86cf863812b56"
|
|
||||||
integrity sha512-wjXPdKPLscA7mn0I1de1NHrbfWdXz4S1ladaGgHVKdn1hTgKK5N6EdGIJM0KrS6bKnJBj7WuqJroDTsPKKr66Q==
|
|
||||||
dependencies:
|
|
||||||
semver "^5.6.0"
|
|
||||||
|
|
||||||
react-dev-utils@^11.0.1, react-dev-utils@^11.0.4:
|
|
||||||
version "11.0.4"
|
version "11.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-11.0.4.tgz#a7ccb60257a1ca2e0efe7a83e38e6700d17aa37a"
|
resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-11.0.4.tgz#a7ccb60257a1ca2e0efe7a83e38e6700d17aa37a"
|
||||||
integrity sha512-dx0LvIGHcOPtKbeiSUM4jqpBl3TcY7CDjZdfOIcKeznE7BWr9dg0iPG90G5yfVQ+p/rGNMXdbfStvzQZEVEi4A==
|
integrity sha512-dx0LvIGHcOPtKbeiSUM4jqpBl3TcY7CDjZdfOIcKeznE7BWr9dg0iPG90G5yfVQ+p/rGNMXdbfStvzQZEVEi4A==
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
import { IAlertProps } from '../../typings/alerts';
|
import { IAlertProps } from '../../typings/alerts';
|
||||||
import { BankEvents } from '../../typings/bank';
|
import { BankEvents } from '../../typings/bank';
|
||||||
|
import { PhoneEvents } from '../../typings/phone';
|
||||||
|
|
||||||
onNet(BankEvents.SEND_TRANSFERS, (transfer: any) => {
|
onNet(BankEvents.SEND_TRANSFERS, (transfer: any) => {
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'BANK',
|
app: 'BANK',
|
||||||
method: 'setTransaction',
|
method: BankEvents.SEND_TRANSFERS,
|
||||||
data: transfer,
|
data: transfer,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -15,7 +16,7 @@ onNet(BankEvents.SEND_CREDENTIALS, (credentials: any) => {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'BANK',
|
app: 'BANK',
|
||||||
method: 'setCredentials',
|
method: BankEvents.SEND_CREDENTIALS,
|
||||||
data: credentials,
|
data: credentials,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -35,7 +36,7 @@ onNet(BankEvents.TRANSACTION_ALERT, (result: IAlertProps) => {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'BANK',
|
app: 'BANK',
|
||||||
method: 'setAlert',
|
method: BankEvents.SEND_ALERT,
|
||||||
data: result,
|
data: result,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -45,7 +46,7 @@ onNet(BankEvents.TRANSACTION_NOTIFICATION, (transfer: any) => {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'BANK',
|
app: 'BANK',
|
||||||
method: 'setNotification',
|
method: BankEvents.SEND_NOTIFICATION,
|
||||||
data: transfer,
|
data: transfer,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ onNet(CallEvents.START_CALL, (transmitter: string, receiver: string, isTransmitt
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'CALL',
|
app: 'CALL',
|
||||||
method: 'setCaller',
|
method: CallEvents.SET_CALLER,
|
||||||
data: {
|
data: {
|
||||||
active: true,
|
active: true,
|
||||||
transmitter: transmitter,
|
transmitter: transmitter,
|
||||||
@@ -40,7 +40,7 @@ onNet(CallEvents.WAS_ACCEPTED, (channelId: number, currentCall: ICall, isTransmi
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'CALL',
|
app: 'CALL',
|
||||||
method: 'setCaller',
|
method: CallEvents.SET_CALLER,
|
||||||
data: {
|
data: {
|
||||||
active: true,
|
active: true,
|
||||||
transmitter: currentCall.transmitter,
|
transmitter: currentCall.transmitter,
|
||||||
@@ -63,7 +63,7 @@ onNet(CallEvents.WAS_REJECTED, () => {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'CALL',
|
app: 'CALL',
|
||||||
method: 'setCaller',
|
method: CallEvents.SET_CALLER,
|
||||||
data: {
|
data: {
|
||||||
transmitter: null,
|
transmitter: null,
|
||||||
receiver: null,
|
receiver: null,
|
||||||
@@ -93,7 +93,7 @@ onNet(CallEvents.WAS_ENDED, () => {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'CALL',
|
app: 'CALL',
|
||||||
method: 'setCaller',
|
method: CallEvents.SET_CALLER,
|
||||||
data: {
|
data: {
|
||||||
transmitter: null,
|
transmitter: null,
|
||||||
receiver: null,
|
receiver: null,
|
||||||
@@ -109,7 +109,7 @@ function openCallModal(show: boolean) {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'CALL',
|
app: 'CALL',
|
||||||
method: 'callModal',
|
method: CallEvents.SET_CALL_MODAL,
|
||||||
data: show,
|
data: show,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -119,7 +119,7 @@ onNet(CallEvents.SEND_HISTORY, (calls: ICall) => {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'DIALER',
|
app: 'DIALER',
|
||||||
method: 'setHistory',
|
method: CallEvents.SET_CALL_HISTORY,
|
||||||
data: calls,
|
data: calls,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ContactEvents } from '../../typings/contact';
|
|||||||
import { sendContactsEvent } from '../utils/messages';
|
import { sendContactsEvent } from '../utils/messages';
|
||||||
|
|
||||||
onNet(ContactEvents.SEND_CONTACTS, (contacts: any) => {
|
onNet(ContactEvents.SEND_CONTACTS, (contacts: any) => {
|
||||||
sendContactsEvent('setContacts', contacts);
|
sendContactsEvent(ContactEvents.SEND_CONTACTS, contacts);
|
||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(ContactEvents.ADD_CONTACT);
|
RegisterNuiCallbackType(ContactEvents.ADD_CONTACT);
|
||||||
@@ -36,5 +36,5 @@ onNet(ContactEvents.DELETE_CONTACT_SUCCESS, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onNet(ContactEvents.ACTION_RESULT, (alert: any) => {
|
onNet(ContactEvents.ACTION_RESULT, (alert: any) => {
|
||||||
sendContactsEvent('setAlert', alert);
|
sendContactsEvent(ContactEvents.SEND_ALERT, alert);
|
||||||
});
|
});
|
||||||
@@ -10,6 +10,7 @@ import { NotesEvents } from '../../typings/notes';
|
|||||||
import { BankEvents } from '../../typings/bank';
|
import { BankEvents } from '../../typings/bank';
|
||||||
import { PhotoEvents } from '../../typings/photo';
|
import { PhotoEvents } from '../../typings/photo';
|
||||||
import { CallEvents } from '../../typings/call';
|
import { CallEvents } from '../../typings/call';
|
||||||
|
import { MatchEvents } from '../../typings/match';
|
||||||
|
|
||||||
let isPhoneOpen = false;
|
let isPhoneOpen = false;
|
||||||
let isPhoneReady = false;
|
let isPhoneReady = false;
|
||||||
@@ -30,6 +31,18 @@ function fetchOnInitialize() {
|
|||||||
|
|
||||||
RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
|
RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
|
||||||
|
|
||||||
|
const getCurrentGameTime = () => {
|
||||||
|
let hour: string | number = GetClockHours();
|
||||||
|
|
||||||
|
let minute: string | number = GetClockMinutes();
|
||||||
|
|
||||||
|
// Format time if need be
|
||||||
|
if (hour < 10) hour = `0${hour}`;
|
||||||
|
if (minute < 10) minute = `0${minute}`;
|
||||||
|
|
||||||
|
return `${hour}:${minute}`;
|
||||||
|
};
|
||||||
|
|
||||||
/* * * * * * * * * * * * *
|
/* * * * * * * * * * * * *
|
||||||
*
|
*
|
||||||
* Phone Visibility Handling
|
* Phone Visibility Handling
|
||||||
@@ -38,10 +51,12 @@ RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
|
|||||||
|
|
||||||
const showPhone = async (): Promise<void> => {
|
const showPhone = async (): Promise<void> => {
|
||||||
isPhoneOpen = true;
|
isPhoneOpen = true;
|
||||||
|
const time = getCurrentGameTime();
|
||||||
await phoneOpenAnim(); // Animation starts before the phone is open
|
await phoneOpenAnim(); // Animation starts before the phone is open
|
||||||
emitNet('phone:getCredentials');
|
emitNet('phone:getCredentials');
|
||||||
SetCursorLocation(0.9, 0.922); //Experimental
|
SetCursorLocation(0.9, 0.922); //Experimental
|
||||||
sendMessage('PHONE', 'setVisibility', true);
|
sendMessage('PHONE', 'setVisibility', true);
|
||||||
|
sendMessage('PHONE', 'setTime', time);
|
||||||
SetNuiFocus(true, true);
|
SetNuiFocus(true, true);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -175,3 +190,9 @@ on(`__cfx_nui:${PhoneEvents.CLOSE_PHONE}`, async (data: any, cb: Function) => {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
// Will update the phone's time even while its open
|
||||||
|
// setInterval(() => {
|
||||||
|
// const time = getCurrentGameTime()
|
||||||
|
// sendMessage('PHONE', 'setTime', time)
|
||||||
|
// }, 2000);
|
||||||
@@ -3,7 +3,7 @@ import { IAlertProps } from '../../typings/alerts';
|
|||||||
import { sendMarketplaceEvent } from '../utils/messages';
|
import { sendMarketplaceEvent } from '../utils/messages';
|
||||||
|
|
||||||
onNet(MarketplaceEvents.SEND_LISTING, (listings: MarketplaceListing[]) => {
|
onNet(MarketplaceEvents.SEND_LISTING, (listings: MarketplaceListing[]) => {
|
||||||
sendMarketplaceEvent('setListings', listings);
|
sendMarketplaceEvent(MarketplaceEvents.SEND_LISTING, listings);
|
||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(MarketplaceEvents.ADD_LISTING);
|
RegisterNuiCallbackType(MarketplaceEvents.ADD_LISTING);
|
||||||
@@ -33,5 +33,5 @@ onNet(MarketplaceEvents.DELETE_LISTING_SUCCESS, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onNet(MarketplaceEvents.ACTION_RESULT, (alert: IAlertProps) => {
|
onNet(MarketplaceEvents.ACTION_RESULT, (alert: IAlertProps) => {
|
||||||
sendMarketplaceEvent('setAlert', alert);
|
sendMarketplaceEvent(MarketplaceEvents.SEND_ALERT, alert);
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
import { Like, Profile, MatchEvents } from '../../typings/match';
|
||||||
|
import { sendMatchEvent } from '../utils/messages';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Many events that are just statuses are passed directly from
|
||||||
|
* the server to NUI and the client is just acting as a middle man.
|
||||||
|
* For those cases this function allows us to simply transfer all the
|
||||||
|
* data associated with the event.
|
||||||
|
* @param eventName - event we are propagating
|
||||||
|
*/
|
||||||
|
const transferEvent = (eventName: string) => (...args: any) => {
|
||||||
|
sendMatchEvent(eventName, ...args);
|
||||||
|
};
|
||||||
|
|
||||||
|
onNet(MatchEvents.GET_PROFILES_FAILED, transferEvent(MatchEvents.GET_PROFILES_FAILED));
|
||||||
|
onNet(MatchEvents.SAVE_LIKES_SUCCESS, transferEvent(MatchEvents.SAVE_LIKES_SUCCESS));
|
||||||
|
onNet(MatchEvents.SAVE_LIKES_FAILED, transferEvent(MatchEvents.SAVE_LIKES_FAILED));
|
||||||
|
onNet(MatchEvents.GET_MATCHES_SUCCESS, transferEvent(MatchEvents.GET_MATCHES_SUCCESS));
|
||||||
|
onNet(MatchEvents.GET_MATCHES_FAILED, transferEvent(MatchEvents.GET_MATCHES_FAILED));
|
||||||
|
onNet(MatchEvents.GET_MY_PROFILE_SUCCESS, transferEvent(MatchEvents.GET_MY_PROFILE_SUCCESS));
|
||||||
|
onNet(MatchEvents.GET_MY_PROFILE_FAILED, transferEvent(MatchEvents.GET_MY_PROFILE_FAILED));
|
||||||
|
onNet(MatchEvents.GET_PROFILES_SUCCESS, transferEvent(MatchEvents.GET_PROFILES_SUCCESS));
|
||||||
|
onNet(MatchEvents.UPDATE_MY_PROFILE_SUCCESS, transferEvent(MatchEvents.UPDATE_MY_PROFILE_SUCCESS));
|
||||||
|
onNet(MatchEvents.CREATE_MY_PROFILE_SUCCESS, transferEvent(MatchEvents.CREATE_MY_PROFILE_SUCCESS));
|
||||||
|
onNet(MatchEvents.CREATE_MY_PROFILE_FAILED, transferEvent(MatchEvents.CREATE_MY_PROFILE_FAILED));
|
||||||
|
onNet(MatchEvents.UPDATE_MY_PROFILE_FAILED, transferEvent(MatchEvents.UPDATE_MY_PROFILE_FAILED));
|
||||||
|
onNet(MatchEvents.NEW_MATCH, transferEvent(MatchEvents.NEW_MATCH));
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(MatchEvents.SAVE_LIKES);
|
||||||
|
on(`__cfx_nui:${MatchEvents.SAVE_LIKES}`, (likes: Like[], cb: Function) => {
|
||||||
|
emitNet(MatchEvents.SAVE_LIKES, likes);
|
||||||
|
cb();
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(MatchEvents.GET_MATCHES);
|
||||||
|
on(`__cfx_nui:${MatchEvents.GET_MATCHES}`, () => {
|
||||||
|
emitNet(MatchEvents.GET_MATCHES);
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(MatchEvents.INITIALIZE);
|
||||||
|
on(`__cfx_nui:${MatchEvents.INITIALIZE}`, () => {
|
||||||
|
emitNet(MatchEvents.INITIALIZE);
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(MatchEvents.CREATE_MY_PROFILE);
|
||||||
|
on(`__cfx_nui:${MatchEvents.CREATE_MY_PROFILE}`, (profile: Profile) => {
|
||||||
|
emitNet(MatchEvents.CREATE_MY_PROFILE, profile);
|
||||||
|
});
|
||||||
|
|
||||||
|
RegisterNuiCallbackType(MatchEvents.UPDATE_MY_PROFILE);
|
||||||
|
on(`__cfx_nui:${MatchEvents.UPDATE_MY_PROFILE}`, (profile: Profile) => {
|
||||||
|
emitNet(MatchEvents.UPDATE_MY_PROFILE, profile);
|
||||||
|
});
|
||||||
@@ -2,7 +2,7 @@ import { NotesEvents } from '../../typings/notes';
|
|||||||
import { sendNotesEvent } from '../utils/messages';
|
import { sendNotesEvent } from '../utils/messages';
|
||||||
|
|
||||||
onNet(NotesEvents.SEND_NOTE, (notes: any) => {
|
onNet(NotesEvents.SEND_NOTE, (notes: any) => {
|
||||||
sendNotesEvent('setNotes', notes);
|
sendNotesEvent(NotesEvents.SEND_NOTE, notes);
|
||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(NotesEvents.ADD_NOTE);
|
RegisterNuiCallbackType(NotesEvents.ADD_NOTE);
|
||||||
@@ -35,5 +35,5 @@ onNet(NotesEvents.UPDATE_NOTE_SUCCESS, () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
onNet(NotesEvents.ACTION_RESULT, (alert: any) => {
|
onNet(NotesEvents.ACTION_RESULT, (alert: any) => {
|
||||||
sendNotesEvent('setAlert', alert);
|
sendNotesEvent(NotesEvents.SEND_ALERT, alert);
|
||||||
});
|
});
|
||||||
@@ -76,7 +76,7 @@ const handleCameraExit = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
onNet(PhotoEvents.SEND_PHOTOS, (photos: string[]) => {
|
onNet(PhotoEvents.SEND_PHOTOS, (photos: string[]) => {
|
||||||
sendCameraEvent('setPhotos', photos);
|
sendCameraEvent(PhotoEvents.SEND_PHOTOS, photos);
|
||||||
});
|
});
|
||||||
|
|
||||||
function takePhoto() {
|
function takePhoto() {
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ import ClientUtils from './cl_utils';
|
|||||||
import './cl_main';
|
import './cl_main';
|
||||||
import './cl_twitter';
|
import './cl_twitter';
|
||||||
import './cl_contacts';
|
import './cl_contacts';
|
||||||
import './cl_sellout';
|
import './cl_marketplace';
|
||||||
import './cl_bank';
|
import './cl_bank';
|
||||||
import './cl_notes';
|
import './cl_notes';
|
||||||
import './cl_photo';
|
import './cl_photo';
|
||||||
import './cl_messages';
|
import './cl_messages';
|
||||||
import './cl_call';
|
import './cl_call';
|
||||||
|
import './cl_match';
|
||||||
import './functions';
|
import './functions';
|
||||||
|
|
||||||
export const ClUtils = new ClientUtils();
|
export const ClUtils = new ClientUtils();
|
||||||
@@ -47,9 +47,9 @@ export async function getIdentifierByPhoneNumber(
|
|||||||
* Returns the player phoneNumber for a passed identifier
|
* Returns the player phoneNumber for a passed identifier
|
||||||
* @param identifier The players phone number
|
* @param identifier The players phone number
|
||||||
*/
|
*/
|
||||||
export function getPlayerFromIdentifier(identifier: string) {
|
export function getPlayerFromIdentifier(identifier: string): Player | null {
|
||||||
const player = PlayersByIdentifier.get(identifier);
|
const player = PlayersByIdentifier.get(identifier);
|
||||||
if (!player) mainLogger.error(`Could not find player from identifier: ${identifier}`);
|
if (!player) return null;
|
||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +70,7 @@ function getRandomPhoneNumber() {
|
|||||||
return randomNumber;
|
return randomNumber;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generatePhoneNumber(identifier: string): Promise<void> {
|
export async function generatePhoneNumber(identifier: string): Promise<string> {
|
||||||
const getQuery = `SELECT phone_number FROM users WHERE identifier = ?`;
|
const getQuery = `SELECT phone_number FROM users WHERE identifier = ?`;
|
||||||
const [results] = await pool.query(getQuery, [identifier]);
|
const [results] = await pool.query(getQuery, [identifier]);
|
||||||
const result = <any[]>results;
|
const result = <any[]>results;
|
||||||
@@ -90,5 +90,7 @@ export async function generatePhoneNumber(identifier: string): Promise<void> {
|
|||||||
mainLogger.debug(`Inserting number into Database: ${newNumber}`);
|
mainLogger.debug(`Inserting number into Database: ${newNumber}`);
|
||||||
const query = 'UPDATE users SET phone_number = ? WHERE identifier = ?';
|
const query = 'UPDATE users SET phone_number = ? WHERE identifier = ?';
|
||||||
await pool.query(query, [newNumber, identifier]);
|
await pool.query(query, [newNumber, identifier]);
|
||||||
|
return newNumber;
|
||||||
}
|
}
|
||||||
|
return phoneNumber;
|
||||||
}
|
}
|
||||||
@@ -32,10 +32,21 @@ export async function handlePlayerAdd(pSource: number) {
|
|||||||
const username = GetPlayerName(pSource.toString());
|
const username = GetPlayerName(pSource.toString());
|
||||||
playerLogger.info(`Started loading for ${username} (${pSource})`);
|
playerLogger.info(`Started loading for ${username} (${pSource})`);
|
||||||
// Ensure phone number exists or generate
|
// Ensure phone number exists or generate
|
||||||
await generatePhoneNumber(playerIdentifer);
|
const phone_number = await generatePhoneNumber(playerIdentifer);
|
||||||
|
|
||||||
// Get player info to populate class instance
|
// Get player info to populate class instance
|
||||||
const { firstname, lastname, phone_number } = await getPlayerInfo(playerIdentifer);
|
let playerInfo = { firstname: '', lastname: '' };
|
||||||
|
try {
|
||||||
|
playerInfo = await getPlayerInfo(playerIdentifer);
|
||||||
|
} catch (e) {
|
||||||
|
playerLogger.debug(
|
||||||
|
`Failed to get player info, defaulting to phone number as profile, ${e.message}`,
|
||||||
|
{
|
||||||
|
source: pSource,
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const { firstname, lastname } = playerInfo;
|
||||||
|
|
||||||
const newPlayer = new Player({
|
const newPlayer = new Player({
|
||||||
identifier: playerIdentifer,
|
identifier: playerIdentifer,
|
||||||
@@ -104,11 +115,14 @@ async function getCleanedPlayerInfo(identifier: string): Promise<PlayerQueryResp
|
|||||||
* Generate a profile name by the player's name and/or phone number
|
* Generate a profile name by the player's name and/or phone number
|
||||||
* @param identifier - player's identifier
|
* @param identifier - player's identifier
|
||||||
*/
|
*/
|
||||||
export async function generateProfileName(identifier: string): Promise<string | null> {
|
export async function generateProfileName(
|
||||||
|
identifier: string,
|
||||||
|
delimiter: string = '_',
|
||||||
|
): Promise<string | null> {
|
||||||
const { firstname, lastname, phone_number } = await getCleanedPlayerInfo(identifier);
|
const { firstname, lastname, phone_number } = await getCleanedPlayerInfo(identifier);
|
||||||
|
|
||||||
if (firstname && lastname) {
|
if (firstname && lastname) {
|
||||||
return `${firstname}_${lastname}`;
|
return `${firstname}${delimiter}${lastname}`;
|
||||||
} else if (firstname) {
|
} else if (firstname) {
|
||||||
return firstname;
|
return firstname;
|
||||||
} else if (lastname) {
|
} else if (lastname) {
|
||||||
|
|||||||
@@ -4,11 +4,12 @@ import './db';
|
|||||||
import './sv_twitter';
|
import './sv_twitter';
|
||||||
import './sv_main';
|
import './sv_main';
|
||||||
import './sv_contacts';
|
import './sv_contacts';
|
||||||
import './sv_sellout';
|
import './sv_marketplace';
|
||||||
import './sv_bank';
|
import './sv_bank';
|
||||||
import './sv_notes';
|
import './sv_notes';
|
||||||
import './sv_photo';
|
import './sv_photo';
|
||||||
import './sv_messages';
|
import './sv_messages';
|
||||||
|
import './sv_match';
|
||||||
import './sv_call';
|
import './sv_call';
|
||||||
import './players/sv_player_events';
|
import './players/sv_player_events';
|
||||||
import { mainLogger } from './sv_logger';
|
import { mainLogger } from './sv_logger';
|
||||||
|
|||||||
File renamed without changes.
@@ -0,0 +1,357 @@
|
|||||||
|
import { ResultSetHeader, RowDataPacket } from 'mysql2';
|
||||||
|
|
||||||
|
import { pool } from './db';
|
||||||
|
import { getIdentifier, getSource } from './functions';
|
||||||
|
import config from '../utils/config';
|
||||||
|
import { Like, Match, Profile, MatchEvents, NewProfile } from '../../typings/match';
|
||||||
|
import { mainLogger } from './sv_logger';
|
||||||
|
import { generateProfileName } from './players/sv_players';
|
||||||
|
|
||||||
|
const matchLogger = mainLogger.child({ module: 'match' });
|
||||||
|
const DEFAULT_IMAGE = 'https://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Select profiles that:
|
||||||
|
* 1. aren't the current player
|
||||||
|
* 2. haven't been viewed before
|
||||||
|
* 3. have been viewed before but that was at least 7 days ago
|
||||||
|
* @param identifier - players identifier
|
||||||
|
* @returns - array of profiles
|
||||||
|
*/
|
||||||
|
async function getPotentialProfiles(identifier: string): Promise<Profile[]> {
|
||||||
|
const query = `
|
||||||
|
SELECT
|
||||||
|
npwd_match_profiles.*,
|
||||||
|
UNIX_TIMESTAMP(npwd_match_profiles.updatedAt) AS lastActive,
|
||||||
|
MaxDates.lastSeen
|
||||||
|
FROM npwd_match_profiles
|
||||||
|
LEFT OUTER JOIN (
|
||||||
|
SELECT id, profile, MAX(createdAt) AS lastSeen
|
||||||
|
FROM npwd_match_views
|
||||||
|
WHERE identifier = ?
|
||||||
|
GROUP BY id, profile
|
||||||
|
) AS MaxDates ON npwd_match_profiles.id = MaxDates.profile
|
||||||
|
WHERE npwd_match_profiles.identifier != ? AND
|
||||||
|
(MaxDates.lastSeen IS NULL OR MaxDates.lastSeen < NOW() - INTERVAL 7 DAY)
|
||||||
|
ORDER BY npwd_match_profiles.updatedAt DESC
|
||||||
|
LIMIT 25
|
||||||
|
`;
|
||||||
|
const [results] = await pool.query(query, [identifier, identifier]);
|
||||||
|
const profiles = <Profile[]>results;
|
||||||
|
return profiles;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save a list of Like objects
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @param likes - likes to be saved to the database
|
||||||
|
* @returns ResultSet
|
||||||
|
*/
|
||||||
|
async function saveLikes(identifier: string, likes: Like[]): Promise<ResultSetHeader[]> {
|
||||||
|
const query = `INSERT INTO npwd_match_views (identifier, profile, liked) VALUES ?`;
|
||||||
|
const formattedLikes = likes.map((like) => [identifier, like.id, like.liked]);
|
||||||
|
|
||||||
|
const results = await pool.query(query, [formattedLikes]);
|
||||||
|
const result = <ResultSetHeader[]>results;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if a profile we just liked has already liked us in the past which
|
||||||
|
* indicates a match has occurred
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @param id - profile ID we just liked
|
||||||
|
* @returns Profile[] - list of profiles that are a match
|
||||||
|
*/
|
||||||
|
async function checkForMatchById(identifier: string, id: number): Promise<Profile[]> {
|
||||||
|
const query = `
|
||||||
|
SELECT
|
||||||
|
targetProfile.*,
|
||||||
|
UNIX_TIMESTAMP(targetProfile.updatedAt) AS lastActive
|
||||||
|
FROM npwd_match_views
|
||||||
|
LEFT OUTER JOIN npwd_match_profiles AS playerProfile ON npwd_match_views.profile = playerProfile.id
|
||||||
|
LEFT OUTER JOIN npwd_match_profiles AS targetProfile ON npwd_match_views.identifier = targetProfile.identifier
|
||||||
|
WHERE playerProfile.identifier = ? AND targetProfile.id = ? AND Liked = 1
|
||||||
|
`;
|
||||||
|
const [results] = await pool.query(query, [identifier, id]);
|
||||||
|
return <Profile[]>results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Given a list of likes determine if any of the profiles we liked have also
|
||||||
|
* liked us which indicates a match has occurred.
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @param likes - list of new Likes
|
||||||
|
* @returns Profile[] - list of profiles we matched with
|
||||||
|
*/
|
||||||
|
async function findNewMatches(identifier: string, likes: Like[]): Promise<Profile[]> {
|
||||||
|
let matches: Profile[] = [];
|
||||||
|
for (const like of likes) {
|
||||||
|
if (!like.liked) continue;
|
||||||
|
const matchedProfiles = await checkForMatchById(identifier, like.id);
|
||||||
|
matches = matches.concat(matchedProfiles);
|
||||||
|
}
|
||||||
|
return matches;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return all matches associated with a player regardless of date/time. A
|
||||||
|
* match is a case where two profiles have liked each other.
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @returns Match[] - all matches associated with the current player
|
||||||
|
*/
|
||||||
|
async function findAllMatches(identifier: string): Promise<Match[]> {
|
||||||
|
const query = `
|
||||||
|
SELECT
|
||||||
|
targetProfile.*,
|
||||||
|
UNIX_TIMESTAMP(targetProfile.updatedAt) AS lastActive,
|
||||||
|
UNIX_TIMESTAMP(GREATEST(npwd_match_views.createdAt, targetViews.createdAt)) AS matchedAt,
|
||||||
|
targetUser.phone_number AS phoneNumber
|
||||||
|
FROM npwd_match_views
|
||||||
|
LEFT OUTER JOIN npwd_match_profiles AS targetProfile ON npwd_match_views.profile = targetProfile.id
|
||||||
|
LEFT OUTER JOIN npwd_match_profiles AS myProfile ON npwd_match_views.identifier = myProfile.identifier
|
||||||
|
LEFT OUTER JOIN npwd_match_views AS targetViews ON targetProfile.identifier = targetViews.identifier AND targetViews.profile = myProfile.id
|
||||||
|
LEFT OUTER JOIN users AS targetUser ON targetProfile.identifier = targetUser.identifier
|
||||||
|
WHERE npwd_match_views.identifier = ? AND npwd_match_views.liked = 1 AND targetViews.liked = 1
|
||||||
|
ORDER BY matchedAt DESC
|
||||||
|
`;
|
||||||
|
const [results] = await pool.query(query, [identifier]);
|
||||||
|
return <Match[]>results;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the current player's profile
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @returns Profile - player's current profile
|
||||||
|
*/
|
||||||
|
async function getPlayerProfile(identifier: string): Promise<Profile> {
|
||||||
|
const query = `
|
||||||
|
SELECT *,
|
||||||
|
UNIX_TIMESTAMP(updatedAt) AS lastActive
|
||||||
|
FROM npwd_match_profiles
|
||||||
|
WHERE identifier = ?
|
||||||
|
LIMIT 1
|
||||||
|
`;
|
||||||
|
const [results] = await pool.query(query, [identifier]);
|
||||||
|
const profiles = <Profile[]>results;
|
||||||
|
return profiles[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a profile and associate it with the current player
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @param profile - profile we are going to create
|
||||||
|
* @returns Profile - the created profile
|
||||||
|
*/
|
||||||
|
async function createProfile(identifier: string, profile: NewProfile): Promise<Profile> {
|
||||||
|
const { name, image, bio, location, job, tags } = profile;
|
||||||
|
const query = `
|
||||||
|
INSERT INTO npwd_match_profiles (identifier, name, image, bio, location, job, tags)
|
||||||
|
VALUES (?, ?, ?, ?, ?, ?, ?)
|
||||||
|
`;
|
||||||
|
|
||||||
|
await pool.execute(query, [identifier, name, image, bio, location, job, tags]);
|
||||||
|
return await getPlayerProfile(identifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the current player's profile
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @param profile Profile - player's updated profile
|
||||||
|
*/
|
||||||
|
async function updateProfile(identifier: string, profile: Profile): Promise<Profile> {
|
||||||
|
const { image, name, bio, location, job, tags } = profile;
|
||||||
|
const query = `
|
||||||
|
UPDATE npwd_match_profiles
|
||||||
|
SET image = ?, name = ?, bio = ?, location = ?, job = ?, tags = ?
|
||||||
|
WHERE identifier = ?
|
||||||
|
`;
|
||||||
|
await pool.execute(query, [image, name, bio, location, job, tags, identifier]);
|
||||||
|
return await getPlayerProfile(identifier);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a default profile for a player based on information
|
||||||
|
* associated with them (name, phone number, etc.)
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @returns Profile | null - the player's profile or null if it does not exist
|
||||||
|
* and could not be created
|
||||||
|
*/
|
||||||
|
async function createDefaultProfile(identifier: string): Promise<Profile | null> {
|
||||||
|
// case where the server owner wants players to select their own names
|
||||||
|
if (!config.match.generateProfileNameFromUsers) return null;
|
||||||
|
|
||||||
|
const defaultProfileName = await generateProfileName(identifier, ' ');
|
||||||
|
// case where we tried to generate a profile name but failed due to
|
||||||
|
// some database misconfiguration or error
|
||||||
|
if (!defaultProfileName) return null;
|
||||||
|
|
||||||
|
const defaultProfile = {
|
||||||
|
name: defaultProfileName,
|
||||||
|
image: DEFAULT_IMAGE,
|
||||||
|
bio: '',
|
||||||
|
location: '',
|
||||||
|
job: '',
|
||||||
|
tags: '',
|
||||||
|
};
|
||||||
|
|
||||||
|
matchLogger.info(`Creating default match profile ${defaultProfileName} for ${identifier}`);
|
||||||
|
return await createProfile(identifier, defaultProfile);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve the player's profile by their identifier if it exists. If
|
||||||
|
* not, create it and return it.
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
* @returns Profile - player's profile
|
||||||
|
*/
|
||||||
|
export async function getOrCreateProfile(identifier: string): Promise<Profile> {
|
||||||
|
const profile = await getPlayerProfile(identifier);
|
||||||
|
return profile || (await createDefaultProfile(identifier));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* We track when the player last used the app so other players can
|
||||||
|
* be aware of how active that player is when they are liking/disliking
|
||||||
|
* @param identifier - player's identifier
|
||||||
|
*/
|
||||||
|
async function updateLastActive(identifier: string): Promise<void> {
|
||||||
|
const query = `
|
||||||
|
UPDATE npwd_match_profiles
|
||||||
|
SET updatedAt = CURRENT_TIMESTAMP()
|
||||||
|
WHERE identifier = ?
|
||||||
|
`;
|
||||||
|
await pool.execute(query, [identifier]);
|
||||||
|
}
|
||||||
|
|
||||||
|
async function dispatchPlayerProfile(identifier: string, source: number): Promise<void> {
|
||||||
|
try {
|
||||||
|
const profile = await getOrCreateProfile(identifier);
|
||||||
|
emitNet(MatchEvents.GET_MY_PROFILE_SUCCESS, source, profile);
|
||||||
|
} catch (e) {
|
||||||
|
matchLogger.error(`Failed to get player profile, ${e.message}`);
|
||||||
|
emitNet(MatchEvents.GET_MY_PROFILE_FAILED, source, {
|
||||||
|
message: 'APPS_MATCH_GET_MY_PROFILE_FAILED',
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function dispatchProfiles(identifier: string, source: number): Promise<void> {
|
||||||
|
try {
|
||||||
|
const profiles = await getPotentialProfiles(identifier);
|
||||||
|
emitNet(MatchEvents.GET_PROFILES_SUCCESS, source, profiles);
|
||||||
|
} catch (e) {
|
||||||
|
matchLogger.error(`Failed to retrieve profiles, ${e.message}`);
|
||||||
|
emitNet(MatchEvents.GET_PROFILES_FAILED, source, {
|
||||||
|
message: 'APPS_MATCH_GET_PROFILES_FAILED',
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
onNet(MatchEvents.INITIALIZE, async () => {
|
||||||
|
const _source = getSource();
|
||||||
|
const identifier = getIdentifier(_source);
|
||||||
|
matchLogger.debug(`Initializing match for identifier: ${identifier}`);
|
||||||
|
|
||||||
|
await dispatchPlayerProfile(identifier, _source);
|
||||||
|
await dispatchProfiles(identifier, _source);
|
||||||
|
await updateLastActive(identifier);
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(MatchEvents.CREATE_MY_PROFILE, async (profile: Profile) => {
|
||||||
|
const _source = getSource();
|
||||||
|
const identifier = getIdentifier(_source);
|
||||||
|
matchLogger.debug(`Creating profile for identifier: ${identifier}`);
|
||||||
|
matchLogger.debug(profile);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!profile.name || !profile.name.trim()) {
|
||||||
|
throw new Error('Profile name must not be blank');
|
||||||
|
}
|
||||||
|
|
||||||
|
const newProfile = await createProfile(identifier, profile);
|
||||||
|
emitNet(MatchEvents.CREATE_MY_PROFILE_SUCCESS, _source, newProfile);
|
||||||
|
} catch (e) {
|
||||||
|
matchLogger.error(`Failed to update profile for identifier ${identifier}, ${e.message}`);
|
||||||
|
emitNet(MatchEvents.CREATE_MY_PROFILE_FAILED, _source, {
|
||||||
|
message: 'APPS_MATCH_CREATE_PROFILE_FAILED',
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(MatchEvents.UPDATE_MY_PROFILE, async (profile: Profile) => {
|
||||||
|
const _source = getSource();
|
||||||
|
const identifier = getIdentifier(_source);
|
||||||
|
matchLogger.debug(`Updating profile for identifier: ${identifier}`);
|
||||||
|
matchLogger.debug(profile);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (!profile.name || !profile.name.trim()) {
|
||||||
|
throw new Error('Profile name must not be blank');
|
||||||
|
}
|
||||||
|
|
||||||
|
const updatedProfile = await updateProfile(identifier, profile);
|
||||||
|
emitNet(MatchEvents.UPDATE_MY_PROFILE_SUCCESS, _source, updatedProfile);
|
||||||
|
} catch (e) {
|
||||||
|
matchLogger.error(`Failed to update profile for identifier ${identifier}, ${e.message}`);
|
||||||
|
emitNet(MatchEvents.UPDATE_MY_PROFILE_FAILED, _source, {
|
||||||
|
message: 'APPS_MATCH_UPDATE_PROFILE_FAILED',
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(MatchEvents.SAVE_LIKES, async (likes: Like[]) => {
|
||||||
|
const _source = getSource();
|
||||||
|
const identifier = getIdentifier(_source);
|
||||||
|
matchLogger.debug(`Saving likes for identifier ${identifier}`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
await saveLikes(identifier, likes);
|
||||||
|
} catch (e) {
|
||||||
|
matchLogger.error(`Failed to save likes, ${e.message}`);
|
||||||
|
emitNet(MatchEvents.SAVE_LIKES_FAILED, _source, {
|
||||||
|
message: 'APPS_MATCH_SAVE_LIKES_FAILED',
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const newMatches = await findNewMatches(identifier, likes);
|
||||||
|
if (newMatches.length > 0) {
|
||||||
|
emitNet(MatchEvents.NEW_MATCH, _source, {
|
||||||
|
message: 'APPS_MATCH_NEW_LIKE_FOUND',
|
||||||
|
type: 'info',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
matchLogger.error(`Failed to find new matches, ${e.message}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
onNet(MatchEvents.GET_MATCHES, async () => {
|
||||||
|
const _source = getSource();
|
||||||
|
const identifier = getIdentifier(_source);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const matchedProfiles = await findAllMatches(identifier);
|
||||||
|
emitNet(MatchEvents.GET_MATCHES_SUCCESS, _source, matchedProfiles);
|
||||||
|
} catch (e) {
|
||||||
|
matchLogger.error(`Failed to retrieve matches, ${e.message}`);
|
||||||
|
emitNet(MatchEvents.GET_MATCHES_FAILED, _source, {
|
||||||
|
message: 'APPS_MATCH_GET_MATCHES_FAILED',
|
||||||
|
type: 'error',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!config.match.allowEdtiableProfileName && !config.match.generateProfileNameFromUsers) {
|
||||||
|
const warning =
|
||||||
|
`Both allowEdtiableProfileName and generateProfileNameFromUsers ` +
|
||||||
|
`are set false - this means users will likely not have profile names ` +
|
||||||
|
`for the Match App and won't be able to use it!`;
|
||||||
|
matchLogger.warn(warning);
|
||||||
|
}
|
||||||
@@ -356,19 +356,29 @@ async function createMessageGroupsFromPhoneNumbers(
|
|||||||
): Promise<CreateMessageGroupResult> {
|
): Promise<CreateMessageGroupResult> {
|
||||||
// we check that each phoneNumber exists before we create the group
|
// we check that each phoneNumber exists before we create the group
|
||||||
const identifiers: string[] = [];
|
const identifiers: string[] = [];
|
||||||
|
const failedNumbers: string[] = [];
|
||||||
|
|
||||||
for (const phoneNumber of phoneNumbers) {
|
for (const phoneNumber of phoneNumbers) {
|
||||||
const identifier = await getIdentifierFromPhoneNumber(phoneNumber);
|
try {
|
||||||
identifiers.push(identifier);
|
const identifier = await getIdentifierFromPhoneNumber(phoneNumber);
|
||||||
|
identifiers.push(identifier);
|
||||||
|
} catch (e) {
|
||||||
|
failedNumbers.push(phoneNumber);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (phoneNumbers.length === failedNumbers.length) {
|
||||||
|
return { error: true, allNumbersFailed: true, failedNumbers };
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't allow explicitly adding yourself
|
// don't allow explicitly adding yourself
|
||||||
if (identifiers.some((identifier) => identifier === userIdentifier)) {
|
if (identifiers.some((identifier) => identifier === userIdentifier)) {
|
||||||
return { error: true, mine: true };
|
return { error: true, mine: true, failedNumbers };
|
||||||
}
|
}
|
||||||
|
|
||||||
const groupId = createGroupHashID([userIdentifier, ...identifiers]);
|
const groupId = createGroupHashID([userIdentifier, ...identifiers]);
|
||||||
if (await checkIfMessageGroupExists(groupId)) {
|
if (await checkIfMessageGroupExists(groupId)) {
|
||||||
return { error: false, duplicate: true, groupId, identifiers };
|
return { error: false, duplicate: true, groupId, identifiers, failedNumbers };
|
||||||
}
|
}
|
||||||
|
|
||||||
const queryPromises = [
|
const queryPromises = [
|
||||||
@@ -388,7 +398,7 @@ async function createMessageGroupsFromPhoneNumbers(
|
|||||||
// group exist while other are left off.
|
// group exist while other are left off.
|
||||||
await withTransaction(queryPromises);
|
await withTransaction(queryPromises);
|
||||||
|
|
||||||
return { error: false, groupId, identifiers };
|
return { error: false, groupId, identifiers, failedNumbers };
|
||||||
}
|
}
|
||||||
|
|
||||||
// getting the participants from groupId.
|
// getting the participants from groupId.
|
||||||
@@ -426,9 +436,10 @@ onNet(MessageEvents.CREATE_MESSAGE_GROUP, async (phoneNumbers: string[], label:
|
|||||||
const _identifier = getIdentifier(_source);
|
const _identifier = getIdentifier(_source);
|
||||||
const result = await createMessageGroupsFromPhoneNumbers(_identifier, phoneNumbers, label);
|
const result = await createMessageGroupsFromPhoneNumbers(_identifier, phoneNumbers, label);
|
||||||
|
|
||||||
if (result.error && result.duplicate) {
|
if (result.error && result.allNumbersFailed) {
|
||||||
|
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_FAILED, _source, result);
|
||||||
return emitNet(MessageEvents.ACTION_RESULT, _source, {
|
return emitNet(MessageEvents.ACTION_RESULT, _source, {
|
||||||
message: 'MESSAGES_MESSAGE_GROUP_DUPLICATE',
|
message: `APPS_MESSAGES_MESSAGE_GROUP_CREATE_ALL_NUMBERS_FAILED`,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -436,11 +447,27 @@ onNet(MessageEvents.CREATE_MESSAGE_GROUP, async (phoneNumbers: string[], label:
|
|||||||
if (result.error) {
|
if (result.error) {
|
||||||
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_FAILED, _source, result);
|
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_FAILED, _source, result);
|
||||||
return emitNet(MessageEvents.ACTION_RESULT, _source, {
|
return emitNet(MessageEvents.ACTION_RESULT, _source, {
|
||||||
message: `MESSAGES_MESSAGE_GROUP_CREATE_FAILED:`,
|
message: `APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED`,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (result.failedNumbers.length === 1) {
|
||||||
|
emitNet(MessageEvents.ACTION_RESULT, _source, {
|
||||||
|
message: `APPS_MESSAGES_MESSAGE_GROUP_CREATE_ONE_NUMBER_FAILED`,
|
||||||
|
type: 'warning',
|
||||||
|
options: { number: result.failedNumbers[0] },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (result.failedNumbers.length > 1) {
|
||||||
|
emitNet(MessageEvents.ACTION_RESULT, _source, {
|
||||||
|
message: `APPS_MESSAGES_MESSAGE_GROUP_CREATE_SOME_NUMBERS_FAILED`,
|
||||||
|
type: 'warning',
|
||||||
|
options: { numbers: result.failedNumbers.join(', ') },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_SUCCESS, _source, result);
|
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_SUCCESS, _source, result);
|
||||||
if (result.duplicate) {
|
if (result.duplicate) {
|
||||||
return;
|
return;
|
||||||
@@ -461,7 +488,7 @@ onNet(MessageEvents.CREATE_MESSAGE_GROUP, async (phoneNumbers: string[], label:
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_FAILED, _source);
|
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_FAILED, _source);
|
||||||
emitNet(MessageEvents.ACTION_RESULT, _source, {
|
emitNet(MessageEvents.ACTION_RESULT, _source, {
|
||||||
message: `MESSAGES_MESSAGE_GROUP_CREATE_FAILED:`,
|
message: `APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED`,
|
||||||
type: 'error',
|
type: 'error',
|
||||||
});
|
});
|
||||||
messageLogger.error(`Failed to create message group, ${e.message}`, {
|
messageLogger.error(`Failed to create message group, ${e.message}`, {
|
||||||
@@ -513,14 +540,8 @@ onNet(MessageEvents.SEND_MESSAGE, async (groupId: string, message: string, group
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Not really sure what this does? As I cant find any reference
|
|
||||||
// of this in the ui part.
|
|
||||||
emitNet(MessageEvents.SEND_MESSAGE_FAILED, _source);
|
|
||||||
// sending a new alert
|
|
||||||
// The message property is always using the locale strings without
|
|
||||||
// the APPS_ prefix.
|
|
||||||
emitNet(MessageEvents.ACTION_RESULT, _source, {
|
emitNet(MessageEvents.ACTION_RESULT, _source, {
|
||||||
message: 'MESSAGES_NEW_MESSAGE_FAILED',
|
message: 'APPS_MESSAGES_NEW_MESSAGE_FAILED',
|
||||||
type: 'error',
|
type: 'error',
|
||||||
});
|
});
|
||||||
messageLogger.error(`Failed to send message, ${e.message}`, {
|
messageLogger.error(`Failed to send message, ${e.message}`, {
|
||||||
|
|||||||
@@ -516,3 +516,11 @@ onNet(TwitterEvents.REPORT, async (tweetId: number) => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!config.twitter.allowEdtiableProfileName && !config.twitter.generateProfileNameFromUsers) {
|
||||||
|
const warning =
|
||||||
|
`Both allowEdtiableProfileName and generateProfileNameFromUsers ` +
|
||||||
|
`are set false - this means users will likely not have profile names ` +
|
||||||
|
`for the Twitter App and won't be able to use it!`;
|
||||||
|
twitterLogger.warn(warning);
|
||||||
|
}
|
||||||
Loaded 100 of 112 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user