Author SHA1 Message Date
J Francisco Rader bec0af2b4e Snapshot is mad 2021-03-31 16:40:42 -03:00
J Francisco Rader 7c9ba3dc6b wip 2021-03-31 15:50:26 -03:00
J Francisco Rader 836dc3e724 wip 2021-03-31 15:33:12 -03:00
J Francisco Rader 8fd711270d Fix first time join again :D 2021-03-30 03:17:51 -03:00
J Francisco Rader c7fc4ab660 Fixed first time join 2021-03-30 02:58:15 -03:00
J Francisco Rader e08bdf4c12 Welcome email + Phone Actions tested working 2021-03-30 02:48:22 -03:00
J Francisco Rader 392dfda8b4 Remove useless stuff 2021-03-30 02:10:13 -03:00
J Francisco Rader 0a5a49b3d5 Phone actions can be triggered from outside the phone via email 2021-03-30 02:08:53 -03:00
J Francisco Rader 901d7e95d3 Fix shit 2021-03-30 02:08:53 -03:00
J Francisco Rader 0ffafbc950 Still WIP :) 2021-03-30 02:08:53 -03:00
J Francisco Rader a9b824d026 WIP :D 2021-03-30 02:08:53 -03:00
J Francisco Rader b83a890f48 Create email and Reply functionality 2021-03-30 02:08:52 -03:00
J Francisco Rader 15a8db1293 WIP 2021-03-30 02:08:34 -03:00
J Francisco Rader 04670233bc Playing around with stuff 2021-03-30 02:07:56 -03:00
J Francisco Rader 282e99df18 WIP 2021-03-30 02:07:04 -03:00
J Francisco Rader 1efa5af259 re-make inbox query 2021-03-30 02:07:04 -03:00
J Francisco Rader 74ba95db4b Improve isRead 2021-03-30 02:07:04 -03:00
J Francisco Rader 4e0b5a38ff Improve email formatting 2021-03-30 02:07:04 -03:00
J Francisco Rader e22db7c9bc Format messages from db into Emails 2021-03-30 02:07:04 -03:00
J Francisco Rader 1959b9c209 Add sql structure 2021-03-30 02:07:04 -03:00
J Francisco Rader a97d858f99 WIP :D 2021-03-30 02:07:04 -03:00
J Francisco Rader ff4381fa01 Email app upgrades WIP 2021-03-30 02:07:04 -03:00
J Francisco Rader c2510266f8 Email app create email form 2021-03-30 02:07:04 -03:00
J Francisco Rader 6569f94cd5 Add email app UI 2021-03-30 02:07:04 -03:00
J Francisco Rader 804c9982b2 Add EMAIL app 2021-03-30 02:07:02 -03:00
409 changed files with 31987 additions and 13672 deletions

No files matched your search

