mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-02 06:28:52 +00:00
Compare commits
33
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3697201afe | ||
|
|
833efedec4 | ||
|
|
ffd21c4e6d | ||
|
|
b1b83b5021 | ||
|
|
214da78056 | ||
|
|
b9243e9ca3 | ||
|
|
d15273b7b1 | ||
|
|
7b1d30f265 | ||
|
|
9610891a04 | ||
|
|
e6deff23da | ||
|
|
a0c5f94514 | ||
|
|
75500a01f8 | ||
|
|
2ee206b83e | ||
|
|
c3ee168d55 | ||
|
|
8b746c8185 | ||
|
|
d363866a34 | ||
|
|
289207beb9 | ||
|
|
8bfdc1b8b2 | ||
|
|
d315d72e93 | ||
|
|
2992a644fe | ||
|
|
2b633c9e80 | ||
|
|
dab4c1eaf7 | ||
|
|
48e0dd2443 | ||
|
|
3157cafd5a | ||
|
|
c82a48b012 | ||
|
|
4d46566811 | ||
|
|
ee7e3a3ae1 | ||
|
|
31241c7e8f | ||
|
|
5f2dce2dda | ||
|
|
107dc43624 | ||
|
|
f27e486ff5 | ||
|
|
a88286f97a | ||
|
|
baf6dedb6f |
No files matched your search
+2
-2
@@ -68,7 +68,7 @@ CREATE TABLE IF NOT EXISTS `npwd_match_profiles` (
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name_UNIQUE` (`name`),
|
||||
UNIQUE KEY `identifier_UNIQUE` (`identifier`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `npwd_match_views` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
@@ -80,7 +80,7 @@ CREATE TABLE IF NOT EXISTS `npwd_match_views` (
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `match_profile_idx` (`profile`),
|
||||
CONSTRAINT `match_profile` FOREIGN KEY (`profile`) REFERENCES `npwd_match_profiles` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_notes (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
|
||||
+14
-9
@@ -5,7 +5,6 @@ import { Route } from 'react-router-dom';
|
||||
import { CallModal } from './os/call/components/CallModal';
|
||||
import { HomeApp } from './apps/home/components/Home';
|
||||
import { Box, Paper, Slide, Typography } from '@material-ui/core';
|
||||
import { useKeyboardService } from './os/keyboard/hooks/useKeyboardService';
|
||||
import { NotificationBar } from './os/notifications/components/NotificationBar';
|
||||
import { Navigation } from './os/navigation-bar/components/Navigation';
|
||||
import { useNuiService } from './os/nui-events/hooks/useNuiService';
|
||||
@@ -16,7 +15,7 @@ import { useApps } from './os/apps/hooks/useApps';
|
||||
import { useContactsService } from './apps/contacts/hooks/useContactsService';
|
||||
import { useTwitterService } from './apps/twitter/hooks/useTwitterService';
|
||||
import { useMatchService } from './apps/match/hooks/useMatchService';
|
||||
import { useSelloutService } from './apps/sellout/hooks/useSelloutService';
|
||||
import { useMarketplaceService } from './apps/marketplace/hooks/useMarketplaceService';
|
||||
import { useBankService } from './apps/bank/hooks/useBankService';
|
||||
import { useMessagesService } from './apps/messages/hooks/useMessageService';
|
||||
import { useNotesService } from './apps/notes/hooks/useNotesService';
|
||||
@@ -33,6 +32,8 @@ import WindowSnackbar from './ui/components/WindowSnackbar';
|
||||
import { usePhone } from './os/phone/hooks/usePhone';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSnackbar } from './ui/hooks/useSnackbar';
|
||||
import { PhoneEvents } from '../../typings/phone';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
function Phone() {
|
||||
const { t, i18n } = useTranslation();
|
||||
@@ -62,13 +63,12 @@ function Phone() {
|
||||
}, []);
|
||||
|
||||
useNuiService();
|
||||
useKeyboardService();
|
||||
usePhoneService();
|
||||
useSimcardService();
|
||||
useContactsService();
|
||||
useTwitterService();
|
||||
useMatchService();
|
||||
useSelloutService();
|
||||
useMarketplaceService();
|
||||
useBankService();
|
||||
useMessagesService();
|
||||
useNotesService();
|
||||
@@ -104,8 +104,8 @@ function Phone() {
|
||||
id="phone"
|
||||
className="PhoneScreen"
|
||||
style={{
|
||||
backgroundImage: settings.customBackground.value
|
||||
? `url(${settings.customBackground.value})`
|
||||
backgroundImage: settings.customWallpaper
|
||||
? `url(${settings.customWallpaper})`
|
||||
: `url(media/backgrounds/${settings.wallpaper.value})`,
|
||||
}}
|
||||
>
|
||||
@@ -151,15 +151,20 @@ function Phone() {
|
||||
|
||||
export default Phone;
|
||||
|
||||
InjectDebugData([
|
||||
InjectDebugData<any>([
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: 'setVisibility',
|
||||
method: PhoneEvents.SET_VISIBILITY,
|
||||
data: true,
|
||||
},
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: 'setPhoneReady',
|
||||
method: PhoneEvents.SET_PHONE_READY,
|
||||
data: true,
|
||||
},
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: PhoneEvents.SET_TIME,
|
||||
data: dayjs().format('hh:mm'),
|
||||
},
|
||||
]);
|
||||
@@ -7,7 +7,6 @@ import { useBankNotification } from './useBankNotification';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { BankEvents } from '../../../../../typings/bank';
|
||||
import { PhoneEvents } from '../../../../../typings/phone';
|
||||
|
||||
export const useBankService = () => {
|
||||
const setTransaction = useSetRecoilState(bankState.transactions);
|
||||
|
||||
@@ -5,11 +5,12 @@ import { GalleryGrid } from './grid/GalleryGrid';
|
||||
import { GalleryModal } from './modal/GalleryModal';
|
||||
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import { PhotoEvents } from '../../../../../typings/photo';
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'CAMERA',
|
||||
method: 'setPhotos',
|
||||
method: PhotoEvents.SEND_PHOTOS,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
|
||||
@@ -7,9 +7,8 @@ import ShareIcon from '@material-ui/icons/Share';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
|
||||
import { ICameraPhoto } from '../../hooks/usePhotos';
|
||||
import { ShareModal } from './ShareModal';
|
||||
import { PhotoEvents } from '../../../../../../typings/photo';
|
||||
import { IPhoto, PhotoEvents } from '../../../../../../typings/photo';
|
||||
|
||||
export const GalleryModal = () => {
|
||||
const classes = useStyles();
|
||||
@@ -19,10 +18,9 @@ export const GalleryModal = () => {
|
||||
|
||||
const [shareOpen, setShareOpen] = useState(null);
|
||||
|
||||
const meta: ICameraPhoto = useMemo(
|
||||
() => ({ id: query.id as string, image: query.image as string }),
|
||||
[query],
|
||||
);
|
||||
const meta: IPhoto = useMemo(() => ({ id: parseInt(query.id), image: query.image as string }), [
|
||||
query,
|
||||
]);
|
||||
|
||||
const _handleClose = () => {
|
||||
history.push(referal);
|
||||
|
||||
@@ -5,11 +5,11 @@ import MessageIcon from '@material-ui/icons/Message';
|
||||
import { setClipboard } from '../../../../os/phone/hooks/useClipboard';
|
||||
|
||||
import useStyles from './modal.styles';
|
||||
import { ICameraPhoto } from '../../hooks/usePhotos';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { IPhoto } from '../../../../../../typings/photo';
|
||||
|
||||
interface IShareModalProps {
|
||||
meta: ICameraPhoto;
|
||||
meta: IPhoto;
|
||||
referal: string;
|
||||
onClose(): void;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { atom } from 'recoil';
|
||||
import { IPhoto } from '../../../../../typings/photo';
|
||||
|
||||
export const photoState = {
|
||||
photos: atom({
|
||||
photos: atom<IPhoto[]>({
|
||||
key: 'galleryPhotos',
|
||||
default: null,
|
||||
default: [],
|
||||
}),
|
||||
};
|
||||
@@ -1,8 +1,9 @@
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { photoState } from './state';
|
||||
import { PhotoEvents } from '../../../../../typings/photo';
|
||||
|
||||
export const usePhotoService = () => {
|
||||
const setPhotos = useSetRecoilState(photoState.photos);
|
||||
useNuiEvent('CAMERA', 'setPhotos', setPhotos);
|
||||
useNuiEvent('CAMERA', PhotoEvents.SEND_PHOTOS, setPhotos);
|
||||
};
|
||||
@@ -1,11 +1,6 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { photoState } from './state';
|
||||
|
||||
export interface ICameraPhoto {
|
||||
id: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
export const usePhotos = (): ICameraPhoto[] | null => {
|
||||
return useRecoilValue<ICameraPhoto[] | null>(photoState.photos);
|
||||
export const usePhotos = () => {
|
||||
return useRecoilValue(photoState.photos);
|
||||
};
|
||||
@@ -9,6 +9,7 @@ import { Route } from 'react-router-dom';
|
||||
import ContactsInfoPage from './views/ContactInfo';
|
||||
import { ContactPage } from './views/ContactsPage';
|
||||
import { ContactsThemeProvider } from '../providers/ContactsThemeProvider';
|
||||
import { ContactEvents } from '../../../../../typings/contact';
|
||||
|
||||
export const ContactsApp = () => {
|
||||
const contacts = useApp('CONTACTS');
|
||||
@@ -29,7 +30,7 @@ export const ContactsApp = () => {
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'CONTACTS',
|
||||
method: 'setContacts',
|
||||
method: ContactEvents.SEND_CONTACTS,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
|
||||
@@ -1,24 +1,17 @@
|
||||
import { atom } from 'recoil';
|
||||
import { Contact } from '../../../../../typings/contact';
|
||||
|
||||
export const contactsState = {
|
||||
contacts: atom({
|
||||
contacts: atom<Contact[]>({
|
||||
key: 'contactsList',
|
||||
default: [],
|
||||
}),
|
||||
showModal: atom({
|
||||
showModal: atom<boolean>({
|
||||
key: 'showModal',
|
||||
default: false,
|
||||
}),
|
||||
filterContacts: atom({
|
||||
filterContacts: atom<string>({
|
||||
key: 'filterContacts',
|
||||
default: '',
|
||||
}),
|
||||
showContactsModal: atom({
|
||||
key: 'showContactModal',
|
||||
default: false,
|
||||
}),
|
||||
contactDetail: atom({
|
||||
key: 'contactDetail',
|
||||
default: null,
|
||||
}),
|
||||
};
|
||||
@@ -3,7 +3,7 @@ import { contactsState } from './state';
|
||||
|
||||
interface FilterdContactsProps {
|
||||
filteredContacts: string;
|
||||
setFilteredContacts: (contact: any) => void;
|
||||
setFilteredContacts: (searchTerm: string) => void;
|
||||
}
|
||||
|
||||
export const useFilteredContacts = (): FilterdContactsProps => {
|
||||
|
||||
@@ -11,6 +11,7 @@ import { useDialHistory } from '../hooks/useDialHistory';
|
||||
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||
import { ContactList } from '../../contacts/components/List/ContactList';
|
||||
import { DialerThemeProvider } from '../providers/DialerThemeProvider';
|
||||
import { CallEvents } from '../../../../../typings/call';
|
||||
|
||||
export const DialerApp = () => {
|
||||
const history = useDialHistory();
|
||||
@@ -40,7 +41,7 @@ export const DialerApp = () => {
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'DIALER',
|
||||
method: 'setHistory',
|
||||
method: CallEvents.SET_CALL_HISTORY,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
|
||||
@@ -7,6 +7,7 @@ import { DialInputCtx, IDialInputCtx } from '../context/InputContext';
|
||||
import Nui from '../../../os/nui-events/utils/Nui';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { CallEvents } from '../../../../../typings/call';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
root: {
|
||||
@@ -30,6 +31,7 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||
export const DialerInput = () => {
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { inputVal, set } = useContext<IDialInputCtx>(DialInputCtx);
|
||||
|
||||
@@ -46,7 +48,7 @@ export const DialerInput = () => {
|
||||
return (
|
||||
<Box component={Paper} className={classes.root}>
|
||||
<InputBase
|
||||
placeholder="Enter a number"
|
||||
placeholder={t('APPS_DIALER_INPUT_PLACEHOLDER')}
|
||||
className={classes.input}
|
||||
value={inputVal}
|
||||
onChange={(e) => set(e.target.value)}
|
||||
|
||||
@@ -5,6 +5,7 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import PhoneIcon from '@material-ui/icons/Phone';
|
||||
import PersonIcon from '@material-ui/icons/Person';
|
||||
import HistoryIcon from '@material-ui/icons/History';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
root: {
|
||||
@@ -20,6 +21,7 @@ const DialerNavBar = () => {
|
||||
const classes = useStyles();
|
||||
const { pathname } = useLocation();
|
||||
const [page, setPage] = useState(pathname);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleChange = (_e, newPage) => {
|
||||
setPage(newPage);
|
||||
@@ -28,14 +30,14 @@ const DialerNavBar = () => {
|
||||
return (
|
||||
<BottomNavigation value={page} onChange={handleChange} showLabels className={classes.root}>
|
||||
<BottomNavigationAction
|
||||
label="History"
|
||||
label={t('APPS_DIALER_NAVBAR_HISTORY')}
|
||||
value="/phone"
|
||||
component={NavLink}
|
||||
icon={<HistoryIcon />}
|
||||
to="/phone"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
label="Dial"
|
||||
label={t('APPS_DIALER_NAVBAR_DIAL')}
|
||||
value="/phone/dial"
|
||||
color="secondary"
|
||||
component={NavLink}
|
||||
@@ -43,7 +45,7 @@ const DialerNavBar = () => {
|
||||
to="/phone/dial"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
label="Contacts"
|
||||
label={t('APPS_DIALER_NAVBAR_CONTACTS')}
|
||||
value="/phone/contacts"
|
||||
color="secondary"
|
||||
component={NavLink}
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ListItem } from '../../../../ui/components/ListItem';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useSimcard } from '../../../../os/simcard/hooks/useSimcard';
|
||||
import { useContacts } from '../../../contacts/hooks/useContacts';
|
||||
import { CallEvents, ICall } from '../../../../../../typings/call';
|
||||
import { CallEvents, CallHistoryItem } from '../../../../../../typings/call';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Box, IconButton, ListItemIcon, ListItemText } from '@material-ui/core';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
@@ -55,7 +55,7 @@ export const DialerHistory = ({ calls }) => {
|
||||
|
||||
return (
|
||||
<List disablePadding>
|
||||
{calls.map((call: ICall) =>
|
||||
{calls.map((call: CallHistoryItem) =>
|
||||
call.transmitter === myNumber ? (
|
||||
<ListItem key={call.id} divider>
|
||||
<ListItemIcon>
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { atom } from 'recoil';
|
||||
import { CallHistoryItem } from '../../../../../typings/call';
|
||||
|
||||
export const dialState = {
|
||||
history: atom({
|
||||
history: atom<CallHistoryItem[]>({
|
||||
key: 'dialHistory',
|
||||
default: [],
|
||||
}),
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { ICall } from '../../../../../typings/call';
|
||||
import { dialState } from './state';
|
||||
|
||||
export const useDialHistory = () => {
|
||||
return useRecoilValue<ICall[]>(dialState.history);
|
||||
return useRecoilValue(dialState.history);
|
||||
};
|
||||
+14
-12
@@ -1,42 +1,44 @@
|
||||
import React from 'react';
|
||||
import { AppWrapper } from '../../../ui/components/AppWrapper';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import { SelloutTitle } from './SelloutTitle';
|
||||
import { SelloutListContainer } from './SelloutList/SelloutListContainer';
|
||||
import { MarketplaceTitle } from './MarketplaceTitle';
|
||||
import { MarketplaceListContainer } from './SelloutList/MarketplaceListContainer';
|
||||
import { NavigationBar } from './navigation/NavigationBar';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
import { ListingFormContainer } from './form/ListingFormContainer';
|
||||
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 (
|
||||
<SelloutThemeProvider>
|
||||
<MarketplaceThemeProvider>
|
||||
<AppWrapper id="sellout-app">
|
||||
<SelloutTitle />
|
||||
<MarketplaceTitle />
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<Route path="/sellout" exact component={SelloutListContainer} />
|
||||
<Route path="/sellout/new" component={ListingFormContainer} />
|
||||
<Route path="/marketplace" exact component={MarketplaceListContainer} />
|
||||
<Route path="/marketplace/new" component={ListingFormContainer} />
|
||||
</Switch>
|
||||
</AppContent>
|
||||
<NavigationBar />
|
||||
</AppWrapper>
|
||||
</SelloutThemeProvider>
|
||||
</MarketplaceThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'SELLOUT',
|
||||
method: 'setListings',
|
||||
method: MarketplaceEvents.SEND_LISTING,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Some guy',
|
||||
number: '111-1134',
|
||||
title: 'Car',
|
||||
description: 'Selling this cool car',
|
||||
title: 'eeeeeeeeeeeeeeeeeeeeeeeee',
|
||||
description:
|
||||
'skldfsdEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
|
||||
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();
|
||||
return (
|
||||
<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,
|
||||
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();
|
||||
|
||||
return (
|
||||
@@ -62,7 +70,7 @@ export const SelloutItem = (listing: MarketplaceListing) => {
|
||||
</Typography>
|
||||
)}
|
||||
|
||||
<Typography variant="h6" style={{ padding: 10 }}>
|
||||
<Typography variant="body1" className={classes.listingContent}>
|
||||
{listing.description}
|
||||
</Typography>
|
||||
<ListingActions listing={listing} />
|
||||
+3
-3
@@ -1,15 +1,15 @@
|
||||
import React from 'react';
|
||||
import { List } from '../../../../ui/components/List';
|
||||
import { useListing } from '../../hooks/useListing';
|
||||
import { SelloutItem } from './SelloutItem';
|
||||
import { MarketplaceItem } from './MarketplaceItem';
|
||||
|
||||
export const SelloutList = () => {
|
||||
export const MarketplaceList = () => {
|
||||
const listings = useListing();
|
||||
|
||||
return (
|
||||
<List>
|
||||
{listings.map((listing) => (
|
||||
<SelloutItem key={listing.id} {...listing} />
|
||||
<MarketplaceItem key={listing.id} {...listing} />
|
||||
))}
|
||||
</List>
|
||||
);
|
||||
@@ -0,0 +1,6 @@
|
||||
import React from 'react';
|
||||
import { MarketplaceList } from './MarketplaceList';
|
||||
|
||||
export const MarketplaceListContainer = () => {
|
||||
return <MarketplaceList />;
|
||||
};
|
||||
+38
-11
@@ -2,6 +2,9 @@ import React, { useState } from 'react';
|
||||
import { makeStyles, Button, TextField } from '@material-ui/core';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
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) => ({
|
||||
root: {
|
||||
@@ -29,17 +32,28 @@ const useStyles = makeStyles((theme) => ({
|
||||
|
||||
export const ListingForm = () => {
|
||||
const classes = useStyles();
|
||||
const { t } = useTranslation();
|
||||
const { addAlert } = useSnackbar();
|
||||
const history = useHistory();
|
||||
|
||||
const [title, setTitle] = useState('');
|
||||
const [url, setUrl] = useState('');
|
||||
const [description, setDescription] = useState('');
|
||||
|
||||
const addListing = () => {
|
||||
Nui.send(MarketplaceEvents.ADD_LISTING, {
|
||||
title,
|
||||
url,
|
||||
description,
|
||||
});
|
||||
if (title !== '' && description !== '') {
|
||||
Nui.send(MarketplaceEvents.ADD_LISTING, {
|
||||
title,
|
||||
url,
|
||||
description,
|
||||
});
|
||||
history.push('/marketplace');
|
||||
} else {
|
||||
addAlert({
|
||||
message: t('APPS_MARKETPLACE_REQUIRED_FIELDS'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -48,15 +62,22 @@ export const ListingForm = () => {
|
||||
<TextField
|
||||
className={classes.input}
|
||||
onChange={(e) => setTitle(e.target.value)}
|
||||
placeholder="Title on listing.."
|
||||
inputProps={{ className: classes.textFieldInput }}
|
||||
label={t('GENERIC_REQUIRED')}
|
||||
placeholder={t('APPS_MARKETPLACE_FORM_TITLE')}
|
||||
inputProps={{
|
||||
className: classes.textFieldInput,
|
||||
maxLength: 25,
|
||||
}}
|
||||
style={{ width: '80%' }}
|
||||
size="medium"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
/>
|
||||
|
||||
<TextField
|
||||
className={classes.input}
|
||||
placeholder="Image URL"
|
||||
placeholder={t('APPS_MARKETPLACE_FORM_IMAGE')}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
inputProps={{ className: classes.textFieldInput }}
|
||||
style={{ width: '80%' }}
|
||||
@@ -67,15 +88,21 @@ export const ListingForm = () => {
|
||||
<TextField
|
||||
className={classes.input}
|
||||
onChange={(e) => setDescription(e.target.value)}
|
||||
placeholder="Description"
|
||||
inputProps={{ className: classes.multilineFieldInput }}
|
||||
label={t('GENERIC_REQUIRED')}
|
||||
placeholder={t('APPS_MARKETPLACE_FORM_DESCRIPTION')}
|
||||
inputProps={{
|
||||
className: classes.multilineFieldInput,
|
||||
maxLength: 130,
|
||||
}}
|
||||
style={{ width: '80%' }}
|
||||
size="medium"
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
multiline
|
||||
rows={4}
|
||||
variant="outlined"
|
||||
/>
|
||||
|
||||
<Button onClick={addListing} className={classes.postButton}>
|
||||
Post
|
||||
</Button>
|
||||
File renamed without changes.
+2
-2
@@ -31,9 +31,9 @@ export const NavigationBar = () => {
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { atom } from 'recoil';
|
||||
import { MarketplaceListing } from '../../../../../typings/marketplace';
|
||||
|
||||
export const selloutState = {
|
||||
listing: atom<MarketplaceListing[]>({
|
||||
key: 'listing',
|
||||
default: [],
|
||||
}),
|
||||
};
|
||||
File renamed without changes.
+1
-1
@@ -6,7 +6,7 @@ import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { MarketplaceEvents } from '../../../../../typings/marketplace';
|
||||
|
||||
export const useSelloutService = () => {
|
||||
export const useMarketplaceService = () => {
|
||||
const setSellout = useSetRecoilState(selloutState.listing);
|
||||
const { addAlert } = useSnackbar();
|
||||
const { t } = useTranslation();
|
||||
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);
|
||||
@@ -15,8 +15,6 @@ const useStyles = makeStyles({
|
||||
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 />} />
|
||||
|
||||
@@ -54,7 +54,7 @@ InjectDebugData(
|
||||
[
|
||||
{
|
||||
app: 'MATCH',
|
||||
method: 'phone:getMatchProfilesSuccess',
|
||||
method: MatchEvents.GET_PROFILES_SUCCESS,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
@@ -102,7 +102,7 @@ InjectDebugData(
|
||||
},
|
||||
{
|
||||
app: 'MATCH',
|
||||
method: 'phone:getMyProfileSuccess',
|
||||
method: MatchEvents.GET_MY_PROFILE_SUCCESS,
|
||||
data: {
|
||||
id: 4,
|
||||
image:
|
||||
@@ -120,7 +120,7 @@ InjectDebugData(
|
||||
},
|
||||
{
|
||||
app: 'MATCH',
|
||||
method: 'phone:getMatchesSuccess',
|
||||
method: MatchEvents.GET_MATCHES_SUCCESS,
|
||||
data: [
|
||||
{
|
||||
id: 5,
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { atom } from 'recoil';
|
||||
import { FormattedMatch, FormattedProfile } from '../../../../../typings/match';
|
||||
|
||||
export const matchState = {
|
||||
profiles: atom({
|
||||
profiles: atom<FormattedProfile[]>({
|
||||
key: 'profiles',
|
||||
default: null,
|
||||
}),
|
||||
@@ -9,19 +10,19 @@ export const matchState = {
|
||||
key: 'errorLoadingProfiles',
|
||||
default: false,
|
||||
}),
|
||||
matches: atom({
|
||||
matches: atom<FormattedMatch[]>({
|
||||
key: 'matches',
|
||||
default: null,
|
||||
}),
|
||||
errorLoadingMatches: atom({
|
||||
errorLoadingMatches: atom<boolean>({
|
||||
key: 'errorLoadingMatches',
|
||||
default: false,
|
||||
}),
|
||||
myProfile: atom({
|
||||
myProfile: atom<FormattedProfile | null>({
|
||||
key: 'myProfile',
|
||||
default: null,
|
||||
}),
|
||||
noProfileExists: atom({
|
||||
noProfileExists: atom<boolean>({
|
||||
key: 'noProfileExists',
|
||||
default: false,
|
||||
}),
|
||||
|
||||
@@ -53,7 +53,7 @@ export const MessagesApp = () => {
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'MESSAGES',
|
||||
method: 'phone:fetchMessageGroupsSuccess',
|
||||
method: MessageEvents.FETCH_MESSAGE_GROUPS_SUCCESS,
|
||||
data: [
|
||||
{
|
||||
groupId: '2',
|
||||
@@ -93,7 +93,7 @@ InjectDebugData(
|
||||
[
|
||||
{
|
||||
app: 'MESSAGES',
|
||||
method: 'phone:fetchMessagesSuccess',
|
||||
method: MessageEvents.FETCH_MESSAGES_SUCCESS,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Box, Button, TextField } from '@material-ui/core';
|
||||
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { Autocomplete } from '@material-ui/lab';
|
||||
import { useContacts } from '../../../contacts/hooks/useContacts';
|
||||
import { Contact } from '../../../../../../typings/contact';
|
||||
import { MessageEvents } from '../../../../../../typings/messages';
|
||||
import { PHONE_NUMBER_REGEX } from '../../../../../../typings/phone';
|
||||
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
|
||||
|
||||
const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
const history = useHistory();
|
||||
const { t } = useTranslation();
|
||||
const { addAlert } = useSnackbar();
|
||||
const [participants, setParticipants] = useState([]);
|
||||
const [label, setLabel] = useState('');
|
||||
const { getContactByNumber, contacts } = useContacts();
|
||||
@@ -45,6 +47,10 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
const onAutocompleteChange = (_e, value: any) => {
|
||||
const lastIdx = value.length - 1;
|
||||
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] });
|
||||
setParticipants(value);
|
||||
return;
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Box, List } from '@material-ui/core';
|
||||
import { MessageEvents, MessageGroup } from '../../../../../../typings/messages';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { MessageGroup } from '../../../../../../typings/messages';
|
||||
import useMessages from '../../hooks/useMessages';
|
||||
import MessageGroupItem from './MessageGroupItem';
|
||||
import useStyles from './list.styles';
|
||||
|
||||
@@ -1,32 +1,33 @@
|
||||
import { atom } from 'recoil';
|
||||
import { CreateMessageGroupResult, Message, MessageGroup } from '../../../../../typings/messages';
|
||||
|
||||
export const messageState = {
|
||||
messageGroups: atom({
|
||||
messageGroups: atom<MessageGroup[]>({
|
||||
key: 'messageGroups',
|
||||
default: null,
|
||||
default: [],
|
||||
}),
|
||||
messages: atom({
|
||||
messages: atom<Message[]>({
|
||||
key: 'messages',
|
||||
default: null,
|
||||
}),
|
||||
activeMessageGroup: atom({
|
||||
activeMessageGroup: atom<MessageGroup>({
|
||||
key: 'activeMessageGroup',
|
||||
default: null,
|
||||
}),
|
||||
showNewMessageGroup: atom({
|
||||
showNewMessageGroup: atom<boolean>({
|
||||
key: 'showNewMessageGroup',
|
||||
default: false,
|
||||
}),
|
||||
createMessageGroupResult: atom({
|
||||
createMessageGroupResult: atom<CreateMessageGroupResult>({
|
||||
key: 'createMessageGroupResult',
|
||||
default: null,
|
||||
}),
|
||||
imageModal: atom({
|
||||
imageModal: atom<boolean>({
|
||||
key: 'useImageModal',
|
||||
default: false,
|
||||
}),
|
||||
unreadMessagesCount: atom({
|
||||
unreadMessagesCount: atom<number>({
|
||||
key: 'unreadMessagesCount',
|
||||
default: 0,
|
||||
})
|
||||
}),
|
||||
};
|
||||
@@ -1,4 +1,3 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { matchPath, useHistory } from 'react-router-dom';
|
||||
import { useApp } from '../../../os/apps/hooks/useApps';
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useCallback } from 'react';
|
||||
import Nui from '../../../os/nui-events/utils/Nui';
|
||||
import { useLocation } from 'react-router';
|
||||
import { MessageEvents } from '../../../../../typings/messages';
|
||||
import { TOptionsBase } from 'i18next';
|
||||
|
||||
export const useMessagesService = () => {
|
||||
const { pathname } = useLocation();
|
||||
@@ -22,9 +23,9 @@ export const useMessagesService = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleAddAlert = useCallback(
|
||||
({ message, type }: IAlert) => {
|
||||
({ message, type, options = {} }: IAlert & { options: TOptionsBase }) => {
|
||||
addAlert({
|
||||
message: t(`APPS_${message}`),
|
||||
message: t(`${message}`, options),
|
||||
type,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -14,7 +14,7 @@ interface IUseMessages {
|
||||
activeMessageGroup: MessageGroup | null;
|
||||
}
|
||||
|
||||
export default (): IUseMessages => {
|
||||
export default function useMessages(): IUseMessages {
|
||||
const [messages, setMessages] = useRecoilState<Message[] | null>(messageState.messages);
|
||||
const messageGroups = useRecoilValue<MessageGroup[] | null>(messageState.messageGroups);
|
||||
const [activeMessageGroup, _setActiveMessageGroup] = useRecoilState<MessageGroup | null>(
|
||||
@@ -54,4 +54,4 @@ export default (): IUseMessages => {
|
||||
activeMessageGroup,
|
||||
setActiveMessageGroup,
|
||||
};
|
||||
};
|
||||
}
|
||||
@@ -12,6 +12,7 @@ import useStyles from './notes.styles';
|
||||
import InjectDebugData from '../../os/debug/InjectDebugData';
|
||||
import { NotesThemeProvider } from './providers/NotesThemeProvider';
|
||||
import { Route, useHistory } from 'react-router-dom';
|
||||
import { NotesEvents } from '../../../../typings/notes';
|
||||
|
||||
export const NotesApp = () => {
|
||||
const classes = useStyles();
|
||||
@@ -43,7 +44,7 @@ export const NotesApp = () => {
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'NOTES',
|
||||
method: 'setNotes',
|
||||
method: NotesEvents.SEND_NOTE,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import React from 'react';
|
||||
import { SelloutList } from './SelloutList';
|
||||
|
||||
export const SelloutListContainer = () => {
|
||||
return <SelloutList />;
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
export const selloutState = {
|
||||
listing: atom({
|
||||
key: 'listing',
|
||||
default: [],
|
||||
}),
|
||||
};
|
||||
@@ -1,5 +0,0 @@
|
||||
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||
|
||||
import selloutTheme from '../sellout.theme';
|
||||
|
||||
export const SelloutThemeProvider = createAppThemeProvider(selloutTheme);
|
||||
@@ -1,4 +1,4 @@
|
||||
import React, { useState } from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
ListItem,
|
||||
ListItemText,
|
||||
@@ -10,8 +10,8 @@ import {
|
||||
Tooltip,
|
||||
Typography,
|
||||
Switch,
|
||||
TextField,
|
||||
} from '@material-ui/core';
|
||||
import CreateIcon from '@material-ui/icons/Create';
|
||||
|
||||
interface ISettingItem {
|
||||
options?: any;
|
||||
@@ -108,11 +108,14 @@ export const SettingItemIconAction = ({
|
||||
</>
|
||||
);
|
||||
|
||||
export const SettingItemInput = ({ icon, label, onChange }) => (
|
||||
<>
|
||||
<ListItem divider>
|
||||
<ListItemIcon>{icon}</ListItemIcon>
|
||||
<TextField placeholder="Custom background" value={label} onChange={onChange} />
|
||||
</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>
|
||||
);
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
SettingItemIconAction,
|
||||
SettingItemSlider,
|
||||
SettingSwitch,
|
||||
SettingItemInput,
|
||||
SettingItemModal,
|
||||
} from './SettingItem';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import VisibilityOffIcon from '@material-ui/icons/VisibilityOff';
|
||||
@@ -28,14 +28,14 @@ import {
|
||||
FileCopy,
|
||||
Book,
|
||||
DeleteForever,
|
||||
InsertPhoto,
|
||||
} from '@material-ui/icons';
|
||||
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
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 { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { IContextMenuOption } from '../../../ui/components/ContextMenu';
|
||||
import WallpaperModal from './WallpaperModal';
|
||||
|
||||
const SubHeaderComp = (props: { text: string }) => (
|
||||
<ListSubheader color="primary" component="div" disableSticky>
|
||||
@@ -43,12 +43,26 @@ const SubHeaderComp = (props: { text: string }) => (
|
||||
</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 = () => {
|
||||
const settingsApp = useApp('SETTINGS');
|
||||
const [config] = useConfig();
|
||||
const simcard = useSimcard();
|
||||
const [settings, setSettings] = useSettings();
|
||||
const { t } = useTranslation();
|
||||
const { customWallpaperModal, setCustomWallpaperModal } = useCustomWallpaperModal();
|
||||
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
@@ -124,12 +138,13 @@ export const SettingsApp = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const setCustomBackground = () => {};
|
||||
|
||||
const [openMenu, closeMenu, ContextMenu, isMenuOpen] = useContextMenu();
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<AppWrapper>
|
||||
<AppTitle app={settingsApp} />
|
||||
<WallpaperModal />
|
||||
<div className={customWallpaperModal ? classes.backgroundModal : undefined} />
|
||||
<AppContent backdrop={isMenuOpen} onClickBackdrop={closeMenu}>
|
||||
<List disablePadding subheader={<SubHeaderComp text={t('SETTINGS.CATEGORY.PHONE')} />}>
|
||||
<SettingItemIconAction
|
||||
@@ -196,13 +211,15 @@ export const SettingsApp = () => {
|
||||
value={settings.wallpaper.label}
|
||||
options={wallpapers}
|
||||
onClick={openMenu}
|
||||
icon={<InsertPhoto />}
|
||||
/>
|
||||
<SettingItemInput
|
||||
label={settings.customBackground.value}
|
||||
onChange={(e, val) => handleSettingChange('customBackground', val)}
|
||||
icon={<Wallpaper />}
|
||||
/>
|
||||
{/* CUSTOM BACKGROUND */}
|
||||
<SettingItemModal
|
||||
icon={<Wallpaper />}
|
||||
label={t('APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER')}
|
||||
secondary={settings.customWallpaper}
|
||||
onClick={() => setCustomWallpaperModal(true)}
|
||||
/>
|
||||
<SettingItem
|
||||
label={t('APPS_SETTINGS_OPTION_FRAME')}
|
||||
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,7 +23,7 @@ const settingsSchema: Schema = {
|
||||
properties: {
|
||||
language: { $ref: '/SettingOption' },
|
||||
wallpaper: { $ref: '/SettingOption' },
|
||||
customBackground: { $ref: '/SettingOption' },
|
||||
customWallpaper: { type: 'string' },
|
||||
frame: { $ref: '/SettingOption' },
|
||||
theme: { $ref: '/SettingOption' },
|
||||
zoom: { $ref: '/SettingOption' },
|
||||
@@ -64,7 +64,7 @@ export function isSettingsSchemaValid(): boolean {
|
||||
export interface IPhoneSettings {
|
||||
language: SettingOption;
|
||||
wallpaper: SettingOption;
|
||||
customBackground: SettingOption;
|
||||
customWallpaper: string;
|
||||
frame: SettingOption;
|
||||
theme: SettingOption;
|
||||
zoom: SettingOption;
|
||||
@@ -106,12 +106,17 @@ const localStorageEffect = (key) => ({ setSelf, onSet }) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const settingsState = atom({
|
||||
export const settingsState = atom<IPhoneSettings>({
|
||||
key: 'settings',
|
||||
default: config.defaultSettings,
|
||||
effects_UNSTABLE: [localStorageEffect(NPWD_STORAGE_KEY)],
|
||||
});
|
||||
|
||||
const customWallpaperState = atom({
|
||||
key: 'customWallpaperState',
|
||||
default: false,
|
||||
});
|
||||
|
||||
export const useSettings = () => {
|
||||
return useRecoilState(settingsState);
|
||||
};
|
||||
@@ -119,3 +124,8 @@ export const useSettings = () => {
|
||||
export const useResetSettings = () => {
|
||||
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 { makeStyles } from '@material-ui/core/styles';
|
||||
|
||||
import Nui from '../../../os/nui-events/utils/Nui';
|
||||
import { AppWrapper } from '../../../ui/components';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import TweetListContainer from './tweet/TweetListContainer';
|
||||
@@ -78,7 +77,7 @@ export const TwitterApp = () => {
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'TWITTER',
|
||||
method: 'getOrCreateTwitterProfile',
|
||||
method: TwitterEvents.GET_OR_CREATE_PROFILE,
|
||||
data: {
|
||||
profile_name: 'Angular_Dev',
|
||||
bio: 'Angular FTW',
|
||||
@@ -89,7 +88,7 @@ InjectDebugData([
|
||||
},
|
||||
{
|
||||
app: 'TWITTER',
|
||||
method: 'fetchTweets',
|
||||
method: TwitterEvents.FETCH_TWEETS,
|
||||
data: [
|
||||
{
|
||||
id: 59,
|
||||
@@ -150,7 +149,7 @@ InjectDebugData(
|
||||
[
|
||||
{
|
||||
app: 'TWITTER',
|
||||
method: 'createTweetBroadcast',
|
||||
method: TwitterEvents.CREATE_TWEET_BROADCAST,
|
||||
data: {
|
||||
id: 111,
|
||||
profile_id: 111,
|
||||
@@ -162,7 +161,7 @@ InjectDebugData(
|
||||
},
|
||||
{
|
||||
app: 'TWITTER',
|
||||
method: 'createTweetBroadcast',
|
||||
method: TwitterEvents.CREATE_TWEET_BROADCAST,
|
||||
data: {
|
||||
id: 111,
|
||||
profile_id: 111,
|
||||
|
||||
@@ -7,7 +7,7 @@ const useStyles = makeStyles(() => ({
|
||||
root: {
|
||||
position: 'absolute',
|
||||
bottom: '75px',
|
||||
right: '15px',
|
||||
right: '10px',
|
||||
},
|
||||
button: {
|
||||
background: '#00acee',
|
||||
|
||||
@@ -37,7 +37,12 @@ export const ShowMore = ({ id, isReported, isMine }) => {
|
||||
|
||||
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 />
|
||||
</Button>
|
||||
<Menu
|
||||
|
||||
@@ -8,7 +8,7 @@ import { twitterState } from './state';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTwitterNotifications } from './useTwitterNotifications';
|
||||
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
|
||||
@@ -83,15 +83,15 @@ export const useTwitterService = () => {
|
||||
});
|
||||
};
|
||||
|
||||
useNuiEvent(APP_TWITTER, 'getOrCreateTwitterProfile', setProfile);
|
||||
useNuiEvent(APP_TWITTER, 'getOrCreateTwitterProfileNull', setDefaultProfileNames);
|
||||
useNuiEvent(APP_TWITTER, 'phone:createProfileResult', handleAddAlert);
|
||||
useNuiEvent(APP_TWITTER, 'updateProfileLoading', setUpdateProfileLoading);
|
||||
useNuiEvent(APP_TWITTER, 'updateProfileResult', handleAddAlert);
|
||||
useNuiEvent(APP_TWITTER, 'fetchTweets', _setTweets);
|
||||
useNuiEvent(APP_TWITTER, 'fetchTweetsFiltered', _setFilteredTweets);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetLoading', setCreateLoading);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetResult', handleAddAlert);
|
||||
useNuiEvent(APP_TWITTER, 'createTweetBroadcast', handleTweetBroadcast);
|
||||
useNuiEvent(APP_TWITTER, 'phone:retweetExists', handleAddAlert);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.GET_OR_CREATE_PROFILE, setProfile);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.GET_OR_CREATE_PROFILE_NULL, setDefaultProfileNames);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.CREATE_PROFILE_RESULT, handleAddAlert);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.UPDATE_PROFILE_LOADING, setUpdateProfileLoading);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.UPDATE_PROFILE_RESULT, handleAddAlert);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.FETCH_TWEETS, _setTweets);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.FETCH_TWEETS_FILTERED, _setFilteredTweets);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.CREATE_TWEET_LOADING, setCreateLoading);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.CREATE_TWEET_RESULT, handleAddAlert);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.CREATE_TWEET_BROADCAST, handleTweetBroadcast);
|
||||
useNuiEvent(APP_TWITTER, TwitterEvents.RETWEET_EXISTS, handleAddAlert);
|
||||
};
|
||||
@@ -144,10 +144,7 @@
|
||||
"label": "Project Error",
|
||||
"value": "projecterror.jpg"
|
||||
},
|
||||
"customBackground": {
|
||||
"label": "https://beta.iodine.gg/58d1e.jpeg",
|
||||
"value": "https://beta.iodine.gg/58d1e.jpeg"
|
||||
},
|
||||
"customWallpaper": "",
|
||||
"frame": {
|
||||
"label": "Default",
|
||||
"value": "default.png"
|
||||
|
||||
@@ -56,7 +56,11 @@
|
||||
"APPS_DIALER_ACCEPT_CALL": "Accept",
|
||||
"APPS_DIALER_REJECT_CALL": "Reject",
|
||||
"APPS_DIALER_END_CALL": "End",
|
||||
"APPS_DIALER_INPUT_PLACEHOLDER": "Enter a number",
|
||||
"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_MESSAGE_PLACEHOLDER": "What's happening?",
|
||||
@@ -145,6 +149,9 @@
|
||||
"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_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_UNREAD_MESSAGES": "You have {{ count }} unread messages",
|
||||
"APPS_MESSAGES_MEMBERS_TITLE": "Members",
|
||||
@@ -177,6 +184,7 @@
|
||||
|
||||
"APPS_SETTINGS_PHONE_NUMBER": "Phone Number",
|
||||
"APPS_SETTINGS_OPTION_WALLPAPER": "Wallpaper",
|
||||
"APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER": "Custom Wallpaper",
|
||||
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
||||
"APPS_SETTINGS_OPTION_THEME": "Theme",
|
||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
||||
@@ -187,18 +195,24 @@
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notification",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Notification Volume",
|
||||
"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_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_FAILED": "Failed to delete listing",
|
||||
"APPS_MARKETPLACE_REPORT_LISTING_FAILED": "This listing has already been reported",
|
||||
"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_WAIT": "Please wait...",
|
||||
"GENERIC_SAVE": "Save",
|
||||
"GENERIC_UPDATE": "Update",
|
||||
"GENERIC_REQUIRED": "Required",
|
||||
"GENERIC_DELETE": "Delete",
|
||||
"GENERIC_REPORT": "Report",
|
||||
"GENERIC_CALL": "Call",
|
||||
|
||||
+83
-15
@@ -2,6 +2,37 @@
|
||||
"translation": {
|
||||
"DATE_FORMAT": "DD/MM/YYYY",
|
||||
"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...",
|
||||
"INITIALIZING": "Starter",
|
||||
@@ -25,9 +56,10 @@
|
||||
"APPS_DIALER_ACCEPT_CALL": "Svar",
|
||||
"APPS_DIALER_REJECT_CALL": "Avvis",
|
||||
"APPS_DIALER_END_CALL": "Legg på",
|
||||
"APPS_DIALER_NO_HISTORY": "Du har ingen historikk",
|
||||
|
||||
"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_SUBMIT_IMAGE": "Legg til media",
|
||||
"APPS_TWITTER_CLOSE_IMAGE": "Lukk",
|
||||
@@ -36,7 +68,7 @@
|
||||
"APPS_TWITTER_REPORT": "Rapporter",
|
||||
"APPS_TWITTER_REPORTED": "Rapportert",
|
||||
"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_PLACEHOLDER": "Søk etter profil eller melding",
|
||||
"APPS_TWITTER_TWEET_MESSAGE_CHAR_LIMIT": "Meldingen er over grensen",
|
||||
@@ -45,13 +77,16 @@
|
||||
"APPS_TWITTER_CREATE_FAILED": "Mislykket tweet",
|
||||
"APPS_TWITTER_EDIT_PROFILE_AVATAR": "Avatar URL",
|
||||
"APPS_TWITTER_EDIT_PROFILE_NAME": "Brukernavn",
|
||||
"APPS_TWITTER_EDIT_DEFAULT_PROFILE_NAME": "Velg brukernavn",
|
||||
"APPS_TWITTER_EDIT_PROFILE_BIO": "Bio",
|
||||
"APPS_TWITTER_EDIT_PROFILE_LOCATION": "Lokasjon",
|
||||
"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_FAILURE": "Klarte ikke å oppdatere profilen",
|
||||
"APPS_TWITTER_RETWEET_EXISTS": "Du har akkuratt retvitret denne tweeten",
|
||||
"APPS_TWITTER_TIME_JUST_NOW": "Akkuratt nå",
|
||||
"APPS_TWITTER_RETWEET_EXISTS": "Du har akkurat retvitret denne tweeten!",
|
||||
"APPS_TWITTER_TIME_JUST_NOW": "Akkurat nå",
|
||||
"APPS_TWITTER_TIME_MINUTES": "m",
|
||||
"APPS_TWITTER_TIME_HOURS": "t",
|
||||
"APPS_TWITTER_TIME_DAYS": "d",
|
||||
@@ -59,11 +94,41 @@
|
||||
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} retvitret noen!",
|
||||
"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_HOME_TITLE": "Velkommen",
|
||||
"APPS_BANK_ACCOUNT_LINK": "Konto",
|
||||
"APPS_BANK_TIME_JUST_NOW": "Akkuratt nå",
|
||||
"APPS_BANK_ACCOUNT_TITLE": "Konto oversikt",
|
||||
"APPS_BANK_TIME_JUST_NOW": "Akkurat nå",
|
||||
"APPS_BANK_ACCOUNT_TITLE": "Kontooversikt",
|
||||
"APPS_BANK_ACCOUNT_TRANSACTIONS": "Transaksjoner",
|
||||
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "Se alt",
|
||||
"APPS_BANK_ACTIONS_TRANSFER": "Overføring",
|
||||
@@ -73,14 +138,14 @@
|
||||
"APPS_MESSAGES_SEARCH_PLACEHOLDER": "Søk etter meldinger...",
|
||||
"APPS_MESSAGES_NEW_MESSAGE": "Melding...",
|
||||
"APPS_MESSAGES_NEW_MESSAGE_FAILED:": "Kunne ikke sende melding",
|
||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP": "Telefonnummre...",
|
||||
"APPS_MESSAGES_GROUP_CHAT_LABEL": "Gruppesamtale navn...",
|
||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP": "Telefonnummer...",
|
||||
"APPS_MESSAGES_GROUP_CHAT_LABEL": "Navn på gruppe...",
|
||||
"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_CREATE_FAILED": "Kunne ikke opprette gruppesamtale",
|
||||
"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_MEMBERS_TITLE": "Medlemmer",
|
||||
"APPS_MESSAGES_ME": "Meg",
|
||||
@@ -108,26 +173,29 @@
|
||||
"APPS_NOTES_DELETE_SUCCESS": "Slettet notat!",
|
||||
"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_OPTION_WALLPAPER": "Bakgrunn",
|
||||
"APPS_SETTINGS_OPTION_FRAME": "Deksel",
|
||||
"APPS_SETTINGS_OPTION_THEME": "Utseende",
|
||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
||||
"APPS_SETTINGS_OPTION_THEME": "Tema",
|
||||
"APPS_SETTINGS_OPTION_ZOOM": "Forstørrelse",
|
||||
"APPS_SETTINGS_OPTION_STREAMER_MODE": "Strømmemodus",
|
||||
"APPS_SETTINGS_OPTION_RINGTONE": "Ringetone",
|
||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Ringetone Volum",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtrer notifikasjoner",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notifikasjon",
|
||||
"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_MARKETPALCE_CREATE_LISTING_FAILED": "Kunne ikke opprette annonse!",
|
||||
"APPS_MARKETPLACE_DELETE_LISTING_SUCCESS": "Slettet annonse!",
|
||||
"APPS_MARKETPLACE_DELETE_LISTING_FAILED": "Kunne ikke opprette annonse!",
|
||||
"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_SAVE": "Lagre",
|
||||
"GENERIC_UPDATE": "Oppdater",
|
||||
@@ -140,6 +208,6 @@
|
||||
"GENERIC_TITLE": "Tittel",
|
||||
"GENERIC_CONTENT": "Innhold",
|
||||
"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": {
|
||||
"DATE_FORMAT": "MM/DD/YYYY",
|
||||
"DATE_TIME_FORMAT": "MM/DD/YYYY hh:mm A",
|
||||
"DATE_FORMAT": "DD/MM/YYYY",
|
||||
"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...",
|
||||
"INITIALIZING": "Inicializando",
|
||||
@@ -10,32 +41,38 @@
|
||||
"APPS_CONTACTS": "Contatos",
|
||||
"APPS_MESSAGES": "Mensagens",
|
||||
"APPS_CALCULATOR": "Calculadora",
|
||||
"APPS_SETTINGS": "Configurações",
|
||||
"APPS_SETTINGS": "Configurações",
|
||||
"APPS_BANK": "Banco WhoDis",
|
||||
"APPS_NOTES": "Notas",
|
||||
"APPS_EXAMPLE": "Aplicativo de exemplo",
|
||||
"APPS_TWITTER": "Twitter",
|
||||
"APPS_SELLOUT": "Market",
|
||||
"APPS_SELLOUT": "Mercado",
|
||||
"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_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_ACCEPT_CALL": "Atender",
|
||||
"APPS_DIALER_REJECT_CALL": "Desligar",
|
||||
"APPS_DIALER_REJECT_CALL": "Rejeitar",
|
||||
"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_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_CLOSE_IMAGE": "Fechar",
|
||||
"APPS_TWITTER_CLOSE": "Fechar",
|
||||
"APPS_TWITTER_DELETE": "Deletar",
|
||||
"APPS_TWITTER_REPORT": "Reportar",
|
||||
"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_PLACEHOLDER": "Procurar por nome de perfil ou mensagem",
|
||||
"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_EDIT_PROFILE_AVATAR": "URL do Avatar",
|
||||
"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_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_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_FAILURE": "Não foi possivel atualizar seu perfil",
|
||||
"APPS_TWITTER_TIME_JUST_NOW": "agora",
|
||||
"APPS_TWITTER_EDIT_PROFILE_FAILURE": "Falha ao atualizar o seu perfil",
|
||||
"APPS_TWITTER_RETWEET_EXISTS": "Você já retuitou este tweet!",
|
||||
"APPS_TWITTER_TIME_JUST_NOW": "Agora mesmo",
|
||||
"APPS_TWITTER_TIME_MINUTES": "m",
|
||||
"APPS_TWITTER_TIME_HOURS": "h",
|
||||
"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_UNREAD_MESSAGES": "Voce tem {{ count }} novos tweets na sua timeline!",
|
||||
"APPS_MESSAGES_UNREAD_MESSAGES": "Voce tem {{ count }} Mensagens nao lidas",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtro de notificaçao",
|
||||
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} Retweetou alguem!",
|
||||
"APPS_TWITTER_RETWEET_EXISTS": "Voce ja retweetou isso!",
|
||||
"APPS_TWITTER_RETWEETED": "Retweetado",
|
||||
"GENERIC_CALL": "Call",
|
||||
"GENERIC_MESSAGE": "Mensagem",
|
||||
"GENERIC_REPORT": "Reporte",
|
||||
"GENERIC_WAIT": "Por favor aguarde...",
|
||||
"GENERIC_WRITE_TO_CLIPBOARD_MESSAGE": "Copiado {{content}} para a área de transferência!!",
|
||||
"GENERIC_WRITE_TO_CLIPBOARD_TOOLTIP": "Copiar {{ content }}",
|
||||
"APPS_TWITTER_NEW_RETWEET_BROADCAST": "@{{ profile_name }} retuitou alguém!",
|
||||
"APPS_TWITTER_UNREAD_MESSAGES": "Você tem {{ count }} novos tweets em sua linha do tempo!",
|
||||
|
||||
"APPS_MATCH": "Matchmaker",
|
||||
"APPS_MATCH_LIKED": "CURTIR",
|
||||
"APPS_MATCH_NOPE": "NÃO",
|
||||
"APPS_MATCH_LIKE": "Curtir",
|
||||
"APPS_MATCH_DISLIKE": "Não curtir",
|
||||
"APPS_MATCH_NO_PROFILES": "Nenhum perfil recente encontrado",
|
||||
"APPS_MATCH_NO_MATCHES": "Nenhum match encontrado",
|
||||
"APPS_MATCH_PROFILES_ERROR": "Erro ao carregar perfis",
|
||||
"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_HOME_TITLE": "Bem vindo",
|
||||
@@ -82,19 +137,25 @@
|
||||
"APPS_BANK_ACCOUNT_SEE_TRANSACTION": "Ver tudo",
|
||||
"APPS_BANK_ACTIONS_TRANSFER": "Transferir",
|
||||
"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_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_GROUP_CHAT_LABEL": "Nome do chat em grupo...",
|
||||
"APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT": "Enviar",
|
||||
"APPS_MESSAGES_INVALID_PHONE_NUMBER": "Numero de telefone invalido: ",
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_DUPLICATE": "Esse grupo ja existe",
|
||||
"APPS_MESSAGES_INVALID_PHONE_NUMBER": "Numero de telefone inválido: ",
|
||||
"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_MINE": "Voce nao pode adcionar voce mesmo!",
|
||||
"APPS_MESSAGES_INPUT_NAME_OR_NUMBER": "Procure por contatos ou numero e aperte enter",
|
||||
"APPS_MESSAGES_MESSAGE_GROUP_CREATE_MINE": "Voce não pode adcionar você mesmo!",
|
||||
"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_NUMBER": "Número",
|
||||
@@ -121,25 +182,46 @@
|
||||
|
||||
"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_OPTION_WALLPAPER": "Papel de parede",
|
||||
"APPS_SETTINGS_OPTIONS_CUSTOM_WALLPAPER": "Papel de parede customizado",
|
||||
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
||||
"APPS_SETTINGS_OPTION_THEME": "Tema",
|
||||
"APPS_SETTINGS_OPTION_ZOOM": "Zoom",
|
||||
"APPS_SETTINGS_OPTION_STREAMER_MODE": "Modo Streamer",
|
||||
"APPS_SETTINGS_OPTION_RINGTONE": "Toque",
|
||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Volume do toque",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION": "Notificaçao",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATIONVOL": "Volume da notificaçao",
|
||||
"APPS_SETTINGS_OPTION_NOTIFICATION_FILTER": "Filtros de Notificação",
|
||||
"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_UPDATE": "Atualizar",
|
||||
"GENERIC_DELETE": "Deletar",
|
||||
"GENERIC_REQUIRED": "Requerido",
|
||||
"GENERIC_DELETE": "Apagar",
|
||||
"GENERIC_REPORT": "Reportar",
|
||||
"GENERIC_CALL": "Chamar",
|
||||
"GENERIC_MESSAGE": "Mensagem",
|
||||
"GENERIC_CLOSE": "Fechar",
|
||||
"GENERIC_CANCEL": "Cancelar",
|
||||
"GENERIC_TITLE": "Titulo",
|
||||
"GENERIC_CONTENT": "Conteudo"
|
||||
"GENERIC_TITLE": "Título",
|
||||
"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!"
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,7 @@
|
||||
import React from 'react';
|
||||
import { blue, common, grey, purple } from '@material-ui/core/colors';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import {
|
||||
faAd,
|
||||
faPlaneArrival,
|
||||
faPhoneAlt,
|
||||
faWonSign,
|
||||
faStickyNote,
|
||||
} from '@fortawesome/free-solid-svg-icons';
|
||||
import { faAd, faPlaneArrival, faPhoneAlt, faStickyNote } from '@fortawesome/free-solid-svg-icons';
|
||||
import { faTwitter } from '@fortawesome/free-brands-svg-icons';
|
||||
|
||||
import ContactsIcon from '@material-ui/icons/Contacts';
|
||||
@@ -20,12 +14,11 @@ import { DialerApp } from '../../../apps/dialer/components/DialerApp';
|
||||
import { ContactsApp } from '../../../apps/contacts/components/ContactsApp';
|
||||
import { CalculatorApp } from '../../../apps/calculator/components/CalculatorApp';
|
||||
import { SettingsApp } from '../../../apps/settings/components/SettingsApp';
|
||||
import { BankApp } from '../../../apps/bank/components/BankApp';
|
||||
import { MessagesApp } from '../../../apps/messages/components/MessagesApp';
|
||||
import { MatchApp } from '../../../apps/match/components/MatchApp';
|
||||
import { TwitterApp } from '../../../apps/twitter/components/TwitterApp';
|
||||
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 CameraApp from '../../../apps/camera/components/CameraApp';
|
||||
import { AppRoute } from '../components/AppRoute';
|
||||
@@ -41,7 +34,7 @@ import {
|
||||
import {
|
||||
SELLOUT_APP_PRIMARY_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 { DIALER_APP_PRIMARY_COLOR, DIALER_APP_TEXT_COLOR } from '../../../apps/dialer/dialer.theme';
|
||||
import {
|
||||
@@ -112,7 +105,8 @@ export const APPS: IAppConfig[] = [
|
||||
path: '/settings',
|
||||
Route: () => <AppRoute id="SETTINGS" path="/settings" component={SettingsApp} />,
|
||||
},
|
||||
{
|
||||
/* Hiding the bank app while the bank resource gets done */
|
||||
/*{
|
||||
id: 'BANK',
|
||||
nameLocale: 'APPS_BANK',
|
||||
icon: <FontAwesomeIcon icon={faWonSign} />,
|
||||
@@ -121,7 +115,7 @@ export const APPS: IAppConfig[] = [
|
||||
color: common.white,
|
||||
path: '/bank',
|
||||
Route: () => <AppRoute id="BANK" path="/bank" component={BankApp} />,
|
||||
},
|
||||
},*/
|
||||
{
|
||||
id: 'MATCH',
|
||||
nameLocale: 'APPS_MATCH',
|
||||
@@ -149,8 +143,8 @@ export const APPS: IAppConfig[] = [
|
||||
notificationIcon: <FontAwesomeIcon icon={faAd} fixedWidth size="xs" />,
|
||||
backgroundColor: SELLOUT_APP_PRIMARY_COLOR,
|
||||
color: SELLOUT_APP_ICON_COLOR,
|
||||
path: '/sellout',
|
||||
Route: () => <AppRoute id="SELLOUT" path="/sellout" component={SelloutApp} />,
|
||||
path: '/marketplace',
|
||||
Route: () => <AppRoute id="MARKETPLACE" path="/marketplace" component={MarketplaceApp} />,
|
||||
},
|
||||
{
|
||||
id: 'NOTES',
|
||||
|
||||
@@ -2,10 +2,10 @@ import React from 'react';
|
||||
import { Box, makeStyles } from '@material-ui/core';
|
||||
import { CallControls } from './CallControls';
|
||||
|
||||
interface ICallNotificationProps {
|
||||
onAccept(): void;
|
||||
onReject(): void;
|
||||
}
|
||||
// interface ICallNotificationProps {
|
||||
// onAccept(): void;
|
||||
// onReject(): void;
|
||||
// }
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { atom } from 'recoil';
|
||||
import { ActiveCall } from '../../../../../typings/call';
|
||||
|
||||
export const callerState = {
|
||||
currentCall: atom({
|
||||
currentCall: atom<ActiveCall>({
|
||||
key: 'currentCall',
|
||||
default: null,
|
||||
}),
|
||||
callModal: atom({
|
||||
callModal: atom<boolean>({
|
||||
key: 'callingModal',
|
||||
default: false,
|
||||
}),
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { CallProps } from '../../../../../typings/call';
|
||||
import { ActiveCall } from '../../../../../typings/call';
|
||||
import Nui from '../../nui-events/utils/Nui';
|
||||
import { callerState } from './state';
|
||||
import { CallEvents } from '../../../../../typings/call';
|
||||
|
||||
interface CallHook {
|
||||
call: CallProps;
|
||||
call: ActiveCall;
|
||||
setCall: (details: any) => void;
|
||||
acceptCall(): void;
|
||||
rejectCall(): void;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { CallProps } from '../../../../../typings/call';
|
||||
import { ActiveCall } from '../../../../../typings/call';
|
||||
import { useApp } from '../../apps/hooks/useApps';
|
||||
import { useNotifications } from '../../notifications/hooks/useNotifications';
|
||||
import { useRingtoneSound } from '../../sound/hooks/useRingtoneSound';
|
||||
@@ -27,7 +27,7 @@ export const useCallNotifications = () => {
|
||||
notificationIcon,
|
||||
};
|
||||
|
||||
const setNotification = (call: CallProps) => {
|
||||
const setNotification = (call: ActiveCall) => {
|
||||
stop();
|
||||
if (!call || !call.active) {
|
||||
removeId(NOTIFICATION_ID);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
||||
import { useNuiEvent } from '../../nui-events/hooks/useNuiEvent';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { useCall } from './useCall';
|
||||
import { CallEvents, CallProps } from '../../../../../typings/call';
|
||||
import { CallEvents, ActiveCall } from '../../../../../typings/call';
|
||||
import InjectDebugData from '../../debug/InjectDebugData';
|
||||
import { useCallModal } from './useCallModal';
|
||||
import { useHistory, useLocation } from 'react-router-dom';
|
||||
@@ -10,7 +10,7 @@ import { callerState } from './state';
|
||||
import { useCallNotifications } from './useCallNotifications';
|
||||
import { useDuration } from './useDuration';
|
||||
|
||||
InjectDebugData<CallProps | boolean>([
|
||||
InjectDebugData<ActiveCall | boolean>([
|
||||
/* {
|
||||
app: 'CALL',
|
||||
method: 'setCaller',
|
||||
@@ -56,11 +56,11 @@ export const useCallService = () => {
|
||||
}
|
||||
}, [history, modal, pathname, modalHasBeenOpenedThisCall]);
|
||||
|
||||
const _setCall = (_call: CallProps) => {
|
||||
const _setCall = (_call: ActiveCall) => {
|
||||
resetDuration();
|
||||
setCall(_call);
|
||||
setNotification(_call);
|
||||
};
|
||||
useNuiEvent<CallProps>('CALL', CallEvents.SET_CALLER, _setCall, call);
|
||||
useNuiEvent<ActiveCall>('CALL', CallEvents.SET_CALLER, _setCall, call);
|
||||
useNuiEvent<boolean>('CALL', CallEvents.SET_CALL_MODAL, setModal);
|
||||
};
|
||||
@@ -1,109 +0,0 @@
|
||||
import { useCallback, useEffect, useRef } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { atom, useSetRecoilState, useRecoilValue } from 'recoil';
|
||||
import { usePhone } from '../../phone/hooks/usePhone';
|
||||
|
||||
const keyboardState = {
|
||||
ArrowRight: atom({
|
||||
key: 'ArrowRight',
|
||||
default: null,
|
||||
}),
|
||||
ArrowLeft: atom({
|
||||
key: 'ArrowLeft',
|
||||
default: null,
|
||||
}),
|
||||
ArrowUp: atom({
|
||||
key: 'ArrowUp',
|
||||
default: null,
|
||||
}),
|
||||
ArrowDown: atom({
|
||||
key: 'ArrowDown',
|
||||
default: null,
|
||||
}),
|
||||
Backspace: atom({
|
||||
key: 'Backspace',
|
||||
default: null,
|
||||
}),
|
||||
Enter: atom({
|
||||
key: 'Enter',
|
||||
default: null,
|
||||
}),
|
||||
Escape: atom({
|
||||
key: 'Escape',
|
||||
default: null,
|
||||
}),
|
||||
};
|
||||
|
||||
const validKeys = [
|
||||
'ArrowRight',
|
||||
'ArrowLeft',
|
||||
'ArrowUp',
|
||||
'ArrowDown',
|
||||
'Backspace',
|
||||
'Enter',
|
||||
'Escape',
|
||||
];
|
||||
|
||||
const isKeyValid = (key) => validKeys.indexOf(key) !== -1;
|
||||
|
||||
export const useKeyboardService = () => {
|
||||
const history = useHistory();
|
||||
const { closePhone } = usePhone();
|
||||
const getters = {
|
||||
ArrowRight: useRecoilValue(keyboardState.ArrowRight),
|
||||
ArrowLeft: useRecoilValue(keyboardState.ArrowLeft),
|
||||
ArrowUp: useRecoilValue(keyboardState.ArrowUp),
|
||||
ArrowDown: useRecoilValue(keyboardState.ArrowDown),
|
||||
Backspace: useRecoilValue(keyboardState.Backspace),
|
||||
Enter: useRecoilValue(keyboardState.Enter),
|
||||
Escape: useRecoilValue(keyboardState.Escape),
|
||||
};
|
||||
|
||||
const handlers = useRef(new Map());
|
||||
const setEscape = useSetRecoilState<any>(keyboardState.Escape);
|
||||
const setBackspace = useSetRecoilState(keyboardState.Backspace);
|
||||
|
||||
useEffect(
|
||||
function registerCustomKeys() {
|
||||
Object.keys(getters).forEach((g) => {
|
||||
handlers.current.set(g, getters[g]);
|
||||
});
|
||||
},
|
||||
[getters],
|
||||
);
|
||||
|
||||
useEffect(
|
||||
function handleNUIKeyboardMessage() {
|
||||
function onKeyUp(event) {
|
||||
const { key } = event;
|
||||
const callback = handlers.current.get(key);
|
||||
if (isKeyValid(key) && callback && callback.call) {
|
||||
return callback(event);
|
||||
}
|
||||
}
|
||||
|
||||
window.addEventListener('keyup', onKeyUp);
|
||||
return () => window.removeEventListener('keyup', onKeyUp);
|
||||
},
|
||||
[getters],
|
||||
);
|
||||
|
||||
const backspaceHandler = useCallback(
|
||||
(event) => {
|
||||
if (['input', 'textarea'].includes(event.target.nodeName.toLowerCase())) {
|
||||
// Dont anything if we are typing something :)
|
||||
return;
|
||||
}
|
||||
history.goBack();
|
||||
},
|
||||
[history],
|
||||
);
|
||||
|
||||
useEffect(
|
||||
function registerDefaultHandlers() {
|
||||
handlers.current.set('Escape', () => closePhone());
|
||||
handlers.current.set('Backspace', backspaceHandler);
|
||||
},
|
||||
[setEscape, setBackspace, history, backspaceHandler, closePhone],
|
||||
);
|
||||
};
|
||||
@@ -26,7 +26,7 @@ function getParams(event, data): [RequestInfo, RequestInit] {
|
||||
];
|
||||
}
|
||||
|
||||
export default {
|
||||
const NuiUtils = {
|
||||
async send(event: any, data = {}) {
|
||||
return fetch(...getParams(event, data));
|
||||
},
|
||||
@@ -34,3 +34,5 @@ export default {
|
||||
return abortableFetch(...getParams(event, data));
|
||||
},
|
||||
};
|
||||
|
||||
export default NuiUtils;
|
||||
@@ -1,12 +0,0 @@
|
||||
import { atom } from 'recoil';
|
||||
|
||||
export const phoneSettings = {
|
||||
theme: atom({
|
||||
key: 'settingTheme',
|
||||
default: 'default-dark',
|
||||
}),
|
||||
zoom: atom({
|
||||
key: 'settingZoom',
|
||||
default: '100%',
|
||||
}),
|
||||
};
|
||||
@@ -1,19 +1,20 @@
|
||||
import { atom } from 'recoil';
|
||||
import { IServerConfig } from '../../../../../typings/config';
|
||||
|
||||
export const phoneState = {
|
||||
visibility: atom({
|
||||
visibility: atom<boolean>({
|
||||
key: 'phoneVisibility',
|
||||
default: false,
|
||||
}),
|
||||
phoneConfig: atom({
|
||||
phoneConfig: atom<IServerConfig>({
|
||||
key: 'phoneConfig',
|
||||
default: undefined,
|
||||
default: null,
|
||||
}),
|
||||
phoneReady: atom({
|
||||
phoneReady: atom<boolean>({
|
||||
key: 'phoneReady',
|
||||
default: false,
|
||||
}),
|
||||
phoneTime: atom({
|
||||
phoneTime: atom<string>({
|
||||
key: 'phoneTime',
|
||||
default: null,
|
||||
}),
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { phoneState } from './state';
|
||||
import { useNuiEvent } from '../../nui-events/hooks/useNuiEvent';
|
||||
import { PhoneEvents } from '../../../../../typings/phone';
|
||||
|
||||
export const usePhoneService = () => {
|
||||
const setVisibility = useSetRecoilState(phoneState.visibility);
|
||||
const setPhoneConfig = useSetRecoilState(phoneState.phoneConfig);
|
||||
const setPhoneReady = useSetRecoilState(phoneState.phoneReady);
|
||||
const setPhoneTime = useSetRecoilState(phoneState.phoneTime);
|
||||
useNuiEvent('PHONE', 'setVisibility', setVisibility);
|
||||
useNuiEvent('PHONE', 'setPhoneReady', setPhoneReady);
|
||||
useNuiEvent('PHONE', 'phoneConfig', setPhoneConfig);
|
||||
useNuiEvent('PHONE', 'setTime', setPhoneTime);
|
||||
useNuiEvent('PHONE', PhoneEvents.SET_VISIBILITY, setVisibility);
|
||||
useNuiEvent('PHONE', PhoneEvents.SET_PHONE_READY, setPhoneReady);
|
||||
useNuiEvent('PHONE', PhoneEvents.SET_CONFIG, setPhoneConfig);
|
||||
useNuiEvent('PHONE', PhoneEvents.SET_TIME, setPhoneTime);
|
||||
};
|
||||
@@ -3,6 +3,7 @@ import { useSetRecoilState } from 'recoil';
|
||||
import { simcardState } from './state';
|
||||
import { useSimcard } from './useSimcard';
|
||||
import InjectDebugData from '../../debug/InjectDebugData';
|
||||
import { PhoneEvents } from '../../../../../typings/phone';
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
@@ -14,6 +15,6 @@ InjectDebugData([
|
||||
|
||||
export const useSimcardService = () => {
|
||||
const setNumber = useSetRecoilState(simcardState.number);
|
||||
useNuiEvent('SIMCARD', 'setNumber', setNumber);
|
||||
useNuiEvent('SIMCARD', PhoneEvents.SET_NUMBER, setNumber);
|
||||
return useSimcard();
|
||||
};
|
||||
@@ -2,13 +2,11 @@ import React from 'react';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import Snackbar from '@material-ui/core/Snackbar';
|
||||
import Fade from '@material-ui/core/Fade';
|
||||
import { createMuiTheme, ThemeProvider } from '@material-ui/core';
|
||||
import { ThemeProvider } from '@material-ui/core';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { usePhone } from '../../os/phone/hooks/usePhone';
|
||||
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { settingsState } from '../../apps/settings/hooks/useSettings';
|
||||
import themeConfig from '../../config/default.json';
|
||||
import { usePhoneTheme } from '../../os/phone/hooks/usePhoneTheme';
|
||||
|
||||
const useStyles = makeStyles({
|
||||
paper: {
|
||||
@@ -25,15 +23,14 @@ function Notification({ children, handleClose, open }) {
|
||||
const classes = useStyles();
|
||||
const { config } = usePhone();
|
||||
|
||||
const [settings] = useRecoilState(settingsState);
|
||||
const currentTheme = usePhoneTheme();
|
||||
|
||||
if (!config) return null;
|
||||
|
||||
const { horizontal, vertical } = config.notificationPosition;
|
||||
const currentTheme = () => createMuiTheme(themeConfig.themes[settings.theme.value]);
|
||||
|
||||
return (
|
||||
<ThemeProvider theme={currentTheme()}>
|
||||
<ThemeProvider theme={currentTheme}>
|
||||
<Snackbar
|
||||
className={classes.snackBar}
|
||||
anchorOrigin={{ horizontal, vertical }}
|
||||
|
||||
@@ -6,7 +6,7 @@ export interface IAlert {
|
||||
type: AlertType;
|
||||
}
|
||||
|
||||
export type AlertType = 'success' | 'error' | 'info';
|
||||
export type AlertType = 'success' | 'error' | 'info' | 'warning';
|
||||
|
||||
interface ISnackBar {
|
||||
addAlert: ({ message, type }: IAlert) => void;
|
||||
|
||||
+22
-19
@@ -1,5 +1,5 @@
|
||||
import { CallEvents } from '../../typings/call';
|
||||
import { ICall } from '../../typings/call';
|
||||
import { CallHistoryItem } from '../../typings/call';
|
||||
import { phoneCallStartAnim, phoneCallEndAnim } from './functions';
|
||||
|
||||
const exp = (global as any).exports;
|
||||
@@ -34,23 +34,26 @@ on(`__cfx_nui:${CallEvents.ACCEPT_CALL}`, (data: any, cb: Function) => {
|
||||
cb();
|
||||
});
|
||||
|
||||
onNet(CallEvents.WAS_ACCEPTED, (channelId: number, currentCall: ICall, isTransmitter: boolean) => {
|
||||
exp['mumble-voip'].SetCallChannel(channelId);
|
||||
phoneCallStartAnim(); // Trigger call animation only if the call was accepted.
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'CALL',
|
||||
method: CallEvents.SET_CALLER,
|
||||
data: {
|
||||
active: true,
|
||||
transmitter: currentCall.transmitter,
|
||||
receiver: currentCall.receiver,
|
||||
isTransmitter: isTransmitter,
|
||||
accepted: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
});
|
||||
onNet(
|
||||
CallEvents.WAS_ACCEPTED,
|
||||
(channelId: number, currentCall: CallHistoryItem, isTransmitter: boolean) => {
|
||||
exp['mumble-voip'].SetCallChannel(channelId);
|
||||
phoneCallStartAnim(); // Trigger call animation only if the call was accepted.
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'CALL',
|
||||
method: CallEvents.SET_CALLER,
|
||||
data: {
|
||||
active: true,
|
||||
transmitter: currentCall.transmitter,
|
||||
receiver: currentCall.receiver,
|
||||
isTransmitter: isTransmitter,
|
||||
accepted: true,
|
||||
},
|
||||
}),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
RegisterNuiCallbackType(CallEvents.REJECTED); // Fires when cancelling and rejecting a call.
|
||||
on(`__cfx_nui:${CallEvents.REJECTED}`, (data: any, cb: Function) => {
|
||||
@@ -115,7 +118,7 @@ function openCallModal(show: boolean) {
|
||||
);
|
||||
}
|
||||
|
||||
onNet(CallEvents.SEND_HISTORY, (calls: ICall) => {
|
||||
onNet(CallEvents.SEND_HISTORY, (calls: CallHistoryItem[]) => {
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'DIALER',
|
||||
|
||||
@@ -25,8 +25,8 @@ function fetchOnInitialize() {
|
||||
emitNet(ContactEvents.GET_CONTACTS);
|
||||
emitNet(MessageEvents.FETCH_MESSAGE_GROUPS);
|
||||
emitNet(TwitterEvents.GET_OR_CREATE_PROFILE);
|
||||
sendMessage('PHONE', 'setPhoneReady', isPhoneReady);
|
||||
sendMessage('PHONE', 'phoneConfig', config);
|
||||
sendMessage('PHONE', PhoneEvents.SET_PHONE_READY, isPhoneReady);
|
||||
sendMessage('PHONE', PhoneEvents.SET_CONFIG, config);
|
||||
}
|
||||
|
||||
RegisterKeyMapping('phone', 'Open Phone', 'keyboard', 'f1');
|
||||
@@ -55,14 +55,14 @@ const showPhone = async (): Promise<void> => {
|
||||
await phoneOpenAnim(); // Animation starts before the phone is open
|
||||
emitNet('phone:getCredentials');
|
||||
SetCursorLocation(0.9, 0.922); //Experimental
|
||||
sendMessage('PHONE', 'setVisibility', true);
|
||||
sendMessage('PHONE', 'setTime', time);
|
||||
sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, true);
|
||||
sendMessage('PHONE', PhoneEvents.SET_TIME, time);
|
||||
SetNuiFocus(true, true);
|
||||
};
|
||||
|
||||
const hidePhone = async (): Promise<void> => {
|
||||
isPhoneOpen = false;
|
||||
sendMessage('PHONE', 'setVisibility', false);
|
||||
sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, false);
|
||||
await phoneCloseAnim();
|
||||
SetNuiFocus(false, false);
|
||||
};
|
||||
@@ -115,15 +115,15 @@ onNet(PhoneEvents.PLAYER_IS_READY, fetchOnInitialize);
|
||||
|
||||
AddEventHandler('onResourceStop', function (resource: string) {
|
||||
if (resource === GetCurrentResourceName()) {
|
||||
sendMessage('PHONE', 'setVisibility', false);
|
||||
sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, false);
|
||||
SetNuiFocus(false, false);
|
||||
removePhoneProp(); //Deletes the phone incase it was attached.
|
||||
ClearPedTasks(PlayerPedId()); //Leave here until launch as it'll fix any stuck animations.
|
||||
}
|
||||
});
|
||||
|
||||
onNet('phone:sendCredentials', (number: string) => {
|
||||
sendMessage('SIMCARD', 'setNumber', number);
|
||||
onNet(PhoneEvents.SEND_CREDENTIALS, (number: string) => {
|
||||
sendMessage('SIMCARD', PhoneEvents.SET_NUMBER, number);
|
||||
});
|
||||
|
||||
// DO NOT CHANGE THIS EITHER, PLEASE - CHIP
|
||||
|
||||
File renamed without changes.
@@ -1,6 +1,7 @@
|
||||
import { PhotoEvents } from '../../typings/photo';
|
||||
import { Delay } from '../utils/fivem';
|
||||
import { sendMessage, sendCameraEvent } from '../utils/messages';
|
||||
import { PhoneEvents } from '../../typings/phone';
|
||||
const SCREENSHOT_BASIC_TOKEN = GetConvar('SCREENSHOT_BASIC_TOKEN', 'none');
|
||||
|
||||
const exp = (global as any).exports;
|
||||
@@ -9,12 +10,12 @@ let inCameraMode = false;
|
||||
|
||||
function closePhoneTemp() {
|
||||
SetNuiFocus(false, false);
|
||||
sendMessage('PHONE', 'setVisibility', false);
|
||||
sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, false);
|
||||
}
|
||||
|
||||
function openPhoneTemp() {
|
||||
SetNuiFocus(true, true);
|
||||
sendMessage('PHONE', 'setVisibility', true);
|
||||
sendMessage('PHONE', PhoneEvents.SET_VISIBILITY, true);
|
||||
}
|
||||
|
||||
function CellFrontCamActivate(activate: boolean) {
|
||||
@@ -76,7 +77,7 @@ const handleCameraExit = () => {
|
||||
};
|
||||
|
||||
onNet(PhotoEvents.SEND_PHOTOS, (photos: string[]) => {
|
||||
sendCameraEvent('setPhotos', photos);
|
||||
sendCameraEvent(PhotoEvents.SEND_PHOTOS, photos);
|
||||
});
|
||||
|
||||
function takePhoto() {
|
||||
|
||||
@@ -3,7 +3,7 @@ import ClientUtils from './cl_utils';
|
||||
import './cl_main';
|
||||
import './cl_twitter';
|
||||
import './cl_contacts';
|
||||
import './cl_sellout';
|
||||
import './cl_marketplace';
|
||||
import './cl_bank';
|
||||
import './cl_notes';
|
||||
import './cl_photo';
|
||||
|
||||
@@ -47,9 +47,9 @@ export async function getIdentifierByPhoneNumber(
|
||||
* Returns the player phoneNumber for a passed identifier
|
||||
* @param identifier The players phone number
|
||||
*/
|
||||
export function getPlayerFromIdentifier(identifier: string) {
|
||||
export function getPlayerFromIdentifier(identifier: string): Player | null {
|
||||
const player = PlayersByIdentifier.get(identifier);
|
||||
if (!player) mainLogger.error(`Could not find player from identifier: ${identifier}`);
|
||||
if (!player) return null;
|
||||
return player;
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ function getRandomPhoneNumber() {
|
||||
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 [results] = await pool.query(getQuery, [identifier]);
|
||||
const result = <any[]>results;
|
||||
@@ -90,5 +90,7 @@ export async function generatePhoneNumber(identifier: string): Promise<void> {
|
||||
mainLogger.debug(`Inserting number into Database: ${newNumber}`);
|
||||
const query = 'UPDATE users SET phone_number = ? WHERE 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());
|
||||
playerLogger.info(`Started loading for ${username} (${pSource})`);
|
||||
// Ensure phone number exists or generate
|
||||
await generatePhoneNumber(playerIdentifer);
|
||||
const phone_number = await generatePhoneNumber(playerIdentifer);
|
||||
|
||||
// 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({
|
||||
identifier: playerIdentifer,
|
||||
|
||||
@@ -4,7 +4,7 @@ import './db';
|
||||
import './sv_twitter';
|
||||
import './sv_main';
|
||||
import './sv_contacts';
|
||||
import './sv_sellout';
|
||||
import './sv_marketplace';
|
||||
import './sv_bank';
|
||||
import './sv_notes';
|
||||
import './sv_photo';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CallEvents } from '../../typings/call';
|
||||
import { getIdentifierByPhoneNumber, getPlayer, getSource } from './functions';
|
||||
import { getPlayerFromIdentifier } from './functions';
|
||||
import { ICall } from '../../typings/call';
|
||||
import { CallHistoryItem } from '../../typings/call';
|
||||
|
||||
import { pool } from './db';
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
@@ -9,25 +9,25 @@ import { mainLogger } from './sv_logger';
|
||||
|
||||
const callLogger = mainLogger.child({ module: 'calls' });
|
||||
|
||||
async function saveCall(call: ICall) {
|
||||
async function saveCall(call: CallHistoryItem) {
|
||||
const query =
|
||||
'INSERT INTO npwd_calls (identifier, transmitter, receiver, start) VALUES (?, ?, ?, ?)';
|
||||
await pool.query(query, [call.identifier, call.transmitter, call.receiver, call.start]);
|
||||
}
|
||||
|
||||
async function updateCall(call: ICall, isAccepted: boolean, end: number) {
|
||||
async function updateCall(call: CallHistoryItem, isAccepted: boolean, end: number) {
|
||||
const query = 'UPDATE npwd_calls SET is_accepted=?, end=? WHERE identifier = ?';
|
||||
await pool.query(query, [isAccepted, end, call.identifier]);
|
||||
}
|
||||
|
||||
async function fetchCalls(phoneNumber: string): Promise<ICall[]> {
|
||||
async function fetchCalls(phoneNumber: string): Promise<CallHistoryItem[]> {
|
||||
const query = 'SELECT * FROM npwd_calls WHERE receiver = ? OR transmitter = ? ORDER BY id DESC';
|
||||
const [result] = await pool.query(query, [phoneNumber, phoneNumber]);
|
||||
const calls = <ICall[]>result;
|
||||
const calls = <CallHistoryItem[]>result;
|
||||
return calls;
|
||||
}
|
||||
|
||||
let calls: Map<string, ICall> = new Map();
|
||||
let calls: Map<string, CallHistoryItem> = new Map();
|
||||
|
||||
onNet(CallEvents.INITIALIZE_CALL, async (phoneNumber: string) => {
|
||||
const _source = getSource();
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { pool } from './db';
|
||||
import { getIdentifier, getSource } from './functions';
|
||||
import { mainLogger } from './sv_logger';
|
||||
import { PhoneEvents } from '../../typings/phone';
|
||||
|
||||
interface Credentials {
|
||||
phone_number: string;
|
||||
@@ -19,7 +20,7 @@ onNet('phone:getCredentials', async () => {
|
||||
try {
|
||||
const identifier = getIdentifier(_source);
|
||||
const number = await getCredentials(identifier);
|
||||
emitNet('phone:sendCredentials', _source, number);
|
||||
emitNet(PhoneEvents.SEND_CREDENTIALS, _source, number);
|
||||
} catch (e) {
|
||||
mainLogger.error(`Failed to get a number, ${e.message}`, {
|
||||
source: _source,
|
||||
|
||||
File renamed without changes.
@@ -356,19 +356,29 @@ async function createMessageGroupsFromPhoneNumbers(
|
||||
): Promise<CreateMessageGroupResult> {
|
||||
// we check that each phoneNumber exists before we create the group
|
||||
const identifiers: string[] = [];
|
||||
const failedNumbers: string[] = [];
|
||||
|
||||
for (const phoneNumber of phoneNumbers) {
|
||||
const identifier = await getIdentifierFromPhoneNumber(phoneNumber);
|
||||
identifiers.push(identifier);
|
||||
try {
|
||||
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
|
||||
if (identifiers.some((identifier) => identifier === userIdentifier)) {
|
||||
return { error: true, mine: true };
|
||||
return { error: true, mine: true, failedNumbers };
|
||||
}
|
||||
|
||||
const groupId = createGroupHashID([userIdentifier, ...identifiers]);
|
||||
if (await checkIfMessageGroupExists(groupId)) {
|
||||
return { error: false, duplicate: true, groupId, identifiers };
|
||||
return { error: false, duplicate: true, groupId, identifiers, failedNumbers };
|
||||
}
|
||||
|
||||
const queryPromises = [
|
||||
@@ -388,7 +398,7 @@ async function createMessageGroupsFromPhoneNumbers(
|
||||
// group exist while other are left off.
|
||||
await withTransaction(queryPromises);
|
||||
|
||||
return { error: false, groupId, identifiers };
|
||||
return { error: false, groupId, identifiers, failedNumbers };
|
||||
}
|
||||
|
||||
// getting the participants from groupId.
|
||||
@@ -426,9 +436,10 @@ onNet(MessageEvents.CREATE_MESSAGE_GROUP, async (phoneNumbers: string[], label:
|
||||
const _identifier = getIdentifier(_source);
|
||||
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, {
|
||||
message: 'MESSAGES_MESSAGE_GROUP_DUPLICATE',
|
||||
message: `APPS_MESSAGES_MESSAGE_GROUP_CREATE_ALL_NUMBERS_FAILED`,
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
@@ -436,11 +447,27 @@ onNet(MessageEvents.CREATE_MESSAGE_GROUP, async (phoneNumbers: string[], label:
|
||||
if (result.error) {
|
||||
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_FAILED, _source, result);
|
||||
return emitNet(MessageEvents.ACTION_RESULT, _source, {
|
||||
message: `MESSAGES_MESSAGE_GROUP_CREATE_FAILED:`,
|
||||
message: `APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED`,
|
||||
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);
|
||||
if (result.duplicate) {
|
||||
return;
|
||||
@@ -461,7 +488,7 @@ onNet(MessageEvents.CREATE_MESSAGE_GROUP, async (phoneNumbers: string[], label:
|
||||
} catch (e) {
|
||||
emitNet(MessageEvents.CREATE_MESSAGE_GROUP_FAILED, _source);
|
||||
emitNet(MessageEvents.ACTION_RESULT, _source, {
|
||||
message: `MESSAGES_MESSAGE_GROUP_CREATE_FAILED:`,
|
||||
message: `APPS_MESSAGES_MESSAGE_GROUP_CREATE_FAILED`,
|
||||
type: 'error',
|
||||
});
|
||||
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) {
|
||||
// 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, {
|
||||
message: 'MESSAGES_NEW_MESSAGE_FAILED',
|
||||
message: 'APPS_MESSAGES_NEW_MESSAGE_FAILED',
|
||||
type: 'error',
|
||||
});
|
||||
messageLogger.error(`Failed to send message, ${e.message}`, {
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export interface IAlertProps {
|
||||
message: string;
|
||||
type: 'success' | 'error';
|
||||
type: 'success' | 'error' | 'info' | 'warning';
|
||||
}
|
||||
+2
-9
@@ -1,4 +1,4 @@
|
||||
export interface CallProps {
|
||||
export interface ActiveCall {
|
||||
active: boolean;
|
||||
accepted: boolean;
|
||||
isTransmitter: boolean;
|
||||
@@ -6,7 +6,7 @@ export interface CallProps {
|
||||
receiver: string;
|
||||
}
|
||||
|
||||
export interface ICall {
|
||||
export interface CallHistoryItem {
|
||||
id?: number;
|
||||
identifier: string;
|
||||
transmitter: string;
|
||||
@@ -18,13 +18,6 @@ export interface ICall {
|
||||
accepted: boolean;
|
||||
}
|
||||
|
||||
export interface ICallDuration {
|
||||
ms: number;
|
||||
s: number;
|
||||
m: number;
|
||||
h: number;
|
||||
}
|
||||
|
||||
export enum CallEvents {
|
||||
INITIALIZE_CALL = 'npwd:beginCall',
|
||||
START_CALL = 'npwd:startCall',
|
||||
|
||||
@@ -30,6 +30,8 @@ export interface CreateMessageGroupResult {
|
||||
groupId?: string;
|
||||
mine?: boolean;
|
||||
identifiers?: string[];
|
||||
allNumbersFailed?: boolean;
|
||||
failedNumbers: string[];
|
||||
}
|
||||
|
||||
export interface CreateMessageBroadcast {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
export const PHONE_NUMBER_REGEX = /^([0-9]{3}-[0-9]{4})|([0-9]{7})$/;
|
||||
|
||||
export enum PhoneEvents {
|
||||
PLAYER_IS_READY = 'npwd:playerIsReady',
|
||||
OPEN_APP_CONTACTS = 'npwd:app:CONTACTS',
|
||||
@@ -9,5 +11,11 @@ export enum PhoneEvents {
|
||||
OPEN_PHONE = 'npwd:open',
|
||||
CLOSE_PHONE = 'npwd:close',
|
||||
SET_ALERT = 'npwd:setAlert',
|
||||
SET_VISIBILITY = 'npwd:setVisibility',
|
||||
SET_NOTIFICATION = 'npwd:setNotification',
|
||||
SET_NUMBER = 'npwd:setNumber',
|
||||
SET_PHONE_READY = 'npwd:phoneReady',
|
||||
SET_CONFIG = 'npwd:setPhoneConfig',
|
||||
SET_TIME = 'npwd:setGameTime',
|
||||
SEND_CREDENTIALS = 'npwd:sendCredentials',
|
||||
}
|
||||
Reference in new issue
Block a user