+11 -19
View File
@@ -1,6 +1,6 @@
name: Test Suite name: Test Suite
on: [push, pull_request] on: [push]
jobs: jobs:
nui_preformatting_tests: nui_preformatting_tests:
@@ -13,6 +13,11 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Get yarn cache directory path - name: Get yarn cache directory path
id: yarn-cache-dir-path id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn config get cacheFolder)" run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
@@ -31,8 +36,6 @@ jobs:
run: yarn --frozen-lockfile run: yarn --frozen-lockfile
- name: Run Enzyme Tests - name: Run Enzyme Tests
run: yarn test run: yarn test
- name: Check build status
run: yarn build
env: env:
CI: true CI: true
@@ -46,6 +49,11 @@ jobs:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
# This is important to fetch the changes to the previous commit
fetch-depth: 0
- name: Use Node.js - name: Use Node.js
uses: actions/setup-node@v1 uses: actions/setup-node@v1
with: with:
@@ -54,21 +62,5 @@ jobs:
run: yarn --frozen-lockfile run: yarn --frozen-lockfile
- name: Run Jest Tests - name: Run Jest Tests
run: yarn test run: yarn test
- name: Check build status
run: yarn build
env: env:
CI: true CI: true
lint:
name: Lint Lua scripts
runs-on: ubuntu-latest
defaults:
run:
working-directory: resources
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint
uses: GoatG33k/fivem-lua-lint-action@v1
-57
View File
@@ -1,57 +0,0 @@
name: Prerelease Publisher
on:
push:
branches:
- master
jobs:
pre-release-build:
name: 'Build & Create Pre-Release'
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Setup Node and Yarn Cache
uses: actions/setup-node@v2
with:
node-version: '14'
cache: 'yarn'
# Get zip util
- name: Install archive tools
run: sudo apt install zip
- name: Get variables
id: get_vars
run: |
echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)"
echo "::set-output name=DATE::$(date +'%D')"
- name: Install Deps
run: yarn --frozen-lockfile
- name: Run build
run: yarn build
- name: Bundle and Zip files
run: |
mkdir -p ./temp/npwd/resources
cp ./{LICENSE,README.md,config.json,import.sql,fxmanifest.lua} ./temp/npwd/
cp -r ./resources/{dist,html} ./temp/npwd/resources
cd ./temp && zip -r npwd-pre-${{ steps.get_vars.outputs.SHORT_SHA }}.zip ./npwd
- name: Create Release & Changelog
uses: "marvinpinto/[email protected]"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: Pre-Release Build (${{ steps.get_vars.outputs.SHORT_SHA }}) | ${{ steps.get_vars.outputs.DATE }}
prerelease: true
automatic_release_tag: "unstable"
files: ./temp/npwd-pre-${{ steps.get_vars.outputs.SHORT_SHA }}.zip
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-107
View File
@@ -1,107 +0,0 @@
name: Tagged Release Publisher
on:
push:
tags:
- "*"
jobs:
bump-version:
name: Bump Version
runs-on: ubuntu-latest
outputs:
VERSION_TAG: ${{ steps.get_version_tag.outputs.VERSION_TAG }}
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
- name: Get Version Tag
id: get_version_tag
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//}
- name: Setup Node
uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Bump package shells
run: |
cd phone && npm version ${{ needs.bump-version.outputs.VERSION_TAG }}
cd resources && npm version ${{ needs.bump-version.outputs.VERSION_TAG }}
git status
- name: Commit and push
uses: EndBug/[email protected]
with:
message: Bump version to v${{ needs.bump-version.outputs.VERSION_TAG }}
default_author: github_actions
branch: master
add: |
phone/package.json
resources/package.json
create-tagged-release:
name: Build and Create Tagged Release
runs-on: ubuntu-latest
needs: bump-version
steps:
- name: Install archive tools
run: sudo apt install zip
- name: Checkout source code
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: ${{ github.ref }}
- name: Install dependencies
run: yarn
- name: Run build
run: yarn build
- name: Create Sentry Release (NPWD)
uses: tclindner/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: 'project-error'
SENTRY_PROJECT: 'npwd'
SENTRY_URL: https://sentry.projecterror.dev/
SENTRY_LOG_LEVEL: debug
with:
environment: production
tagName: ${{ needs.bump-version.outputs.VERSION_TAG }}
sourceMapOptions: './resources/html/static/js'
- name: Create Sentry Release (NodeJS)
uses: tclindner/[email protected]
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
SENTRY_ORG: 'project-error'
SENTRY_PROJECT: 'npwd-s'
SENTRY_URL: https://sentry.projecterror.dev/
with:
environment: production
tagName: ${{ steps.get_vars.outputs.VERSION_TAG }}
sourceMapOptions: './resources/html/static/js'
- name: Bundle built files
run: |
mkdir -p ./temp/npwd/resources
cp ./{LICENSE,README.md,config.json,import.sql,fxmanifest.lua} ./temp/npwd/
cp -r ./resources/{dist,html} ./temp/npwd/resources
cd ./temp && zip -r npwd-${{ needs.bump-version.outputs.VERSION_TAG }}.zip ./npwd
- name: Create Release
uses: "marvinpinto/[email protected]"
id: auto_release
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
title: NPWD Release | ${{ needs.bump-version.outputs.VERSION_TAG }}
prerelease: false
files: npwd-${{ needs.bump-version.outputs.VERSION_TAG }}.zip
env:
CI: false
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
-5
View File
@@ -1,8 +1,6 @@
# No IDE Folders # No IDE Folders
.idea .idea
npwd_temp
resources/html resources/html
phone/.eslintcache phone/.eslintcache
@@ -22,6 +20,3 @@ yarn-error.log*
# Debug logs # Debug logs
sv_npwd.log sv_npwd.log
# FXServer Yarn
.yarn.installed
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
if [ -z "$husky_skip_init" ]; then
debug () {
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
}
readonly hook_name="$(basename "$0")"
debug "starting $hook_name..."
if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi
if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi
export readonly husky_skip_init=1
sh -e "$0" "$@"
exitCode="$?"
if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
exit $exitCode
fi
exit 0
fi
-4
View File
@@ -1,4 +0,0 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit ""
File renamed without changes.
+12 -12
View File
@@ -1,9 +1,9 @@
# New-Phone-Who-Dis (NPWD) # New-Phone-Who-Dis (NPWD)
<img src="https://i.file.glass/zVkK7.png" width="500" height="300" /> <img src="https://beta.iodine.gg/zVkK7.png" width="500" height="300" />
NPWD is our flagship and current running project. The team has been working on the project since August, 2020. This resource isn’t complete yet and currently has a pre-release. There is however no ETA for a stable release, yet. Feel free to test it out in a dev environment by following the installation guide. NPWD is our current running project. Our team has been working on the project since August, 2020. This resource isn’t complete yet and currently has no ETA for release. Feel free to test it out in a dev environment by following the installation guide.
Written completely by the Project Error Dev Team in [React](https://reactjs.org/) with a [TypeScript](https://www.typescriptlang.org/) client/server environment. Written completely by the Project Error Dev Team in [React](https://reactjs.org/) with a [TypeScript](https://www.typescriptlang.org/) client/server environment.
@@ -36,13 +36,13 @@ We do not want issues opened that are due to the phone being **WIP** as this slo
Most of these apps have UI that does **not** represent the final product and are subject to change. Most of these apps have UI that does **not** represent the final product and are subject to change.
- [**Bank**](https://i.file.glass/Eh53X.png) - [**Bank**](https://beta.iodine.gg/Eh53X.png)
- [**Calculator**](https://i.file.glass/s6VQV.png) - [**Calculator**](https://beta.iodine.gg/s6VQV.png)
- [**Camera**](https://i.file.glass/vW0y9.png) - [**Camera**](https://beta.iodine.gg/vW0y9.png)
- [**Contacts**](https://i.file.glass/3fujR.png) - [**Contacts**](https://beta.iodine.gg/3fujR.png)
- [**Marketplace**](https://i.file.glass/5bUa8.png) - [**Marketplace**](https://beta.iodine.gg/5bUa8.png)
- [**Messages**](https://i.file.glass/S4Lia.png) - [**Messages**](https://beta.iodine.gg/S4Lia.png)
- [**Notes**](https://i.file.glass/qTkBb.png) - [**Notes**](https://beta.iodine.gg/qTkBb.png)
- [**Phone**](https://i.file.glass/z0ii9.png) - [**Phone**](https://beta.iodine.gg/z0ii9.png)
- [**Settings**](https://i.file.glass/mZAIt.png) - [**Settings**](https://beta.iodine.gg/mZAIt.png)
- [**Twitter**](https://i.file.glass/rQZFR.png) - [**Twitter**](https://beta.iodine.gg/rQZFR.png)
-3
View File
@@ -1,3 +0,0 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
+18 -16
View File
@@ -1,23 +1,23 @@
{ {
"Locale": "en", "Locale": "en",
"PhoneAsItem": { "KeyTogglePhone": 288,
"enabled": false, "KeyTakeCall": 38,
"exportResource": "my-core-resource", "PhoneAsItem": false,
"exportName": "myCheckerFunction" "SwimDestroy": false,
"RunRate": 10,
"DestoryChance": 100,
"DestroyPhoneReCheck": 3,
"notificationPosition": {
"horizontal": "right",
"vertical": "top"
}, },
"general": { "general": {
"useDashNumber": true, "useDashNumber": true
"enableMultiChar": false
},
"database": {
"useIdentifierPrefix": false,
"playerTable": "users",
"identifierColumn": "identifier"
}, },
"twitter": { "twitter": {
"showNotifications": true, "showNotifications": true,
"generateProfileNameFromUsers": true, "generateProfileNameFromUsers": true,
"allowEditableProfileName": true, "allowEdtiableProfileName": true,
"allowDeleteTweets": true, "allowDeleteTweets": true,
"allowReportTweets": true, "allowReportTweets": true,
"characterLimit": 160, "characterLimit": 160,
@@ -29,14 +29,16 @@
}, },
"match": { "match": {
"generateProfileNameFromUsers": true, "generateProfileNameFromUsers": true,
"allowEditableProfileName": true "allowEdtiableProfileName": true
},
"email": {
"provider": "project-error.dev"
}, },
"bank": { "bank": {
"showNotifications": true "showNotifications": true
}, },
"debug": { "debug": {
"level": "silly", "level": "debug",
"enabled": true, "enabled": true
"sentryEnabled": true
} }
} }
+5 -5
View File
@@ -3,9 +3,8 @@ game "gta5"
description 'js runtime monkaW' description 'js runtime monkaW'
authors { "itschip", "erik-sn", "TasoOneAsia", "kidz", "RockySouthpaw"} authors { "itschip", "erik-sn", "TasoOneAsia", "kidz", "RockySouthpaw"}
client_scripts { client_script {
'resources/dist/client/*.client.js', 'resources/dist/client/*.client.js'
'resources/client/*.lua'
} }
server_script { server_script {
@@ -15,7 +14,8 @@ server_script {
ui_page 'resources/html/index.html' ui_page 'resources/html/index.html'
files { files {
'config.json',
'resources/html/index.html', 'resources/html/index.html',
'resources/html/**/*', 'resources/html/*.js',
'resources/html/*.map',
'resources/html/media/**/*'
} }
+106 -46
View File
@@ -1,13 +1,16 @@
# comment this out if your server has a different table/location for phone_number # comment this out if your server has a different table/location for phone_number
# or if it already exists in the users table # or if it already exists in the users table
ALTER TABLE `users` ADD COLUMN `phone_number` VARCHAR(20) DEFAULT NULL; ALTER TABLE `users` ADD COLUMN `phone_number` VARCHAR(20) DEFAULT NULL;
ALTER TABLE `users` ADD COLUMN `phone_email` VARCHAR(255) DEFAULT NULL;
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('phone', 'Phone', 1, 0, 1);
INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`) VALUES ('dphone', 'Destroyed Phone', 1, 0, 1);
CREATE TABLE IF NOT EXISTS `npwd_phone_contacts` ( CREATE TABLE IF NOT EXISTS npwd_phone_contacts (
`id` int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) DEFAULT NULL, identifier varchar(60) DEFAULT NULL,
`avatar` varchar(512) DEFAULT NULL, avatar varchar(512) DEFAULT NULL,
`number` varchar(12) DEFAULT NULL, number varchar(10) DEFAULT NULL,
`display` varchar(255) NOT NULL DEFAULT '', display varchar(60) NOT NULL DEFAULT '',
PRIMARY KEY (id) PRIMARY KEY (id)
); );
@@ -17,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`likes` int NOT NULL DEFAULT '0', `likes` int NOT NULL DEFAULT '0',
`identifier` varchar(48) NOT NULL, `identifier` varchar(40) NOT NULL,
`visible` tinyint NOT NULL DEFAULT '1', `visible` tinyint NOT NULL DEFAULT '1',
`images` varchar(1000) DEFAULT '', `images` varchar(1000) DEFAULT '',
`retweet` int DEFAULT NULL, `retweet` int DEFAULT NULL,
@@ -28,9 +31,9 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` ( CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`profile_name` varchar(90) NOT NULL, `profile_name` varchar(90) NOT NULL,
`identifier` varchar(48) NOT NULL, `identifier` varchar(40) NOT NULL,
# Default Profile avatar can be set here # Default Profile avatar can be set here
`avatar_url` varchar(255) DEFAULT 'https://i.file.glass/QrEvq.png', `avatar_url` varchar(255) DEFAULT 'https://beta.iodine.gg/QrEvq.png',
`bio` varchar(512) DEFAULT NULL, `bio` varchar(512) DEFAULT NULL,
`location` varchar(45) DEFAULT NULL, `location` varchar(45) DEFAULT NULL,
`job` varchar(45) DEFAULT NULL, `job` varchar(45) DEFAULT NULL,
@@ -54,7 +57,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
CREATE TABLE IF NOT EXISTS `npwd_match_profiles` ( CREATE TABLE IF NOT EXISTS `npwd_match_profiles` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) NOT NULL, `identifier` varchar(255) NOT NULL,
`name` varchar(90) NOT NULL, `name` varchar(90) NOT NULL,
`image` varchar(255) NOT NULL, `image` varchar(255) NOT NULL,
`bio` varchar(512) DEFAULT NULL, `bio` varchar(512) DEFAULT NULL,
@@ -66,11 +69,11 @@ CREATE TABLE IF NOT EXISTS `npwd_match_profiles` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`), UNIQUE KEY `name_UNIQUE` (`name`),
UNIQUE KEY `identifier_UNIQUE` (`identifier`) 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` ( CREATE TABLE IF NOT EXISTS `npwd_match_views` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) NOT NULL, `identifier` varchar(40) NOT NULL,
`profile` int NOT NULL, `profile` int NOT NULL,
`liked` tinyint DEFAULT '0', `liked` tinyint DEFAULT '0',
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -78,34 +81,34 @@ CREATE TABLE IF NOT EXISTS `npwd_match_views` (
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `match_profile_idx` (`profile`), KEY `match_profile_idx` (`profile`),
CONSTRAINT `match_profile` FOREIGN KEY (`profile`) REFERENCES `npwd_match_profiles` (`id`) 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` ( CREATE TABLE IF NOT EXISTS npwd_notes (
`id` int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) NOT NULL, identifier varchar(255) NOT NULL,
`title` varchar(255) NOT NULL, title varchar(255) NOT NULL,
`content` varchar(255) NOT NULL, content varchar(255) NOT NULL,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
CREATE TABLE IF NOT EXISTS `npwd_marketplace_listings` ( CREATE TABLE IF NOT EXISTS npwd_marketplace_listings (
`id` int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) DEFAULT NULL, identifier varchar(255) DEFAULT NULL,
`username` varchar(255) DEFAULT NULL, username varchar(255) DEFAULT NULL,
`name` varchar(50) DEFAULT NULL, name varchar(50) DEFAULT NULL,
`number` varchar(255) NOT NULL, number varchar(255) NOT NULL,
`title` varchar(255) DEFAULT NULL, title varchar(255) DEFAULT NULL,
`url` varchar(255) DEFAULT NULL, url varchar(255) DEFAULT NULL,
`description` varchar(255) NOT NULL, description varchar(255) NOT NULL,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, createdAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, updatedAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
CREATE TABLE IF NOT EXISTS `npwd_marketplace_reports` ( CREATE TABLE IF NOT EXISTS npwd_marketplace_reports (
`id` int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
`listing_id` int(11) DEFAULT NULL, listing_id int(11) DEFAULT NULL,
`profile` varchar(255) DEFAULT NULL, profile varchar(255) DEFAULT NULL,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
@@ -123,20 +126,30 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` (
CREATE TABLE IF NOT EXISTS `npwd_messages_groups` ( CREATE TABLE IF NOT EXISTS `npwd_messages_groups` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`user_identifier` varchar(48) NOT NULL, `user_identifier` varchar(40) NOT NULL,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, `updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`group_id` varchar(512) NOT NULL, `group_id` varchar(512) NOT NULL,
`participant_identifier` varchar(48) NOT NULL, `participant_identifier` varchar(40) NOT NULL,
`label` varchar(60) DEFAULT '', `label` varchar(60) DEFAULT '',
`unreadCount` int(11) NOT NULL DEFAULT 0, `unreadCount` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
); );
CREATE TABLE IF NOT EXISTS `npwd_messages_labels` (
`id` int NOT NULL AUTO_INCREMENT,
`user_identifier` varchar(40) NOT NULL,
`label` varchar(60) NOT NULL,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`group_id` varchar(512) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `npwd_messages` ( CREATE TABLE IF NOT EXISTS `npwd_messages` (
`id` int NOT NULL AUTO_INCREMENT, `id` int NOT NULL AUTO_INCREMENT,
`message` varchar(512) NOT NULL, `message` varchar(512) NOT NULL,
`user_identifier` varchar(48) NOT NULL, `user_identifier` varchar(40) NOT NULL,
`group_id` varchar(512) NOT NULL, `group_id` varchar(512) NOT NULL,
`isRead` tinyint NOT NULL DEFAULT '0', `isRead` tinyint NOT NULL DEFAULT '0',
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
@@ -145,20 +158,67 @@ CREATE TABLE IF NOT EXISTS `npwd_messages` (
PRIMARY KEY (`id`) PRIMARY KEY (`id`)
); );
CREATE TABLE IF NOT EXISTS `npwd_calls` ( CREATE TABLE IF NOT EXISTS npwd_calls (
`id` int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) DEFAULT NULL, identifier varchar(255) DEFAULT NULL,
`transmitter` varchar(255) NOT NULL, transmitter varchar(255) NOT NULL,
`receiver` varchar(255) NOT NULL, receiver varchar(255) NOT NULL,
`is_accepted` tinyint(4) DEFAULT 0, is_accepted tinyint(4) DEFAULT 0,
`start` varchar(255) DEFAULT NULL, start varchar(255) DEFAULT NULL,
end varchar(255) DEFAULT NULL, end varchar(255) DEFAULT NULL,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
CREATE TABLE IF NOT EXISTS npwd_phone_gallery ( CREATE TABLE IF NOT EXISTS npwd_phone_gallery (
`id` int(11) NOT NULL AUTO_INCREMENT, id int(11) NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) DEFAULT NULL, identifier varchar(255) DEFAULT NULL,
`image` varchar(255) DEFAULT NULL, image varchar(255) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS npwd_emails (
id int(11) NOT NULL AUTO_INCREMENT,
subject varchar(80) NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS npwd_emails_messages (
id int(11) NOT NULL AUTO_INCREMENT,
parent_id int(11) DEFAULT NULL,
email_id int(11) NOT NULL,
sender varchar(255) NOT NULL,
sender_identifier varchar(255),
send_date int(11) NOT NULL,
body TEXT,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS npwd_emails_receivers (
id int(12) NOT NULL AUTO_INCREMENT,
message_id int(11) NOT NULL,
receiver varchar(255) NOT NULL,
receiver_identifier varchar(255) NOT NULL,
read_at int(11) DEFAULT NULL,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS npwd_emails_phone_actions (
id int(11) NOT NULL AUTO_INCREMENT,
message_id int(11) NOT NULL,
label varchar(255) NOT NULL,
close_phone int(1) DEFAULT 0,
delete_email int(1) DEFAULT 1,
href text NOT NULL,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS npwd_emails_external_actions (
id int(11) NOT NULL AUTO_INCREMENT,
message_id int(11) NOT NULL,
label varchar(255) NOT NULL,
close_phone int(1) DEFAULT 0,
delete_email int(1) DEFAULT 1,
event_name varchar(255) NOT NULL,
event_arg text,
PRIMARY KEY (id) PRIMARY KEY (id)
); );
+5 -14
View File
@@ -1,29 +1,20 @@
{ {
"name": "npwd", "name": "npwd",
"version": "0.1.0",
"description": "A FiveM phone resource, made in React & TypeScript",
"repository": "https://github.com/project-error/new-phone-who-dis",
"license": "CC-BY-NC-SA-4.0",
"devDependencies": { "devDependencies": {
"@commitlint/cli": "^12.1.1",
"@commitlint/config-conventional": "^12.1.1",
"@octokit/core": "^3.4.0",
"husky": "^5.1.3", "husky": "^5.1.3",
"lerna": "^3.22.1", "lerna": "^3.22.1",
"prettier": "^2.2.1", "prettier": "^2.2.1",
"pretty-quick": "^3.1.0" "pretty-quick": "^3.1.0"
}, },
"scripts": { "scripts": {
"build": "lerna run test && lerna run build", "build": "lerna run build --concurrency 1",
"prepare": "husky install", "prepare": "husky install",
"bootstrap": "lerna bootstrap", "format": "pretty-quick"
"format:staged": "pretty-quick --staged",
"postinstall": "husky install && yarn bootstrap",
"test": "lerna run test"
}, },
"husky": { "husky": {
"hooks": { "hooks": {
"pre-commit": "npx run format:staged" "pre-commit": "pretty-quick --staged"
}
} }
},
"dependencies": {}
} }
+12
View File
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
],
"@babel/preset-react"
],
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-syntax-dynamic-import"]
}
-1
View File
@@ -1 +0,0 @@
REACT_APP_VERSION=$npm_package_version
-12
View File
@@ -1,5 +1,3 @@
const path = require('path');
const { const {
addAfterLoader, addAfterLoader,
removeLoaders, removeLoaders,
@@ -54,17 +52,7 @@ module.exports = {
if (!babelLoaderIsAdded) throwError('failed to add back babel-loader for non-application JS'); if (!babelLoaderIsAdded) throwError('failed to add back babel-loader for non-application JS');
paths.appBuild = webpackConfig.output.path = path.resolve('../resources/html');
if (webpackConfig.mode === 'development') {
webpackConfig.devtool = 'eval-source-map';
}
return webpackConfig; return webpackConfig;
}, },
}, },
devServer: (devServerConfig) => {
devServerConfig.writeToDisk = true;
return devServerConfig;
},
}; };
+1 -1
View File
@@ -4,7 +4,7 @@ console.log(args);
const path = './src/locale/'; const path = './src/locale/';
const langs = ['bs', 'no', 'es', 'fr', 'pt', 'ptbr', 'sv', 'tr', "hu"]; const langs = ['bs', 'no', 'es', 'fr', 'pt', 'ptbr', 'sv', 'tr'];
const defaultLang = 'en'; const defaultLang = 'en';
+18572
View File
File diff suppressed because it is too large. Load diff
+71 -36
View File
@@ -2,57 +2,92 @@
"name": "npwd-nui", "name": "npwd-nui",
"version": "0.1.0", "version": "0.1.0",
"repository": "https://github.com/project-error/new-phone-who-dis", "repository": "https://github.com/project-error/new-phone-who-dis",
"private": true, "private": false,
"license": "CC-BY-NC-SA-4.0", "license": "CC-BY-NC-SA-4.0",
"homepage": "/resources/html",
"dependencies": { "dependencies": {
"@material-ui/core": "^4.11.3", "@babel/polyfill": "^7.4.4",
"@material-ui/icons": "^4.11.2", "@fortawesome/fontawesome-svg-core": "^1.2.32",
"@fortawesome/free-brands-svg-icons": "^5.15.1",
"@fortawesome/free-solid-svg-icons": "^5.15.1",
"@fortawesome/react-fontawesome": "^0.1.11",
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56", "@material-ui/lab": "^4.0.0-alpha.56",
"dayjs": "^1.10.4", "@popperjs/core": "^2.5.3",
"dompurify": "^2.2.6",
"emoji-mart": "^3.0.1",
"enzyme": "^3.11.0",
"fivem-nui-react-lib": "^2.2.8",
"howler": "^2.2.1",
"i18next": "^20.3.4",
"jsonschema": "^1.4.0",
"parse-url": "^5.0.7",
"qs": "^6.9.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^11.7.1",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"recoil": "^0.3.1"
},
"devDependencies": {
"@craco/craco": "^6.1.1",
"@sentry/integrations": "^6.10.0",
"@sentry/webpack-plugin": "^1.16.0",
"@sentry/react": "^5.29.2", "@sentry/react": "^5.29.2",
"@sentry/tracing": "^5.29.2", "@sentry/tracing": "^5.29.2",
"core-js": "^3.8.3",
"dayjs": "^1.10.4",
"dompurify": "^2.2.6",
"emoji-mart": "^3.0.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"howler": "^2.2.1",
"i18next": "^19.7.0",
"jsonschema": "^1.4.0",
"parse-url": "^5.0.2",
"qs": "^6.9.6",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-hotkeys": "^2.0.0",
"react-i18next": "^11.7.1",
"react-popper": "^2.2.3",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"recoil": "^0.1.2"
},
"devDependencies": {
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"@craco/craco": "^6.1.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/enzyme": "^3.10.7", "@types/enzyme": "^3.10.7",
"@types/howler": "^2.2.1", "@types/howler": "^2.2.1",
"@types/jest": "^26.0.14",
"@types/node": "^14.11.5", "@types/node": "^14.11.5",
"@types/qs": "^6.9.5", "@types/qs": "^6.9.5",
"@types/react": "^16.9.51", "@types/react": "^16.9.51",
"@types/react-dom": "^16.9.8", "@types/react-dom": "^16.9.8",
"@types/react-router-dom": "^5.1.7", "@types/react-router-dom": "^5.1.7",
"@welldone-software/why-did-you-render": "^6.1.1", "babel-eslint": "^10.0.1",
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1", "babel-loader": "^8.1.0",
"cross-env": "^7.0.3", "babel-plugin-styled-components": "^1.10.0",
"dotenv": "^10.0.0", "babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"ts-loader": "^8.3.0", "copy-webpack-plugin": "6.2.1",
"typescript": "^4.3.2" "cp-cli": "^2.0.0",
"cra-build-watch": "^3.2.0",
"cross-env": "^7.0.2",
"css-loader": "^2.1.1",
"customize-cra": "^1.0.0",
"file-loader": "^3.0.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^4.3.0",
"react-devtools": "^4.10.1",
"react-test-renderer": "^16.13.1",
"style-loader": "^0.23.1",
"svg-url-loader": "^2.3.2",
"terser-webpack-plugin": "^1.3.0",
"ts-loader": "^8.0.4",
"typescript": "3.9.7",
"url-loader": "^1.1.2",
"webpack-cli": "^3.3.12"
}, },
"scripts": { "scripts": {
"i18n:missing": "node --experimental-json-modules i18n.missingKeys.js", "i18n:missing": "node --experimental-json-modules i18n.missingKeys.js",
"start": "cross-env PUBLIC_URL=/ craco start", "copy:config": "cp-cli ../config.json ./src/config.autogen.json",
"watch": "cross-env REACT_APP_IN_GAME=1 craco start", "start": "craco start",
"build:release": "cross-env SENTRY_RELEASE=true craco build", "watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js",
"build": "craco build", "build": "yarn copy:config && cross-env NODE_ENV=production webpack --config webpack/prod.config.js --color -p --progress --hide-modules --display-optimization-bailout",
"test": "craco test --watchAll=false --testMatch **/src/**/*.test.{ts,js,tsx}" "build:dev": "cross-env NODE_ENV=development webpack --config webpack/dev.config.js --color -p --progress --hide-modules --display-optimization-bailout --analyze",
"test": "craco test --watchAll=false --testMatch **/src/**/*.test.{ts,js,tsx}",
"test:watch": "react-scripts test --watchAll --testMatch **/src/**/*.test.{ts,js,tsx}",
"eject": "react-scripts eject"
}, },
"eslintConfig": { "eslintConfig": {
"extends": "react-app" "extends": "react-app"
-96
View File
@@ -1,96 +0,0 @@
customElements.define(
'x-frame-bypass',
class extends HTMLIFrameElement {
static get observedAttributes() {
return ['src'];
}
constructor() {
super();
}
attributeChangedCallback() {
this.load(this.src);
}
connectedCallback() {
this.sandbox =
'' + this.sandbox ||
'allow-forms allow-modals allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation-by-user-activation'; // all except allow-top-navigation
}
load(url, options) {
if (!url || !url.startsWith('http'))
throw new Error(`Unable to load src ${url} does not start with http(s)://`);
this.srcdoc = `<html>
<head>
<style>
.loader {
position: absolute;
top: calc(50% - 25px);
left: calc(50% - 25px);
width: 50px;
height: 50px;
background-color: #333;
border-radius: 50%;
animation: loader 1s infinite ease-in-out;
}
@keyframes loader {
0% {
transform: scale(0);
}
100% {
transform: scale(1);
opacity: 0;
}
}
</style>
</head>
<body>
<div class="loader"></div>
</body>
</html>`;
this.fetchProxy(url, options, 0)
.then((res) => res.text())
.then((data) => {
if (data)
this.srcdoc = data.replace(
/<head([^>]*)>/i,
`<head$1>
<base href="${url}">
<script>
// X-Frame-Bypass navigation event handlers
document.addEventListener('click', e => {
if (frameElement && document.activeElement && document.activeElement.href) {
e.preventDefault()
frameElement.load(document.activeElement.href)
}
})
document.addEventListener('submit', e => {
if (frameElement && document.activeElement && document.activeElement.form && document.activeElement.form.action) {
e.preventDefault()
if (document.activeElement.form.method === 'post')
frameElement.load(document.activeElement.form.action, {method: 'post', body: new FormData(document.activeElement.form)})
else
frameElement.load(document.activeElement.form.action + '?' + new URLSearchParams(new FormData(document.activeElement.form)))
}
})
</script>`,
);
})
.catch((e) => console.error('Unable to load proxy iframe service', e));
}
fetchProxy(url, options, i) {
const proxies = (options || {}).proxies || [
'https://cors-anywhere.herokuapp.com/',
'https://api.codetabs.com/v1/proxy/?quest=',
];
return fetch(proxies[i] + url, options)
.then((res) => {
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
return res;
})
.catch((error) => {
if (i === proxies.length - 1) throw error;
return this.fetchProxy(url, options, i + 1);
});
}
},
{ extends: 'iframe' },
);
-2
View File
@@ -8,8 +8,6 @@
/> />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" /> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- Enable experimental proxy custom iframe webcomp -->
<!-- <script type="module" src="./iframe.webcomp.js"></script>-->
<title>Project Error - New Phone Who Dis</title> <title>Project Error - New Phone Who Dis</title>
</head> </head>
<body> <body>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_bank"><path d="M58.446,100.843l-0.002,0.001l-0.111,-0.814c-0.113,0.019 -0.254,0.043 -0.423,0.072c-0.205,0.035 -0.414,0.055 -0.628,0.059c-0.215,-0.004 -0.373,-0 -0.488,0.006c-0.457,-0.006 -1.092,-0.107 -1.901,-0.287c-0.009,-0.002 -0.018,-0.004 -0.027,-0.006c-0.584,-0.117 -1.236,-0.171 -1.957,-0.157c-0.727,0.015 -1.446,0.123 -2.156,0.327c-0.984,0.281 -1.545,0.797 -1.734,1.512c-0.175,0.65 0.03,1.248 0.659,1.785c0.655,0.559 1.911,1.072 3.819,1.456c4.335,0.947 8.77,0.769 13.305,-0.549c0.309,2.174 0.647,4.292 1.012,6.353l0.087,0.326c0.021,0.076 0.056,0.149 0.103,0.217c0.624,0.898 1.978,1.497 4.182,1.594c1.511,0.08 2.51,-0.179 3.051,-0.589c0.482,-0.366 0.725,-0.866 0.629,-1.524c-0.001,-0.004 -0.002,-0.009 -0.002,-0.013c-0.507,-3.055 -1.021,-6.235 -1.543,-9.54c0.72,-0.411 1.412,-0.848 2.077,-1.312c7.412,-4.882 10.396,-9.629 9.221,-14.124c-0.847,-3.503 -4.878,-6.508 -12.293,-8.84c-0.68,-0.221 -1.412,-0.432 -2.198,-0.635c-0.34,-3.261 -0.616,-6.387 -0.829,-9.379c-0.002,-0.033 -0.007,-0.066 -0.014,-0.098c-0.001,-0.012 -0.052,-0.501 -0.112,-1.217l-0,0c2.426,-0.661 4.883,-1.121 7.372,-1.382c0.005,-0.001 0.01,-0.001 0.015,-0.002c1.086,-0.126 1.95,-0.436 2.606,-0.901c0.396,-0.28 0.616,-0.596 0.7,-0.929c0.112,-0.447 -0.019,-0.964 -0.535,-1.518c-0.612,-0.657 -1.577,-1.186 -2.932,-1.546c-1.293,-0.345 -2.472,-0.442 -3.533,-0.315c-1.397,0.165 -2.801,0.374 -4.211,0.627c-0.104,-1.786 -0.231,-3.584 -0.383,-5.395c-0,-0.039 -0.009,-0.099 -0.027,-0.163l-0.082,-0.293c-0.012,-0.037 -0.028,-0.075 -0.047,-0.111c-0.476,-0.887 -1.732,-1.54 -3.935,-1.708c-0.003,-0 -0.006,-0.001 -0.008,-0.001c-1.873,-0.131 -3.01,0.255 -3.52,0.838c-0.275,0.315 -0.42,0.707 -0.383,1.186c0.132,2.266 0.303,4.766 0.513,7.5c-0.402,0.11 -0.779,0.226 -1.131,0.347c-0.887,0.294 -1.603,0.547 -2.15,0.759c-0.54,0.21 -1.239,0.494 -2.097,0.852c-0.901,0.376 -1.648,0.74 -2.243,1.088c-0.6,0.352 -1.211,0.779 -1.832,1.283c-0.646,0.525 -1.156,1.055 -1.537,1.586c-0.002,0.004 -0.005,0.007 -0.007,0.01c-0.917,1.325 -1.276,2.575 -1.122,3.743c0.156,1.185 0.668,2.201 1.519,3.052c0.794,0.793 1.877,1.553 3.257,2.271c1.327,0.691 2.586,1.247 3.778,1.671c1.179,0.42 2.454,0.8 3.823,1.139c0.373,0.106 0.86,0.234 1.448,0.383c0.667,6.042 1.408,11.967 2.224,17.775c-0.711,0.422 -1.436,0.786 -2.178,1.093c-0.013,0.005 -0.025,0.011 -0.038,0.017c-1.679,0.767 -3.286,1.286 -4.826,1.549c-0.203,0.035 -0.335,0.057 -0.335,0.057l0.11,0.814Zm13.367,-18.787c0.275,0.109 0.554,0.235 0.839,0.379l0.56,0.129c-0,0 -0.558,-0.128 -0.558,-0.128l0.329,0.163c0.207,0.142 0.482,0.335 0.824,0.578l0.249,0.139c0.088,0.072 0.176,0.149 0.266,0.235c0.002,0.002 0.382,0.506 0.382,0.506l0.21,0.259c0.014,0.029 0.032,0.058 0.051,0.086c0.406,0.585 0.605,1.225 0.601,1.918c-0,0.004 -0,0.008 -0,0.011c0.019,1.744 -0.84,3.531 -2.528,5.377c-0.426,-3.165 -0.834,-6.382 -1.225,-9.652Zm-8.924,-8.139c-1.188,-0.383 -2.026,-0.773 -2.479,-1.216c-0.007,-0.007 -0.014,-0.013 -0.021,-0.02c-0.756,-0.69 -0.707,-1.539 -0.028,-2.542c0,-0.001 0,-0.001 0.001,-0.002c0.41,-0.61 1.089,-1.176 2.024,-1.711l0.503,5.491Z" style="fill:#fff;fill-rule:nonzero;"/><path d="M46.249,27.211c-0.82,0.319 -1.327,1.183 -1.166,2.081c0.183,1.021 1.16,1.7 2.181,1.517c-0,0 0.527,-0.047 1.468,-0.123c0.015,0.23 0.024,0.474 0.029,0.729c-0.558,0.043 -0.864,0.069 -0.864,0.069c-0.75,0.011 -1.35,0.629 -1.339,1.379c0.007,0.437 0.22,0.823 0.545,1.067c-0.158,0.196 -0.263,0.438 -0.291,0.706c-0.079,0.746 0.462,1.416 1.208,1.495c-0,0 0.201,0.035 0.575,0.098c-0.036,0.468 -0.072,0.895 -0.106,1.258c-0.825,0.119 -1.288,0.191 -1.288,0.191c-1.034,0.067 -1.82,0.961 -1.754,1.995c0.02,0.313 0.116,0.603 0.268,0.853c-0.606,0.38 -1.34,0.798 -2.223,1.249c-1.736,0.885 -3.984,1.833 -6.882,2.8c-6.965,2.325 -15.771,8.42 -21.67,17.453c-4.799,7.349 -7.651,16.623 -6.169,27.345c1.398,10.098 7.128,18.379 15.434,24.695c10.511,7.992 25.239,12.766 40.136,14.111c12.423,1.091 24.62,-1.912 34.562,-7.464c11.755,-6.564 20.295,-16.711 22.802,-27.706c2.092,-9.335 0.674,-16.82 -2.607,-23.035c-4.929,-9.337 -14.317,-15.729 -22.31,-21.233c-3.373,-2.323 -6.463,-4.463 -8.642,-6.699c-0.662,-0.68 -1.248,-1.346 -1.683,-2.033c0.116,-0.058 0.227,-0.129 0.332,-0.213c0.809,-0.648 0.941,-1.831 0.293,-2.64c-0.054,-0.079 -0.172,-0.185 -0.356,-0.301c0.04,-0.233 0.018,-0.48 -0.074,-0.716c-0.204,-0.525 -0.701,-0.852 -1.232,-0.866c-0.045,-0.339 -0.093,-0.685 -0.14,-1.035c0.316,0.005 0.579,0.016 0.784,0.032c0.744,0.096 1.425,-0.431 1.521,-1.175c0.095,-0.744 -0.431,-1.426 -1.175,-1.521c-0.333,-0.Line truncated

After

Width:  |  Height:  |  Size: 8.3 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_calculator"><path d="M104.884,7.053l0.043,0.002c-12.889,-1.555 -25.354,-2.432 -38.673,-2.704c-11.907,-0.243 -24.48,0.022 -38.642,0.671c-2.968,0.139 -5.536,1.613 -7.247,3.614c-1.442,1.686 -2.223,3.844 -2.265,6.236c-0.256,17.652 -0.683,38.403 -1.494,59.01c-0.525,13.363 -1.176,26.665 -2.261,38.999c-0.229,2.87 0.659,5.552 2.402,7.668c1.92,2.333 4.946,3.961 8.247,4.059c17.596,1.54 34.209,2.45 49.218,2.163c12.384,-0.237 23.689,-1.276 33.596,-3.219c2.606,-0.519 4.904,-1.779 6.396,-3.521c1.506,-1.759 2.463,-3.909 2.42,-6.469c0.312,-12.969 0.055,-26.151 -0.543,-39.551c-0.86,-19.256 -2.385,-38.937 -3.609,-59.08c-0.034,-2.205 -1.017,-4.183 -2.491,-5.647c-1.304,-1.294 -3.087,-2.09 -5.097,-2.231Zm1.4,8.497c-0.067,-1.698 -1.441,-3.076 -3.218,-3.076c-24.172,-2.32 -45.414,-2.683 -75.016,-0.677c-1.773,0.12 -3.218,1.377 -3.218,3.075c0,29.289 -0.099,67.107 -2.685,98.677c-0.139,1.693 1.44,3.076 3.218,3.076c31.474,3.052 59.735,3.87 81.252,-0c1.751,-0.315 3.218,-1.377 3.218,-3.076c1.37,-31.497 -2.206,-63.907 -3.551,-97.999Z" style="fill:#fff;"/><path d="M99.918,25.915c-0.08,-0.699 -0.483,-1.594 -1.505,-2.331c-0.577,-0.415 -2.12,-0.912 -2.991,-1.14c-5.706,-1.478 -13.411,-2.247 -22.877,-2.415c-9.515,-0.169 -20.824,0.312 -33.668,1.068c-1.855,0.132 -3.496,0.644 -4.153,1.027c-1.992,1.16 -2.5,2.901 -2.535,4.397c-0.001,0.073 -0.095,17.896 -0.095,17.896c-0.058,1.525 0.375,3.346 2.325,4.677c0.742,0.507 2.642,1.258 4.936,1.232c12.021,0.05 23.162,0.058 33.23,-0.237c8.156,-0.24 15.596,-0.681 22.307,-1.227c1.783,-0.149 3.291,-0.627 3.873,-1.031c1.336,-0.926 1.816,-2.088 1.841,-3.155c0.373,-3.033 0.519,-6.122 0.394,-9.268c-0.123,-3.115 -0.478,-6.277 -1.082,-9.493l0,0Zm-3.981,0.702c-0.048,-0.311 -31.65,-2.755 -56.655,-0.6c-1.178,0.102 -2.232,0.26 -2.231,0.572c-0.104,6.712 0.305,12.591 0.054,18.068c-0.014,0.312 1.002,0.562 2.235,0.558c21.843,0.491 39.199,0.362 54.128,-0.395c1.214,-0.062 2.888,0.031 2.887,-0.281c0.934,-5.785 0.534,-11.666 -0.418,-17.922Z" style="fill:#fff;"/><path d="M51.355,66.473c0.637,-1.267 0.074,-2.28 -0.009,-3.609c-0.022,-0.352 -0.257,-0.564 -0.342,-0.904c-0.107,-0.426 -0.386,-0.691 -0.621,-1.057c-1.095,-1.706 -3.298,-2.342 -5.445,-2.466c-0,-0 -6.942,0.157 -6.942,0.157c-2.116,0.061 -4.047,0.902 -5.392,2.364c-1.331,1.447 -2.213,3.375 -2.145,5.515c0,-0 0.227,7.1 0.227,7.1c0.065,2.051 0.845,3.921 2.204,5.222c1.342,1.285 3.125,2.138 5.106,2.07c-0,0 6.942,-0.261 6.942,-0.261c1.883,-0.071 3.599,-0.822 4.789,-2.132c1.173,-1.291 1.952,-3.001 1.884,-4.899c0,-0 -0.256,-7.1 -0.256,-7.1Z" style="fill:#fff;"/><path d="M77.309,66.663c0.203,-1.857 -0.605,-3.508 -1.665,-4.861c-1.107,-1.415 -2.854,-2.107 -4.753,-2.319c0,-0 -6.942,-0.677 -6.942,-0.677c-2.151,-0.172 -4.07,0.808 -5.583,2.147c-1.549,1.373 -2.347,3.456 -2.491,5.71c-0,0 -0.211,7.101 -0.211,7.101c0.054,2.329 0.926,4.472 2.472,5.945c1.531,1.457 3.562,2.44 5.813,2.329c-0,-0 6.942,-0.494 6.942,-0.494c2.069,-0.179 3.981,-0.934 5.215,-2.446c1.195,-1.465 2.092,-3.287 1.901,-5.334c-0,-0 -0.698,-7.101 -0.698,-7.101Z" style="fill:#fff;"/><path d="M51.551,95.477c0.203,-1.857 -0.605,-3.508 -1.664,-4.861c-1.108,-1.415 -2.855,-2.107 -4.754,-2.319c0,-0 -6.942,-0.677 -6.942,-0.677c-2.151,-0.172 -4.07,0.808 -5.582,2.147c-1.55,1.373 -2.348,3.456 -2.492,5.71c-0,0 -0.21,7.101 -0.21,7.101c0.053,2.329 0.925,4.472 2.472,5.945c1.53,1.457 3.561,2.44 5.812,2.329c0,-0 6.942,-0.494 6.942,-0.494c2.069,-0.179 3.981,-0.934 5.215,-2.446c1.195,-1.465 2.092,-3.287 1.901,-5.334c-0,-0 -0.698,-7.101 -0.698,-7.101Z" style="fill:#fff;"/><path d="M77.532,97.538c0.637,-1.267 0.074,-2.28 -0.009,-3.609c-0.023,-0.352 -0.257,-0.564 -0.342,-0.904c-0.107,-0.425 -0.386,-0.691 -0.621,-1.057c-1.095,-1.706 -3.298,-2.341 -5.446,-2.466c0,0 -6.942,0.157 -6.942,0.157c-2.115,0.062 -4.046,0.902 -5.391,2.364c-1.331,1.447 -2.213,3.375 -2.145,5.515c-0,-0 0.227,7.1 0.227,7.1c0.065,2.051 0.845,3.921 2.204,5.222c1.342,1.285 3.125,2.138 5.105,2.07c0,0 6.942,-0.261 6.942,-0.261c1.884,-0.071 3.6,-0.822 4.79,-2.132c1.172,-1.291 1.952,-3.001 1.884,-4.899c0,0 -0.256,-7.1 -0.256,-7.1Z" style="fill:#fff;"/><path d="M102.44,68.09c0.091,-1.912 -0.6,-3.629 -1.606,-4.953c-1.029,-1.355 -2.547,-2.105 -4.21,-2.215c0,0 -6.29,-0.396 -6.29,-0.396c-1.792,-0.104 -3.399,0.8 -4.632,2.115c-1.256,1.339 -1.951,3.301 -2.041,5.449c-0,-0 -0.458,10.812 -0.671,20.194c-0.162,7.153 -0.163,13.463 -0.163,13.463c0.024,2.432 0.848,4.643 2.22,6.219c1.367,1.571 3.227,2.572 5.287,2.543c-0,0 6.29,-0.183 6.29,-0.183c2.003,-0.07 3Line truncated

After

Width:  |  Height:  |  Size: 5.0 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_camera"><path d="M99.419,19.052c0.322,0.042 0.521,0.368 0.579,0.441c0.415,0.975 0.499,3.369 0.682,4.833c0.379,3.037 0.46,5.978 0.46,5.978c-0.064,1.765 1.317,3.25 3.082,3.315c1.765,0.064 3.25,-1.316 3.315,-3.081c-0,-0 0.47,-5.32 0.086,-9.516c-0.191,-2.093 -0.725,-3.919 -1.347,-5.095c-0.762,-1.431 -2.242,-2.536 -4.298,-3.237c-2.913,-0.995 -7.732,-0.875 -11.395,-1.014c-3.315,0.046 -7.424,0.224 -10.498,1.072c-2.571,0.709 -4.57,1.857 -5.654,3.288c-1.303,1.766 -2.049,4.184 -2.074,6.749c-0.04,4.009 1.223,8.187 1.223,8.187c0.431,1.713 2.171,2.754 3.884,2.323c1.713,-0.431 2.754,-2.171 2.323,-3.884c-0,-0 -0.412,-2.53 -0.262,-5.185c0.068,-1.2 0.227,-3.494 0.926,-4.253c0.126,-0.141 2.614,-0.502 3.759,-0.601c2.082,-0.181 4.352,-0.191 6.296,-0.142c0.41,-0.005 0.836,-0.015 1.272,-0.028c1.773,-0.051 3.723,-0.138 5.49,-0.09c0.727,0.02 1.588,-0.133 2.151,-0.06Z" style="fill:#fff;"/><path d="M39.166,25.241c-0.028,-0 -0.056,-0.001 -0.084,-0c0,-0 -14.768,0.147 -24.513,7.739c-4.632,3.608 -8.219,8.771 -8.984,16.157c-1.155,11.146 -4.352,34.192 -1.866,49.947c1.767,11.196 6.747,18.788 15.038,19.591c5.535,0.536 12.72,0.728 20.425,0.735c17.379,0.014 37.457,-0.911 46.648,-0.741c9.187,0.175 22.857,-1.228 31.542,-5.736c5.882,-3.052 9.625,-7.521 9.979,-13.272c0.468,-7.575 0.971,-26.683 0.916,-41.105c-0.036,-9.768 -0.563,-17.548 -1.222,-19.12c-1.759,-4.197 -3.927,-7.511 -7.789,-9.867c-3.528,-2.153 -8.675,-3.529 -16.91,-3.533l-63.18,-0.795Zm81.626,16.192c0.041,0.314 0.252,1.947 0.336,3.367c0.255,4.301 -0.527,12.247 -0.559,19.587c-0.058,13.172 -1.498,28.251 -1.892,34.743c-0.237,3.888 -4.16,5.936 -8.727,7.575c-7.427,2.667 -17.118,3.425 -23.956,3.297c-9.221,-0.177 -29.365,0.731 -46.802,0.703c-7.39,-0.011 -14.283,-0.19 -19.592,-0.709c-2.336,-0.228 -3.822,-1.883 -4.942,-4.149c-1.839,-3.722 -2.649,-8.913 -2.973,-14.649c-0.811,-14.374 -0.365,-31.791 0.6,-40.975c0.626,-5.957 6.276,-9.75 10.366,-12.013c7.068,-3.91 15.643,-4.094 16.409,-4.103l0.029,-0l63.257,0.699c4.807,-0.003 10.128,-0.741 12.658,0.258c3.221,1.271 4.586,3.545 5.788,6.369Z" style="fill:#fff;"/><path d="M101.655,43.026c-1.02,-0.082 -6.863,-0.465 -10.334,1.27c-2.132,1.065 -3.467,2.829 -3.604,5.307c-0.131,2.637 -0.577,4.694 -0.345,6.233c0.247,1.636 1.003,2.92 2.574,3.925c1.87,1.176 4.806,1.951 8.112,2.176c3.746,0.254 7.978,-0.135 11.348,-0.884c0.76,-0.173 2.165,-0.957 2.563,-3.049c0.474,-2.485 0.18,-8.597 -0.473,-11.043c-0.402,-1.493 -1.514,-2.673 -3.28,-3.302c-1.811,-0.645 -4.432,-0.748 -6.561,-0.633Zm5.067,5.293c0.343,1.781 0.406,5.461 0.131,7.651c-2.119,0.3 -4.488,0.415 -6.749,0.348c-2.865,-0.086 -5.567,-0.401 -7.139,-1.385l0.134,-5.186c-0.004,-1.126 1.315,-1.325 2.472,-1.619c2.734,-0.696 5.854,-0.554 5.854,-0.554c0.09,0.008 0.18,0.01 0.27,0.007c1.231,-0.014 2.692,0.042 3.925,0.314c0.386,0.085 0.889,0.319 1.102,0.424Z" style="fill:#fff;"/><path d="M55.449,43.864c-1.615,-0.323 -11.247,-1.973 -19.84,2.654c-5.142,2.769 -9.898,7.754 -12.45,16.486c-3.281,11.647 -1.489,20.925 3.149,27.364c5.419,7.52 14.903,11.368 25.8,10.615c10.499,-0.845 19.757,-5.419 24.764,-13.057c4.475,-6.825 5.823,-16.17 1.176,-27.707c-2.21,-5.456 -5.581,-9.121 -9.098,-11.553c-5.917,-4.091 -12.161,-4.713 -13.501,-4.802Zm-1.07,6.315c0.164,0.035 0.331,0.056 0.498,0.064c0,-0 5.218,0.425 10.028,4.036c2.468,1.852 4.786,4.595 6.231,8.59c3.139,8.621 2.361,15.497 -1.093,20.428c-3.836,5.477 -10.829,8.357 -18.53,8.764c-7.51,0.482 -14.09,-1.9 -17.887,-7.035c-3.429,-4.638 -4.546,-11.345 -2.41,-19.88c1.502,-6.257 4.573,-10.013 8.1,-12.162c6.911,-4.212 15.063,-2.805 15.063,-2.805Z" style="fill:#fff;"/><path d="M57.194,57.138c0,-0 -2.102,-0.509 -5.096,-0.428c-1.598,0.043 -3.369,0.316 -5.198,0.941c-2.218,0.759 -4.441,2.097 -6.18,4.195c-1.116,1.347 -2.008,3.038 -2.535,5.046c-0.389,1.48 -0.634,3.102 -0.574,4.945c0.068,2.075 0.399,4.308 1.144,6.889c0.087,0.737 0.757,1.265 1.494,1.177c0.738,-0.088 1.265,-0.758 1.177,-1.495c0.116,-2.844 0.654,-5.097 1.295,-7.08c0.289,-0.894 0.668,-1.66 1.02,-2.404c0.561,-1.188 1.281,-2.119 1.987,-2.973c0.66,-0.797 1.306,-1.522 2.039,-2.109c0.873,-0.698 1.719,-1.325 2.618,-1.795c3.412,-1.783 6.597,-2.227 6.597,-2.227c0.741,0.058 1.389,-0.495 1.447,-1.235c0.059,-0.74 -0.495,-1.389 -1.235,-1.447Z" style="fill:#fff;"/></g></svg>

After

Width:  |  Height:  |  Size: 4.7 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><path id="icon_contacts" d="M32.743,29.128c-0.796,-0.575 -1.484,-1.22 -2.085,-1.956c-1.383,-1.692 -2.306,-3.891 -2.934,-6.938c-0.11,-0.531 -0.46,-5.525 4.371,-6.47c1.599,-0.313 3.949,-0.126 7.347,1.197c-0.004,-0.78 0.008,-1.664 0.057,-2.416c0.08,-1.254 0.294,-2.501 0.716,-3.516c0.437,-1.051 1.101,-1.878 1.985,-2.397c0.592,-0.346 1.363,-0.479 2.278,-0.271c0.75,0.17 1.68,0.611 2.658,1.228c1.448,0.913 3.066,2.236 4.309,3.203c0.58,-2.03 1.553,-4.832 3.256,-6.696c1.697,-1.857 4.033,-2.942 7.318,-1.983c1.266,0.371 2.307,1.773 2.695,3.826c0.258,1.36 0.301,3.02 0.284,4.42c1.184,-0.822 2.647,-1.864 4.143,-2.662c2.239,-1.193 4.564,-1.801 6.39,-1.18c1.357,0.462 2.05,1.495 2.171,2.95c0.113,1.352 -0.44,3.251 -0.969,4.916c1.498,-0.827 3.395,-1.872 5.24,-2.739c2.663,-1.252 5.268,-2.043 6.717,-1.742c1.929,0.401 2.692,1.764 2.641,3.6c-0.025,0.92 -0.316,1.997 -0.69,3.019c0.609,-0.286 1.23,-0.547 1.809,-0.738c1.301,-0.428 2.461,-0.45 3.158,-0.094c1.288,0.658 1.782,1.642 1.829,2.747c0.032,0.742 -0.172,1.567 -0.511,2.366c0.415,-0.078 0.821,-0.111 1.188,-0.074c0.852,0.084 1.555,0.462 1.989,1.248c0.783,1.421 0.272,3.198 -1.213,4.836c-1.173,1.295 -2.914,2.544 -4.512,3.45c1.138,0.818 2.278,1.657 3.43,2.507c0.731,-0.152 1.495,-0.244 2.284,-0.256c1.267,-0.019 2.596,0.118 3.975,0.485c1.177,0.313 2.384,0.736 3.618,1.383c1.506,0.79 3.014,1.8 4.59,3.151c0.482,0.307 0.624,0.949 0.316,1.431c-0.307,0.482 -0.949,0.624 -1.431,0.317c-2.403,-1.111 -4.553,-1.607 -6.535,-1.887c-0.44,-0.062 -0.867,-0.101 -1.283,-0.122c4.275,3.828 8.106,8.134 11.267,12.739c3.181,1.596 5.785,4.12 7.944,6.95c3.566,4.675 4.187,10.763 3.285,17.037c-0.388,2.151 -2.658,11.628 -3.387,14.443c-3.997,14.741 -14.119,26.606 -26.857,33.743c-12.969,7.266 -28.742,9.2 -43.666,4.834c-14.276,-4.756 -26.578,-14.309 -33.861,-26.525c-2.73,-4.58 -4.811,-9.486 -6.115,-14.577l-0.015,-0.015c-2.1,-1.998 -3.784,-4.339 -4.897,-6.98c-2.47,-5.861 -3.181,-12.625 -0.339,-18.864c2.541,-4.927 5.862,-9.122 10.382,-11.309c1.072,-2.054 2.23,-4.036 3.467,-5.932c-0.44,0.022 -0.884,0.059 -1.333,0.114c-1.674,0.206 -3.362,0.491 -5.111,1.152c-0.501,0.277 -1.132,0.096 -1.409,-0.405c-0.277,-0.5 -0.096,-1.132 0.405,-1.409c1.518,-1.16 3.054,-2.021 4.654,-2.701c1.161,-0.493 2.325,-0.824 3.498,-1.079c0.898,-0.196 1.789,-0.32 2.673,-0.384c2.66,-3.377 5.61,-6.399 8.816,-8.975Zm59.068,6.434c-5.585,-4.186 -12.121,-6.051 -18.304,-7.987c-16.45,-5.151 -30.827,-0.215 -40.982,11.975c0.2,0.077 0.396,0.155 0.59,0.236c4.697,1.944 7.566,4.53 7.566,4.53c0.478,0.316 0.609,0.959 0.294,1.437c-0.315,0.477 -0.959,0.609 -1.436,0.293c-0,0 -3.865,-1.706 -9.183,-2.546c-0.245,-0.039 -0.494,-0.075 -0.745,-0.109c-0.71,1.027 -1.393,2.088 -2.044,3.179c2.618,0.059 5.226,0.646 7.73,2.014l-0,-0c5.762,0.722 10.051,4.306 13.318,8.589c3.566,4.675 4.187,10.763 3.285,17.037c-1.201,6.651 -5.613,11.663 -10.857,15.1c-4.53,2.969 -12.377,3.599 -18.06,2.887c1.402,10.259 17.683,23.175 30.598,27.219c22.542,7.059 56.729,-7.848 60.893,-29.443l-2.293,0.643c-4.943,2.178 -10.765,2.338 -16.485,0.989c-6.645,-2.393 -12.173,-6.861 -14.718,-12.899c-2.47,-5.86 -3.18,-12.624 -0.338,-18.863c2.949,-5.72 6.95,-10.453 12.657,-12.203c3.26,-0.999 6.671,-1.563 10.031,-1.153c-2.373,-2.851 -5.011,-5.526 -7.839,-7.966c-1.033,0.421 -1.983,0.882 -2.836,1.41c-3.212,1.992 -5.133,4.351 -5.133,4.351c-0.285,0.495 -0.92,0.666 -1.415,0.38c-0.496,-0.285 -0.666,-0.92 -0.381,-1.416c0,0 1.382,-3.318 4.544,-6.374c0.472,-0.456 0.987,-0.895 1.543,-1.31Zm-24.543,57.545c-3.015,-0.099 -5.174,1.653 -6.635,4.415c-1.401,2.648 -1.854,6.454 -1.584,10.617c0.215,2.187 1.521,4.158 3.369,5.417c1.74,1.186 3.988,1.653 6.154,1.193c1.713,-0.417 3.488,-1.494 4.727,-3.074c1.195,-1.524 1.988,-3.38 1.972,-5.179c-0.164,-5.574 -1.009,-9.17 -2.522,-11.111c-1.402,-1.798 -3.167,-2.638 -5.481,-2.278l-0,-0Zm0.208,3.182c1.242,0.028 1.894,0.83 2.283,2.21c0.495,1.756 0.433,4.284 0.012,7.741c-0.061,0.597 -0.521,1.108 -0.963,1.579c-0.423,0.45 -0.958,0.792 -1.493,0.884c-0.532,0.108 -1.062,-0.069 -1.5,-0.344c-0.42,-0.263 -0.867,-0.562 -0.956,-1.041c-0.672,-3.064 -0.836,-5.927 -0.143,-8.071c0.488,-1.509 1.249,-2.709 2.76,-2.958l0,-0Zm-9,-9.076c0.042,0.055 0.173,0.229 0.248,0.334c0.184,0.26 0.383,0.517 0.606,0.735c0.213,0.207 0.459,0.366 0.728,0.489c1.753,0.798 3.442,1.114 5.156,1.12c2.334,0.008 4.718,-0.616 7.418,-1.489c0.527,-0.172 0.894,-0.495 1.194,-0.887c0.115,-0.149 0.282,-0.43 0.382,-0.604c0.099,0.015 0.214,0.042 0.292,0.04c0.337,-0.008 0.674,-0.033 0.979,-0.091c0.355,-0.069 0.675,-Line truncated

After

Width:  |  Height:  |  Size: 6.3 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_phone"><path d="M67.177,81.796c-0.501,-0.11 -3.812,-1.343 -5.704,-2.523c-2.593,-1.618 -5.033,-3.696 -7.024,-5.261c-3.146,-3.224 -5.051,-6.328 -6.493,-8.425c2.566,-1.093 5.527,-3.354 7.945,-7.884c1.637,-3.026 1.675,-7.972 -0.129,-13.203c-1.654,-4.795 -4.682,-9.901 -7.747,-13.27c-1.172,-1.433 -7.138,-8.4 -14.298,-10.989c-4.94,-1.786 -10.324,-1.72 -15.569,1.741c-7.488,4.91 -12.99,12.386 -14.74,22.046c-1.286,7.097 -0.401,15.488 3.698,25.107c1.987,4.713 5.063,10.884 9.073,17.235c3.427,5.428 7.589,10.922 12.331,15.784c4.631,4.783 9.909,8.854 15.101,12.258c6.258,4.102 12.46,7.093 17.37,9.021l0.001,-0c12.815,4.147 24.184,4.21 33.181,1.391c8.632,-2.704 15.335,-7.754 19.328,-14.511c3.152,-5.333 3.431,-10.974 1.794,-16.255c-2.721,-8.784 -10.691,-16.233 -10.691,-16.233c-0.057,-0.054 -0.115,-0.107 -0.173,-0.159c-4.992,-4.235 -9.704,-7.624 -14.115,-8.934c-5.303,-1.575 -10.443,-1.168 -15.477,2.908c-4.2,3.384 -6.532,6.425 -7.392,9.157c-0.104,0.332 -0.196,0.665 -0.27,0.999Zm-25.671,-22.626c0.742,1.319 0.624,1.376 2.003,1.246c2.025,-0.192 5.244,-2.259 6.951,-5.454c2.322,-4.344 -2.415,-14.689 -7.244,-19.807c-0,-0 -11.312,-14.684 -21.226,-7.898c-10.481,7.175 -16.269,20.484 -7.881,38.87c3.645,7.989 10.765,20.544 20.567,30.036c9.472,9.173 21.55,15.371 29.714,18.28c19.445,6.929 35.162,2.181 41.854,-8.439c6.329,-10.047 -7.086,-22.764 -7.086,-22.764c-7.228,-6.443 -13.497,-10.973 -19.814,-6.098c-3.458,2.669 -5.317,4.823 -5.411,7.014c-0.008,0.182 -0.096,1.309 0.635,1.625c0.864,0.374 0.768,0.331 1.684,0.688c1.474,0.482 2.268,2.035 1.771,3.466c-0.496,1.431 -2.03,1.933 -3.57,1.72c-2.504,-0.346 -8.951,-2.746 -9.693,-3.092c-2.267,-0.896 -5.02,-2.121 -6.955,-3.121c-2.465,-1.275 -4.672,-2.617 -6.597,-4.036c-4.103,-3.023 -7.066,-6.207 -9.237,-9.071c-5.093,-6.718 -5.933,-11.838 -5.933,-11.838l0,0c-0.377,-1.465 0.542,-2.951 2.051,-3.317c1.508,-0.367 2.336,0.07 3.417,1.99Zm7.381,-46.162c0,0 14.152,-2.748 29.966,-0.666c9.097,1.199 18.721,4.069 26.528,10.257c11.212,8.886 18.458,24.623 14.975,52.525c-0.241,1.672 0.962,3.22 2.684,3.454c1.723,0.234 3.317,-0.934 3.558,-2.606c3.21,-19.245 1.34,-33.469 -3.432,-43.916c-3.065,-6.71 -7.334,-11.937 -12.315,-15.914c-9.06,-7.234 -20.445,-10.414 -31.079,-11.429c-17.183,-1.641 -32.339,2.341 -32.339,2.341c-1.693,0.389 -2.741,2.04 -2.34,3.683c0.402,1.643 2.102,2.661 3.794,2.271l0,0Zm10.474,12.418c0,0 7.799,-0.713 16.939,1.511c4.869,1.185 10.064,3.301 14.772,6.872c4.547,3.448 8.662,8.239 11.344,15.311c1.419,3.741 2.54,8.036 3.109,13.042c0.104,1.507 1.449,2.648 3.001,2.546c1.552,-0.102 2.727,-1.407 2.622,-2.914c-0.321,-10.92 -3.032,-19.15 -7.027,-25.329c-2.313,-3.579 -5.073,-6.49 -8.092,-8.785c-5.691,-4.327 -12.221,-6.574 -18.195,-7.63c-10.553,-1.866 -19.364,-0.027 -19.364,-0.027c-1.535,0.239 -2.583,1.643 -2.337,3.134c0.246,1.491 1.692,2.508 3.228,2.269l0,0Zm7.437,18.269c-0,-0 4.598,0.71 9.398,3.095c1.709,0.849 3.458,1.896 5.037,3.346c2.209,2.027 4.269,4.651 5.151,8.659c0.226,1.674 1.809,2.856 3.534,2.637c1.724,-0.218 2.942,-1.756 2.717,-3.43c-0.462,-7.718 -3.919,-12.924 -8.278,-16.112c-2.698,-1.974 -5.784,-3.081 -8.559,-3.693c-5.039,-1.111 -9.07,-0.622 -9.07,-0.622c-1.739,0.019 -3.136,1.405 -3.117,3.094c0.02,1.688 1.447,3.044 3.187,3.026Z" style="fill:#fff;"/></g></svg>

After

Width:  |  Height:  |  Size: 3.7 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_SMS"><path d="M11.886,75.885c0.408,2.235 1.47,9.625 -0.474,17.62c-1.262,5.191 -3.85,10.642 -8.883,15.016c-1.492,1.297 -1.378,2.726 -1.132,3.686c0.221,0.861 1.17,2.484 3.777,2.732c1.958,0.186 6.878,-0.451 12.699,-2.634c7.622,-2.858 16.765,-8.42 22.734,-17.787c3.09,0.552 8.213,1.4 13.462,1.979c4.01,0.443 8.089,0.706 11.443,0.611c18.265,-0.605 35.832,-4.66 47.938,-12.929c10.443,-7.132 16.984,-17.297 17.406,-30.656c0.244,-10.923 -6.967,-20.778 -19.356,-27.527c-11.733,-6.392 -28.112,-10.127 -45.381,-9.867c-17.329,0.348 -34.936,4.197 -47.426,11.096c-12.025,6.643 -19.418,16.036 -18.393,27.512c0.389,4.295 1.649,8.416 3.883,12.228c1.884,3.213 4.427,6.223 7.703,8.92Zm0.572,30.764c2.358,-3.882 4.427,-8.537 5.176,-12.5c2.071,-10.959 -0.751,-20.679 -0.751,-20.679c-0.119,-0.456 -0.378,-0.876 -0.759,-1.191c-2.944,-2.559 -5.179,-5.38 -6.751,-8.379c-1.672,-3.188 -3.208,-6.035 -3.36,-9.544c-0.405,-9.131 6.242,-15.955 15.996,-20.815c11.773,-5.865 28.136,-8.701 44.11,-8.379c15.433,0.232 29.965,3.919 40.311,9.881c8.221,4.738 13.828,10.797 13.533,18.139c-0.298,9.646 -5.238,16.806 -12.708,22.056c-10.611,7.458 -26.048,11.284 -42.188,12.241c-2.968,0.191 -6.59,0.063 -10.157,-0.195c-8.005,-0.58 -15.736,-1.794 -15.736,-1.794c-1.886,-0.338 -3.768,0.611 -4.618,2.329c-4.97,10.648 -14.971,16.328 -22.098,18.83Z" style="fill:#fff;"/><g><path d="M74.925,67.723c-1.278,1.191 -2.642,2.253 -4.093,3.183c-0.269,0.165 -0.425,0.357 -0.504,0.555c-0.094,0.235 -0.095,0.493 0.03,0.775c0.145,0.327 0.344,0.617 0.598,0.871c0.236,0.236 0.456,0.421 0.658,0.556c0.002,0.001 0.004,0.002 0.006,0.003c1.314,0.854 2.424,0.945 3.313,0.411c0.004,-0.003 0.008,-0.005 0.012,-0.008c1.503,-0.963 2.916,-2.075 4.239,-3.338c0.039,-0.034 0.077,-0.077 0.112,-0.132l0.21,-0.338c0.037,-0.055 0.063,-0.118 0.076,-0.185c0.152,-0.762 -0.321,-1.576 -1.651,-2.262c-1.404,-0.739 -2.411,-0.679 -3.006,-0.091Zm-7.275,-14.497c-0.677,0.046 -1.37,0.099 -2.08,0.162c0.128,-0.737 0.271,-1.494 0.427,-2.272c1.901,-0.161 3.738,-0.283 5.509,-0.366c0.004,-0 0.007,-0.001 0.01,-0.001c0.685,-0.046 1.105,-0.341 1.31,-0.798c0.205,-0.455 0.15,-0.964 -0.258,-1.51c-0.002,-0.001 -0.003,-0.003 -0.004,-0.005c-0.346,-0.45 -0.826,-0.818 -1.449,-1.095c-0.617,-0.275 -1.218,-0.391 -1.8,-0.356c-0.001,-0 -0.002,-0 -0.002,-0c-0.768,0.048 -1.624,0.106 -2.566,0.173c0.248,-1.22 0.558,-2.763 0.93,-4.629c0.188,-0.937 -0.347,-1.82 -1.806,-2.495c-0.005,-0.002 -0.009,-0.004 -0.014,-0.006c-0.231,-0.099 -0.527,-0.192 -0.891,-0.274c-0.377,-0.086 -0.771,-0.113 -1.183,-0.079c-0.643,0.054 -0.983,0.371 -1.09,0.855c-0.001,0.003 -0.001,0.007 -0.002,0.01c-0.604,3.025 -1.069,5.376 -1.393,7.053c-0.527,0.039 -1.066,0.083 -1.615,0.133c0.169,-1.093 0.327,-2.072 0.476,-2.938c0.001,-0.01 0.003,-0.02 0.004,-0.031c0.042,-0.375 -0.181,-0.887 -0.838,-1.429c-0.444,-0.438 -1.005,-0.747 -1.684,-0.918c-1.056,-0.297 -1.773,-0.154 -2.167,0.232c-0.202,0.198 -0.341,0.467 -0.397,0.816c-0,0.001 -0,0.001 -0.001,0.002c-0.246,1.593 -0.493,3.199 -0.74,4.818c-2.355,0.255 -4.643,0.523 -6.864,0.805c-0.001,0 -0.002,0 -0.003,0c-0.665,0.089 -1.072,0.386 -1.272,0.808c-0.207,0.438 -0.159,0.944 0.255,1.497c0.001,0.001 0.002,0.003 0.004,0.005c0.343,0.447 0.829,0.822 1.464,1.115c0.65,0.299 1.257,0.404 1.819,0.333c0.003,-0 0.006,-0 0.009,-0.001c1.258,-0.18 2.605,-0.349 4.041,-0.506c-0.112,0.884 -0.232,1.848 -0.36,2.89c-1.722,0.342 -3.419,0.736 -5.089,1.182c-0.418,0.106 -0.672,0.322 -0.803,0.584c-0.129,0.259 -0.161,0.542 -0.084,0.852c0.058,0.232 0.154,0.454 0.289,0.667c-0,-0 -0,-0 -0,-0c0.126,0.198 0.261,0.368 0.405,0.512c0.015,0.015 0.03,0.029 0.047,0.042c0.461,0.363 0.979,0.643 1.555,0.841c0.623,0.214 1.219,0.245 1.788,0.102l1.364,-0.351c-0.205,1.904 -0.386,3.738 -0.544,5.502c0,0.003 -0,0.006 -0,0.009c-0.042,0.582 0.228,1.126 0.893,1.583c0.512,0.353 1.025,0.61 1.537,0.773c0.404,0.177 0.892,0.223 1.462,0.112c0.717,-0.139 1.105,-0.549 1.197,-1.198c0.001,-0.009 0.003,-0.019 0.003,-0.029c0.227,-2.632 0.493,-5.278 0.8,-7.938c0,-0 1.209,-0.233 1.209,-0.233c-0.68,4.461 -1.118,8.587 -1.316,12.378c-0.001,0.009 -0.001,0.018 -0.001,0.027c0,0.257 0.061,0.513 0.189,0.77c0.003,0.005 0.005,0.011 0.008,0.016c0.417,0.765 1.246,1.32 2.53,1.599c0.852,0.184 1.457,0.089 1.826,-0.169c0.309,-0.217 0.503,-0.548 0.541,-1.013c0.001,-0.005 0.001,-0.01 0.001,-0.016c0.231,-4.306 0.772,-9.106 1.623,-14.4c1.696,-0.212 3.366,-0.373 5.011,-0.483c0.698,-0.047 1.11,-0.352 1.296,-0.818c0.179,-0.449 0.113,-0.952 -0.29,-1.49c-0.001,-0.002 -0.002,-0.003 -0.004Line truncated

After

Width:  |  Height:  |  Size: 9.9 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_notes"><path d="M64.798,11.355l-4.528,0.002c-0.384,-2.379 -1.11,-4.383 -1.981,-5.646c-1.039,-1.507 -2.307,-2.326 -3.72,-2.381c-3.274,-0.065 -5.201,0.982 -6.314,2.441c-0.742,0.973 -1.211,2.057 -1.378,3.111c-0.16,1.006 -0.136,1.92 -0.092,2.482l-3.739,0.002c-0.353,-2.273 -1.006,-4.194 -1.796,-5.439c-1.034,-1.628 -2.341,-2.492 -3.79,-2.554c-3.454,-0.083 -5.497,1.19 -6.653,2.963c-1.088,1.67 -1.359,3.725 -1.408,5.036l-3.276,0.002c-0.898,-0.008 -1.761,0.345 -2.398,0.978c-0.583,0.581 -0.931,1.354 -0.982,2.17l-6.156,5.537c-0.625,0.568 -0.982,1.371 -0.986,2.215l-0.966,102.263c-0.004,0.955 0.38,1.87 1.064,2.536c0.683,0.666 1.608,1.025 2.562,0.995l86.36,-2.573c1.31,-0.041 2.496,-0.787 3.1,-1.951l3.761,-7.283l1.259,-0.23c1.222,-0.224 2.296,-0.943 2.97,-1.987c0.674,-1.043 0.887,-2.318 0.59,-3.524l-2.391,-9.623c0,-0 -2.101,-85.572 -2.101,-85.572c-0.043,-2.204 -1.832,-3.972 -4.036,-3.99l-13,0.006c-0.387,-2.444 -1.111,-4.51 -1.975,-5.819c-1.052,-1.594 -2.354,-2.44 -3.78,-2.5c-3.544,-0.082 -5.528,1.25 -6.584,3.064c-1.032,1.772 -1.129,3.97 -1.075,5.261l-3.05,0.002c-0.37,-2.439 -1.08,-4.503 -1.933,-5.812c-1.046,-1.605 -2.35,-2.457 -3.783,-2.518c-3.513,-0.083 -5.516,1.229 -6.606,3.028c-1.086,1.792 -1.22,4.023 -1.189,5.308Zm-42.095,11.266l-1.073,0.988c0,-0 -1.495,77.247 -1.847,95.434c-0.047,2.427 1.071,3.74 3.09,3.63c15.133,-0.829 78.838,-3.956 78.838,-3.956l0.434,-0.903c-0,-0 -1.527,0.104 -1.758,0.111l-73.818,1.982c-1.115,0.031 -2.196,-0.39 -2.997,-1.167c-0.801,-0.776 -1.255,-1.843 -1.259,-2.959l0.39,-93.16Zm7.449,21.602l1.273,67.239l68.355,-2.195c-0,-0 6.633,-1.229 6.633,-1.229l-1.34,-5.461c-0.08,-0.324 -0.123,-0.655 -0.13,-0.988l-0.839,-56.769c-5.46,0.118 -14.36,0.288 -24.279,0.392c-4.153,0.043 -8.484,0.086 -12.816,0.045c-7.418,-0.071 -14.833,-0.287 -21.354,-0.484c-6.256,-0.189 -11.685,-0.394 -15.503,-0.55Zm10.694,53.637c0,-0 5.715,0.357 13.444,0.623c4.105,0.142 8.772,0.296 13.444,0.304c2.727,0.005 5.452,-0.074 8.066,-0.153c10.289,-0.309 18.821,-0.774 18.821,-0.774c1.499,-0 2.717,-1.218 2.717,-2.717c-0,-1.499 -1.218,-2.717 -2.717,-2.717c0,0 -8.532,-0.465 -18.821,-0.774c-2.614,-0.079 -5.339,-0.158 -8.066,-0.153c-4.672,0.008 -9.339,0.162 -13.444,0.304c-7.729,0.266 -13.444,0.623 -13.444,0.623c-1.499,0 -2.717,1.218 -2.717,2.717c0,1.499 1.218,2.717 2.717,2.717Zm0.979,-18.921c-0,-0 5.642,0.392 13.274,0.706c4.054,0.167 8.662,0.35 13.276,0.387c2.693,0.022 5.385,-0.041 7.967,-0.103c10.165,-0.246 18.594,-0.658 18.594,-0.658c1.499,0.009 2.724,-1.201 2.734,-2.7c0.009,-1.499 -1.201,-2.724 -2.7,-2.733c0,-0 -8.423,-0.518 -18.584,-0.891c-2.581,-0.095 -5.272,-0.191 -7.966,-0.203c-4.614,-0.02 -9.224,0.105 -13.279,0.221c-7.635,0.219 -13.282,0.541 -13.282,0.541c-1.499,-0.01 -2.724,1.2 -2.734,2.699c-0.009,1.499 1.201,2.724 2.7,2.734Zm-2.275,-17.925c-0,-0 6.109,0.286 14.363,0.457c4.386,0.091 9.372,0.187 14.361,0.138c2.912,-0.029 5.821,-0.142 8.612,-0.253c10.983,-0.436 20.09,-1.006 20.09,-1.006c1.499,-0.018 2.702,-1.249 2.685,-2.748c-0.017,-1.499 -1.249,-2.702 -2.748,-2.685c0,-0 -9.118,-0.36 -20.108,-0.542c-2.792,-0.046 -5.704,-0.092 -8.616,-0.054c-4.988,0.066 -9.97,0.278 -14.353,0.47c-8.248,0.362 -14.349,0.79 -14.349,0.79c-1.499,0.017 -2.702,1.248 -2.685,2.748c0.017,1.499 1.248,2.702 2.748,2.685Zm-9.509,-22.629c3.827,-0.092 9.324,-0.208 15.67,-0.292c6.524,-0.087 13.941,-0.178 21.36,-0.124c4.331,0.032 8.661,0.148 12.813,0.261c9.834,0.269 18.665,0.587 24.134,0.797l-0.29,-19.62l-8.578,-0.145c-0.066,2.383 -0.247,4.637 -0.423,6.377c1.25,0.637 2.107,1.937 2.107,3.434c-0,2.126 -1.726,3.853 -3.853,3.853c-2.126,-0 -3.852,-1.727 -3.852,-3.853c0,-1.198 0.548,-2.269 1.407,-2.975c-0.119,-1.799 -0.307,-4.298 -0.578,-6.924l-11.314,-0.191c-0.089,2.904 -0.351,5.64 -0.571,7.523c1.191,0.656 2,1.923 2,3.378c-0,2.126 -1.726,3.853 -3.853,3.853c-2.126,-0 -3.852,-1.727 -3.852,-3.853c0,-1.305 0.65,-2.459 1.644,-3.156c-0.105,-1.871 -0.294,-4.78 -0.593,-7.834l-12.789,-0.217c-0.093,3.238 -0.425,6.274 -0.662,8.104c1.187,0.657 1.992,1.922 1.992,3.374c-0,2.126 -1.726,3.852 -3.852,3.852c-2.126,-0 -3.853,-1.726 -3.853,-3.852c0,-1.358 0.704,-2.553 1.767,-3.239c-0.099,-1.77 -0.304,-4.97 -0.648,-8.328l-12.005,-0.203c-0.006,0.2 -0.013,0.399 -0.021,0.598c-0.103,2.702 -0.363,5.287 -0.599,7.208c0.991,0.698 1.639,1.85 1.639,3.153c-0,2.126 -1.726,3.852 -3.852,3.852c-2.127,-0 -3.853,-1.726 -3.853,-3.852c0,-1.402 0.75,-2.629 1.87,-3.303c-0.097,-2.05 -0.26,-4.875 -0.521,-7.746l-8.374,-0.142l0.383,20.232Zm7.137,-27.017c-0.166,-1.016 -0.345,-Line truncated

After

Width:  |  Height:  |  Size: 6.5 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_AD"><path d="M67.522,3.067c-3.039,-1.311 -6.655,-1.54 -10.928,-1.63c-13.581,0.261 -19.547,7.157 -23.025,16.968c-2.266,6.393 -4.217,13.717 -3.856,20.576c0.006,0.112 0.012,0.223 0.019,0.333l-12.093,-0.008c-1.867,-0.034 -3.446,1.374 -3.627,3.232l-9.329,81.467c-0.136,1.398 0.325,2.788 1.269,3.829c0.944,1.04 2.284,1.633 3.689,1.633c-0,0 28.788,0.448 53.721,0.623c19.032,0.135 35.814,0.09 35.814,0.09c1.681,-0 3.276,-0.743 4.357,-2.029c0.374,-0.445 0.674,-0.939 0.894,-1.464l16.399,-0.228c1.633,-0.033 3.173,-0.766 4.229,-2.011c1.057,-1.246 1.528,-2.885 1.294,-4.501c-0,-0 -2.079,-13.828 -4.659,-29.477c-3.382,-20.508 -7.579,-44.129 -7.579,-44.129c-0.279,-1.923 -1.86,-3.392 -3.798,-3.528l-5.542,-0.21c0.726,-3.636 1.606,-9.661 1.147,-15.963c-0.339,-4.654 -2.039,-9.581 -4.303,-13.733c-3.592,-6.588 -9.326,-10.902 -20.161,-11.944c-5.572,-0.255 -10.281,0.208 -13.932,2.104Zm-37.043,43.861l-11.411,-0.885c-0,0 -4.027,73.383 -4.027,73.383c9.506,-0.137 29.959,-0.414 48.321,-0.543c11,-0.078 21.248,-0.096 27.94,-0.097l-0.106,-11.302c-0.225,-1.768 -0.648,-31.178 -0.915,-37.153c-0.373,-8.319 0.432,-17.534 0.159,-22.334l-10.98,0.687c-0.567,2.495 -1.15,4.659 -1.633,6.321c1.178,1.22 1.903,2.88 1.903,4.709c-0,3.742 -3.038,6.78 -6.78,6.78c-3.742,-0 -6.78,-3.038 -6.78,-6.78c-0,-2.893 1.815,-5.365 4.368,-6.338c0.264,-1.333 0.57,-3.031 0.854,-4.981l-10.875,-0.39c-0.413,0.262 -0.886,0.442 -1.401,0.517c-0.969,0.14 -1.903,-0.123 -2.634,-0.662l-17.775,-0.637c0.121,2.179 0.302,4.121 0.48,5.695c2.561,0.97 4.383,3.446 4.383,6.344c-0,3.742 -3.038,6.78 -6.78,6.78c-3.742,-0 -6.78,-3.038 -6.78,-6.78c0,-1.783 0.689,-3.405 1.816,-4.616c-0.429,-2.019 -0.93,-4.676 -1.347,-7.718Zm67.066,2.874c0.419,4.919 1.023,12.305 1.548,19.835c0.425,6.076 0.787,12.243 0.987,17.294c0.156,4.193 0.708,9.386 1.356,14.518c0.641,5.087 1.393,10.112 2.021,14.079l10.748,-0.29c-0.745,-5.521 -1.879,-14.062 -3.024,-23.247c-2.006,-16.087 -4.073,-34.13 -4.886,-41.292l-8.75,-0.897Zm-0.3,-7.484c0.389,-4.031 0.784,-12.91 -2.137,-20.393c-2.09,-5.357 -6.308,-9.764 -14.621,-10.085c-1.107,-0.102 -2.143,-0.115 -3.114,-0.049c1.261,2.127 2.216,4.485 2.909,7.002c1.42,5.152 1.691,10.994 1.255,16.628c-0.103,1.326 -0.241,2.639 -0.405,3.925l11.107,0.007c1.963,0.036 3.654,1.229 4.399,2.942l0.607,0.023Zm-29.478,-25.364c-0.096,0.131 -0.191,0.265 -0.283,0.4c-4.481,6.576 -5.384,16.143 -5.473,21.98l10.267,0.006c0.266,-5.801 -0.081,-12.158 -1.912,-17.499c-0.622,-1.817 -1.468,-3.479 -2.599,-4.887Zm-9.488,-4.584c-0.541,-0.033 -1.102,-0.044 -1.685,-0.032c-7.976,-0.153 -12.326,4.042 -14.713,9.669c-2.231,5.259 -3.082,11.531 -3.275,17.312l15.622,0.01c-0.265,-2.89 -0.438,-6.553 -0.214,-10.441c0.321,-5.585 1.561,-11.558 4.265,-16.518Z" style="fill:#fff;"/><path d="M50.489,96.651c0.764,-0.136 1.225,-0.521 1.465,-1.028c0.27,-0.57 0.231,-1.243 -0.364,-1.964c-0.443,-0.558 -1.019,-0.986 -1.736,-1.271c-0.147,-1.001 -0.355,-2.354 -0.623,-4.058c-0.323,-2.054 -0.557,-3.595 -0.704,-4.622c-0.001,-0.006 -0.002,-0.012 -0.003,-0.018c-0.147,-0.91 -0.359,-2.29 -0.638,-4.14c-0.28,-1.852 -0.493,-3.25 -0.64,-4.193c-0.095,-0.685 -0.452,-1.282 -1.115,-1.762c-0.498,-0.36 -1.036,-0.615 -1.613,-0.767c-0.367,-0.17 -0.911,-0.256 -1.64,-0.157c-0.683,0.092 -1.099,0.391 -1.328,0.738c-0.191,0.29 -0.285,0.646 -0.223,1.078l0.334,2.258c-0.637,0.134 -1.034,0.507 -1.237,0.98c-0.003,0.006 -0.005,0.012 -0.008,0.018c-2.866,7.083 -5.049,12.461 -6.547,16.135c-0.068,0.009 -0.139,0.019 -0.214,0.029c-0.281,0.036 -0.482,0.058 -0.605,0.058c-0.042,-0 -0.084,0.003 -0.127,0.008c-0.845,0.113 -1.348,0.513 -1.602,1.049c-0.267,0.565 -0.236,1.223 0.299,1.937c-0,-0 -0,-0 -0,-0c0.192,0.256 0.429,0.492 0.713,0.704c-0.486,1.182 -0.971,2.403 -1.456,3.665c-0.281,0.689 -0.166,1.402 0.523,2.091c0.439,0.44 0.933,0.77 1.48,0.994c0.281,0.137 0.6,0.252 0.953,0.341c-0,-0 -0,-0 -0,-0c0.405,0.101 0.84,0.125 1.306,0.064c0.756,-0.098 1.203,-0.486 1.412,-1.068c0.289,-0.665 0.716,-1.688 1.274,-3.053c0.432,-1.059 0.778,-1.921 1.036,-2.587c0.794,-0.092 1.85,-0.225 3.168,-0.4c1.123,-0.149 2.053,-0.268 2.791,-0.356c0.105,0.704 0.236,1.583 0.393,2.636c0.236,1.579 0.97,5.949 0.97,5.949c0.133,0.665 0.496,1.241 1.116,1.706c0.488,0.366 1.025,0.625 1.61,0.778c0.361,0.168 0.911,0.254 1.653,0.157c0.713,-0.094 1.131,-0.41 1.349,-0.764c0.183,-0.297 0.265,-0.661 0.174,-1.102l0.368,2.418c-1.116,-7.389 -1.448,-9.153 -1.964,-12.481Zm14.784,-18.17l0.141,0.061c0.161,0.046 0.3,0.091 0.417,0.137c0.086,0.048 0.187,0.097 0.306,0.143l0.219,0.121c0.538,0.334Line truncated

After

Width:  |  Height:  |  Size: 6.7 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_settings"><path d="M52.583,20.24c-1.927,0.522 -3.682,1.192 -5.373,2.022c-1.518,0.746 -2.985,1.624 -4.477,2.651c-3.783,-3.154 -6.844,-5.155 -9.493,-6.041c-4.427,-1.48 -8.16,-0.682 -12.132,3.053c-3.33,3.132 -4.375,6.147 -3.905,9.586c0.45,3.295 2.928,7.401 7.382,13.358c-0.588,1.156 -1.142,2.34 -1.661,3.549c-0.864,2.013 -1.632,4.093 -2.295,6.229c-0.461,1.485 -0.795,2.673 -1.044,3.853c-0.055,0.263 -0.107,0.525 -0.154,0.79c-5.248,0.765 -9.367,1.858 -12.165,3.678c-3.798,2.47 -5.846,6.07 -5.393,11.887c0.379,4.86 1.499,7.122 2.647,8.334c1.049,1.108 2.274,1.708 3.79,1.999c1.038,0.198 2.367,0.118 4.035,0.547l0.361,0.075c-0,0 3.1,0.503 6.959,0.588c1.328,0.029 2.743,0.007 4.156,-0.096c0.613,1.176 1.279,2.33 1.995,3.457c0.665,1.049 1.374,2.075 2.122,3.075c-4.617,6.251 -6.643,10.227 -6.893,13.186c-0.288,3.403 1.06,6.119 4.426,9.056c4.049,3.536 6.939,4.464 9.66,4.012c1.483,-0.247 3.028,-0.937 4.76,-2.226c2.017,-1.502 4.512,-4.022 8.217,-7.481c2.038,1.117 4.416,2.018 6.283,2.491c0.337,3.157 0.568,5.665 0.902,7.619c0.479,2.811 1.271,4.75 2.376,6.079c1.76,2.116 4.461,3.265 9.478,2.758c6.381,-0.646 9.1,-2.279 10.657,-5.215c1.128,-2.127 1.467,-5.53 1.87,-11.241c1.048,-0.257 2.034,-0.597 2.956,-0.998c0.932,-0.405 1.798,-0.871 2.6,-1.377c4.161,3.666 6.945,5.734 9.299,6.559c3.632,1.274 6.74,0.525 11.527,-2.857c4.415,-3.119 5.539,-6.925 4.971,-10.904c-0.469,-3.281 -2.427,-6.818 -4.768,-10.139c1.256,-1.345 2.226,-2.41 3.111,-3.707c0.589,-0.865 1.145,-1.824 1.705,-3.012c5.475,-0.592 9.564,-1.09 12.359,-2.737c3.13,-1.844 5.244,-4.845 5.75,-10.699c0.503,-5.812 -1.665,-8.984 -5.416,-10.986c-2.609,-1.392 -6.413,-2.039 -11.076,-2.533c-0.647,-2.25 -1.424,-4.202 -2.401,-6.112c-0.878,-1.714 -1.923,-3.394 -3.204,-5.231c3.224,-4.458 5.457,-8.329 6.275,-11.806c1.074,-4.565 0.168,-8.684 -3.696,-12.716c-2.776,-2.896 -6.201,-3.804 -10.179,-3.017c-3.786,0.748 -8.312,3.395 -13.19,7.359c-1.345,-0.917 -2.597,-1.682 -3.867,-2.367c-1.495,-0.806 -3.016,-1.5 -4.75,-2.182c-0.691,-6.533 -0.94,-11.696 -2.811,-14.819c-1.733,-2.892 -4.443,-4.793 -9.316,-4.946c-3.951,-0.124 -6.835,1.497 -8.964,4.435c-2.092,2.887 -3.323,7.532 -4.006,13.16Zm4.351,84.237c-1.731,-0.273 -4.99,-1.453 -6.556,-2.905c-0.001,-0 -0.001,-0 -0.001,-0c-1.482,-1.372 -3.767,-1.383 -5.263,-0.026c-5.194,4.703 -8.106,7.951 -10.458,9.439c-0.327,0.207 -0.607,0.326 -0.891,0.321c-0.295,-0.005 -0.575,-0.136 -0.893,-0.33c-0.63,-0.385 -1.331,-1.006 -2.235,-1.799c-0.84,-0.738 -1.459,-1.34 -1.642,-2.097c-0.108,-0.445 -0.037,-0.933 0.189,-1.527c0.932,-2.443 3.211,-5.604 6.902,-10.363c0.001,-0 0.001,-0.001 0.001,-0.001c1.145,-1.482 1.096,-3.562 -0.116,-4.988c-1.261,-1.488 -2.412,-3.056 -3.44,-4.688c-1.033,-1.64 -1.941,-3.347 -2.71,-5.104c-0,-0.001 -0.001,-0.002 -0.001,-0.002c-0.737,-1.677 -2.523,-2.635 -4.327,-2.322c-1.842,0.316 -3.842,0.369 -5.639,0.324c-2.757,-0.071 -5.055,-0.388 -5.694,-0.483c-1.349,-0.331 -2.912,-0.521 -3.833,-0.613c-0.006,-0.021 -0.011,-0.042 -0.016,-0.062c-0.184,-0.75 -0.307,-1.73 -0.402,-3.008c-0.16,-2.146 0.351,-3.578 1.755,-4.483c2.573,-1.658 6.673,-2.201 11.891,-2.784c0,-0 0.001,-0 0.002,-0c1.947,-0.222 3.46,-1.798 3.604,-3.752c0.088,-1.163 0.214,-2.089 0.415,-3.02c0.205,-0.953 0.487,-1.911 0.866,-3.11c0.587,-1.858 1.264,-3.667 2.025,-5.417c0.774,-1.781 1.636,-3.499 2.58,-5.145c0,-0 0.001,-0.001 0.001,-0.002c0.82,-1.436 0.701,-3.224 -0.301,-4.54c-3.461,-4.567 -5.908,-7.771 -6.959,-10.397c-0.273,-0.685 -0.364,-1.271 -0.208,-1.827c0.168,-0.6 0.596,-1.147 1.236,-1.744c1.253,-1.168 2.355,-1.668 3.744,-1.197c2.485,0.844 5.29,3.183 9.152,6.645c0.001,0.001 0.001,0.001 0.002,0.002c1.524,1.36 3.803,1.435 5.414,0.178c2.01,-1.56 3.85,-2.807 5.811,-3.761c1.891,-0.92 3.896,-1.554 6.285,-1.96c0.001,-0.001 0.002,-0.001 0.002,-0.001c1.914,-0.328 3.363,-1.91 3.523,-3.846c-0,-0.001 -0,-0.002 0,-0.002c0.353,-4.402 0.838,-8.257 2.061,-10.94c0.548,-1.202 1.215,-2.117 2.499,-2.082c0.862,0.023 1.5,0.181 1.963,0.531c0.439,0.333 0.696,0.831 0.883,1.453c0.929,3.098 0.879,7.563 1.564,12.895c0.197,1.559 1.26,2.876 2.746,3.397c0.001,0.001 0.001,0.001 0.002,0.001c2.378,0.829 4.24,1.584 6.052,2.55c1.746,0.931 3.445,2.055 5.523,3.599c1.562,1.166 3.73,1.077 5.193,-0.215c0,-0.001 0.001,-0.001 0.001,-0.002c3.77,-3.346 7.235,-5.969 10.308,-7.184c1.684,-0.667 3.16,-0.966 4.263,0.175c1.614,1.668 2.116,3.342 1.678,5.241c-0.748,3.248 -3.27,6.812 -6.567,11.193c-1.076,1.422 -1.081,3.387 -0.012,4.817c0.001,0 0.001,0.001 0.001,0.001c1.824,2.43 3.207,4.433 4.28,6.512c1.077,Line truncated

After

Width:  |  Height:  |  Size: 11 KiB

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 132 132" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><rect id="ICONS-SVG" serif:id="ICONS SVG" x="0" y="0" width="131.067" height="131.086" style="fill:none;"/><g id="icon_twitter"><path d="M15.373,71.516c-0.976,0.343 -1.8,0.782 -2.409,1.277c-1.084,0.883 -1.736,1.985 -1.998,3.238c-0.255,1.222 -0.158,2.727 0.861,4.466c1.92,3.275 6.039,7.24 11.434,10.253c1.258,0.702 2.583,1.354 3.963,1.936c-0.494,0.126 -1.021,0.244 -1.579,0.352c-3.09,0.598 -7.009,0.859 -11.938,0.471c-3.986,-0.314 -5.969,1.349 -6.773,2.75c-0.922,1.605 -1.138,4.438 1.445,7.463c3.159,3.701 11.91,9.405 23.927,12.954c13.438,3.969 30.98,5.376 48.819,-1.405c15.38,-5.871 27.118,-16.79 33.43,-30.389c5.835,-12.573 7.072,-27.437 2.204,-42.688c2.012,-1.429 5.108,-3.879 7.502,-6.894c2.014,-2.536 3.526,-5.456 3.793,-8.49c0.088,-0.912 -0.27,-1.811 -0.962,-2.414c-0.691,-0.602 -1.631,-0.834 -2.523,-0.621l-3.248,0.842c0.434,-1.082 0.808,-2.172 1.012,-3.113c0.383,-1.771 0.15,-3.231 -0.387,-4.086c-0.393,-0.625 -0.98,-1.148 -1.841,-1.433c-0.78,-0.259 -2.031,-0.317 -3.535,-0.009c-2.84,0.581 -7.083,2.356 -9.333,3.35c-1.503,-1.277 -4.228,-3.36 -7.794,-5.107c-3.057,-1.499 -6.729,-2.735 -10.77,-3.053c-6.354,-0.5 -16.405,1.068 -22.709,8.579c-3.644,4.342 -6.112,10.71 -5.729,19.961c-8.256,-0.641 -16.085,-2.819 -23.392,-6.878c-7.478,-4.154 -14.391,-10.288 -20.682,-18.722c-0.717,-0.947 -1.857,-1.476 -3.044,-1.412c-1.186,0.063 -2.263,0.71 -2.876,1.728c0,0 -5.003,8.031 -3.425,19.976c0.365,2.761 1.085,5.74 2.316,8.878c-0.052,-0.001 -0.103,-0.003 -0.154,-0.003c-2.199,-0.023 -3.86,0.859 -4.915,2.336c-0.717,1.003 -1.244,2.456 -1.004,4.575c0.411,3.607 2.13,8.553 5.732,13.752c1.731,2.5 3.906,5.07 6.582,7.58Zm101.602,-51.231l-3.074,7.118c-0.554,0.971 -0.467,2.18 0.22,3.062c0.687,0.882 1.838,1.263 2.915,0.963l3.524,-0.847c-0.259,0.363 -0.535,0.719 -0.82,1.065c-3.288,3.998 -8.086,6.732 -8.086,6.732c-1.24,0.726 -1.794,2.227 -1.322,3.584c4.865,14.376 3.763,28.36 -1.877,40.031c-5.758,11.914 -16.264,21.381 -29.911,26.367c-10.201,3.739 -20.259,4.503 -29.322,3.643c-12.914,-1.225 -23.812,-5.779 -30.208,-9.937l-0.32,-0.205c4.706,-0.022 8.442,-0.618 11.381,-1.438c8.669,-2.419 11.242,-6.909 11.242,-6.909c0.779,-1.203 0.876,-2.724 0.256,-4.016c-0.62,-1.292 -1.867,-2.168 -3.293,-2.313c-3.984,-0.398 -7.795,-1.792 -11.036,-3.589c-2.646,-1.468 -4.926,-3.188 -6.552,-4.88c2.525,-0.157 5.275,0.192 5.275,0.192c1.871,0.205 3.633,-0.913 4.245,-2.692c0.612,-1.779 -0.09,-3.745 -1.691,-4.734c-4.899,-3.002 -8.662,-6.378 -11.45,-9.725c-3.01,-3.615 -4.883,-7.152 -5.767,-10.064c0.16,0.057 0.31,0.116 0.443,0.175c1.9,0.836 3.549,1.856 3.549,1.856c1.535,0.967 3.54,0.717 4.791,-0.597c1.252,-1.315 1.402,-3.329 0.361,-4.816c-3.842,-5.413 -5.655,-10.496 -6.298,-14.929c-0.58,-4 -0.217,-7.439 0.371,-10.035c5.959,6.7 12.35,11.749 19.113,15.366c9.317,4.985 19.333,7.283 29.92,7.395c0.901,0.017 1.765,-0.358 2.369,-1.027c0.604,-0.669 0.888,-1.567 0.778,-2.462c-1.183,-9.055 0.533,-15.16 3.77,-19.158c4.857,-5.999 12.818,-7.181 17.825,-6.88c3.323,0.201 6.351,1.181 8.884,2.365c4.766,2.228 7.816,5.159 7.816,5.159c0.75,0.742 1.882,0.939 2.839,0.496c-0,-0 6.21,-3.857 9.14,-4.316Zm-102.494,78.696c-0.468,-0.444 -0.623,-0.792 -0.245,-0.977c0.459,-0.225 0.4,0.376 0.245,0.977Z" style="fill:#fff;"/></g></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.
+2 -2
View File
@@ -1,12 +1,12 @@
import React from 'react'; import React from 'react';
import { RecoilRoot } from 'recoil'; import { RecoilRoot } from 'recoil';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import { PhoneProviders } from './PhoneProviders'; import Phone from './Phone';
it('renders Phone', () => { it('renders Phone', () => {
shallow( shallow(
<RecoilRoot> <RecoilRoot>
<PhoneProviders /> <Phone />
</RecoilRoot>, </RecoilRoot>,
); );
}); });
+69 -28
View File
@@ -4,33 +4,36 @@ import './i18n';
import { Route } from 'react-router-dom'; import { Route } from 'react-router-dom';
import { CallModal } from './os/call/components/CallModal'; import { CallModal } from './os/call/components/CallModal';
import { HomeApp } from './apps/home/components/Home'; 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 { NotificationBar } from './os/notifications/components/NotificationBar';
import { Navigation } from './os/navigation-bar/components/Navigation'; import { Navigation } from './os/navigation-bar/components/Navigation';
import { useNuiService } from './os/nui-events/hooks/useNuiService';
import { useSimcardService } from './os/simcard/hooks/useSimcardService'; import { useSimcardService } from './os/simcard/hooks/useSimcardService';
import { usePhoneService } from './os/phone/hooks/usePhoneService'; import { usePhoneService } from './os/phone/hooks/usePhoneService';
import { useApps } from './os/apps/hooks/useApps'; import { useApps } from './os/apps/hooks/useApps';
import { useContactsService } from './apps/contacts/hooks/useContactsService';
import { useTwitterService } from './apps/twitter/hooks/useTwitterService'; import { useTwitterService } from './apps/twitter/hooks/useTwitterService';
import { useMatchService } from './apps/match/hooks/useMatchService';
import { useMarketplaceService } from './apps/marketplace/hooks/useMarketplaceService'; import { useMarketplaceService } from './apps/marketplace/hooks/useMarketplaceService';
import { useBankService } from './apps/bank/hooks/useBankService'; import { useBankService } from './apps/bank/hooks/useBankService';
import { useMessagesService } from './apps/messages/hooks/useMessageService'; import { useMessagesService } from './apps/messages/hooks/useMessageService';
import { useNotesService } from './apps/notes/hooks/useNotesService';
import { usePhotoService } from './apps/camera/hooks/usePhotoService';
import { isSettingsSchemaValid, useSettings } from './apps/settings/hooks/useSettings'; import { isSettingsSchemaValid, useSettings } from './apps/settings/hooks/useSettings';
import { useCallService } from './os/call/hooks/useCallService'; import { useCallService } from './os/call/hooks/useCallService';
import { useDialService } from './apps/dialer/hooks/useDialService'; import { useDialService } from './apps/dialer/hooks/useDialService';
import InjectDebugData from './os/debug/InjectDebugData'; import InjectDebugData from './os/debug/InjectDebugData';
import { usePhoneVisibility } from './os/phone/hooks/usePhoneVisibility';
import { PhoneSnackbar } from './ui/components/PhoneSnackbar'; import { PhoneSnackbar } from './ui/components/PhoneSnackbar';
import { NotificationAlert } from './os/notifications/components/NotificationAlert'; import { NotificationAlert } from './os/notifications/components/NotificationAlert';
import { useCallModal } from './os/call/hooks/useCallModal'; import { useCallModal } from './os/call/hooks/useCallModal';
import WindowSnackbar from './ui/components/WindowSnackbar'; import WindowSnackbar from './ui/components/WindowSnackbar';
import { usePhone } from './os/phone/hooks/usePhone';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useSnackbar } from './ui/hooks/useSnackbar'; import { useSnackbar } from './ui/hooks/useSnackbar';
import { PhoneEvents } from '../../typings/phone'; import { useEmailService } from './apps/email/hooks/useEmailService';
import { useKeyboardService } from './os/keyboard/hooks/useKeyboardService';
import PhoneWrapper from './PhoneWrapper';
import dayjs from 'dayjs';
import DefaultConfig from '../../config.json';
import { TopLevelErrorComponent } from './ui/components/TopLevelErrorComponent';
import { useConfig } from './os/phone/hooks/useConfig';
function Phone() { function Phone() {
const { t, i18n } = useTranslation(); const { t, i18n } = useTranslation();
@@ -59,26 +62,55 @@ function Phone() {
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, []); }, []);
useConfig(); useNuiService();
useKeyboardService(); useKeyboardService();
usePhoneService(); usePhoneService();
useSimcardService(); useSimcardService();
useContactsService();
useTwitterService(); useTwitterService();
useMatchService();
useMarketplaceService(); useMarketplaceService();
useBankService(); useBankService();
useMessagesService(); useMessagesService();
/*usePhotoService();*/ useNotesService();
usePhotoService();
useCallService(); useCallService();
useDialService(); useDialService();
useEmailService();
const { modal: callModal } = useCallModal(); const { modal: callModal } = useCallModal();
const { bottom, visibility } = usePhoneVisibility();
const { isPhoneReady } = usePhone();
return ( return (
<div> <div>
<TopLevelErrorComponent>
<WindowSnackbar /> <WindowSnackbar />
<PhoneWrapper> <Slide direction="up" timeout={{ enter: 500, exit: 500 }} in={visibility}>
<div className="PhoneWrapper">
<div
className="Phone"
style={{
position: 'fixed',
transformOrigin: 'right bottom',
transform: `scale(${settings.zoom.value}`,
bottom,
}}
>
<div
className="PhoneFrame"
style={{
backgroundImage: `url(media/frames/${settings.frame.value})`,
}}
/>
<div
id="phone"
className="PhoneScreen"
style={{
backgroundImage: `url(media/backgrounds/${settings.wallpaper.value})`,
}}
>
{isPhoneReady ? (
<>
<NotificationBar /> <NotificationBar />
<div className="PhoneAppContainer"> <div className="PhoneAppContainer">
<> <>
@@ -92,33 +124,42 @@ function Phone() {
<PhoneSnackbar /> <PhoneSnackbar />
</div> </div>
<Navigation /> <Navigation />
</PhoneWrapper> </>
</TopLevelErrorComponent> ) : (
<Box
component={Paper}
height="100%"
width="100%"
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
>
<Typography paragraph variant="h6">
NPWD {t('INITIALIZING')}
</Typography>
<Typography paragraph>{t('GENERIC_WAIT')}</Typography>
</Box>
)}
</div>
</div>
</div>
</Slide>
</div> </div>
); );
} }
export default Phone; export default Phone;
InjectDebugData<any>([ InjectDebugData([
{ {
app: 'PHONE', app: 'PHONE',
method: PhoneEvents.SET_VISIBILITY, method: 'setVisibility',
data: true, data: true,
}, },
{ {
app: 'PHONE', app: 'PHONE',
method: PhoneEvents.SET_PHONE_READY, method: 'setPhoneReady',
data: true, data: true,
}, },
{
app: 'PHONE',
method: PhoneEvents.SET_TIME,
data: dayjs().format('hh:mm'),
},
{
app: 'PHONE',
method: PhoneEvents.SET_CONFIG,
data: DefaultConfig,
},
]); ]);
@@ -4,13 +4,11 @@ import { NotificationsProvider } from './os/notifications/providers/Notification
import { usePhoneTheme } from './os/phone/hooks/usePhoneTheme'; import { usePhoneTheme } from './os/phone/hooks/usePhoneTheme';
import SnackbarProvider from './ui/providers/SnackbarProvider'; import SnackbarProvider from './ui/providers/SnackbarProvider';
import Phone from './Phone'; import Phone from './Phone';
import { NuiProvider } from 'fivem-nui-react-lib';
import { SoundProvider } from './os/sound/providers/SoundProvider'; import { SoundProvider } from './os/sound/providers/SoundProvider';
export const PhoneProviders = () => { export const PhoneContainer = () => {
const currentTheme = usePhoneTheme(); const currentTheme = usePhoneTheme();
return ( return (
<NuiProvider resource="npwd">
<ThemeProvider theme={currentTheme}> <ThemeProvider theme={currentTheme}>
<SoundProvider> <SoundProvider>
<NotificationsProvider> <NotificationsProvider>
@@ -20,6 +18,5 @@ export const PhoneProviders = () => {
</NotificationsProvider> </NotificationsProvider>
</SoundProvider> </SoundProvider>
</ThemeProvider> </ThemeProvider>
</NuiProvider>
); );
}; };
-46
View File
@@ -1,46 +0,0 @@
import React from 'react';
import { isDefaultWallpaper } from './apps/settings/utils/isDefaultWallpaper';
import { useSettings } from './apps/settings/hooks/useSettings';
import { usePhoneVisibility } from './os/phone/hooks/usePhoneVisibility';
import { Slide } from '@material-ui/core';
const PhoneWrapper: React.FC = ({ children }) => {
const [settings] = useSettings();
const { bottom, visibility } = usePhoneVisibility();
return (
<Slide direction="up" timeout={{ enter: 500, exit: 500 }} in={visibility}>
<div className="PhoneWrapper">
<div
className="Phone"
style={{
position: 'fixed',
transformOrigin: 'right bottom',
transform: `scale(${settings.zoom.value}`,
bottom,
}}
>
<div
className="PhoneFrame"
style={{
backgroundImage: `url(media/frames/${settings.frame.value})`,
}}
/>
<div
id="phone"
className="PhoneScreen"
style={{
backgroundImage: !isDefaultWallpaper(settings.wallpaper.value)
? `url(${settings.wallpaper.value})`
: `url(media/backgrounds/${settings.wallpaper.value})`,
}}
>
{children}
</div>
</div>
</div>
</Slide>
);
};
export default PhoneWrapper;
@@ -3,7 +3,8 @@ import React, { useState } from 'react';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core'; import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { Home, List, Payment } from '@material-ui/icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faHome, faList, faMoneyCheck } from '@fortawesome/free-solid-svg-icons';
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
root: { root: {
@@ -29,9 +30,21 @@ export const NavigationBar = () => {
showLabels showLabels
className={classes.root} className={classes.root}
> >
<BottomNavigationAction component={Link} icon={<Home />} to="/bank" /> <BottomNavigationAction
<BottomNavigationAction component={Link} icon={<Payment />} to="/bank/account" /> component={Link}
<BottomNavigationAction component={Link} icon={<List />} to="/bank/transactions" /> icon={<FontAwesomeIcon icon={faHome} />}
to="/bank"
/>
<BottomNavigationAction
component={Link}
icon={<FontAwesomeIcon icon={faMoneyCheck} />}
to="/bank/account"
/>
<BottomNavigationAction
component={Link}
icon={<FontAwesomeIcon icon={faList} />}
to="/bank/transactions"
/>
</BottomNavigation> </BottomNavigation>
); );
}; };
@@ -49,6 +49,16 @@ export const TransactionList = () => {
</div> </div>
</div> </div>
))} ))}
<TablePagination
rowsPerPageOptions={[3, 5]}
className={classes.pagination}
component="div"
count={transactionList.length}
rowsPerPage={rowsPerPage}
page={page}
onChangePage={handleChangePage}
onChangeRowsPerPage={handleChangeRowsPerPage}
/>
</div> </div>
</div> </div>
); );
@@ -1,10 +1,11 @@
import React, { useState } from 'react'; import React, { useState } from 'react';
import Modal from '../../../../ui/components/Modal'; import Modal from '../../../../ui/components/Modal';
import { Button, List, ListItem, makeStyles } from '@material-ui/core'; import { Button, List, ListItem, TextField, makeStyles } from '@material-ui/core';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useBankModal } from '../../hooks/useBankModal'; import { useBankModal } from '../../hooks/useBankModal';
import { BankEvents } from '../../../../../../typings/bank'; import { BankEvents } from '../../../../../../typings/bank';
import { useNuiRequest } from 'fivem-nui-react-lib';
import { TextField } from '../../../../ui/components/Input';
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
input: { input: {
@@ -29,7 +30,6 @@ const useStyles = makeStyles((theme) => ({
})); }));
export const TransferModal = () => { export const TransferModal = () => {
const Nui = useNuiRequest();
const classes = useStyles(); const classes = useStyles();
const [targetID, setTargetID] = useState(''); const [targetID, setTargetID] = useState('');
+2 -1
View File
@@ -1,4 +1,4 @@
import { useNuiEvent } from 'fivem-nui-react-lib'; import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { bankState } from './state'; import { bankState } from './state';
import { useTransactions } from './useTransactions'; import { useTransactions } from './useTransactions';
import { useCredentials } from './useCredentials'; import { useCredentials } from './useCredentials';
@@ -7,6 +7,7 @@ import { useBankNotification } from './useBankNotification';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar'; import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { BankEvents } from '../../../../../typings/bank'; import { BankEvents } from '../../../../../typings/bank';
import { PhoneEvents } from '../../../../../typings/phone';
export const useBankService = () => { export const useBankService = () => {
const setTransaction = useSetRecoilState(bankState.transactions); const setTransaction = useSetRecoilState(bankState.transactions);
@@ -1,108 +0,0 @@
import { AppWrapper } from '../../../ui/components';
import React, { Reducer, useReducer, useRef } from 'react';
import { AppContent } from '../../../ui/components/AppContent';
import { Box, makeStyles } from '@material-ui/core';
import { BrowserURLBar } from './BrowserURLBar';
import { promiseTimeout } from '../../../utils/promiseTimeout';
import { usePhoneConfig } from '../../../config/hooks/usePhoneConfig';
const useStyles = makeStyles(() => ({
iframe: {
height: '100%',
width: '100%',
zoom: 0.5,
border: 'none',
},
root: {
height: '100%',
display: 'flex',
flexDirection: 'column',
},
}));
interface BrowserState {
browserUrl: string;
browserHistory: string[];
}
interface ReducerAction {
payload: any;
type: ReducerActionsType;
}
enum ReducerActionsType {
SET_URL,
ADD_HISTORY,
RELOAD,
}
const browserReducer: Reducer<BrowserState, ReducerAction> = (state, action) => {
switch (action.type) {
case ReducerActionsType.ADD_HISTORY:
if (action.payload === 'about:blank') return state;
return { ...state, browserHistory: state.browserHistory.concat(action.payload) };
case ReducerActionsType.SET_URL:
return { ...state, browserUrl: action.payload };
default:
throw new Error('Invalid reducer action type');
}
};
export const BrowserApp: React.FC = () => {
const classes = useStyles();
const [{ appSettings }] = usePhoneConfig();
const [browserState, dispatch] = useReducer(browserReducer, {
browserUrl: appSettings.browserHomePage,
browserHistory: [appSettings.browserHomePage],
});
const { browserHistory, browserUrl } = browserState;
const iframeRef = useRef<HTMLIFrameElement | null>(null);
const _setBrowserUrl = (newUrl: string) => {
const formattedUrl = newUrl.match(/^(http|https):\/\//) ? newUrl : 'https://' + newUrl;
dispatch({ payload: browserUrl, type: ReducerActionsType.ADD_HISTORY });
dispatch({ payload: formattedUrl, type: ReducerActionsType.SET_URL });
};
const handleGoBack = () => {
if (browserHistory.length <= 1) return;
// Get last page from history
const lastPage = browserHistory[browserHistory.length - 1];
// Bail if last page is same as current
if (lastPage === browserUrl) return;
_setBrowserUrl(lastPage);
};
const reloadPage = async () => {
const strCopy = browserUrl.slice();
dispatch({ payload: 'about:blank', type: ReducerActionsType.SET_URL });
await promiseTimeout(100);
dispatch({ payload: strCopy, type: ReducerActionsType.SET_URL });
};
return (
<AppWrapper id="browser">
<AppContent className={classes.root}>
<BrowserURLBar
browserUrl={browserUrl}
browserHasHistory={browserHistory.length > 1}
setBrowser={_setBrowserUrl}
goBack={handleGoBack}
reloadPage={reloadPage}
/>
<Box flexGrow={1}>
<iframe
is="x-frame-bypass"
src={browserUrl}
// @ts-ignore
className={classes.iframe}
title="npwd-browser"
ref={iframeRef}
/>
</Box>
</AppContent>
</AppWrapper>
);
};
@@ -1,92 +0,0 @@
import React, { FocusEventHandler, useRef, useState } from 'react';
import { makeStyles, Theme, Box, IconButton } from '@material-ui/core';
import { Cached, KeyboardArrowLeft } from '@material-ui/icons';
import { InputBase } from '../../../ui/components/Input';
const useStyles = makeStyles((theme: Theme) => ({
urlInput: {
borderRadius: 18,
borderWidth: 1,
borderStyle: 'solid',
paddingRight: 10,
paddingLeft: 10,
marginLeft: 5,
borderColor: '#787878FF',
color: '#909090',
transition: 'color 0.1s ease',
},
urlInputFocused: {
color: '#fff',
},
root: {},
}));
interface BrowserControlsProps {
setBrowser: (url: string) => void;
browserUrl: string;
reloadPage: () => void;
browserHasHistory: boolean;
goBack: () => void;
}
export const BrowserURLBar: React.FC<BrowserControlsProps> = ({
goBack,
reloadPage,
browserHasHistory,
browserUrl,
setBrowser,
}) => {
const classes = useStyles();
const inputRef = useRef<HTMLInputElement>(null);
const [inputState, setInputState] = useState('');
const [isFocused, setFocus] = useState(false);
const handleFocus: FocusEventHandler = (e) => {
setInputState(browserUrl);
setFocus(true);
};
const handleFocusOut: FocusEventHandler = (e) => {
setFocus(false);
setInputState(browserUrl);
};
const handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
setInputState(e.target.value);
};
const onEnter: React.KeyboardEventHandler<HTMLInputElement> = (e) => {
if ((e as any).code !== 'Enter') return;
setBrowser(inputState);
e.currentTarget.blur();
};
const styledUrl = browserUrl.replace(/(^\w+:|^)\/\//, '');
const transformedUrl = isFocused ? inputState : styledUrl;
return (
<Box display="flex" py={1} className={classes.root} px={1}>
<IconButton size="small" onClick={() => reloadPage()}>
<Cached />
</IconButton>
{browserHasHistory && (
<IconButton size="small" onClick={() => goBack()}>
<KeyboardArrowLeft />
</IconButton>
)}
<InputBase
className={classes.urlInput}
ref={inputRef}
fullWidth
onChange={handleChange}
onKeyDown={onEnter}
value={transformedUrl}
classes={{ focused: classes.urlInputFocused }}
onFocus={handleFocus}
spellCheck={false}
onBlur={handleFocusOut}
/>
</Box>
);
};
+21 -4
View File
@@ -3,20 +3,37 @@ import { AppWrapper } from '../../../ui/components';
import { AppContent } from '../../../ui/components/AppContent'; import { AppContent } from '../../../ui/components/AppContent';
import { GalleryGrid } from './grid/GalleryGrid'; import { GalleryGrid } from './grid/GalleryGrid';
import { GalleryModal } from './modal/GalleryModal'; import { GalleryModal } from './modal/GalleryModal';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { Route, Switch } from 'react-router-dom'; import { Route, Switch } from 'react-router-dom';
import { LoadingSpinner } from '../../../ui/components/LoadingSpinner';
const CameraApp: React.FC = () => ( InjectDebugData([
{
app: 'CAMERA',
method: 'setPhotos',
data: [
{
id: 1,
image: 'https://beta.iodine.gg/noDcb.jpeg',
},
{
id: 2,
image: 'https://beta.iodine.gg/teUcY.jpeg',
},
],
},
]);
const CameraApp = () => {
return (
<AppWrapper id="camera-app"> <AppWrapper id="camera-app">
<AppContent> <AppContent>
<Switch> <Switch>
<React.Suspense fallback={<LoadingSpinner />}>
<Route path="/camera" exact component={GalleryGrid} /> <Route path="/camera" exact component={GalleryGrid} />
<Route path="/camera/image" exact component={GalleryModal} /> <Route path="/camera/image" exact component={GalleryModal} />
</React.Suspense>
</Switch> </Switch>
</AppContent> </AppContent>
</AppWrapper> </AppWrapper>
); );
};
export default CameraApp; export default CameraApp;
@@ -1,55 +1,37 @@
import React, { useState } from 'react'; import React from 'react';
import { Box, Button, CircularProgress } from '@material-ui/core'; import { Box, Button } from '@material-ui/core';
import useStyles from './grid.styles'; import useStyles from './grid.styles';
import { usePhotos } from '../../hooks/usePhotos';
import AddIcon from '@material-ui/icons/Add'; import AddIcon from '@material-ui/icons/Add';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { useQueryParams } from '../../../../common/hooks/useQueryParams'; import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { addQueryToLocation } from '../../../../common/utils/addQueryToLocation'; import { addQueryToLocation } from '../../../../common/utils/addQueryToLocation';
import { getLocationFromUrl } from '../../../../common/utils/getLocationFromUrl'; import { getLocationFromUrl } from '../../../../common/utils/getLocationFromUrl';
import { fetchNui } from '../../../../utils/fetchNui'; import { PhotoEvents } from '../../../../../../typings/photo';
import { ServerPromiseResp } from '../../../../../../typings/common';
import { GalleryPhoto, PhotoEvents } from '../../../../../../typings/photo';
import { usePhotoActions } from '../../hooks/usePhotoActions';
import { usePhotosValue } from '../../hooks/state';
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
export const GalleryGrid = () => { export const GalleryGrid = () => {
const classes = useStyles(); const classes = useStyles();
const history = useHistory(); const history = useHistory();
const query = useQueryParams(); const query = useQueryParams();
const { addAlert } = useSnackbar();
const { t } = useTranslation();
const photos = usePhotosValue();
const { takePhoto } = usePhotoActions();
const [isLoading, setIsLoading] = useState<boolean>(false);
const referal = query.referal ? decodeURIComponent(query.referal) : '/camera/image'; const referal = query.referal ? decodeURIComponent(query.referal) : '/camera/image';
const handlePhotoOpen = (photo) => { const photos = usePhotos();
history.push(addQueryToLocation(getLocationFromUrl(referal), 'image', photo.image));
const handleCamera = () => {
Nui.send(PhotoEvents.TAKE_PHOTO, {});
}; };
const handleTakePhoto = () => { const handlePhotoOpen = (photo) => {
setIsLoading(true); history.push(addQueryToLocation(getLocationFromUrl(referal), 'image', photo.image));
fetchNui<ServerPromiseResp<GalleryPhoto>>(PhotoEvents.TAKE_PHOTO).then((serverResp) => {
if (serverResp.status !== 'ok') {
return addAlert({
message: t('APPS_CAMERA_FAILED_TO_TAKE_PHOTO'),
type: 'error',
});
}
takePhoto(serverResp.data);
setIsLoading(false);
});
}; };
if (!photos) if (!photos)
return ( return (
<Box display="flex" flexWrap="wrap" alignContent="flex-start" className={classes.root}> <Box display="flex" flexWrap="wrap" alignContent="flex-start" className={classes.root}>
<Box> <Box>
<Button onClick={takePhoto} style={{ borderRadius: 0 }} className={classes.photo}> <Button onClick={handleCamera} style={{ borderRadius: 0 }} className={classes.photo}>
<AddIcon fontSize="large" /> <AddIcon fontSize="large" />
</Button> </Button>
</Box> </Box>
@@ -60,13 +42,8 @@ export const GalleryGrid = () => {
<div> <div>
<Box display="flex" flexWrap="wrap" alignContent="flex-start" className={classes.root}> <Box display="flex" flexWrap="wrap" alignContent="flex-start" className={classes.root}>
<Box> <Box>
<Button <Button onClick={handleCamera} style={{ borderRadius: 0 }} className={classes.photo}>
disabled={isLoading} <AddIcon fontSize="large" />
onClick={handleTakePhoto}
style={{ borderRadius: 0 }}
className={classes.photo}
>
{!isLoading ? <AddIcon fontSize="large" /> : <CircularProgress />}
</Button> </Button>
</Box> </Box>
{photos.map((photo) => ( {photos.map((photo) => (
@@ -4,30 +4,23 @@ import { Button, Paper } from '@material-ui/core';
import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import DeleteIcon from '@material-ui/icons/Delete'; import DeleteIcon from '@material-ui/icons/Delete';
import ShareIcon from '@material-ui/icons/Share'; import ShareIcon from '@material-ui/icons/Share';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { useQueryParams } from '../../../../common/hooks/useQueryParams'; import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { ICameraPhoto } from '../../hooks/usePhotos';
import { ShareModal } from './ShareModal'; import { ShareModal } from './ShareModal';
import { GalleryPhoto, PhotoEvents } from '../../../../../../typings/photo'; import { PhotoEvents } from '../../../../../../typings/photo';
import { usePhotoActions } from '../../hooks/usePhotoActions';
import { fetchNui } from '../../../../utils/fetchNui';
import { ServerPromiseResp } from '../../../../../../typings/common';
import { useTranslation } from 'react-i18next';
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
export const GalleryModal = () => { export const GalleryModal = () => {
const [shareOpen, setShareOpen] = useState(null);
const classes = useStyles(); const classes = useStyles();
const history = useHistory(); const history = useHistory();
const query = useQueryParams(); const query = useQueryParams();
const { deletePhoto } = usePhotoActions();
const { addAlert } = useSnackbar();
const { t } = useTranslation();
const referal = query.referal || '/camera'; const referal = query.referal || '/camera';
const meta: GalleryPhoto = useMemo( const [shareOpen, setShareOpen] = useState(null);
() => ({ id: parseInt(query.id), image: query.image as string }),
const meta: ICameraPhoto = useMemo(
() => ({ id: query.id as string, image: query.image as string }),
[query], [query],
); );
@@ -36,17 +29,10 @@ export const GalleryModal = () => {
}; };
const handleDeletePhoto = () => { const handleDeletePhoto = () => {
fetchNui<ServerPromiseResp<GalleryPhoto>>(PhotoEvents.DELETE_PHOTO, { Nui.send(PhotoEvents.DELETE_PHOTO, {
image: meta.image, image: meta.image,
}).then((serverResp) => {
if (serverResp.status !== 'ok') {
return addAlert({ message: t('APPS_CAMERA_FAILED_TO_DELETE_PHOTO'), type: 'error' });
}
deletePhoto(meta.image);
history.push(referal);
}); });
history.push(referal);
}; };
const handleSharePhoto = useCallback(() => { const handleSharePhoto = useCallback(() => {
@@ -5,11 +5,11 @@ import MessageIcon from '@material-ui/icons/Message';
import { setClipboard } from '../../../../os/phone/hooks/useClipboard'; import { setClipboard } from '../../../../os/phone/hooks/useClipboard';
import useStyles from './modal.styles'; import useStyles from './modal.styles';
import { ICameraPhoto } from '../../hooks/usePhotos';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { GalleryPhoto } from '../../../../../../typings/photo';
interface IShareModalProps { interface IShareModalProps {
meta: GalleryPhoto; meta: ICameraPhoto;
referal: string; referal: string;
onClose(): void; onClose(): void;
} }
+3 -28
View File
@@ -1,33 +1,8 @@
import { atom, selector, useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; import { atom } from 'recoil';
import { ServerPromiseResp } from '../../../../../typings/common';
import { GalleryPhoto, PhotoEvents } from '../../../../../typings/photo';
import { fetchNui } from '../../../utils/fetchNui';
import LogDebugEvent from '../../../os/debug/LogDebugEvents';
import { isEnvBrowser } from '../../../utils/misc';
import { MockPhotoData } from '../utils/constants';
export const photoState = { export const photoState = {
photos: atom<GalleryPhoto[]>({ photos: atom({
key: 'galleryPhotos', key: 'galleryPhotos',
default: selector({ default: null,
key: 'defaultGalleryPhotos',
get: async () => {
try {
const resp = await fetchNui<ServerPromiseResp<GalleryPhoto[]>>(PhotoEvents.FETCH_PHOTOS);
LogDebugEvent({ action: 'PhotosFetched', data: resp.data });
return resp.data;
} catch (e) {
if (isEnvBrowser()) {
return MockPhotoData;
}
console.error(e);
return [];
}
},
}),
}), }),
}; };
export const useSetPhotos = () => useSetRecoilState(photoState.photos);
export const usePhotos = () => useRecoilState(photoState.photos);
export const usePhotosValue = () => useRecoilValue(photoState.photos);
-61
View File
@@ -1,61 +0,0 @@
import { useCallback, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { SetterOrUpdater, useRecoilState } from 'recoil';
import { GalleryPhoto, PhotoEvents } from '../../../../../typings/photo';
import { useNuiEvent, useNuiCallback } from 'fivem-nui-react-lib/';
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
import { photoState } from './state';
interface IUseCamera {
photos: GalleryPhoto[];
setPhotos: SetterOrUpdater<GalleryPhoto[]>;
takePhoto: () => void;
isLoading: boolean;
}
export const useCamera = (): IUseCamera => {
const { t } = useTranslation();
const { addAlert } = useSnackbar();
const [photos, setPhotos] = useRecoilState<GalleryPhoto[]>(photoState.photos);
const [isUploading, setUploading] = useState(false);
const onPhotoSuccess = useCallback(
(photo) => {
setUploading(false);
if (!photo?.image) return;
setPhotos((curr) => [photo, ...curr]);
},
[setPhotos],
);
const onPhotoError = useCallback(
(i18nKey) => {
setUploading(false);
addAlert({ type: 'error', message: t(i18nKey) });
},
[addAlert, t],
);
const [_takePhoto] = useNuiCallback<void, GalleryPhoto>(
'CAMERA',
PhotoEvents.TAKE_PHOTO,
onPhotoSuccess,
onPhotoError,
);
useNuiEvent('CAMERA', PhotoEvents.UPLOAD_PHOTO, () => setUploading(true));
const takePhoto = () => {
// Timeout at 1 minute
_takePhoto(undefined, { timeout: 60000 });
};
return {
photos,
setPhotos,
takePhoto,
isLoading: isUploading,
};
};
@@ -1,22 +0,0 @@
import { useSetPhotos } from './state';
import { useCallback } from 'react';
export const usePhotoActions = () => {
const setPhotos = useSetPhotos();
const takePhoto = useCallback(
(photo) => {
setPhotos((curPhotos) => [photo, ...curPhotos]);
},
[setPhotos],
);
const deletePhoto = useCallback(
(image: string) => {
setPhotos((curPhotos) => [...curPhotos].filter((meta) => meta.image !== image));
},
[setPhotos],
);
return { takePhoto, deletePhoto };
};
@@ -0,0 +1,8 @@
import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { photoState } from './state';
export const usePhotoService = () => {
const setPhotos = useSetRecoilState(photoState.photos);
useNuiEvent('CAMERA', 'setPhotos', setPhotos);
};
+11
View File
@@ -0,0 +1,11 @@
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);
};
-10
View File
@@ -1,10 +0,0 @@
export const MockPhotoData = [
{
id: 1,
image: 'https://beta.iodine.gg/noDcb.jpeg',
},
{
id: 2,
image: 'https://beta.iodine.gg/teUcY.jpeg',
},
];
@@ -3,47 +3,55 @@ import { AppWrapper } from '../../../ui/components';
import { AppTitle } from '../../../ui/components/AppTitle'; import { AppTitle } from '../../../ui/components/AppTitle';
import { AppContent } from '../../../ui/components/AppContent'; import { AppContent } from '../../../ui/components/AppContent';
import { useApp } from '../../../os/apps/hooks/useApps'; import { useApp } from '../../../os/apps/hooks/useApps';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { Route } from 'react-router-dom'; import { Route } from 'react-router-dom';
import ContactsInfoPage from './views/ContactInfo'; import ContactsInfoPage from './views/ContactInfo';
import { ContactPage } from './views/ContactsPage'; import { ContactPage } from './views/ContactsPage';
import { ContactsThemeProvider } from '../providers/ContactsThemeProvider'; import { ContactsThemeProvider } from '../providers/ContactsThemeProvider';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import Fab from '@material-ui/core/Fab';
import { useHistory } from 'react-router';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { LoadingSpinner } from '../../../ui/components/LoadingSpinner';
const useStyles = makeStyles((theme: Theme) => ({
absolute: {
position: 'absolute',
right: theme.spacing(3),
bottom: theme.spacing(2),
},
}));
export const ContactsApp = () => { export const ContactsApp = () => {
const contacts = useApp('CONTACTS'); const contacts = useApp('CONTACTS');
const history = useHistory();
const classes = useStyles();
return ( return (
<ContactsThemeProvider> <ContactsThemeProvider>
<AppWrapper id="contact-app"> <AppWrapper id="contact-app">
<AppTitle app={contacts} /> <AppTitle app={contacts} />
<AppContent> <AppContent>
<React.Suspense fallback={<LoadingSpinner />}>
<Route path="/contacts/" exact component={ContactPage} /> <Route path="/contacts/" exact component={ContactPage} />
<Route path="/contacts/:id" exact component={ContactsInfoPage} /> <Route path="/contacts/:id" exact component={ContactsInfoPage} />
</React.Suspense>
</AppContent> </AppContent>
<Fab
color="primary"
onClick={() => history.push('/contacts/-1')}
className={classes.absolute}
>
<PersonAddIcon />
</Fab>
</AppWrapper> </AppWrapper>
</ContactsThemeProvider> </ContactsThemeProvider>
); );
}; };
InjectDebugData([
{
app: 'CONTACTS',
method: 'setContacts',
data: [
{
id: 1,
display: 'Ruqen',
number: '555-15196',
},
{
id: 2,
display: 'Taso',
number: '215-8139',
avatar: 'http://i.tasoagc.dev/i9Ig',
},
{
id: 3,
display: 'Chip',
number: '111-1111',
},
{
id: 4,
display: 'Kidz',
number: '444-4444',
},
],
},
]);
@@ -1,19 +1,22 @@
import React from 'react'; import React from 'react';
import ListItemText from '@material-ui/core/ListItemText'; import ListItemText from '@material-ui/core/ListItemText';
import { Button, ListItemAvatar, Avatar as MuiAvatar, List, ListItem } from '@material-ui/core'; import { Button, ListItemAvatar, Avatar as MuiAvatar, List, ListItem } from '@material-ui/core';
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
import PhoneIcon from '@material-ui/icons/Phone'; import PhoneIcon from '@material-ui/icons/Phone';
import ChatIcon from '@material-ui/icons/Chat'; import ChatIcon from '@material-ui/icons/Chat';
import MoreVertIcon from '@material-ui/icons/MoreVert'; import MoreVertIcon from '@material-ui/icons/MoreVert';
import { useContacts } from '../../hooks/useContacts';
import Nui from '../../../../os/nui-events/utils/Nui';
import { SearchContacts } from './SearchContacts'; import { SearchContacts } from './SearchContacts';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents'; import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
import { useFilteredContacts } from '../../hooks/state'; import { CallEvents } from '../../../../../../typings/call';
import { useCall } from '../../../../os/call/hooks/useCall';
export const ContactList = () => { export const ContactList = () => {
const filteredContacts = useFilteredContacts(); const { filteredContacts } = useFilteredContacts();
const history = useHistory(); const history = useHistory();
const { initializeCall } = useCall();
const { contacts } = useContacts();
const openContactInfo = (contactId: number) => { const openContactInfo = (contactId: number) => {
history.push(`/contacts/${contactId}`); history.push(`/contacts/${contactId}`);
@@ -25,7 +28,9 @@ export const ContactList = () => {
level: 2, level: 2,
data: true, data: true,
}); });
initializeCall(number); Nui.send(CallEvents.INITIALIZE_CALL, {
number,
});
}; };
const handleMessage = (phoneNumber: string) => { const handleMessage = (phoneNumber: string) => {
@@ -37,11 +42,18 @@ export const ContactList = () => {
history.push(`/messages/new/${phoneNumber}`); history.push(`/messages/new/${phoneNumber}`);
}; };
const filteredRegEx = new RegExp(filteredContacts, 'gi');
return ( return (
<> <>
<SearchContacts /> <SearchContacts />
<List> <List>
{filteredContacts.map((contact) => ( {contacts
.filter(
(contact) =>
contact.display.match(filteredRegEx) || contact.number.match(filteredRegEx),
)
.map((contact) => (
<ListItem key={contact.id} divider> <ListItem key={contact.id} divider>
<ListItemAvatar> <ListItemAvatar>
{contact.avatar ? ( {contact.avatar ? (
@@ -1,29 +1,21 @@
import React, { useEffect, useState } from 'react'; import React from 'react';
import { Box } from '@material-ui/core'; import { Box } from '@material-ui/core';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
import { SearchField } from '../../../../ui/components/SearchField'; import { SearchField } from '../../../../ui/components/SearchField';
import { useDebounce } from '../../../../os/phone/hooks/useDebounce';
import { useSetContactFilterInput } from '../../hooks/state';
export const SearchContacts = () => { export const SearchContacts = () => {
const { setFilteredContacts, filteredContacts } = useFilteredContacts();
const { t } = useTranslation(); const { t } = useTranslation();
const setFilterVal = useSetContactFilterInput();
const [inputVal, setInputVal] = useState('');
const debouncedVal = useDebounce<string>(inputVal, 500);
useEffect(() => {
setFilterVal(debouncedVal);
}, [debouncedVal, setFilterVal]);
return ( return (
<Box> <Box>
<SearchField <SearchField
onChange={(e) => setInputVal(e.target.value)} onChange={(e) => setFilteredContacts(e.target.value)}
placeholder={t('APPS_CONTACT_PLACEHOLDER_SEARCH_CONTACTS')} placeholder={t('APPS_CONTACT_PLACEHOLDER_SEARCH_CONTACTS')}
value={inputVal} value={filteredContacts}
/> />
</Box> </Box>
); );
@@ -1,17 +1,14 @@
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
import { Avatar as MuiAvatar, Box, Button, Paper } from '@material-ui/core'; import { Avatar as MuiAvatar, Box, Button, Paper, TextField } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useHistory, useParams } from 'react-router-dom'; import { useHistory, useParams } from 'react-router-dom';
import { useContactActions } from '../../hooks/useContactActions'; import { useContacts } from '../../hooks/useContacts';
import Nui from '../../../../os/nui-events/utils/Nui';
import ArrowBackIcon from '@material-ui/icons/ArrowBack'; import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents'; import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
import { useQueryParams } from '../../../../common/hooks/useQueryParams'; import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { Contact, ContactEvents, ContactsDatabaseLimits } from '../../../../../../typings/contact'; import { ContactEvents } from '../../../../../../typings/contact';
import { TextField } from '../../../../ui/components/Input';
import { fetchNui } from '../../../../utils/fetchNui';
import { ServerPromiseResp } from '../../../../../../typings/common';
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
interface ContactInfoRouteParams { interface ContactInfoRouteParams {
mode: string; mode: string;
@@ -52,11 +49,10 @@ const useStyles = makeStyles({
const ContactsInfoPage = () => { const ContactsInfoPage = () => {
const classes = useStyles(); const classes = useStyles();
const history = useHistory(); const history = useHistory();
const { getContact, addContact, updateContact, deleteContact } = useContactActions(); const { getContact } = useContacts();
const { addAlert } = useSnackbar();
const { id } = useParams<ContactInfoRouteParams>(); const { id } = useParams<ContactInfoRouteParams>();
const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({ const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({
@@ -72,24 +68,6 @@ const ContactsInfoPage = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const handleNumberChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
const inputVal = e.target.value;
if (inputVal.length === ContactsDatabaseLimits.number) return;
setNumber(e.target.value);
};
const handleDisplayChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
const inputVal = e.target.value;
if (inputVal.length === ContactsDatabaseLimits.display) return;
setName(e.target.value);
};
const handleAvatarChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
const inputVal = e.target.value;
if (inputVal.length === ContactsDatabaseLimits.avatar) return;
setAvatar(e.target.value);
};
useEffect(() => { useEffect(() => {
if (addNumber) { if (addNumber) {
setNumber(addNumber); setNumber(addNumber);
@@ -102,27 +80,12 @@ const ContactsInfoPage = () => {
data: contact, data: contact,
level: 2, level: 2,
}); });
fetchNui<ServerPromiseResp<Contact>>(ContactEvents.ADD_CONTACT, { Nui.send(ContactEvents.ADD_CONTACT, {
display: name, display: name,
number, number,
avatar, avatar,
}).then((serverResp) => {
if (serverResp.status !== 'ok') {
return addAlert({
message: t('APPS_CONTACT_ADD_FAILED'),
type: 'error',
});
}
// Sanity checks maybe?
addContact(serverResp.data);
addAlert({
message: t('APPS_CONTACT_ADD_SUCCESS'),
type: 'success',
}); });
history.replace(referal); history.replace(referal);
});
}; };
const handleContactSave = () => { const handleContactSave = () => {
@@ -131,33 +94,13 @@ const ContactsInfoPage = () => {
data: contact, data: contact,
level: 2, level: 2,
}); });
fetchNui<ServerPromiseResp>(ContactEvents.UPDATE_CONTACT, { Nui.send(ContactEvents.UPDATE_CONTACT, {
id: contact.id,
display: name,
number,
avatar,
}).then((resp) => {
if (resp.status !== 'ok') {
return addAlert({
message: t('APPS_CONTACT_UPDATE_FAILED'),
type: 'error',
});
}
updateContact({
id: contact.id, id: contact.id,
display: name, display: name,
number, number,
avatar, avatar,
}); });
addAlert({
message: t('APPS_CONTACT_UPDATE_SUCCESS'),
type: 'success',
});
history.goBack(); history.goBack();
});
}; };
const handleContactDelete = () => { const handleContactDelete = () => {
@@ -166,20 +109,10 @@ const ContactsInfoPage = () => {
data: contact, data: contact,
level: 2, level: 2,
}); });
fetchNui<ServerPromiseResp>(ContactEvents.DELETE_CONTACT, { id: contact.id }).then((resp) => { Nui.send(ContactEvents.DELETE_CONTACT, {
if (resp.status !== 'ok') { id: contact.id,
return addAlert({
message: t('APPS_CONTACT_DELETE_FAILED'),
type: 'error',
}); });
}
history.goBack(); history.goBack();
deleteContact(contact.id);
addAlert({
message: t('APPS_CONTACT_DELETE_SUCCESS'),
type: 'error',
});
});
}; };
return ( return (
@@ -191,10 +124,9 @@ const ContactsInfoPage = () => {
<MuiAvatar className={classes.avatar} src={avatar} /> <MuiAvatar className={classes.avatar} src={avatar} />
<TextField <TextField
autoFocus autoFocus
error={name.length === ContactsDatabaseLimits.display}
className={classes.input} className={classes.input}
value={name} value={name}
onChange={handleDisplayChange} onChange={(e) => setName(e.target.value)}
label={t('APPS_CONTACT_FORM_NAME')} label={t('APPS_CONTACT_FORM_NAME')}
fullWidth fullWidth
inputProps={{ inputProps={{
@@ -203,9 +135,8 @@ const ContactsInfoPage = () => {
/> />
<TextField <TextField
className={classes.input} className={classes.input}
error={number.length === ContactsDatabaseLimits.number}
value={number} value={number}
onChange={handleNumberChange} onChange={(e) => setNumber(e.target.value)}
label={t('APPS_CONTACT_FORM_NUMBER')} label={t('APPS_CONTACT_FORM_NUMBER')}
fullWidth fullWidth
inputProps={{ inputProps={{
@@ -213,12 +144,11 @@ const ContactsInfoPage = () => {
}} }}
/> />
<TextField <TextField
error={avatar.length === ContactsDatabaseLimits.avatar}
className={classes.input} className={classes.input}
label={t('APPS_CONTACT_FORM_AVATAR')} label={t('APPS_CONTACT_FORM_AVATAR')}
fullWidth fullWidth
value={avatar} value={avatar}
onChange={handleAvatarChange} onChange={(e) => setAvatar(e.target.value)}
inputProps={{ inputProps={{
className: classes.inputProps, className: classes.inputProps,
}} }}
@@ -1,10 +1,37 @@
import React from 'react'; import React from 'react';
import Fab from '@material-ui/core/Fab';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { useHistory } from 'react-router-dom';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { ContactList } from '../List/ContactList'; import { ContactList } from '../List/ContactList';
const useStyles = makeStyles((theme: Theme) => ({
absolute: {
position: 'absolute',
bottom: theme.spacing(2),
right: theme.spacing(2),
},
icon: {
color: '#fff',
fontSize: 30,
},
}));
export const ContactPage = () => { export const ContactPage = () => {
const history = useHistory();
const classes = useStyles();
return ( return (
<div style={{ paddingBottom: 60 }}> <>
<ContactList /> <ContactList />
</div> <Fab
color="primary"
onClick={() => history.push('/contacts/-1')}
className={classes.absolute}
>
<PersonAddIcon />
</Fab>
</>
); );
}; };
+15 -48
View File
@@ -1,57 +1,24 @@
import { atom, selector, useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; import { atom } from 'recoil';
import { Contact, ContactEvents } from '../../../../../typings/contact';
import { fetchNui } from '../../../utils/fetchNui';
import { ServerPromiseResp } from '../../../../../typings/common';
import { isEnvBrowser } from '../../../utils/misc';
import LogDebugEvent from '../../../os/debug/LogDebugEvents';
import { BrowserContactsState } from '../utils/constants';
export const contactsState = { export const contactsState = {
contacts: atom<Contact[]>({ contacts: atom({
key: 'contactsList', key: 'contactsList',
default: selector({ default: [],
key: 'contactsListDefault',
get: async () => {
try {
const resp = await fetchNui<ServerPromiseResp<Contact[]>>(ContactEvents.GET_CONTACTS);
LogDebugEvent({ action: 'ContactsFetched', data: resp.data });
return resp.data;
} catch (e) {
if (isEnvBrowser()) {
return BrowserContactsState;
}
console.error(e);
return [];
}
},
}), }),
showModal: atom({
key: 'showModal',
default: false,
}), }),
filterInput: atom<string>({ filterContacts: atom({
key: 'filterInput', key: 'filterContacts',
default: '', default: '',
}), }),
filteredContacts: selector({ showContactsModal: atom({
key: 'filteredContacts', key: 'showContactModal',
get: ({ get }) => { default: false,
const filterInputVal: string = get(contactsState.filterInput); }),
const contacts: Contact[] = get(contactsState.contacts); contactDetail: atom({
key: 'contactDetail',
if (!filterInputVal) return contacts; default: null,
const regExp = new RegExp(filterInputVal, 'gi');
return contacts.filter(
(contact) => contact.display.match(regExp) || contact.number.match(regExp),
);
},
}), }),
}; };
export const useSetContacts = () => useSetRecoilState(contactsState.contacts);
export const useContacts = () => useRecoilState(contactsState.contacts);
export const useContactsValue = () => useRecoilValue(contactsState.contacts);
export const useFilteredContacts = () => useRecoilValue(contactsState.filteredContacts);
export const useContactFilterInput = () => useRecoilState(contactsState.filterInput);
export const useSetContactFilterInput = () => useSetRecoilState(contactsState.filterInput);
@@ -1,92 +0,0 @@
import { useContacts } from './state';
import { Contact } from '../../../../../typings/contact';
import { useCallback } from 'react';
interface UseContactsValue {
getDisplayByNumber: (number: string) => string;
getContactByNumber: (number: string) => Contact | null;
getContact: (id: number) => Contact | null;
getPictureByNumber: (number: string) => string | null;
deleteContact: (id: number) => void;
addContact: (contact: Contact) => void;
updateContact: (contact: Contact) => void;
}
export const useContactActions = (): UseContactsValue => {
const [contacts, setContacts] = useContacts();
const getDisplayByNumber = useCallback(
(number: string) => {
const found = contacts.find((contact) => contact.number === number);
return found ? found.display : number;
},
[contacts],
);
const getPictureByNumber = useCallback(
(number: string) => {
const found = contacts.find((contact) => contact.number === number);
return found ? found.avatar : null;
},
[contacts],
);
const getContactByNumber = useCallback(
(number: string): Contact | null => {
for (const contact of contacts) {
if (contact.number === number) return contact;
}
return null;
},
[contacts],
);
const getContact = useCallback(
(id: number): Contact | null => {
for (const contact of contacts) {
if (contact.id === id) return contact;
}
return null;
},
[contacts],
);
const deleteContact = useCallback(
(id: number): void => {
setContacts((curContacts) => [...curContacts].filter((contact) => contact.id !== id));
},
[setContacts],
);
const addContact = useCallback(
(contact: Contact) => {
setContacts((curContacts) => [...curContacts, contact]);
},
[setContacts],
);
const updateContact = useCallback(
(updatedContact: Contact) => {
setContacts((curContacts) => {
const targetContactIndex = curContacts.findIndex(
(contact) => contact.id === updatedContact.id,
);
const newContactsArray = [...curContacts];
newContactsArray[targetContactIndex] = updatedContact;
return newContactsArray;
});
},
[setContacts],
);
return {
getDisplayByNumber,
getContact,
getContactByNumber,
getPictureByNumber,
deleteContact,
updateContact,
addContact,
};
};
@@ -0,0 +1,46 @@
import { useRecoilValue } from 'recoil';
import { contactsState } from './state';
import { Contact } from '../../../../../typings/contact';
import { useCallback } from 'react';
interface IUseContacts {
contacts: Contact[];
getDisplayByNumber: (number: string) => string;
getContactByNumber: (number: string) => Contact | null;
getContact: (id: number) => Contact | null;
}
export const useContacts = (): IUseContacts => {
const contacts = useRecoilValue(contactsState.contacts);
const getDisplayByNumber = useCallback(
(number: string) => {
const found = contacts.find((contact) => contact.number === number);
return found ? found.display : number;
},
[contacts],
);
const getContactByNumber = useCallback(
(number: string): Contact | null => {
for (const contact of contacts) {
if (contact.number === number) return contact;
}
return null;
},
[contacts],
);
const getContact = useCallback(
(id: number): Contact | null => {
for (const contact of contacts) {
if (contact.id === id) return contact;
}
return null;
},
[contacts],
);
return { contacts, getDisplayByNumber, getContact, getContactByNumber };
};
@@ -0,0 +1,24 @@
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { useSetRecoilState } from 'recoil';
import { contactsState } from './state';
import { useContacts } from './useContacts';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { ContactEvents } from '../../../../../typings/contact';
export const useContactsService = () => {
const setContacts = useSetRecoilState(contactsState.contacts);
const { addAlert } = useSnackbar();
const { t } = useTranslation();
const handleAddAlert = ({ message, type }: IAlert) => {
addAlert({
message: t(`APPS_${message}`),
type,
});
};
useNuiEvent('CONTACTS', ContactEvents.SEND_CONTACTS, setContacts);
useNuiEvent('CONTACTS', ContactEvents.SEND_ALERT, handleAddAlert);
return useContacts();
};
@@ -0,0 +1,12 @@
import { useRecoilState } from 'recoil';
import { contactsState } from './state';
interface FilterdContactsProps {
filteredContacts: string;
setFilteredContacts: (contact: any) => void;
}
export const useFilteredContacts = (): FilterdContactsProps => {
const [filteredContacts, setFilteredContacts] = useRecoilState(contactsState.filterContacts);
return { filteredContacts, setFilteredContacts };
};
+12
View File
@@ -0,0 +1,12 @@
import { useRecoilState } from 'recoil';
import { contactsState } from './state';
interface ModalProps {
showModal: boolean;
setShowModal: (show: boolean) => void;
}
export const useModal = (): ModalProps => {
const [showModal, setShowModal] = useRecoilState(contactsState.showModal);
return { showModal, setShowModal };
};
@@ -1,24 +0,0 @@
export const BrowserContactsState = [
{
id: 1,
display: 'Ruqen',
number: '555-15196',
},
{
id: 2,
display: 'Taso',
number: '215-8139',
avatar: 'http://i.tasoagc.dev/i9Ig',
},
{
id: 3,
display: 'Chip',
number: '603-275-8373',
avatar: 'http://i.tasoagc.dev/2QYV',
},
{
id: 4,
display: 'Kidz',
number: '444-4444',
},
];
+24 -10
View File
@@ -7,17 +7,14 @@ import { useApp } from '../../../os/apps/hooks/useApps';
import { Switch, Route } from 'react-router-dom'; import { Switch, Route } from 'react-router-dom';
import DialPage from './views/DialPage'; import DialPage from './views/DialPage';
import DialerNavBar from './DialerNavBar'; import DialerNavBar from './DialerNavBar';
import { useDialHistory } from '../hooks/useDialHistory';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { ContactList } from '../../contacts/components/List/ContactList'; import { ContactList } from '../../contacts/components/List/ContactList';
import { DialerThemeProvider } from '../providers/DialerThemeProvider'; import { DialerThemeProvider } from '../providers/DialerThemeProvider';
import { Box, CircularProgress } from '@material-ui/core';
const LoadingSpinner: React.FC = () => (
<Box>
<CircularProgress />
</Box>
);
export const DialerApp = () => { export const DialerApp = () => {
const history = useDialHistory();
const dialer = useApp('DIALER'); const dialer = useApp('DIALER');
return ( return (
<DialerThemeProvider> <DialerThemeProvider>
@@ -29,9 +26,7 @@ export const DialerApp = () => {
<DialPage /> <DialPage />
</Route> </Route>
<Route exact path="/phone"> <Route exact path="/phone">
<React.Suspense fallback={<LoadingSpinner />}> <DialerHistory calls={history} />
<DialerHistory />
</React.Suspense>
</Route> </Route>
<Route path="/phone/contacts" component={ContactList} /> <Route path="/phone/contacts" component={ContactList} />
</Switch> </Switch>
@@ -41,3 +36,22 @@ export const DialerApp = () => {
</DialerThemeProvider> </DialerThemeProvider>
); );
}; };
InjectDebugData([
{
app: 'DIALER',
method: 'setHistory',
data: [
{
id: 1,
transmitter: '636-6496',
start: 1615946292,
},
{
id: 2,
transmitter: '777-7777',
start: 1615946292,
},
],
},
]);
@@ -1,13 +1,12 @@
import React, { useContext } from 'react'; import React, { useContext } from 'react';
import { Box, IconButton, Paper } from '@material-ui/core'; import { Box, IconButton, InputBase, Paper } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles'; import { makeStyles, Theme } from '@material-ui/core/styles';
import PhoneIcon from '@material-ui/icons/Phone'; import PhoneIcon from '@material-ui/icons/Phone';
import PersonAddIcon from '@material-ui/icons/PersonAdd'; import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { DialInputCtx, IDialInputCtx } from '../context/InputContext'; import { DialInputCtx, IDialInputCtx } from '../context/InputContext';
import Nui from '../../../os/nui-events/utils/Nui';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { useTranslation } from 'react-i18next'; import { CallEvents } from '../../../../../typings/call';
import { InputBase } from '../../../ui/components/Input';
import { useCall } from '../../../os/call/hooks/useCall';
const useStyles = makeStyles((theme: Theme) => ({ const useStyles = makeStyles((theme: Theme) => ({
root: { root: {
@@ -31,13 +30,13 @@ const useStyles = makeStyles((theme: Theme) => ({
export const DialerInput = () => { export const DialerInput = () => {
const classes = useStyles(); const classes = useStyles();
const history = useHistory(); const history = useHistory();
const { t } = useTranslation();
const { initializeCall } = useCall();
const { inputVal, set } = useContext<IDialInputCtx>(DialInputCtx); const { inputVal, set } = useContext<IDialInputCtx>(DialInputCtx);
const handleCall = (number: string) => { const handleCall = (number: string) => {
initializeCall(number); Nui.send(CallEvents.INITIALIZE_CALL, {
number,
});
}; };
const handleNewContact = (number: string) => { const handleNewContact = (number: string) => {
@@ -47,10 +46,11 @@ export const DialerInput = () => {
return ( return (
<Box component={Paper} className={classes.root}> <Box component={Paper} className={classes.root}>
<InputBase <InputBase
placeholder={t('APPS_DIALER_INPUT_PLACEHOLDER')} placeholder="Enter a number"
className={classes.input} className={classes.input}
value={inputVal} value={inputVal}
onChange={(e) => set(e.target.value)} onChange={(e) => set(e.target.value)}
type="number"
/> />
<IconButton color="primary" className={classes.iconBtn} disabled={inputVal <= ''}> <IconButton color="primary" className={classes.iconBtn} disabled={inputVal <= ''}>
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} /> <PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
@@ -5,7 +5,6 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
import PhoneIcon from '@material-ui/icons/Phone'; import PhoneIcon from '@material-ui/icons/Phone';
import PersonIcon from '@material-ui/icons/Person'; import PersonIcon from '@material-ui/icons/Person';
import HistoryIcon from '@material-ui/icons/History'; import HistoryIcon from '@material-ui/icons/History';
import { useTranslation } from 'react-i18next';
const useStyles = makeStyles((theme: Theme) => ({ const useStyles = makeStyles((theme: Theme) => ({
root: { root: {
@@ -21,7 +20,6 @@ const DialerNavBar = () => {
const classes = useStyles(); const classes = useStyles();
const { pathname } = useLocation(); const { pathname } = useLocation();
const [page, setPage] = useState(pathname); const [page, setPage] = useState(pathname);
const { t } = useTranslation();
const handleChange = (_e, newPage) => { const handleChange = (_e, newPage) => {
setPage(newPage); setPage(newPage);
@@ -30,14 +28,14 @@ const DialerNavBar = () => {
return ( return (
<BottomNavigation value={page} onChange={handleChange} showLabels className={classes.root}> <BottomNavigation value={page} onChange={handleChange} showLabels className={classes.root}>
<BottomNavigationAction <BottomNavigationAction
label={t('APPS_DIALER_NAVBAR_HISTORY')} label="History"
value="/phone" value="/phone"
component={NavLink} component={NavLink}
icon={<HistoryIcon />} icon={<HistoryIcon />}
to="/phone" to="/phone"
/> />
<BottomNavigationAction <BottomNavigationAction
label={t('APPS_DIALER_NAVBAR_DIAL')} label="Dial"
value="/phone/dial" value="/phone/dial"
color="secondary" color="secondary"
component={NavLink} component={NavLink}
@@ -45,7 +43,7 @@ const DialerNavBar = () => {
to="/phone/dial" to="/phone/dial"
/> />
<BottomNavigationAction <BottomNavigationAction
label={t('APPS_DIALER_NAVBAR_CONTACTS')} label="Contacts"
value="/phone/contacts" value="/phone/contacts"
color="secondary" color="secondary"
component={NavLink} component={NavLink}
@@ -5,16 +5,15 @@ import PhoneIcon from '@material-ui/icons/Phone';
import PersonAddIcon from '@material-ui/icons/PersonAdd'; import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { List } from '../../../../ui/components/List'; import { List } from '../../../../ui/components/List';
import { ListItem } from '../../../../ui/components/ListItem'; import { ListItem } from '../../../../ui/components/ListItem';
import { useContactActions } from '../../../contacts/hooks/useContactActions'; import Nui from '../../../../os/nui-events/utils/Nui';
import { CallHistoryItem } from '../../../../../../typings/call'; import { useSimcard } from '../../../../os/simcard/hooks/useSimcard';
import { useContacts } from '../../../contacts/hooks/useContacts';
import { CallEvents, ICall } from '../../../../../../typings/call';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { Box, IconButton, ListItemIcon, ListItemText } from '@material-ui/core'; import { Box, IconButton, ListItemIcon, ListItemText } from '@material-ui/core';
import { useHistory } from 'react-router-dom'; import { useHistory } from 'react-router-dom';
import { makeStyles, Theme } from '@material-ui/core/styles'; import { makeStyles, Theme } from '@material-ui/core/styles';
import dayjs from 'dayjs'; import dayjs from 'dayjs';
import { useMyPhoneNumber } from '../../../../os/simcard/hooks/useMyPhoneNumber';
import { useDialHistory } from '../../hooks/useDialHistory';
import { useCall } from '../../../../os/call/hooks/useCall';
const useStyles = makeStyles((theme: Theme) => ({ const useStyles = makeStyles((theme: Theme) => ({
callForward: { callForward: {
@@ -25,17 +24,20 @@ const useStyles = makeStyles((theme: Theme) => ({
}, },
})); }));
export const DialerHistory: React.FC = () => { export const DialerHistory = ({ calls }) => {
const myNumber = useMyPhoneNumber(); const { number: myNumber } = useSimcard();
const { getDisplayByNumber } = useContactActions(); const { getDisplayByNumber } = useContacts();
const { initializeCall } = useCall();
const calls = useDialHistory();
const classes = useStyles(); const classes = useStyles();
const history = useHistory(); const history = useHistory();
const { t } = useTranslation(); const { t } = useTranslation();
const handleCall = (phoneNumber) => { const handleCall = (phoneNumber) => {
initializeCall(phoneNumber); Nui.send(CallEvents.INITIALIZE_CALL, {
number: phoneNumber,
});
}; };
if (!calls?.length) { if (!calls?.length) {
@@ -53,7 +55,7 @@ export const DialerHistory: React.FC = () => {
return ( return (
<List disablePadding> <List disablePadding>
{calls.map((call: CallHistoryItem) => {calls.map((call: ICall) =>
call.transmitter === myNumber ? ( call.transmitter === myNumber ? (
<ListItem key={call.id} divider> <ListItem key={call.id} divider>
<ListItemIcon> <ListItemIcon>
@@ -64,15 +66,15 @@ export const DialerHistory: React.FC = () => {
primary={getDisplayByNumber(call.receiver)} primary={getDisplayByNumber(call.receiver)}
secondary={ secondary={
// TODO: Locale changes are pending #168 merge // TODO: Locale changes are pending #168 merge
dayjs().to(dayjs.unix(parseInt(call.start))) dayjs().to(dayjs.unix(call.start))
} }
/> />
<IconButton onClick={() => handleCall(call.receiver)}>{<PhoneIcon />}</IconButton> <IconButton onClick={() => handleCall(call.receiver)}>{<PhoneIcon />}</IconButton>
{getDisplayByNumber(call.receiver) === call.receiver && ( {getDisplayByNumber(call.transmitter) === call.transmitter && (
<IconButton <IconButton
onClick={() => onClick={() =>
history.push(`/contacts/-1?addNumber=${call.receiver}&referal=/phone/contacts`) history.push(`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`)
} }
> >
<PersonAddIcon /> <PersonAddIcon />
@@ -89,7 +91,7 @@ export const DialerHistory: React.FC = () => {
primary={getDisplayByNumber(call.transmitter)} primary={getDisplayByNumber(call.transmitter)}
secondary={ secondary={
// TODO: Locale changes are pending #168 merge // TODO: Locale changes are pending #168 merge
dayjs().to(dayjs.unix(parseInt(call.start))) dayjs().to(dayjs.unix(call.start))
} }
/> />
<IconButton onClick={() => handleCall(call.transmitter)}> <IconButton onClick={() => handleCall(call.transmitter)}>
+3 -24
View File
@@ -1,29 +1,8 @@
import { atom, selector } from 'recoil'; import { atom } from 'recoil';
import { CallEvents, CallHistoryItem } from '../../../../../typings/call';
import { fetchNui } from '../../../utils/fetchNui';
import { ServerPromiseResp } from '../../../../../typings/common';
import LogDebugEvent from '../../../os/debug/LogDebugEvents';
import { isEnvBrowser } from '../../../utils/misc';
import { MockHistoryData } from '../utils/constants';
export const dialState = { export const dialState = {
history: atom<CallHistoryItem[]>({ history: atom({
key: 'dialHistory', key: 'dialHistory',
default: selector({ default: [],
key: 'dialHistoryDefault',
get: async () => {
try {
const resp = await fetchNui<ServerPromiseResp<CallHistoryItem[]>>(CallEvents.FETCH_CALLS);
LogDebugEvent({ action: 'ContactsFetched', data: resp.data });
return resp.data;
} catch (e) {
if (isEnvBrowser()) {
return MockHistoryData;
}
console.error(e);
return [];
}
},
}),
}), }),
}; };
@@ -1,4 +1,7 @@
import { useRecoilValue } from 'recoil'; import { useRecoilValue } from 'recoil';
import { ICall } from '../../../../../typings/call';
import { dialState } from './state'; import { dialState } from './state';
export const useDialHistory = () => useRecoilValue(dialState.history); export const useDialHistory = () => {
return useRecoilValue<ICall[]>(dialState.history);
};
+5 -14
View File
@@ -1,18 +1,9 @@
import { useNuiEvent } from 'fivem-nui-react-lib'; import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { dialState } from './state';
import { CallEvents } from '../../../../../typings/call'; import { CallEvents } from '../../../../../typings/call';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
export const useDialService = () => { export const useDialService = () => {
const { addAlert } = useSnackbar(); const setHistory = useSetRecoilState(dialState.history);
const { t } = useTranslation(); useNuiEvent('DIALER', CallEvents.SET_CALL_HISTORY, setHistory);
const handleAddAlert = ({ message, type }: IAlert) => {
addAlert({
message: t(`APPS_${message}`),
type,
});
};
useNuiEvent('DIALER', CallEvents.SEND_ALERT, handleAddAlert);
}; };
-22
View File
@@ -1,22 +0,0 @@
import { CallHistoryItem } from '../../../../../typings/call';
export const MockHistoryData: CallHistoryItem[] = [
{
id: 1,
identifier: 'ca839e8c-ef9d-40bd-b6a3-d531ee58149f',
transmitter: '704-1549',
receiver: '704-1549',
is_accepted: true,
start: '1615939174',
end: null,
},
{
id: 2,
identifier: 'b8080a50-ad30-4ee9-84cb-00688e2bf167',
transmitter: '704-1549',
receiver: '704-1549',
is_accepted: false,
start: '1615939850',
end: null,
},
];
@@ -0,0 +1,34 @@
import React from 'react';
import { AppWrapper } from '../../../ui/components';
import { AppContent } from '../../../ui/components/AppContent';
import { EmailThemeProvider } from '../providers/EmailThemeProvider';
import { EmailAppNav } from './EmailAppNav';
import { Route, Switch } from 'react-router-dom';
import { InboxPage } from './pages/InboxPage';
import { EmailAppHeader } from './EmailAppHeader';
import { NewEmailPage } from './pages/NewEmailPage';
import { EmailDetailsPage } from './pages/EmailDetailsPage'; // <--- What the hell is going on
export const EmailApp = () => {
return (
<EmailThemeProvider>
<AppWrapper>
<EmailAppHeader />
<AppContent>
<Switch>
<Route path="/email" exact>
<InboxPage />
</Route>
<Route path="/email/new" exact>
<NewEmailPage />
</Route>
<Route path="/email/details/:id">
<EmailDetailsPage />
</Route>
</Switch>
</AppContent>
<EmailAppNav />
</AppWrapper>
</EmailThemeProvider>
);
};
@@ -0,0 +1,48 @@
import React from 'react';
import { Box, IconButton, makeStyles } from '@material-ui/core';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import SearchIcon from '@material-ui/icons/Search';
import { useApp } from '../../../os/apps/hooks/useApps';
import { useHistory } from 'react-router';
const useStyles = makeStyles((theme) => ({
root: {
position: 'relative',
backgroundColor: theme.palette.primary.main,
color: theme.palette.primary.contrastText,
},
back: {
color: theme.palette.primary.contrastText,
position: 'absolute',
left: '12px',
},
search: {
color: theme.palette.primary.contrastText,
position: 'absolute',
right: '12px',
},
}));
export const EmailAppHeader = () => {
const classes = useStyles();
const history = useHistory();
const { icon } = useApp('EMAIL');
return (
<Box
className={classes.root}
height="60px"
display="flex"
alignItems="center"
justifyContent="center"
>
<IconButton onClick={() => history.goBack()} className={classes.back}>
<ArrowBackIcon />
</IconButton>
{icon}
<IconButton onClick={() => history.push('/email/?autoSearch=1')} className={classes.search}>
<SearchIcon />
</IconButton>
</Box>
);
};
@@ -0,0 +1,60 @@
import React, { useState } from 'react';
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
import { NavLink, useLocation } from 'react-router-dom';
import { makeStyles, Theme } from '@material-ui/core/styles';
import AllInboxIcon from '@material-ui/icons/AllInbox';
import DraftsIcon from '@material-ui/icons/Drafts';
import SentIcon from '@material-ui/icons/LabelImportant';
const useStyles = makeStyles((theme: Theme) => ({
root: {
width: '100%',
backgroundColor: theme.palette.primary.main,
},
icon: {
color: theme.palette.primary.contrastText,
'&.Mui-selected': {
color: theme.palette.primary.light,
},
},
}));
export const EmailAppNav = () => {
const classes = useStyles();
const { pathname } = useLocation();
const [page, setPage] = useState(pathname);
const handleChange = (_e, newPage) => {
setPage(newPage);
};
return (
<BottomNavigation value={page} onChange={handleChange} showLabels className={classes.root}>
<BottomNavigationAction
className={classes.icon}
label="Inbox"
value="/email"
color="secondary"
component={NavLink}
icon={<AllInboxIcon />}
to="/email"
/>
<BottomNavigationAction
className={classes.icon}
label="New"
value="/email/new"
component={NavLink}
icon={<DraftsIcon />}
to="/email/new"
/>
<BottomNavigationAction
className={classes.icon}
label="Sent"
value="/email/sent"
component={NavLink}
icon={<SentIcon />}
to="/email/sent"
/>
</BottomNavigation>
);
};
@@ -0,0 +1,78 @@
import { Box, Button, CircularProgress, makeStyles } from '@material-ui/core';
import LeftIcon from '@material-ui/icons/ChevronLeft';
import RightIcon from '@material-ui/icons/ChevronRight';
import React, { useEffect, useState } from 'react';
import { useParams } from 'react-router';
import { IEmailMessage } from '../../../../../../typings/email'; // :)
import { useEmail } from '../../hooks/useEmail';
import { EmailMessage } from '../shared/EmailMessage';
const useStyles = makeStyles((theme) => ({
search: {
zIndex: 5,
position: 'absolute',
backgroundColor: theme.palette.primary.light,
top: 0,
},
}));
export const EmailDetailsPage = () => {
const classes = useStyles();
const { id } = useParams<{ id: string }>();
const { getEmailById, head } = useEmail();
const email = getEmailById(Number(id));
const [currMessage, setCurrMessage] = useState<number>(0);
const [message, setMessage] = useState<IEmailMessage>(null);
useEffect(() => {
if (!message && email) {
if (head(email.messages)) {
return;
}
setCurrMessage(0);
}
}, [email, head, message]);
useEffect(() => {
if (email) {
setMessage(email.messages[currMessage]);
}
}, [currMessage, email, message]);
const disableNextPage = currMessage === email?.messages.length - 1;
const disablePrevPage = currMessage === 0;
return (
<Box height="100%" pt="80px" position="relative">
<Box width="100%" p={2} className={classes.search}>
<Box width="100%" display="flex" justifyContent="space-between">
<Button
fullWidth
startIcon={<LeftIcon />}
color="primary"
onClick={() => setCurrMessage((curr) => curr + 1)}
disabled={disableNextPage}
>
Previous
</Button>
<Button
fullWidth
endIcon={<RightIcon />}
color="primary"
onClick={() => setCurrMessage((curr) => curr - 1)}
disabled={disablePrevPage}
>
Newest
</Button>
</Box>
</Box>
{!message || !email ? (
<Box width="100%" height="100%" display="flex" alignItems="center" justifyContent="center">
<CircularProgress color="primary" />
</Box>
) : (
<EmailMessage message={message} subject={email.subject} />
)}
</Box>
);
};
@@ -0,0 +1,55 @@
import React, { useEffect, useState } from 'react';
import { Box, CircularProgress, makeStyles, TextField } from '@material-ui/core';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { useEmail } from '../../hooks/useEmail';
import { EmailList } from '../shared/EmailList';
const useStyles = makeStyles((theme) => ({
search: {
zIndex: 5,
position: 'absolute',
backgroundColor: theme.palette.primary.light,
top: 0,
},
}));
export const InboxPage = () => {
const classes = useStyles();
const { inbox, fetchInbox, loading } = useEmail();
const { autoSearch } = useQueryParams<{ autoSearch }>();
const [search, setSearch] = useState<string>('');
useEffect(() => {
fetchInbox();
}, [fetchInbox]);
const handleSearch = (e) => {
setSearch(e.target.value);
};
return (
<Box height="100%" pt="80px" position="relative">
<Box width="100%" p={2} className={classes.search}>
<TextField
placeholder="Search e-mails"
fullWidth
variant="outlined"
autoFocus={!!autoSearch}
onChange={handleSearch}
value={search}
/>
</Box>
{!inbox && loading ? (
<Box width="100%" height="100%" display="flex" alignItems="center" justifyContent="center">
<CircularProgress color="primary" />
</Box>
) : (
<Box overflow="auto" maxHeight="100%">
<EmailList emails={inbox} />
</Box>
)}
</Box>
);
};
@@ -0,0 +1,118 @@
import React, { useEffect, useState } from 'react';
import SendIcon from '@material-ui/icons/Send';
import { Box, CircularProgress, Fab, makeStyles, TextField } from '@material-ui/core';
import { useTranslation } from 'react-i18next';
import { useEmail } from '../../hooks/useEmail';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
const useStyles = makeStyles((theme) => ({
search: {
backgroundColor: theme.palette.primary.light,
color: theme.palette.common.white,
position: 'absolute',
width: '100%',
top: 0,
},
sendBtn: {
position: 'absolute',
right: theme.spacing(2),
bottom: theme.spacing(2),
},
}));
export const NewEmailPage = () => {
const classes = useStyles();
const { t } = useTranslation();
const { sendEmail, loading } = useEmail();
const [subject, setSubject] = useState<string>('');
const [receivers, setReceivers] = useState<string>('');
const [body, setBody] = useState<string>('');
const {
messageId: queryMessageId,
subject: querySubject,
emailId: queryEmailId,
receivers: queryReceivers,
body: queryBody,
} = useQueryParams({
subject: '',
emailId: null,
receivers: '',
messageId: null,
body: '',
});
useEffect(() => {
if (queryEmailId) {
setSubject(querySubject);
setReceivers(queryReceivers);
setBody(queryBody);
}
}, [queryEmailId, querySubject, queryReceivers, queryBody]);
const handleSubject = (e) => {
setSubject(e.target.value || '');
};
const handleReceiver = (e) => {
setReceivers(e.target.value || '');
};
const handleBody = (e) => {
setBody(e.target.value || '');
};
const handleSubmit = () => {
sendEmail({
subject,
receivers,
body,
email_id: Number(queryEmailId) || undefined,
parent_id: Number(queryMessageId) || undefined,
});
};
return (
<Box height="100%" pt="180px">
<Box p={2} className={classes.search}>
<TextField
variant="outlined"
placeholder="To"
color="primary"
helperText="Add receivers separated by a comma"
fullWidth
value={receivers}
onChange={handleReceiver}
/>
<TextField
disabled={!!queryEmailId}
variant="outlined"
placeholder="Subject"
color="primary"
fullWidth
value={subject}
onChange={handleSubject}
/>
</Box>
<Box px={1}>
<TextField
label={t('GENERIC_CONTENT')}
multiline
fullWidth
rows={16}
variant="outlined"
value={body}
onChange={handleBody}
/>
<Fab
onClick={handleSubmit}
disabled={!body || !receivers}
className={classes.sendBtn}
color="primary"
>
{loading ? <CircularProgress color="secondary" size={1} /> : <SendIcon />}
</Fab>
</Box>
</Box>
);
};
@@ -0,0 +1,14 @@
import React from 'react';
import { IEmail } from '../../../../../../typings/email';
import { EmailListItem } from './EmailListItem';
import { List } from '@material-ui/core';
interface IProps {
emails: IEmail[];
}
export const EmailList = ({ emails }: IProps) => {
return (
<List>{emails && emails.map((email) => <EmailListItem key={email.id} email={email} />)}</List>
);
};
@@ -0,0 +1,51 @@
import React from 'react';
import {
Avatar,
IconButton,
ListItem,
ListItemAvatar,
ListItemSecondaryAction,
ListItemText,
} from '@material-ui/core';
import dayjs from 'dayjs';
import { useTranslation } from 'react-i18next';
import MarkRead from '@material-ui/icons/Markunread';
import MarkUnread from '@material-ui/icons/MarkunreadMailbox';
import { IEmail } from '../../../../../../typings/email';
import { useHistory } from 'react-router';
import { useEmail } from '../../hooks/useEmail';
export const EmailListItem = ({ email }: { email: IEmail }) => {
const { t } = useTranslation();
const { head } = useEmail();
const history = useHistory();
const latestMessage = head(email.messages);
const sendDate = dayjs.unix(latestMessage.sendDate).format(t('DATE_FORMAT'));
const read = latestMessage.isRead === true;
const mine = latestMessage.isMine === true;
const highlight = !mine && !read;
return (
<ListItem
button
divider
key={latestMessage.id}
onClick={() => history.push(`/email/details/${email.id}`)}
>
<ListItemAvatar>
<Avatar>{latestMessage.sender.charAt(0).toUpperCase()}</Avatar>
</ListItemAvatar>
<ListItemText secondary={highlight ? <strong>{sendDate}</strong> : <span>{sendDate}</span>}>
{highlight ? <strong>{email.subject}</strong> : <span>{email.subject}</span>}
</ListItemText>
<ListItemSecondaryAction>
{!mine && (
<IconButton>
{read ? <MarkUnread color="primary" /> : <MarkRead color="primary" />}
</IconButton>
)}
</ListItemSecondaryAction>
</ListItem>
);
};
@@ -0,0 +1,97 @@
import React, { useEffect, useState } from 'react';
import ReplyAllIcon from '@material-ui/icons/ReplyAll';
import ReplyIcon from '@material-ui/icons/Reply';
import { Box, Button, Card, CardActions, CardContent, Typography } from '@material-ui/core';
import { useTranslation } from 'react-i18next';
import { IEmailMessage, EmailEvents, IEmail } from '../../../../../../typings/email';
import { useEmail } from '../../hooks/useEmail';
import { useNuiEventCallback } from '../../../../os/nui-events/hooks/useNuiEventCallback';
import { useHistory } from 'react-router';
import { TFunction } from 'i18next';
const mapParagraphs = (paragraph: string, t: TFunction) => {
const isTranslate = paragraph.includes('--translate-');
const [, tKey] = paragraph.split('--translate-');
const text = isTranslate ? t(tKey) : paragraph;
return (
<Typography variant="caption" paragraph>
{text}
</Typography>
);
};
export const EmailMessage = ({ message, subject }: { message: IEmailMessage; subject: string }) => {
const history = useHistory();
const { t } = useTranslation();
const { replyEmail, head } = useEmail();
const [{ phoneActions, externalActions }, setActions] = useState<
Pick<IEmailMessage, 'phoneActions' | 'externalActions'>
>({});
const [fetchEmailActions, { loading }] = useNuiEventCallback<
{ messageId: number },
Pick<IEmailMessage, 'phoneActions' | 'externalActions'>
>('EMAIL', EmailEvents.FETCH_MESSAGE_ACTIONS, setActions);
useEffect(() => {
if (message.hasActions) {
fetchEmailActions({ messageId: message.id });
}
}, [fetchEmailActions, message.hasActions, message.id]);
const receivers = message.receivers.join(', ');
return (
<Box px={2}>
<Card>
<CardContent>
{t('GENERIC_FROM')}: <i>{message.sender}</i>
</CardContent>
<CardContent>
{t('GENERIC_TO')}: <i>{receivers}</i>
</CardContent>
<CardContent>
{t('APPS_EMAIL_SUBJECT')}: <i>{subject || '( - )'}</i>
</CardContent>
</Card>
<Box mt={2}>
<Card>
<CardContent>{message.body.split('\n').map((p) => mapParagraphs(p, t))}</CardContent>
{message.hasActions && phoneActions && (
<CardActions>
<Box textAlign="right" width="100%">
{phoneActions.map((action) => (
<Button color="primary" onClick={() => history.push(action.href)}>
{action.label}
</Button>
))}
</Box>
</CardActions>
)}
</Card>
{!message.sender.includes('no-reply') && (
<CardActions>
<Box textAlign="right" width="100%">
<Button
onClick={() => replyEmail({ ...message, subject })}
color="primary"
startIcon={<ReplyAllIcon />}
>
{t('GENERIC_REPLY_ALL')}
</Button>
<Button
onClick={() => replyEmail({ ...message, subject, receivers: [message.sender] })}
color="primary"
startIcon={<ReplyIcon />}
>
{t('GENERIC_REPLY')}
</Button>
</Box>
</CardActions>
)}
</Box>
</Box>
);
};
+28
View File
@@ -0,0 +1,28 @@
import { common, grey } from '@material-ui/core/colors';
export const EMAIL_APP_DEFAULT_PRIMARY_COLOR = '#00695c';
export const EMAIL_APP_DEFAULT_TEXT_COLOR = common.white;
const theme = {
palette: {
primary: {
main: EMAIL_APP_DEFAULT_PRIMARY_COLOR,
dark: '#004940',
light: '#99d5cf',
contrastText: EMAIL_APP_DEFAULT_TEXT_COLOR,
},
text: {
primary: grey[900],
secondary: grey[700],
disabled: grey[600],
hint: grey[800],
},
divider: '#99d5cf',
background: {
default: grey[100],
paper: grey[50],
},
},
};
export default theme;
+25
View File
@@ -0,0 +1,25 @@
import { atom } from 'recoil';
import { IEmail } from '../../../../../typings/email';
export const emailState = {
search: atom<IEmail[]>({
default: null,
key: 'EMAIL:search',
}),
searchTerm: atom<string>({
default: null,
key: 'EMAIL:searchTerm',
}),
inbox: atom<IEmail[]>({
default: null,
key: 'EMAIL:inbox',
}),
sent: atom<IEmail[]>({
default: null,
key: 'EMAIL:sent',
}),
myEmail: atom<string>({
default: null,
key: 'EMAIL:myEmail',
}),
};
+64
View File
@@ -0,0 +1,64 @@
import qs from 'qs';
import { useCallback, useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router';
import { useRecoilState, useRecoilValue } from 'recoil';
import { EmailEvents, EmailMessageInput, IEmailMessage } from '../../../../../typings/email';
import { useNuiEventCallback } from '../../../os/nui-events/hooks/useNuiEventCallback';
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
import { emailState } from './state';
export const useEmail = () => {
const history = useHistory();
const { t } = useTranslation();
const { addAlert } = useSnackbar();
const [inbox, setInbox] = useRecoilState(emailState.inbox);
const myEmail = useRecoilValue(emailState.myEmail);
const onError = useCallback((error) => addAlert({ message: t(error), type: 'error' }), [
addAlert,
t,
]);
const onSendSuccess = useCallback(() => {
addAlert({ message: t('APPS_EMAIL_SEND_EMAIL_SUCCESS'), type: 'success' });
history.push('/email');
}, [addAlert, history, t]);
const [sendEmail, { loading: sendLoading }] = useNuiEventCallback<EmailMessageInput>(
'EMAIL',
EmailEvents.SEND_EMAIL,
onSendSuccess,
onError,
);
const [fetchInbox, { loading: inboxLoading }] = useNuiEventCallback(
'EMAIL',
EmailEvents.FETCH_INBOX,
setInbox,
onError,
);
const loading = inboxLoading || sendLoading;
const allEmails = useMemo(() => [...(inbox || [])], [inbox]);
const head = useCallback((arr: IEmailMessage[]): IEmailMessage => arr && arr[0], []);
const getEmailById = useCallback((id: number) => allEmails.find((e) => e.id === id) || null, [
allEmails,
]);
const replyEmail = (message: IEmailMessage & { subject: string }) => {
const receivers = message.receivers.join(',');
const query = qs.stringify(
{
...message,
receivers,
body: '',
},
{ addQueryPrefix: true },
);
history.push(`/email/new/${query}`);
};
return { inbox, myEmail, getEmailById, head, fetchInbox, sendEmail, replyEmail, loading };
};
@@ -0,0 +1,221 @@
import { useSetRecoilState } from 'recoil';
import { EmailEvents, IEmail } from '../../../../../typings/email';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { emailState } from './state';
export const useEmailService = () => {
const setMyEmail = useSetRecoilState(emailState.myEmail);
useNuiEvent('EMAIL', 'phone:setMyEmail', setMyEmail);
};
InjectDebugData<string>([
{
app: 'EMAIL',
method: 'phone:setMyEmail',
data: '[email protected]',
},
]);
InjectDebugData<IEmail[]>(
[
{
app: 'EMAIL',
method: EmailEvents.FETCH_INBOX_SUCCESS,
data: [
{
id: 1,
subject: 'Hey!',
messages: [
{
id: 1,
emailId: 1,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
hasActions: false,
},
],
},
{
id: 2,
subject: 'What is up?',
messages: [
{
id: 2,
emailId: 2,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
hasActions: false,
},
],
},
],
},
{
app: 'EMAIL',
method: EmailEvents.FETCH_INBOX_SUCCESS,
data: [
{
id: 3,
subject: 'Try this great app! 1',
messages: [
{
id: 11,
parentId: 12,
emailId: 3,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
isMine: true,
hasActions: false,
},
{
id: 12,
parentId: 3,
emailId: 3,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
isMine: false,
hasActions: false,
},
{
id: 3,
parentId: null,
emailId: 3,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
isMine: true,
hasActions: false,
},
],
},
{
id: 4,
subject: 'Try this great app!',
messages: [
{
id: 4,
emailId: 1,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
hasActions: false,
},
],
},
{
id: 5,
subject: 'Try this great app!',
messages: [
{
id: 5,
emailId: 5,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: true,
hasActions: false,
},
],
},
{
id: 6,
subject: 'Try this great app!',
messages: [
{
id: 6,
emailId: 6,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: true,
hasActions: false,
},
],
},
{
id: 7,
subject: 'Try this great app!',
messages: [
{
id: 7,
emailId: 7,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: true,
hasActions: false,
},
],
},
{
id: 8,
subject: 'Try this great app!',
messages: [
{
id: 8,
emailId: 8,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
hasActions: false,
},
],
},
{
id: 9,
subject: 'Try this great app!',
messages: [
{
id: 9,
emailId: 9,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
hasActions: false,
},
],
},
{
id: 10,
subject: 'Try this great app!',
messages: [
{
id: 10,
emailId: 10,
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
hasActions: false,
},
],
},
],
},
],
4000,
);
@@ -0,0 +1,4 @@
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
import theme from '../email.theme';
export const EmailThemeProvider = createAppThemeProvider(theme);
@@ -1,4 +1,4 @@
import { useNuiEvent } from 'fivem-nui-react-lib'; import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { useSetRecoilState } from 'recoil'; import { useSetRecoilState } from 'recoil';
import { exampleState } from './state'; import { exampleState } from './state';
import { useExample } from './useExample'; import { useExample } from './useExample';
@@ -1,21 +1,20 @@
import React from 'react'; import React from 'react';
import { AppWrapper } from '../../../ui/components'; import { AppWrapper } from '../../../ui/components/AppWrapper';
import { AppContent } from '../../../ui/components/AppContent'; import { AppContent } from '../../../ui/components/AppContent';
import { MarketplaceListContainer } from './MarketplaceList/MarketplaceListContainer'; import { MarketplaceTitle } from './MarketplaceTitle';
import { MarketplaceListContainer } from './SelloutList/MarketplaceListContainer';
import { NavigationBar } from './navigation/NavigationBar'; import { NavigationBar } from './navigation/NavigationBar';
import { Switch, Route } from 'react-router-dom'; import { Switch, Route } from 'react-router-dom';
import { ListingFormContainer } from './form/ListingFormContainer'; import { ListingFormContainer } from './form/ListingFormContainer';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { MarketplaceThemeProvider } from '../providers/MarketplaceThemeProvider'; import { MarketplaceThemeProvider } from '../providers/MarketplaceThemeProvider';
import { AppTitle } from '../../../ui/components/AppTitle'; import { MarketplaceEvents } from '../../../../../typings/marketplace';
import { useApp } from '../../../os/apps/hooks/useApps';
export const MarketplaceApp = () => { export const MarketplaceApp = () => {
const marketplaceApp = useApp('MARKETPLACE');
return ( return (
<MarketplaceThemeProvider> <MarketplaceThemeProvider>
<AppWrapper id="marketplace-app"> <AppWrapper id="sellout-app">
<AppTitle app={marketplaceApp} /> <MarketplaceTitle />
<AppContent> <AppContent>
<Switch> <Switch>
<Route path="/marketplace" exact component={MarketplaceListContainer} /> <Route path="/marketplace" exact component={MarketplaceListContainer} />
@@ -27,3 +26,29 @@ export const MarketplaceApp = () => {
</MarketplaceThemeProvider> </MarketplaceThemeProvider>
); );
}; };
InjectDebugData([
{
app: 'SELLOUT',
method: MarketplaceEvents.SEND_LISTING,
data: [
{
id: 1,
name: 'Some guy',
number: '111-1134',
title: 'eeeeeeeeeeeeeeeeeeeeeeeee',
description:
'skldfsdEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
url: 'https://beta.iodine.gg/706Y3.jpeg',
},
{
id: 2,
name: 'Some other dude',
number: '666-6666',
title: 'Material',
description: 'Selling my wife',
url: '',
},
],
},
]);
@@ -1,11 +0,0 @@
import React from 'react';
import { MarketplaceList } from './MarketplaceList';
import { LoadingSpinner } from '../../../../ui/components/LoadingSpinner';
export const MarketplaceListContainer: React.FC = () => {
return (
<React.Suspense fallback={<LoadingSpinner />}>
<MarketplaceList />
</React.Suspense>
);
};
@@ -0,0 +1,30 @@
import React from 'react';
import Paper from '@material-ui/core/Paper';
import { makeStyles } from '@material-ui/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faAd } from '@fortawesome/free-solid-svg-icons';
const useStyles = makeStyles((theme) => ({
root: {
height: '60px',
width: '100%',
display: 'flex',
flexFlow: 'row nowrap',
justifyContent: 'center',
alignItems: 'center',
background: theme.palette.background.default,
},
icon: {
color: theme.palette.primary.main,
fontSize: 40,
},
}));
export const MarketplaceTitle = () => {
const classes = useStyles();
return (
<Paper className={classes.root} square variant="outlined" elevation={24}>
<FontAwesomeIcon icon={faAd} className={classes.icon} />
</Paper>
);
};
@@ -2,17 +2,15 @@ import { Box, Tooltip, Button } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles'; import { makeStyles, Theme } from '@material-ui/core/styles';
import React from 'react'; import React from 'react';
import { MarketplaceEvents, MarketplaceListing } from '../../../../../../typings/marketplace'; import { MarketplaceEvents, MarketplaceListing } from '../../../../../../typings/marketplace';
import { useSimcard } from '../../../../os/simcard/hooks/useSimcard';
import DeleteIcon from '@material-ui/icons/Delete'; import DeleteIcon from '@material-ui/icons/Delete';
import ReportIcon from '@material-ui/icons/Report'; import ReportIcon from '@material-ui/icons/Report';
import ChatIcon from '@material-ui/icons/Chat'; import ChatIcon from '@material-ui/icons/Chat';
import PhoneIcon from '@material-ui/icons/Phone'; import PhoneIcon from '@material-ui/icons/Phone';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router'; import { useHistory } from 'react-router';
import { fetchNui } from '../../../../utils/fetchNui'; import { CallEvents } from '../../../../../../typings/call';
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
import { ServerPromiseResp } from '../../../../../../typings/common';
import { useMyPhoneNumber } from '../../../../os/simcard/hooks/useMyPhoneNumber';
import { useCall } from '../../../../os/call/hooks/useCall';
const useStyles = makeStyles((theme: Theme) => ({ const useStyles = makeStyles((theme: Theme) => ({
icon: { icon: {
@@ -20,52 +18,26 @@ const useStyles = makeStyles((theme: Theme) => ({
}, },
})); }));
export const ListingActions: React.FC<MarketplaceListing> = ({ children, ...listing }) => { export const ListingActions = ({ listing }: { listing: MarketplaceListing }) => {
const classes = useStyles(); const classes = useStyles();
const myNumber = useMyPhoneNumber(); const { number: myNumber } = useSimcard();
const { t } = useTranslation(); const { t } = useTranslation();
const history = useHistory(); const history = useHistory();
const { initializeCall } = useCall();
const { addAlert } = useSnackbar();
const handleDeleteListing = () => { const handleDeleteListing = () => {
fetchNui<ServerPromiseResp>(MarketplaceEvents.DELETE_LISTING, { Nui.send(MarketplaceEvents.DELETE_LISTING, {
id: listing.id, id: listing.id,
}).then((resp) => {
if (resp.status !== 'ok') {
return addAlert({
message: t('APPS_MARKETPLACE_DELETE_LISTING_FAILED'),
type: 'error',
});
}
addAlert({
message: t('APPS_MARKETPLACE_DELETE_LISTING_SUCCESS'),
type: 'success',
});
}); });
}; };
const handleReportListing = () => { const handleReportListing = () => {
fetchNui<ServerPromiseResp>(MarketplaceEvents.REPORT_LISTING, { Nui.send(MarketplaceEvents.REPORT_LISTING, listing);
listingId: listing.id,
}).then((resp) => {
if (resp.status !== 'ok') {
return addAlert({
message: t('APPS_MARKETPLACE_REPORT_LISTING_FAILED'),
type: 'error',
});
}
addAlert({
message: t('APPS_MARKETPLACE_REPORT_LISTING_SUCCESS'),
type: 'success',
});
});
}; };
const handleCall = () => { const handleCall = () => {
initializeCall(listing.number); Nui.send(CallEvents.INITIALIZE_CALL, {
number: listing.number,
});
}; };
const handleMessage = () => { const handleMessage = () => {
@@ -73,9 +45,9 @@ export const ListingActions: React.FC<MarketplaceListing> = ({ children, ...list
}; };
return ( return (
<Box justifyContent="space-between" alignItems="center"> <Box flex justifyContent="space-between" alignItems="center">
<div style={{ float: 'left' }}> <div style={{ float: 'left' }}>
{listing.number !== myNumber && ( {listing.number !== myNumber ? (
<> <>
<Tooltip title={t('GENERIC_MESSAGE')}> <Tooltip title={t('GENERIC_MESSAGE')}>
<Button onClick={handleMessage}> <Button onClick={handleMessage}>
@@ -88,7 +60,7 @@ export const ListingActions: React.FC<MarketplaceListing> = ({ children, ...list
</Button> </Button>
</Tooltip> </Tooltip>
</> </>
)} ) : null}
</div> </div>
<div style={{ float: 'right' }}> <div style={{ float: 'right' }}>
@@ -41,7 +41,7 @@ const useStyles = makeStyles((theme) => ({
}, },
})); }));
export const MarketplaceItem: React.FC<MarketplaceListing> = ({ children, ...listing }) => { export const MarketplaceItem = (listing: MarketplaceListing) => {
const classes = useStyles(); const classes = useStyles();
return ( return (
@@ -73,7 +73,7 @@ export const MarketplaceItem: React.FC<MarketplaceListing> = ({ children, ...lis
<Typography variant="body1" className={classes.listingContent}> <Typography variant="body1" className={classes.listingContent}>
{listing.description} {listing.description}
</Typography> </Typography>
<ListingActions {...listing} /> <ListingActions listing={listing} />
</Paper> </Paper>
</div> </div>
</ListItem> </ListItem>
@@ -1,10 +1,10 @@
import React from 'react'; import React from 'react';
import { List } from '../../../../ui/components/List'; import { List } from '../../../../ui/components/List';
import { useListingValue } from '../../hooks/state'; import { useListing } from '../../hooks/useListing';
import { MarketplaceItem } from './MarketplaceItem'; import { MarketplaceItem } from './MarketplaceItem';
export const MarketplaceList: React.FC = () => { export const MarketplaceList = () => {
const listings = useListingValue(); const listings = useListing();
return ( return (
<List> <List>
@@ -0,0 +1,6 @@
import React from 'react';
import { MarketplaceList } from './MarketplaceList';
export const MarketplaceListContainer = () => {
return <MarketplaceList />;
};
@@ -1,16 +1,10 @@
import React, { useEffect, useState, useCallback } from 'react'; import React, { useState } from 'react';
import { makeStyles, Button, Box } from '@material-ui/core'; import { makeStyles, Button, TextField, Typography } from '@material-ui/core';
import { MarketplaceEvents, MarketplaceListing } from '../../../../../../typings/marketplace'; import Nui from '../../../../os/nui-events/utils/Nui';
import { MarketplaceEvents } from '../../../../../../typings/marketplace';
import { useSnackbar } from '../../../../ui/hooks/useSnackbar'; import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next'; import { useTranslation } from 'react-i18next';
import ImageIcon from '@material-ui/icons/Image'; import { useHistory } from 'react-router';
import { useHistory, useLocation } from 'react-router-dom';
import qs from 'qs';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { deleteQueryFromLocation } from '../../../../common/utils/deleteQueryFromLocation';
import { TextField } from '../../../../ui/components/Input';
import { fetchNui } from '../../../../utils/fetchNui';
import { ServerPromiseResp } from '../../../../../../typings/common';
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
root: { root: {
@@ -41,8 +35,6 @@ export const ListingForm = () => {
const { t } = useTranslation(); const { t } = useTranslation();
const { addAlert } = useSnackbar(); const { addAlert } = useSnackbar();
const history = useHistory(); const history = useHistory();
const { pathname, search } = useLocation();
const query = useQueryParams();
const [title, setTitle] = useState(''); const [title, setTitle] = useState('');
const [url, setUrl] = useState(''); const [url, setUrl] = useState('');
@@ -50,24 +42,12 @@ export const ListingForm = () => {
const addListing = () => { const addListing = () => {
if (title !== '' && description !== '') { if (title !== '' && description !== '') {
fetchNui<ServerPromiseResp<MarketplaceListing[]>>(MarketplaceEvents.ADD_LISTING, { Nui.send(MarketplaceEvents.ADD_LISTING, {
title, title,
description,
url, url,
}).then((resp) => { description,
if (resp.status !== 'ok') {
return addAlert({
message: t('APPS_MARKETPLACE_CREATE_LISTING_FAILED'),
type: 'error',
});
}
addAlert({
message: t('APPS_MARKETPLACE_CREATE_LISTING_SUCCESS'),
type: 'success',
}); });
history.push('/marketplace'); history.push('/marketplace');
});
} else { } else {
addAlert({ addAlert({
message: t('APPS_MARKETPLACE_REQUIRED_FIELDS'), message: t('APPS_MARKETPLACE_REQUIRED_FIELDS'),
@@ -76,26 +56,6 @@ export const ListingForm = () => {
} }
}; };
/*const handleChooseImage = () => {
history.push(`/camera?${qs.stringify({
referal: encodeURIComponent(pathname + search),
})}`)
}*/
const handleChooseImage = useCallback(() => {
history.push(
`/camera?${qs.stringify({
referal: encodeURIComponent(pathname + search),
})}`,
);
}, [history, pathname, search]);
useEffect(() => {
if (!query?.image) return;
setUrl(query?.image);
history.replace(deleteQueryFromLocation({ pathname, search }, 'image'));
}, [query?.image, history, pathname, search]);
return ( return (
<div className={classes.root}> <div className={classes.root}>
<h1>New Listing</h1> <h1>New Listing</h1>
@@ -115,19 +75,10 @@ export const ListingForm = () => {
}} }}
/> />
<Box display="flex" alignItems="center" paddingLeft={5}>
<div>
<ImageIcon />
</div>
<div>
<Button onClick={handleChooseImage}>Choose a image</Button>
</div>
</Box>
<TextField <TextField
className={classes.input} className={classes.input}
placeholder={t('APPS_MARKETPLACE_FORM_IMAGE')} placeholder={t('APPS_MARKETPLACE_FORM_IMAGE')}
value={url} onChange={(e) => setUrl(e.target.value)}
onChange={(e) => setUrl(e.currentTarget.value)}
inputProps={{ className: classes.textFieldInput }} inputProps={{ className: classes.textFieldInput }}
style={{ width: '80%' }} style={{ width: '80%' }}
size="medium" size="medium"
@@ -2,7 +2,9 @@ import React, { useState } from 'react';
import { makeStyles } from '@material-ui/core/styles'; import { makeStyles } from '@material-ui/core/styles';
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core'; import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
import { AddCircle, Home } from '@material-ui/icons/'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faHome } from '@fortawesome/free-solid-svg-icons';
import AddCircleIcon from '@material-ui/icons/AddCircle';
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
root: { root: {
@@ -26,8 +28,12 @@ export const NavigationBar = () => {
showLabels showLabels
className={classes.root} className={classes.root}
> >
<BottomNavigationAction component={Link} icon={<Home />} to="/marketplace" /> <BottomNavigationAction
<BottomNavigationAction component={Link} icon={<AddCircle />} to="/marketplace/new" /> component={Link}
icon={<FontAwesomeIcon icon={faHome} />}
to="/marketplace"
/>
<BottomNavigationAction component={Link} icon={<AddCircleIcon />} to="/marketplace/new" />
</BottomNavigation> </BottomNavigation>
); );
}; };
+6 -51
View File
@@ -1,53 +1,8 @@
import { atom, selector, useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; import { atom } from 'recoil';
import { ServerPromiseResp } from '../../../../../typings/common';
import { MarketplaceEvents, MarketplaceListing } from '../../../../../typings/marketplace';
import { fetchNui } from '../../../utils/fetchNui';
import { isEnvBrowser } from '../../../utils/misc';
const defaultData: MarketplaceListing[] = [ export const selloutState = {
{ listing: atom({
id: 1, key: 'listing',
name: 'Some guy', default: [],
number: '111-1134',
username: 'Taso',
title: 'eeeeeeeeeeeeeeeeeeeeeeeee',
description:
'skldfsdEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
url: 'https://i.file.glass/706Y3.jpeg',
},
{
id: 2,
name: 'Some other dude',
number: '666-6666',
username: 'Taso',
title: 'Material',
description: 'Selling my wife',
url: '',
},
];
export const listingState = atom<MarketplaceListing[]>({
key: 'listings',
default: selector({
key: 'defaultListings',
get: async () => {
try {
const resp = await fetchNui<ServerPromiseResp<MarketplaceListing[]>>(
MarketplaceEvents.FETCH_LISTING,
);
return resp.data;
} catch (e) {
if (isEnvBrowser()) {
return defaultData;
}
console.error(e);
return [];
}
},
}), }),
}); };
export const useListingValue = () => useRecoilValue(listingState);
export const useSetListings = () => useSetRecoilState(listingState);
export const useListings = () => useRecoilState(listingState);
@@ -0,0 +1,7 @@
import { useRecoilValue } from 'recoil';
import { MarketplaceListing } from '../../../../../typings/marketplace';
import { selloutState } from './state';
export const useListing = () => {
return useRecoilValue<MarketplaceListing[]>(selloutState.listing);
};
Loaded 100 of 409 files, more files were not shown because too many files have changed in this diff. Show more