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
J Francisco Rader 107dc43624 Improve messages error handling (#181)
* Improve messages error handling

* Add types to getPlayerFromIdentifier function

* Add phone validation regex to message group form

* Add correct alert types to enum

* Improve locale

* Improve error message for unregistered numbers
2021-03-29 18:55:27 -04:00
Christopher f27e486ff5 fix(phone/marketplace): fix word wrap 2021-03-28 23:32:02 +02:00
Christopher Gjelten a88286f97a Improve/marketplace (#184)
Overall fixes for sellout => marketplace.
2021-03-28 04:20:12 +02:00
Christopher baf6dedb6f update en.json 2021-03-28 01:31:49 +01:00
Christopher Gjelten c5115777c5 Merge pull request #177 from project-error/feat/bank-enums
Feat(phone): Update to use all enums.
2021-03-27 17:20:31 +01:00
Christopher d95cd8d4bc fix(phone/dialer): only allow numbers in input 2021-03-27 00:12:40 +01:00
Oldarorn 632e27e0fa Tinder french translation (#183)
Because love can't wait
2021-03-26 14:10:47 -04:00
Taso 853b335ef9 feat(phone): Added a game time indicator to top bar (#176) 2021-03-26 13:30:09 -04:00
Erik 6b865f2e73 Feature/tinder (#179)
* basic framework for match/tinder

* working version of swiping

* working version of profile editing

* introducing backend

* working matching system

* working profile updating

* fix all linting issues

* updated events to Enum

* working profile generation

* documentation updates

* general PR feedback

* working profile loading, matches show matchedAt

* slight modification to event strings

* added sql imports
2021-03-26 13:29:51 -04:00
Christopher Gjelten b02b19be5f Merge pull request #182 from Oldarorn/patch-5
Added missing french translations
2021-03-26 16:33:17 +01:00
Oldarorn 0bb9b6738f Added missing french translations
I was passing by your repo and saw some translations were missing so... here I am ♫
2021-03-26 13:01:21 +01:00
Christopher a6f98d7ac0 update marketplace enums 2021-03-25 13:07:07 +01:00
Christopher 5ce6cf2d4a update notes enums 2021-03-25 12:53:18 +01:00
Christopher 2e4d752cd3 update conatct enums 2021-03-25 11:42:44 +01:00
Christopher 2cd3e9e93d update dial events 2021-03-25 11:31:05 +01:00
Dillon Skaggs b789e73447 fix(readme): fix typo (#180)
auguest kek
2021-03-24 14:24:03 -04:00
Christopher 98efed4e64 fix bank enums 2021-03-24 19:02:02 +01:00
Taso 6c2eae7f5d fix(phone/settings): Fixed localStorage persistence 2021-03-22 19:14:53 -04:00
Christopher de10ce92b2 fix(bank): update all events 2021-03-22 23:15:02 +01:00
Christopher 5654e1f46f feat(bank): update usage of enums 2021-03-22 23:05:39 +01:00
J Francisco Rader a3d7c19f44 Tweaks / Message notifications (#174)
* Remove msg notifications when opening one | Dont alert notifications when inside that conversation

* Fix msg events

* Fix goToConversation util

* Fix nuiEvents for messages
2021-03-22 18:57:20 -03:00
Christopher b42ee97450 feat(resources/cl_utils): NuiCallback 2021-03-22 22:45:47 +01:00
Taso 4e7e6b3e92 fix(client/marketplace): Fixed typo preventing listings from being sent 2021-03-22 14:44:34 -04:00
Taso 0f61088999 refactor(events): Events are now tied to a common enum typings (#167)
* chore(scripts/twitter): Refactored twitter to use event enums

* chore(scripts/marketplace): Refactored marketplace to use event enums

* chore(scripts/messages): Refactored messages to use event enums

* chore(scripts/contacts): Refactored contacts to use event enums

* chore(scripts/calls): Refactored calls to use event enums

* chore(scripts/notes): Refactored notes to use event enums

* chore(scripts/photos): Refactored photos to use event enums

* chore(scripts/bank): Refactored bank to use event enums

* chore(scripts/phone): Refactored phone to use event enums

* chore(events): Removed old events object

* refactor(phone/nui-events): Attached NUI events to respective enum

* tweak(event-enums): Added npwd prefix to all events

* tweak(phone/serve): Added craco to override CRA without eject

Also bumped react-scripts to 4.0.1, with seemingly no issues

* fix(typings/twitter): Fixed method enums for twitter
2021-03-22 13:37:07 -04:00
Erik 53d5bb459d Merge pull request #170 from project-error/feature/default-profile-names
Feature/default profile names
2021-03-22 10:40:22 -04:00
Kire fe1e685f6f fix(phone/twitter): Fix crash on broadcast with no profile set 2021-03-22 10:37:56 -04:00
Kire c8f680fdfb update for PR feedback 2021-03-22 10:37:10 -04:00
Kire f3f055944c handle twitter profile updating 2021-03-22 10:37:10 -04:00
Kire 21a2f8912d initial PR review changes 2021-03-22 10:37:10 -04:00
Kire 97f5c99cc0 handle all configuration cases 2021-03-22 10:37:10 -04:00
Kire 8000cc3d3f added UI for choosing a default profile name 2021-03-22 10:37:10 -04:00
Christopher 9261025b4f fix typo = 2021-03-22 10:58:54 +01:00
Erik a52ffc4e79 Feature/twitter refresh (#160)
* receive and process broadcasted tweets to the clients

* removing profile fetch and cleaning up unused functions

* defend against null profile

* move defenseive check to top pof notifications

* fix bug where delete was visible for non owners

* remove polling implementation
2021-03-20 18:17:14 -04:00
Taso 2a4457b323 feat(phone/settings): Schema validation & Reset Settings
You can now reset your settings to default using the action in the Settings App

Setting schema validation has been added that will temporarily reset to default settings if
the JSON string contains unexpected values. A alert will pop up informing the user
that they should reset to default settings using the action in the settings app,
as a permanent solution.
2021-03-20 12:57:22 -04:00
J Francisco Rader 97c308f550 Add useNuiEventCallback hook (#173)
* Add useNuiEventCallback hook
2021-03-19 11:54:26 -03:00
Christopher Gjelten 769f5a3d21 Merge pull request #169 from project-error/tweak/dialer
tweak(dialer): Several fixes and improvements
2021-03-19 12:08:16 +01:00
Christopher 73f057b55b dont call if no value 2021-03-19 10:01:25 +01:00
J Francisco Rader 0ec2b682e7 Messages bugfix again :D (#164)
* Handle offline messages | Fetch messages when broadcasted | Fetch message groups

* Fetch messages on notification click

* Dont fetch groups if duplicate group

* Only submit new message on click submit

* Fix infinite loading when duplicated group is creatded

* Fix infinite loading when group already existed

* Make code prettier

* Centralize fetch messages on goToConversation

* Remove duplicated event

* Improve message groups mapping to include yourself for unreadCount + Fix redirection after adding contact + General improvements

* Remove conflicts

* Fix media paths
2021-03-18 23:01:54 -03:00
Taso f1f6a05981 tweak(dialer): Several fixes and improvements
Time has been changed to a relative format. Locale specifics are pending
merge of #168.

Several typos have been fixed where "DAILER" was referenced instead of
"DIALER"

A translation key was added for when a user has no call history.

The input box has been unlocked so users can use their keyboard directly
rather than using the dial pad.
2021-03-17 10:26:52 -04:00
200 changed files with 28524 additions and 3818 deletions

No files matched your search

+2
View File
@@ -3,6 +3,8 @@
resources/html
phone/.eslintcache
# Node Modules and Built Folders
node_modules
build
+1 -1
View File
@@ -3,7 +3,7 @@
<img src="https://beta.iodine.gg/zVkK7.png" width="500" height="300" />
NPWD is our current running project. Our team has been working on the project since Auguest, 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.
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.
+7
View File
@@ -27,6 +27,13 @@
"enableImages": true,
"maxImages": 3
},
"match": {
"generateProfileNameFromUsers": true,
"allowEdtiableProfileName": true
},
"email": {
"provider": "project-error.dev"
},
"bank": {
"showNotifications": true
},
+75
View File
@@ -1,6 +1,7 @@
# comment this out if your server has a different table/location for phone_number
# 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_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);
@@ -54,6 +55,33 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS `npwd_match_profiles` (
`id` int NOT NULL AUTO_INCREMENT,
`identifier` varchar(255) NOT NULL,
`name` varchar(90) NOT NULL,
`image` varchar(255) NOT NULL,
`bio` varchar(512) DEFAULT NULL,
`location` varchar(45) DEFAULT NULL,
`job` varchar(45) DEFAULT NULL,
`tags` varchar(255) NOT NULL DEFAULT '',
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`),
UNIQUE KEY `identifier_UNIQUE` (`identifier`)
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE IF NOT EXISTS `npwd_match_views` (
`id` int NOT NULL AUTO_INCREMENT,
`identifier` varchar(40) NOT NULL,
`profile` int NOT NULL,
`liked` tinyint DEFAULT '0',
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `match_profile_idx` (`profile`),
CONSTRAINT `match_profile` FOREIGN KEY (`profile`) REFERENCES `npwd_match_profiles` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
CREATE TABLE IF NOT EXISTS npwd_notes (
id int(11) NOT NULL AUTO_INCREMENT,
@@ -147,3 +175,50 @@ CREATE TABLE IF NOT EXISTS npwd_phone_gallery (
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)
);
+2 -1
View File
@@ -15,5 +15,6 @@
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
},
"dependencies": {}
}
+58
View File
@@ -0,0 +1,58 @@
const {
addAfterLoader,
removeLoaders,
loaderByName,
getLoaders,
throwUnexpectedConfigError,
} = require('@craco/craco');
const throwError = (message) =>
throwUnexpectedConfigError({
packageName: 'craco',
githubRepo: 'gsoft-inc/craco',
message,
githubIssueQuery: 'webpack',
});
module.exports = {
webpack: {
configure: (webpackConfig, { paths }) => {
const { hasFoundAny, matches } = getLoaders(webpackConfig, loaderByName('babel-loader'));
if (!hasFoundAny) throwError('failed to find babel-loader');
const { hasRemovedAny, removedCount } = removeLoaders(
webpackConfig,
loaderByName('babel-loader'),
);
if (!hasRemovedAny) throwError('no babel-loader to remove');
if (removedCount !== 2) throwError('had expected to remove 2 babel loader instances');
webpackConfig.resolve.plugins = webpackConfig.resolve.plugins.filter(
({ constructor: c }) => !c || c.name !== 'ModuleScopePlugin',
);
const tsLoader = {
test: /\.tsx?$/,
loader: require.resolve('ts-loader'),
options: { transpileOnly: true },
};
const { isAdded: tsLoaderIsAdded } = addAfterLoader(
webpackConfig,
loaderByName('url-loader'),
tsLoader,
);
if (!tsLoaderIsAdded) throwError('failed to add ts-loader');
const { isAdded: babelLoaderIsAdded } = addAfterLoader(
webpackConfig,
loaderByName('ts-loader'),
matches[1].loader, // babel-loader
);
if (!babelLoaderIsAdded) throwError('failed to add back babel-loader for non-application JS');
return webpackConfig;
},
},
};
+18572
View File
File diff suppressed because it is too large. Load diff
+6 -3
View File
@@ -24,6 +24,7 @@
"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",
@@ -32,7 +33,7 @@
"react-i18next": "^11.7.1",
"react-popper": "^2.2.3",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"react-scripts": "4.0.1",
"recoil": "^0.1.2"
},
"devDependencies": {
@@ -42,6 +43,7 @@
"@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",
@@ -62,6 +64,7 @@
"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",
@@ -78,11 +81,11 @@
"scripts": {
"i18n:missing": "node --experimental-json-modules i18n.missingKeys.js",
"copy:config": "cp-cli ../config.json ./src/config.autogen.json",
"start": "yarn copy:config && react-scripts start",
"start": "craco start",
"watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js",
"build": "yarn copy:config && cross-env NODE_ENV=production webpack --config webpack/prod.config.js --color -p --progress --hide-modules --display-optimization-bailout",
"build:dev": "cross-env NODE_ENV=development webpack --config webpack/dev.config.js --color -p --progress --hide-modules --display-optimization-bailout --analyze",
"test": "react-scripts test --watchAll=false --testMatch **/src/**/*.test.{ts,js,tsx}",
"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"
},
@@ -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

+24 -5
View File
@@ -15,12 +15,13 @@ import { useApps } from './os/apps/hooks/useApps';
import { useContactsService } from './apps/contacts/hooks/useContactsService';
import { useTwitterService } from './apps/twitter/hooks/useTwitterService';
import { useSelloutService } from './apps/sellout/hooks/useSelloutService';
import { useMatchService } from './apps/match/hooks/useMatchService';
import { useMarketplaceService } from './apps/marketplace/hooks/useMarketplaceService';
import { useBankService } from './apps/bank/hooks/useBankService';
import { useMessagesService } from './apps/messages/hooks/useMessageService';
import { useNotesService } from './apps/notes/hooks/useNotesService';
import { usePhotoService } from './apps/camera/hooks/usePhotoService';
import { useSettings } from './apps/settings/hooks/useSettings';
import { isSettingsSchemaValid, useSettings } from './apps/settings/hooks/useSettings';
import { useCallService } from './os/call/hooks/useCallService';
import { useDialService } from './apps/dialer/hooks/useDialService';
import InjectDebugData from './os/debug/InjectDebugData';
@@ -31,6 +32,8 @@ import { useCallModal } from './os/call/hooks/useCallModal';
import WindowSnackbar from './ui/components/WindowSnackbar';
import { usePhone } from './os/phone/hooks/usePhone';
import { useTranslation } from 'react-i18next';
import { useSnackbar } from './ui/hooks/useSnackbar';
import { useEmailService } from './apps/email/hooks/useEmailService';
function Phone() {
const { t, i18n } = useTranslation();
@@ -39,25 +42,41 @@ function Phone() {
const [settings] = useSettings();
const { addAlert } = useSnackbar();
// Set language from local storage
// This will only trigger on first mount & settings changes
useEffect(() => {
i18n.changeLanguage(settings.language.value).catch((e) => console.error(e));
}, [i18n, settings.language]);
useEffect(() => {
if (!isSettingsSchemaValid()) {
addAlert({
message: t('SETTINGS.MESSAGES.INVALID_SETTINGS'),
type: 'error',
});
}
// We only want to run this on first mount of the phone,
// so we leave an empty dep array. Otherwise, we hit a max depth error.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useNuiService();
useKeyboardService();
usePhoneService();
useSimcardService();
useContactsService();
useTwitterService();
useSelloutService();
useMatchService();
useMarketplaceService();
useBankService();
useMessagesService();
useNotesService();
usePhotoService();
useCallService();
useDialService();
useEmailService();
const { modal: callModal } = useCallModal();
const { bottom, visibility } = usePhoneVisibility();
@@ -80,14 +99,14 @@ function Phone() {
<div
className="PhoneFrame"
style={{
backgroundImage: `url(./media/frames/${settings.frame.value})`,
backgroundImage: `url(media/frames/${settings.frame.value})`,
}}
/>
<div
id="phone"
className="PhoneScreen"
style={{
backgroundImage: `url(./media/backgrounds/${settings.wallpaper.value})`,
backgroundImage: `url(media/backgrounds/${settings.wallpaper.value})`,
}}
>
{isPhoneReady ? (
@@ -5,6 +5,7 @@ import { Button, List, ListItem, TextField, makeStyles } from '@material-ui/core
import Nui from '../../../../os/nui-events/utils/Nui';
import { useBankModal } from '../../hooks/useBankModal';
import { BankEvents } from '../../../../../../typings/bank';
const useStyles = makeStyles((theme) => ({
input: {
@@ -43,7 +44,7 @@ export const TransferModal = () => {
const addTransfer = () => {
const transferAmount = parseInt(amount);
Nui.send('phone:addTransfer', {
Nui.send(BankEvents.ADD_TRANSFER, {
targetID,
transferAmount,
message,
+6 -4
View File
@@ -6,6 +6,8 @@ import { useSetRecoilState } from 'recoil';
import { useBankNotification } from './useBankNotification';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { BankEvents } from '../../../../../typings/bank';
import { PhoneEvents } from '../../../../../typings/phone';
export const useBankService = () => {
const setTransaction = useSetRecoilState(bankState.transactions);
@@ -21,9 +23,9 @@ export const useBankService = () => {
});
};
useNuiEvent('BANK', 'setTransaction', setTransaction);
useNuiEvent('BANK', 'setCredentials', setCredentials);
useNuiEvent('BANK', 'setAlert', handleAddAlert);
useNuiEvent('BANK', 'setNotification', setNotification);
useNuiEvent('BANK', BankEvents.SEND_TRANSFERS, setTransaction);
useNuiEvent('BANK', BankEvents.SEND_CREDENTIALS, setCredentials);
useNuiEvent('BANK', BankEvents.SEND_ALERT, handleAddAlert);
useNuiEvent('BANK', BankEvents.SEND_NOTIFICATION, setNotification);
return { useTransactions, useCredentials, useBankNotification };
};
@@ -8,6 +8,7 @@ import { useHistory } from 'react-router-dom';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { addQueryToLocation } from '../../../../common/utils/addQueryToLocation';
import { getLocationFromUrl } from '../../../../common/utils/getLocationFromUrl';
import { PhotoEvents } from '../../../../../../typings/photo';
export const GalleryGrid = () => {
const classes = useStyles();
@@ -19,7 +20,7 @@ export const GalleryGrid = () => {
const photos = usePhotos();
const handleCamera = () => {
Nui.send('phone:TakePhoto', {});
Nui.send(PhotoEvents.TAKE_PHOTO, {});
};
const handlePhotoOpen = (photo) => {
@@ -9,6 +9,7 @@ import { useHistory } from 'react-router-dom';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { ICameraPhoto } from '../../hooks/usePhotos';
import { ShareModal } from './ShareModal';
import { PhotoEvents } from '../../../../../../typings/photo';
export const GalleryModal = () => {
const classes = useStyles();
@@ -28,7 +29,7 @@ export const GalleryModal = () => {
};
const handleDeletePhoto = () => {
Nui.send('photo:deletePhoto', {
Nui.send(PhotoEvents.DELETE_PHOTO, {
image: meta.image,
});
history.push(referal);
@@ -10,6 +10,7 @@ import Nui from '../../../../os/nui-events/utils/Nui';
import { SearchContacts } from './SearchContacts';
import { useHistory } from 'react-router-dom';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
import { CallEvents } from '../../../../../../typings/call';
export const ContactList = () => {
const { filteredContacts } = useFilteredContacts();
@@ -27,7 +28,7 @@ export const ContactList = () => {
level: 2,
data: true,
});
Nui.send('phone:beginCall', {
Nui.send(CallEvents.INITIALIZE_CALL, {
number,
});
};
@@ -8,6 +8,7 @@ import Nui from '../../../../os/nui-events/utils/Nui';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { ContactEvents } from '../../../../../../typings/contact';
interface ContactInfoRouteParams {
mode: string;
@@ -79,7 +80,7 @@ const ContactsInfoPage = () => {
data: contact,
level: 2,
});
Nui.send('phone:addContacts', {
Nui.send(ContactEvents.ADD_CONTACT, {
display: name,
number,
avatar,
@@ -93,7 +94,7 @@ const ContactsInfoPage = () => {
data: contact,
level: 2,
});
Nui.send('phone:updateContact', {
Nui.send(ContactEvents.UPDATE_CONTACT, {
id: contact.id,
display: name,
number,
@@ -108,7 +109,7 @@ const ContactsInfoPage = () => {
data: contact,
level: 2,
});
Nui.send('phone:deleteContact', {
Nui.send(ContactEvents.DELETE_CONTACT, {
id: contact.id,
});
history.goBack();
@@ -4,6 +4,7 @@ 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);
@@ -17,7 +18,7 @@ export const useContactsService = () => {
});
};
useNuiEvent('CONTACTS', 'setContacts', setContacts);
useNuiEvent('CONTACTS', 'setAlert', handleAddAlert);
useNuiEvent('CONTACTS', ContactEvents.SEND_CONTACTS, setContacts);
useNuiEvent('CONTACTS', ContactEvents.SEND_ALERT, handleAddAlert);
return useContacts();
};
@@ -28,7 +28,7 @@ export const DialerApp = () => {
<Route exact path="/phone">
<DialerHistory calls={history} />
</Route>
<Route path="/phone/contacts" component={ContactList}></Route>
<Route path="/phone/contacts" component={ContactList} />
</Switch>
</AppContent>
<DialerNavBar />
@@ -39,18 +39,18 @@ export const DialerApp = () => {
InjectDebugData([
{
app: 'DAILER',
app: 'DIALER',
method: 'setHistory',
data: [
{
id: 1,
transmitter: '636-6496',
start: 1612301545782,
start: 1615946292,
},
{
id: 2,
transmitter: '777-7777',
start: 1612301545782,
start: 1615946292,
},
],
},
@@ -3,9 +3,10 @@ import { Box, IconButton, InputBase, Paper } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles';
import PhoneIcon from '@material-ui/icons/Phone';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { DialInputCtx } from '../context/InputContext';
import { DialInputCtx, IDialInputCtx } from '../context/InputContext';
import Nui from '../../../os/nui-events/utils/Nui';
import { useHistory } from 'react-router-dom';
import { CallEvents } from '../../../../../typings/call';
const useStyles = makeStyles((theme: Theme) => ({
root: {
@@ -30,10 +31,10 @@ export const DialerInput = () => {
const classes = useStyles();
const history = useHistory();
const { inputVal } = useContext(DialInputCtx);
const { inputVal, set } = useContext<IDialInputCtx>(DialInputCtx);
const handleCall = (number: string) => {
Nui.send('phone:beginCall', {
Nui.send(CallEvents.INITIALIZE_CALL, {
number,
});
};
@@ -44,8 +45,14 @@ export const DialerInput = () => {
return (
<Box component={Paper} className={classes.root}>
<InputBase placeholder="Enter a number" className={classes.input} value={inputVal} />
<IconButton color="primary" className={classes.iconBtn}>
<InputBase
placeholder="Enter a number"
className={classes.input}
value={inputVal}
onChange={(e) => set(e.target.value)}
type="number"
/>
<IconButton color="primary" className={classes.iconBtn} disabled={inputVal <= ''}>
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
</IconButton>
<IconButton className={classes.iconBtn}>
@@ -28,6 +28,7 @@ const DialPage = () => {
add: (val: string) => setInputVal(inputVal + val),
removeOne: () => setInputVal(inputVal.slice(0, -1)),
clear: () => setInputVal(''),
set: (val: string) => setInputVal(val),
}}
>
<DialerInput />
@@ -8,12 +8,12 @@ import { ListItem } from '../../../../ui/components/ListItem';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useSimcard } from '../../../../os/simcard/hooks/useSimcard';
import { useContacts } from '../../../contacts/hooks/useContacts';
import { ICall } from '../../../../../../typings/call';
import dayjs from 'dayjs';
import { CallEvents, ICall } from '../../../../../../typings/call';
import { useTranslation } from 'react-i18next';
import { Box, IconButton, ListItemIcon, ListItemText } from '@material-ui/core';
import { useHistory } from 'react-router-dom';
import { makeStyles, Theme } from '@material-ui/core/styles';
import dayjs from 'dayjs';
const useStyles = makeStyles((theme: Theme) => ({
callForward: {
@@ -25,7 +25,7 @@ const useStyles = makeStyles((theme: Theme) => ({
}));
export const DialerHistory = ({ calls }) => {
const { number } = useSimcard();
const { number: myNumber } = useSimcard();
const { getDisplayByNumber } = useContacts();
const classes = useStyles();
@@ -35,7 +35,7 @@ export const DialerHistory = ({ calls }) => {
const { t } = useTranslation();
const handleCall = (phoneNumber) => {
Nui.send('phone:beginCall', {
Nui.send(CallEvents.INITIALIZE_CALL, {
number: phoneNumber,
});
};
@@ -44,9 +44,9 @@ export const DialerHistory = ({ calls }) => {
return (
<Box display="flex" justifyContent="center" alignItems="center" paddingTop={35}>
<p>
You got no friends!
<span role="img" aria-label="deal with it">
😎
{t('APPS_DIALER_NO_HISTORY')}
<span role="img" aria-label="sad">
😞
</span>
</p>
</Box>
@@ -56,45 +56,57 @@ export const DialerHistory = ({ calls }) => {
return (
<List disablePadding>
{calls.map((call: ICall) =>
call.transmitter === number ? (
call.transmitter === myNumber ? (
<ListItem key={call.id} divider>
<ListItemIcon>{<PhoneForwardedIcon className={classes.callForward} />}</ListItemIcon>
<ListItemIcon>
<PhoneForwardedIcon className={classes.callForward} />
</ListItemIcon>
<ListItemText
primary={getDisplayByNumber(call.receiver)}
secondary={dayjs.unix(call.start).format(t('DATE_TIME_FORMAT'))}
secondary={
// TODO: Locale changes are pending #168 merge
dayjs().to(dayjs.unix(call.start))
}
/>
<IconButton onClick={() => handleCall(call.receiver)}>{<PhoneIcon />}</IconButton>
{getDisplayByNumber(call.transmitter) === call.transmitter ? (
{getDisplayByNumber(call.transmitter) === call.transmitter && (
<IconButton
onClick={() =>
history.push(`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`)
}
>
{<PersonAddIcon />}
<PersonAddIcon />
</IconButton>
) : null}
)}
</ListItem>
) : (
<ListItem key={call.id} divider>
<ListItemIcon>{<PhoneCallbackIcon className={classes.callBack} />}</ListItemIcon>
<ListItemIcon>
<PhoneCallbackIcon className={classes.callBack} />
</ListItemIcon>
<ListItemText
primary={getDisplayByNumber(call.transmitter)}
secondary={dayjs.unix(call.start).format(t('DATE_TIME_FORMAT'))}
secondary={
// TODO: Locale changes are pending #168 merge
dayjs().to(dayjs.unix(call.start))
}
/>
<IconButton onClick={() => handleCall(call.transmitter)}>{<PhoneIcon />}</IconButton>
<IconButton onClick={() => handleCall(call.transmitter)}>
<PhoneIcon />
</IconButton>
{getDisplayByNumber(call.transmitter) === call.transmitter ? (
{getDisplayByNumber(call.transmitter) === call.transmitter && (
<IconButton
onClick={() =>
history.push(`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`)
}
>
{<PersonAddIcon />}
<PersonAddIcon />
</IconButton>
) : null}
)}
</ListItem>
),
)}
@@ -5,6 +5,7 @@ export interface IDialInputCtx {
add: (char: string | number) => void;
removeOne: () => void;
clear: () => void;
set: (val) => void;
}
export const DialInputCtx = createContext(null);
@@ -1,11 +1,7 @@
import { useRecoilValue } from 'recoil';
import { ICall } from '../../../../../typings/call';
import { dialState } from './state';
interface ICallUI {
history: ICall[];
}
export const useDialHistory = (): ICallUI[] => {
const history = useRecoilValue(dialState.history);
return history;
export const useDialHistory = () => {
return useRecoilValue<ICall[]>(dialState.history);
};
@@ -1,8 +1,9 @@
import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { dialState } from './state';
import { CallEvents } from '../../../../../typings/call';
export const useDialService = () => {
const setHistory = useSetRecoilState(dialState.history);
useNuiEvent('DAILER', 'setHistory', setHistory);
useNuiEvent('DIALER', CallEvents.SET_CALL_HISTORY, setHistory);
};
@@ -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);
@@ -16,7 +16,7 @@ export const ExampleApp = () => {
const exampleString = useExample();
const example = useApp('EXAMPLE');
const [soundName, setSound] = useState('pixel.ogg');
const { play, playing, stop } = useSound('./media/ringtones/' + soundName);
const { play, playing, stop } = useSound('media/ringtones/' + soundName);
const toggleSound = () => {
if (soundName === 'pixel.ogg') {
@@ -1,42 +1,44 @@
import React from 'react';
import { AppWrapper } from '../../../ui/components/AppWrapper';
import { AppContent } from '../../../ui/components/AppContent';
import { SelloutTitle } from './SelloutTitle';
import { SelloutListContainer } from './SelloutList/SelloutListContainer';
import { MarketplaceTitle } from './MarketplaceTitle';
import { MarketplaceListContainer } from './SelloutList/MarketplaceListContainer';
import { NavigationBar } from './navigation/NavigationBar';
import { Switch, Route } from 'react-router-dom';
import { ListingFormContainer } from './form/ListingFormContainer';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { SelloutThemeProvider } from '../providers/SelloutThemeProvider';
import { MarketplaceThemeProvider } from '../providers/MarketplaceThemeProvider';
import { MarketplaceEvents } from '../../../../../typings/marketplace';
export const SelloutApp = () => {
export const MarketplaceApp = () => {
return (
<SelloutThemeProvider>
<MarketplaceThemeProvider>
<AppWrapper id="sellout-app">
<SelloutTitle />
<MarketplaceTitle />
<AppContent>
<Switch>
<Route path="/sellout" exact component={SelloutListContainer} />
<Route path="/sellout/new" component={ListingFormContainer} />
<Route path="/marketplace" exact component={MarketplaceListContainer} />
<Route path="/marketplace/new" component={ListingFormContainer} />
</Switch>
</AppContent>
<NavigationBar />
</AppWrapper>
</SelloutThemeProvider>
</MarketplaceThemeProvider>
);
};
InjectDebugData([
{
app: 'SELLOUT',
method: 'setListings',
method: MarketplaceEvents.SEND_LISTING,
data: [
{
id: 1,
name: 'Some guy',
number: '111-1134',
title: 'Car',
description: 'Selling this cool car',
title: 'eeeeeeeeeeeeeeeeeeeeeeeee',
description:
'skldfsdEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
url: 'https://beta.iodine.gg/706Y3.jpeg',
},
{
@@ -20,7 +20,7 @@ const useStyles = makeStyles((theme) => ({
},
}));
export const SelloutTitle = () => {
export const MarketplaceTitle = () => {
const classes = useStyles();
return (
<Paper className={classes.root} square variant="outlined" elevation={24}>
@@ -1,7 +1,7 @@
import { Box, Tooltip, Button } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles';
import React from 'react';
import { 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 ReportIcon from '@material-ui/icons/Report';
@@ -10,6 +10,7 @@ import PhoneIcon from '@material-ui/icons/Phone';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router';
import { CallEvents } from '../../../../../../typings/call';
const useStyles = makeStyles((theme: Theme) => ({
icon: {
@@ -24,17 +25,17 @@ export const ListingActions = ({ listing }: { listing: MarketplaceListing }) =>
const history = useHistory();
const handleDeleteListing = () => {
Nui.send('phone:marketplaceDeleteListing', {
Nui.send(MarketplaceEvents.DELETE_LISTING, {
id: listing.id,
});
};
const handleReportListing = () => {
Nui.send('phone:reportListing', listing);
Nui.send(MarketplaceEvents.REPORT_LISTING, listing);
};
const handleCall = () => {
Nui.send('phone:beginCall', {
Nui.send(CallEvents.INITIALIZE_CALL, {
number: listing.number,
});
};
@@ -31,9 +31,17 @@ const useStyles = makeStyles((theme) => ({
background: theme.palette.background.default,
marginBottom: 20,
},
listingContent: {
padding: 10,
minWidth: 100,
maxWidth: '100%',
width: '100%',
overflowWrap: 'break-word',
wordWrap: 'break-word',
},
}));
export const SelloutItem = (listing: MarketplaceListing) => {
export const MarketplaceItem = (listing: MarketplaceListing) => {
const classes = useStyles();
return (
@@ -62,7 +70,7 @@ export const SelloutItem = (listing: MarketplaceListing) => {
</Typography>
)}
<Typography variant="h6" style={{ padding: 10 }}>
<Typography variant="body1" className={classes.listingContent}>
{listing.description}
</Typography>
<ListingActions listing={listing} />
@@ -1,15 +1,15 @@
import React from 'react';
import { List } from '../../../../ui/components/List';
import { useListing } from '../../hooks/useListing';
import { SelloutItem } from './SelloutItem';
import { MarketplaceItem } from './MarketplaceItem';
export const SelloutList = () => {
export const MarketplaceList = () => {
const listings = useListing();
return (
<List>
{listings.map((listing) => (
<SelloutItem key={listing.id} {...listing} />
<MarketplaceItem key={listing.id} {...listing} />
))}
</List>
);
@@ -0,0 +1,6 @@
import React from 'react';
import { MarketplaceList } from './MarketplaceList';
export const MarketplaceListContainer = () => {
return <MarketplaceList />;
};
@@ -1,6 +1,10 @@
import React, { useState } from 'react';
import { makeStyles, Button, TextField } from '@material-ui/core';
import { makeStyles, Button, TextField, Typography } from '@material-ui/core';
import Nui from '../../../../os/nui-events/utils/Nui';
import { MarketplaceEvents } from '../../../../../../typings/marketplace';
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router';
const useStyles = makeStyles((theme) => ({
root: {
@@ -28,17 +32,28 @@ const useStyles = makeStyles((theme) => ({
export const ListingForm = () => {
const classes = useStyles();
const { t } = useTranslation();
const { addAlert } = useSnackbar();
const history = useHistory();
const [title, setTitle] = useState('');
const [url, setUrl] = useState('');
const [description, setDescription] = useState('');
const addListing = () => {
Nui.send('phone:addListing', {
title,
url,
description,
});
if (title !== '' && description !== '') {
Nui.send(MarketplaceEvents.ADD_LISTING, {
title,
url,
description,
});
history.push('/marketplace');
} else {
addAlert({
message: t('APPS_MARKETPLACE_REQUIRED_FIELDS'),
type: 'error',
});
}
};
return (
@@ -47,15 +62,22 @@ export const ListingForm = () => {
<TextField
className={classes.input}
onChange={(e) => setTitle(e.target.value)}
placeholder="Title on listing.."
inputProps={{ className: classes.textFieldInput }}
label={t('GENERIC_REQUIRED')}
placeholder={t('APPS_MARKETPLACE_FORM_TITLE')}
inputProps={{
className: classes.textFieldInput,
maxLength: 25,
}}
style={{ width: '80%' }}
size="medium"
InputLabelProps={{
shrink: true,
}}
/>
<TextField
className={classes.input}
placeholder="Image URL"
placeholder={t('APPS_MARKETPLACE_FORM_IMAGE')}
onChange={(e) => setUrl(e.target.value)}
inputProps={{ className: classes.textFieldInput }}
style={{ width: '80%' }}
@@ -66,15 +88,21 @@ export const ListingForm = () => {
<TextField
className={classes.input}
onChange={(e) => setDescription(e.target.value)}
placeholder="Description"
inputProps={{ className: classes.multilineFieldInput }}
label={t('GENERIC_REQUIRED')}
placeholder={t('APPS_MARKETPLACE_FORM_DESCRIPTION')}
inputProps={{
className: classes.multilineFieldInput,
maxLength: 130,
}}
style={{ width: '80%' }}
size="medium"
InputLabelProps={{
shrink: true,
}}
multiline
rows={4}
variant="outlined"
/>
<Button onClick={addListing} className={classes.postButton}>
Post
</Button>
@@ -31,9 +31,9 @@ export const NavigationBar = () => {
<BottomNavigationAction
component={Link}
icon={<FontAwesomeIcon icon={faHome} />}
to="/sellout"
to="/marketplace"
/>
<BottomNavigationAction component={Link} icon={<AddCircleIcon />} to="/sellout/new" />
<BottomNavigationAction component={Link} icon={<AddCircleIcon />} to="/marketplace/new" />
</BottomNavigation>
);
};
@@ -4,8 +4,9 @@ import { useListing } from './useListing';
import { useSetRecoilState } from 'recoil';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { MarketplaceEvents } from '../../../../../typings/marketplace';
export const useSelloutService = () => {
export const useMarketplaceService = () => {
const setSellout = useSetRecoilState(selloutState.listing);
const { addAlert } = useSnackbar();
const { t } = useTranslation();
@@ -17,7 +18,7 @@ export const useSelloutService = () => {
});
};
useNuiEvent('SELLOUT', 'setAlert', handleAddAlert);
useNuiEvent('SELLOUT', 'setListings', setSellout);
useNuiEvent('SELLOUT', MarketplaceEvents.SEND_ALERT, handleAddAlert);
useNuiEvent('SELLOUT', MarketplaceEvents.SEND_LISTING, setSellout);
return useListing();
};
@@ -0,0 +1,5 @@
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
import selloutTheme from '../marketplace.theme';
export const MarketplaceThemeProvider = createAppThemeProvider(selloutTheme);
@@ -0,0 +1,163 @@
import React, { useState, useRef } from 'react';
import { Card, Fab, Box, Tooltip } from '@material-ui/core';
import CancelIcon from '@material-ui/icons/Clear';
import FireIcon from '@material-ui/icons/Whatshot';
import { makeStyles } from '@material-ui/core/styles';
import { useTranslation } from 'react-i18next';
import { FormattedProfile } from '../../../../../typings/match';
import Draggable from './Draggable';
import StatusDisplay from './StatusDisplay';
import Profile from './profile/Profile';
const useStyles = makeStyles({
root: {
position: 'absolute',
margin: '15px 15px 25px 15px',
height: 'calc(100% - 90px)',
width: 'calc(100% - 30px)',
overflow: 'hidden',
cursor: 'pointer',
},
media: {
height: '60%',
},
content: {
height: '40%',
},
status: {
position: 'absolute',
zIndex: 20,
padding: '5px 15px',
top: 40,
fontSize: '28px',
fontWeight: 'bold',
},
statusVisible: {
transition: 'opacity 0.25s ease-in-out',
},
// when a user swipes on a profile we need to hide the transition
// otherwise the status will be transitioning out when the next
// profile shows up
statusNull: {
transition: 'opacity 0s',
},
like: {
color: 'green',
border: '6px solid green',
left: 30,
transform: 'rotate(-18deg)',
},
nope: {
color: 'red',
border: '6px solid red',
right: 30,
transform: 'rotate(18deg)',
},
buttons: {
position: 'absolute',
bottom: '3px',
width: '100%',
height: '55px',
},
button: {
margin: '0px 15px',
},
});
interface IProps {
profile: FormattedProfile;
onSwipe: (id: number, liked: boolean) => void;
}
// this represents how far from the original mouse
// click a user has to drag the profile in order for
// it to be registered as a like or dislike
const DECISION_THRESHOLD_X_px = 150;
const ActiveProfile = ({ profile, onSwipe }: IProps) => {
const c = useStyles();
const { t } = useTranslation();
const [status, setStatus] = useState(null);
const statusRef = useRef(null);
const idRef = useRef(null);
// we are reading mutated state from the Draggable element so we
// keep track of it using a ref. Without this ref it will appear
// from React's point of view that the state is not updating
statusRef.current = status;
idRef.current = profile.id;
function onDrag(deltaX: number): void {
const hasDecision = status !== null;
if (!hasDecision && deltaX > DECISION_THRESHOLD_X_px) {
setStatus(true);
} else if (!hasDecision && deltaX < -DECISION_THRESHOLD_X_px) {
setStatus(false);
} else if (deltaX > -DECISION_THRESHOLD_X_px && deltaX < DECISION_THRESHOLD_X_px) {
setStatus(null);
}
}
// handles when user uses mouse to "swipe", or
// more specifically drag the card to one side or the other
const handleSwipe = () => {
onSwipe(idRef.current, statusRef.current);
setStatus(null);
};
// these handlers are explicit and used for when the
// user clicks on buttons
const handleLike = () => {
onSwipe(idRef.current, true);
setStatus(null);
};
const handleNope = () => {
onSwipe(idRef.current, false);
setStatus(null);
};
const isLiked = status === true;
const notLiked = status === false;
const likeClass = `${c.status} ${isLiked ? c.statusVisible : c.statusNull} ${c.like}`;
const nopeClass = `${c.status} ${notLiked ? c.statusVisible : c.statusNull} ${c.nope}`;
return (
<>
<Draggable id="active-profile" onDrag={onDrag} onDrop={handleSwipe}>
<Card raised className={c.root}>
<StatusDisplay className={likeClass} text={t('APPS_MATCH_LIKED')} visible={isLiked} />
<StatusDisplay className={nopeClass} text={t('APPS_MATCH_NOPE')} visible={notLiked} />
<Profile profile={profile} />
</Card>
</Draggable>
<Box className={c.buttons} display="flex" justifyContent="center">
<Tooltip title={t('APPS_MATCH_DISLIKE')} aria-label="dislike">
<Fab
size="large"
color="secondary"
aria-label="dislike"
onClick={handleNope}
className={c.button}
>
<CancelIcon />
</Fab>
</Tooltip>
<Tooltip title={t('APPS_MATCH_LIKE')} aria-label="like">
<Fab
size="large"
color="primary"
aria-label="like"
onClick={handleLike}
className={c.button}
>
<FireIcon />
</Fab>
</Tooltip>
</Box>
</>
);
};
export default ActiveProfile;
@@ -0,0 +1,29 @@
import React from 'react';
import { Link } from 'react-router-dom';
import { makeStyles } from '@material-ui/core/styles';
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
import HomeIcon from '@material-ui/icons/Whatshot';
import GroupIcon from '@material-ui/icons/Group';
import ProfileIcon from '@material-ui/icons/Person';
const useStyles = makeStyles({
root: {
width: '100%',
},
});
export function MatchBottomNavigation({ activePage, handleChange }) {
const classes = useStyles();
console.log(activePage);
return (
<BottomNavigation value={activePage} onChange={handleChange} className={classes.root}>
<BottomNavigationAction component={Link} to="/match" icon={<HomeIcon />} />
<BottomNavigationAction component={Link} to="/match/matches" icon={<GroupIcon />} />
<BottomNavigationAction component={Link} to="/match/profile" icon={<ProfileIcon />} />
</BottomNavigation>
);
}
export default MatchBottomNavigation;
@@ -0,0 +1,61 @@
import React, { useEffect, useRef } from 'react';
import { makeStyles } from '@material-ui/core';
import { LikeorDislikeDraggableElement } from '../utils/drag';
const useStyles = makeStyles({
root: {
position: 'relative',
height: '100%',
width: '100%',
},
like: {
position: 'absolute',
zIndex: 20,
padding: '5px 15px',
top: 100,
color: 'green',
border: '4px solid green',
right: 15,
},
nope: {
position: 'absolute',
zIndex: 20,
padding: '5px 15px',
top: 100,
color: 'red',
border: '4px solid red',
left: 15,
},
});
interface IProps {
id: string;
children: JSX.Element | JSX.Element[];
onDrag: (deltaX: number) => void;
onDrop: () => void;
}
const MAX_ROTATION_DEG = 15;
function Draggable({ id, children, onDrag, onDrop }: IProps) {
const classes = useStyles();
const elementRef = useRef(null);
useEffect(() => {
const drag = new LikeorDislikeDraggableElement(elementRef, MAX_ROTATION_DEG, onDrag, onDrop);
return () => drag.cleanup();
}, [elementRef]); // eslint-disable-line
return (
<>
<div ref={elementRef} key={id} id={id} className={classes.root}>
{children}
</div>
</>
);
}
export default Draggable;
+28
View File
@@ -0,0 +1,28 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { Box, Typography } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
root: {
color: theme.palette.primary.main,
fontSize: theme.typography.fontSize,
height: '100%',
width: '100%',
display: 'flex',
justifyContent: 'center',
paddingTop: '140px',
},
}));
function NoProfiles() {
const classes = useStyles();
const { t } = useTranslation();
return (
<Box className={classes.root}>
<Typography variant="h5">{t('APPS_MATCH_NO_PROFILES')}</Typography>
</Box>
);
}
export default NoProfiles;
@@ -0,0 +1,26 @@
import React from 'react';
import { Box, CircularProgress } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
const useStyles = makeStyles({
root: {
height: '100%',
width: '100%',
display: 'flex',
justifyContent: 'center',
},
progress: {
marginTop: '140px',
},
});
function Loader() {
const classes = useStyles();
return (
<Box className={classes.root}>
<CircularProgress size={60} className={classes.progress} />
</Box>
);
}
export default Loader;
@@ -0,0 +1,158 @@
import React, { useState, useEffect } from 'react';
import { Route } from 'react-router-dom';
import { AppWrapper } from '../../../ui/components';
import { AppTitle } from '../../../ui/components/AppTitle';
import { AppContent } from '../../../ui/components/AppContent';
import { useApp } from '../../../os/apps/hooks/useApps';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { MatchThemeProvider } from '../providers/MatchThemeProvider';
import Nui from '../../../os/nui-events/utils/Nui';
import MatchBottomNavigation from '../components/BottomNavigation';
import MatchPage from './views/MatchPage';
import ProfileEditor from './views/ProfileEditor';
import MatchList from './views/MatchList';
import { MatchEvents } from '../../../../../typings/match';
import { useProfile } from '../hooks/useProfile';
export const MatchApp = () => {
const match = useApp('MATCH');
const [activePage, setActivePage] = useState(0);
const { noProfileExists } = useProfile();
useEffect(() => {
Nui.send(MatchEvents.INITIALIZE);
}, []);
const handlePageChange = (e, page) => setActivePage(page);
return (
<MatchThemeProvider>
<AppWrapper id="contact-app">
<AppTitle app={match} />
{noProfileExists ? (
<AppContent>
<ProfileEditor />
</AppContent>
) : (
<>
<AppContent>
<Route path="/match/" exact component={MatchPage} />
<Route path="/match/matches" exact component={MatchList} />
<Route path="/match/profile" exact component={ProfileEditor} />
</AppContent>
<MatchBottomNavigation activePage={activePage} handleChange={handlePageChange} />
</>
)}
</AppWrapper>
</MatchThemeProvider>
);
};
InjectDebugData(
[
{
app: 'MATCH',
method: 'phone:getMatchProfilesSuccess',
data: [
{
id: 1,
image:
'https://cdn.vox-cdn.com/thumbor/9xCALlkm2Mc0HQk8kMr1Ui3YNbc=/0x0:5464x3070/920x613/filters:focal(2295x1098:3169x1972):format(webp)/cdn.vox-cdn.com/uploads/chorus_image/image/67031748/shutterstock_1450403549.0.jpg',
name: 'Person Alpha',
bio:
'Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.',
createdAt: 1615932985,
updatedAt: 1615932985,
lastActive: 1616004986,
job: 'Gardener',
location: 'Grapeseed',
tags: 'gardening',
phoneNumber: '987-6543',
},
{
id: 2,
image:
'https://media.cntraveler.com/photos/5f8f09c3a078e9112956774d/16:9/w_1600%2Cc_limit/Chicago-GettyImages-1065188752.jpg',
name: 'Person Beta',
bio: 'l impedit quo minus id quod maxime placeat facere possimus',
createdAt: 1615846585,
updatedAt: 1615846585,
lastActive: 1615850185,
job: 'Mechanic',
location: 'Harmony',
tags: 'tinkering,robotics',
phoneNumber: '654-3219',
},
{
id: 3,
image: 'https://www.langan.com/wp-content/uploads/2019/02/Boston-996x554.jpg',
name: 'Person Charlie',
bio: 'ut aut reiciendis voluptatibus',
createdAt: 1615850185,
updatedAt: 1615850185,
lastActive: 1613607385,
job: 'Lawyer',
location: 'Los Santos',
tags: 'reading,coolstuff, coffee',
phoneNumber: '123-4567',
},
],
},
{
app: 'MATCH',
method: 'phone:getMyProfileSuccess',
data: {
id: 4,
image:
'https://www.middlebury.edu/institute/sites/www.middlebury.edu.institute/files/styles/1040x585/public/2018-10/Nashville-skyline.jpg?fv=mS11EKrT&itok=HNhHqYUX',
name: 'Kire Says',
bio: "Kire's cool profile that has many cool things. And others.",
createdAt: 1615932985,
updatedAt: 1615932985,
lastActive: 1616004986,
job: 'Engineer',
location: 'Boston',
tags: 'code,books',
phoneNumber: '999-9999',
},
},
{
app: 'MATCH',
method: 'phone:getMatchesSuccess',
data: [
{
id: 5,
image:
'https://media.cntraveler.com/photos/5f8f09c3a078e9112956774d/16:9/w_1600%2Cc_limit/Chicago-GettyImages-1065188752.jpg',
name: 'Person Delta',
bio: 'l impedit quo minus id quod maxime placeat facere possimus',
createdAt: 1615846585,
updatedAt: 1615846585,
lastActive: 1615850185,
matchedAt: 1613607385,
job: 'Mechanic',
location: 'Harmony',
tags: 'tinkering,robotics',
phoneNumber: '654-3219',
},
{
id: 6,
image: 'https://www.langan.com/wp-content/uploads/2019/02/Boston-996x554.jpg',
name: 'Person Echo',
bio: 'ut aut reiciendis voluptatibus',
createdAt: 1615850185,
updatedAt: 1615850185,
lastActive: 1613607385,
job: 'Lawyer',
location: 'Los Santos',
tags: 'reading,coolstuff, coffee',
phoneNumber: '123-4567',
matchedAt: 1613607385,
},
],
},
],
200,
);
@@ -0,0 +1,31 @@
import React from 'react';
import { Box, Typography } from '@material-ui/core';
import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
root: {
color: theme.palette.primary.main,
fontSize: theme.typography.fontSize,
height: '100%',
width: '100%',
display: 'flex',
justifyContent: 'center',
textAlign: 'center',
padding: '140px 15px 15px 15px',
},
}));
interface IProps {
text: string;
}
function PageText({ text }: IProps) {
const classes = useStyles();
return (
<Box className={classes.root}>
<Typography variant="h5">{text}</Typography>
</Box>
);
}
export default PageText;
@@ -0,0 +1,14 @@
import React from 'react';
import { Box } from '@material-ui/core';
function StatusDisplay({ className, visible, text }) {
const style = { opacity: visible ? '0.65' : '0.0' };
return (
<Box className={className} style={style}>
{text}
</Box>
);
}
export default StatusDisplay;
@@ -0,0 +1,62 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import ListItemText from '@material-ui/core/ListItemText';
import { Box, Button, ListItem, makeStyles } from '@material-ui/core';
import PersonIcon from '@material-ui/icons/Person';
import ChatIcon from '@material-ui/icons/Chat';
import { FormattedMatch } from '../../../../../../typings/match';
import Profile from '../profile/Profile';
const useStyles = makeStyles({
profile: {
position: 'relative',
height: '90%',
marginTop: '15px',
},
});
interface IProps {
match: FormattedMatch;
}
export const Match = ({ match }: IProps) => {
const history = useHistory();
const classes = useStyles();
const { t } = useTranslation();
const [showProfile, setShowProfile] = useState(false);
const handleMessage = () => {
history.push(`/messages/new/${match.phoneNumber}`);
};
const handleProfile = () => {
setShowProfile((show) => !show);
};
const secondaryText = t('APPS_MATCH_PROFILE_MATCHED_AT', {
matchedAt: match.matchedAtFormatted,
});
return (
<>
<ListItem divider>
<ListItemText primary={match.name} secondary={secondaryText} />
<Button onClick={handleProfile}>
<PersonIcon />
</Button>
<Button onClick={handleMessage}>
<ChatIcon />
</Button>
</ListItem>
{showProfile && (
<Box className={classes.profile}>
<Profile profile={match} />
</Box>
)}
</>
);
};
export default Match;
@@ -0,0 +1,78 @@
import React from 'react';
import { CardContent, CardMedia, Chip, Typography } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import { useTranslation } from 'react-i18next';
import { FormattedProfile, FormattedMatch } from '../../../../../../typings/match';
const useStyles = makeStyles({
root: {},
tags: {
position: 'absolute',
bottom: '40%',
},
tag: {
margin: '3px 3px 0px 0px',
opacity: '0.8',
},
media: {
height: '60%',
},
content: {
height: '40%',
overflowY: 'auto',
},
});
interface IProps {
profile: FormattedProfile | FormattedMatch;
}
const DEFAULT_IMAGE = 'https://upload.wikimedia.org/wikipedia/commons/a/ac/No_image_available.svg';
const Profile = ({ profile }: IProps) => {
const c = useStyles();
const { t } = useTranslation();
function parseSecondaryBio(): string | undefined {
const { location, job } = profile;
if (location && job) {
return `${location} - ${job}`;
} else if (location) {
return location;
} else if (job) {
return job;
}
}
const bioSecondary = parseSecondaryBio();
return (
<>
<CardContent className={c.tags}>
{profile.tagList.map((tag) => (
<Chip className={c.tag} label={tag} color="primary" />
))}
</CardContent>
<CardMedia className={c.media} image={profile.image || DEFAULT_IMAGE} title={profile.name} />
<CardContent className={c.content}>
<Typography gutterBottom variant="h4" component="h2">
{profile.name}
</Typography>
<Typography gutterBottom color="textSecondary" component="p">
{t('APPS_MATCH_PROFILE_LAST_ACTIVE', { lastActive: profile.lastActiveFormatted })}
</Typography>
{bioSecondary && (
<Typography gutterBottom variant="body1" color="textSecondary" component="p">
{bioSecondary}
</Typography>
)}
<Typography variant="body2" color="textSecondary" component="p">
{profile.bio}
</Typography>
</CardContent>
</>
);
};
export default Profile;
@@ -0,0 +1,128 @@
import React, { useState } from 'react';
import { makeStyles } from '@material-ui/core/styles';
import { useTranslation } from 'react-i18next';
import Nui from '../../../../os/nui-events/utils/Nui';
import {
Profile as IProfile,
FormattedProfile,
MatchEvents,
} from '../../../../../../typings/match';
import ProfileField from '../../../../ui/components/ProfileField';
import UpdateButton from '../../../../ui/components/UpdateButton';
import { Card } from '@material-ui/core';
import Profile from './Profile';
import { usePhone } from '../../../../os/phone/hooks/usePhone';
import PageText from '../PageText';
const useStyles = makeStyles({
root: {
position: 'relative',
width: '100%',
height: 'calc(100% - 40px)',
padding: '15px',
},
card: {
position: 'absolute',
margin: '15px 15px 25px 15px',
height: 'calc(100% - 80px)',
width: 'calc(100% - 30px)',
overflow: 'hidden',
},
spacer: {
height: '8px',
},
});
interface IProps {
profile: FormattedProfile;
showPreview: boolean;
}
export function ProfileForm({ profile, showPreview }: IProps) {
const classes = useStyles();
const { t } = useTranslation();
const { config } = usePhone();
// note that this assumes we are defensively checking
// that profile is not null in a parent above this component.
// Annoyingling adding conditionals above this line to not render
// when profile === null results in a react error that different
// amounts of hooks are rendering
const [image, setImage] = useState(profile?.image || '');
const [name, setName] = useState(profile?.name || '');
const [bio, setBio] = useState(profile?.bio || '');
const [job, setJob] = useState(profile?.job || '');
const [location, setLocation] = useState(profile?.location || '');
const [tags, setTags] = useState(profile?.tags || '');
const update: FormattedProfile = {
...profile,
image,
name,
bio,
location,
job,
tagList: tags.split(',').map((tag) => tag.trim()),
};
const handleUpdate = () => {
const updatedProfile: IProfile = {
...update,
name: update.name.trim(),
image: update.image.trim(),
tags: update.tagList.join(','),
};
const event = profile ? MatchEvents.UPDATE_MY_PROFILE : MatchEvents.CREATE_MY_PROFILE;
Nui.send(event, updatedProfile);
};
if (!profile && !config.match.allowEdtiableProfileName) {
return <PageText text={t('APPS_MATCH_PROFILE_CONFIGURATION')} />;
}
if (showPreview) {
return (
<Card raised className={classes.card}>
<Profile profile={update} />
</Card>
);
}
return (
<div className={classes.root}>
<ProfileField
label={t('APPS_MATCH_EDIT_PROFILE_IMAGE')}
value={update.image}
handleChange={setImage}
allowChange
/>
<ProfileField
label={t('APPS_MATCH_EDIT_PROFILE_NAME')}
value={name}
handleChange={setName}
allowChange={config.match.allowEdtiableProfileName}
/>
<ProfileField
label={t('APPS_MATCH_EDIT_PROFILE_BIO')}
value={update.bio}
handleChange={setBio}
multiline
/>
<ProfileField
label={t('APPS_MATCH_EDIT_PROFILE_LOCATION')}
value={update.location}
handleChange={setLocation}
/>
<ProfileField
label={t('APPS_MATCH_EDIT_PROFILE_JOB')}
value={update.job}
handleChange={setJob}
/>
<ProfileField label={t('APPS_MATCH_EDIT_PROFILE_TAGS')} value={tags} handleChange={setTags} />
<UpdateButton handleClick={handleUpdate} loading={false} />
</div>
);
}
export default ProfileForm;
@@ -0,0 +1,52 @@
import React, { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Box, makeStyles } from '@material-ui/core';
import { useMatches } from '../../hooks/useMatches';
import Loader from '../Loader';
import PageText from '../PageText';
import Match from '../matches/Match';
import Nui from '../../../../os/nui-events/utils/Nui';
import { MatchEvents } from '../../../../../../typings/match';
const useStyles = makeStyles({
root: {
height: '100%',
},
});
const MINIMUM_LOAD_TIME = 1500;
function MatchList() {
const classes = useStyles();
const { t } = useTranslation();
const { matches, error } = useMatches();
const [loaded, setLoaded] = useState(false);
// We make the conscious descion here to fetch matches everytime
// a user loads this page because this list is dependent on
// other player's database interactions (i.e. their likes/dislikes)
// not just the current players.
// This is less performant but means that we will always have the
// correct state when the player views this page
useEffect(() => {
Nui.send(MatchEvents.GET_MATCHES);
window.setTimeout(() => {
setLoaded(true);
}, MINIMUM_LOAD_TIME);
}, []);
if (error) return <PageText text={t('APPS_MATCH_MATCHES_ERROR')} />;
if (!loaded || !matches) return <Loader />;
if (matches.length === 0) return <PageText text={t('APPS_MATCH_NO_MATCHES')} />;
return (
<Box className={classes.root}>
{matches.map((match) => (
<Match key={match.id} match={match} />
))}
</Box>
);
}
export default MatchList;
@@ -0,0 +1,53 @@
import React, { useEffect, useState } from 'react';
import { Paper } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import { useTranslation } from 'react-i18next';
import { useProfiles } from '../../hooks/useProfiles';
import Loader from '../Loader';
import PageText from '../PageText';
import ActiveProfile from '../ActiveProfile';
const useStyles = makeStyles({
root: {
height: '100%',
width: '100%',
overflow: 'hidden',
},
});
// set a minimum load time so the user doesn't see a flash
// of the loader and then the matches themselves
const MINIMUM_LOAD_TIME = 1250;
const MatchPage = () => {
const classes = useStyles();
const { t } = useTranslation();
const { profiles, error, activeProfile, setViewed } = useProfiles();
const [loaded, setLoaded] = useState(false);
useEffect(() => {
window.setTimeout(() => {
setLoaded(true);
}, MINIMUM_LOAD_TIME);
}, []);
const handleSwipe = (id: number, liked: boolean) => {
// the user didn't choose (didn't swipe far enough)
if (liked === null) return;
setViewed(id, liked);
};
if (error) return <PageText text={t('APPS_MATCH_PROFILES_ERROR')} />;
if (!loaded || !profiles) return <Loader />;
if (!activeProfile) return <PageText text={t('APPS_MATCH_NO_PROFILES')} />;
return (
<Paper className={classes.root} square>
<ActiveProfile profile={activeProfile} onSwipe={handleSwipe} />
</Paper>
);
};
export default MatchPage;
@@ -0,0 +1,45 @@
import React, { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { makeStyles } from '@material-ui/core/styles';
import { Box, FormControlLabel, Switch } from '@material-ui/core';
import { useProfile } from '../../hooks/useProfile';
import Loader from '../Loader';
import ProfileForm from '../profile/ProfileForm';
const useStyles = makeStyles({
root: {
height: '100%',
width: '100%',
},
switch: {
marginLeft: '15px',
},
});
function ProfileEditor() {
const { profile, noProfileExists } = useProfile();
const classes = useStyles();
const { t } = useTranslation();
const [showPreview, setShowPreview] = useState(false);
const toggleSwitch = () => {
setShowPreview((preview) => !preview);
};
if (!profile && !noProfileExists) return <Loader />;
return (
<Box className={classes.root}>
<Box className={classes.switch}>
<FormControlLabel
control={<Switch checked={showPreview} onChange={toggleSwitch} />}
label={t('APPS_MATCH_EDIT_PROFILE_PREVIEW')}
/>
</Box>
<ProfileForm showPreview={showPreview} profile={profile} />
</Box>
);
}
export default ProfileEditor;
+28
View File
@@ -0,0 +1,28 @@
import { atom } from 'recoil';
export const matchState = {
profiles: atom({
key: 'profiles',
default: null,
}),
errorLoadingProfiles: atom({
key: 'errorLoadingProfiles',
default: false,
}),
matches: atom({
key: 'matches',
default: null,
}),
errorLoadingMatches: atom({
key: 'errorLoadingMatches',
default: false,
}),
myProfile: atom({
key: 'myProfile',
default: null,
}),
noProfileExists: atom({
key: 'noProfileExists',
default: false,
}),
};
@@ -0,0 +1,86 @@
import { useSetRecoilState } from 'recoil';
import { matchState } from './state';
import { useTranslation } from 'react-i18next';
import dayjs from 'dayjs';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { Profile, FormattedProfile, Match, MatchEvents } from '../../../../../typings/match';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
export const useMatchService = () => {
const { addAlert } = useSnackbar();
const { t } = useTranslation();
const setNoProfileExists = useSetRecoilState(matchState.noProfileExists);
const setProfiles = useSetRecoilState(matchState.profiles);
const setProfile = useSetRecoilState(matchState.myProfile);
const setMatches = useSetRecoilState(matchState.matches);
const setErrorLoadingMatches = useSetRecoilState(matchState.errorLoadingMatches);
const setErrorLoadingProfiles = useSetRecoilState(matchState.errorLoadingProfiles);
const handleAddAlert = ({ message, type }: IAlert) => {
addAlert({
message: t(message),
type,
});
};
function formatProfile(profile: Profile): FormattedProfile | null {
return {
...profile,
tagList: profile.tags.split(',').filter((t) => t), // remove any empty tags
lastActiveFormatted: dayjs.unix(profile.lastActive).format(t('DATE_TIME_FORMAT')),
viewed: false,
};
}
const _setProfiles = (profiles: Profile[]): void => {
setProfiles(profiles.map(formatProfile));
};
const _setProfile = (profile: Profile) => {
if (!profile) {
setNoProfileExists(true);
} else {
setNoProfileExists(false);
setProfile(formatProfile(profile));
}
};
const _handleGetProfilesFailed = (alert: IAlert): void => {
handleAddAlert(alert);
setErrorLoadingProfiles(true);
};
const _setMatches = (matches: Match[]): void => {
setMatches(
matches.map((match) => ({
...match,
tagList: match.tags.split(',').filter((t) => t), // remove any empty tags
lastActiveFormatted: dayjs.unix(match.lastActive).format(t('DATE_TIME_FORMAT')),
matchedAtFormatted: dayjs.unix(match.matchedAt).format(t('DATE_TIME_FORMAT')),
})),
);
};
const _handleGetMatchesFailed = (alert: IAlert): void => {
handleAddAlert(alert);
setErrorLoadingMatches(true);
};
const _handleUpdateProfile = (profile: Profile) => {
_setProfile(profile);
handleAddAlert({ message: 'APPS_MATCH_UPDATE_PROFILE_SUCCEEDED', type: 'info' });
};
useNuiEvent('MATCH', MatchEvents.GET_PROFILES_SUCCESS, _setProfiles);
useNuiEvent('MATCH', MatchEvents.GET_PROFILES_FAILED, _handleGetProfilesFailed);
useNuiEvent('MATCH', MatchEvents.GET_MY_PROFILE_SUCCESS, _setProfile);
useNuiEvent('MATCH', MatchEvents.GET_MY_PROFILE_FAILED, handleAddAlert);
useNuiEvent('MATCH', MatchEvents.GET_MATCHES_SUCCESS, _setMatches);
useNuiEvent('MATCH', MatchEvents.GET_MATCHES_FAILED, _handleGetMatchesFailed);
useNuiEvent('MATCH', MatchEvents.SAVE_LIKES_FAILED, handleAddAlert);
useNuiEvent('MATCH', MatchEvents.NEW_MATCH, handleAddAlert);
useNuiEvent('MATCH', MatchEvents.UPDATE_MY_PROFILE_SUCCESS, _handleUpdateProfile);
useNuiEvent('MATCH', MatchEvents.UPDATE_MY_PROFILE_FAILED, handleAddAlert);
useNuiEvent('MATCH', MatchEvents.CREATE_MY_PROFILE_SUCCESS, _handleUpdateProfile);
useNuiEvent('MATCH', MatchEvents.CREATE_MY_PROFILE_FAILED, handleAddAlert);
return {};
};
+15
View File
@@ -0,0 +1,15 @@
import { useRecoilValue } from 'recoil';
import { matchState } from './state';
import { FormattedMatch } from '../../../../../typings/match';
interface IUseMatches {
matches: FormattedMatch[];
error: boolean;
}
export const useMatches = (): IUseMatches => {
const matches = useRecoilValue<FormattedMatch[]>(matchState.matches);
const error = useRecoilValue(matchState.errorLoadingMatches);
return { matches, error };
};
+16
View File
@@ -0,0 +1,16 @@
import { useRecoilState, useRecoilValue } from 'recoil';
import { matchState } from './state';
import { FormattedProfile } from '../../../../../typings/match';
interface IUseProfiles {
profile: FormattedProfile;
setProfile: (profile: FormattedProfile) => void;
noProfileExists: boolean;
}
export const useProfile = (): IUseProfiles => {
const [profile, setProfile] = useRecoilState<FormattedProfile>(matchState.myProfile);
const noProfileExists = useRecoilValue(matchState.noProfileExists);
return { profile, setProfile, noProfileExists };
};
+33
View File
@@ -0,0 +1,33 @@
import { useRecoilState, useRecoilValue } from 'recoil';
import { matchState } from './state';
import { FormattedProfile, MatchEvents } from '../../../../../typings/match';
import Nui from '../../../os/nui-events/utils/Nui';
interface IUseProfiles {
profiles: FormattedProfile[];
activeProfile: FormattedProfile | null;
setViewed: (index: number, liked: boolean) => void;
error: boolean;
}
export const useProfiles = (): IUseProfiles => {
const [profiles, setProfiles] = useRecoilState(matchState.profiles);
const error = useRecoilValue(matchState.errorLoadingProfiles);
const setViewed = (id: number, liked: boolean) => {
setProfiles((profiles) =>
profiles.map((profile) => {
if (id === profile.id) return { ...profile, viewed: true, liked };
return profile;
}),
);
Nui.send(MatchEvents.SAVE_LIKES, [{ id, liked }]);
};
const filteredProfiles = profiles ? profiles.filter((profile) => !profile.viewed) : null;
const activeProfile = profiles ? filteredProfiles[0] : null;
return { profiles, activeProfile, error, setViewed };
};
+27
View File
@@ -0,0 +1,27 @@
import { red, common } from '@material-ui/core/colors';
export const MATCH_APP_PRIMARY_COLOR = '#FE3B73';
export const MATCH_APP_TEXT_COLOR = common.white;
const theme = {
palette: {
primary: {
main: MATCH_APP_PRIMARY_COLOR,
dark: red[700],
light: red[300],
contrastText: MATCH_APP_TEXT_COLOR,
},
secondary: {
main: '#d32f2f',
light: '#eb4242',
dark: '#941212',
contrastText: MATCH_APP_TEXT_COLOR,
},
success: {
main: '#2196f3',
contrastText: MATCH_APP_TEXT_COLOR,
},
},
};
export default theme;
@@ -0,0 +1,5 @@
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
import matchTheme from '../match.theme';
export const MatchThemeProvider = createAppThemeProvider(matchTheme);
+161
View File
@@ -0,0 +1,161 @@
interface IDeltas {
deltaX: number;
deltaY: number;
}
/**
* Given a React ref, which should point to some HTML element,
* add draggable functionality to that element so the user can
* interact with it.
*
* It should be noted that when using this in React that this
* class is directly mutating the DOM, not relying on React state
* to do so. This can cause some problems when relying on React
* state updates based on the values derived from this class. That
* is why we primarily use refs to interact with it.
*
* Order of operations:
* 1. User clicks "down" on element - this initializes event
* handlers and saves initial state
* 2. User moves mouse. Every mouse move event triggers a movement
* of the HTML element and also performs some logic to see how far
* we have moved
* 3. User "releases" mouse - cleanup event handlers and do logic
* to compare our final position to our initial position
*/
export class DraggableElement {
private element: HTMLElement;
private width: number = 0;
private initialX: number = 0;
private initialY: number = 0;
private mouseDownInitialX: number = 0;
private mouseDownInitialY: number = 0;
private useRotation: boolean;
private maxRotationDeg: null | number;
private updatedX: number = 0;
private updatedY: number = 0;
private mouseDownX: number = 0;
private mouseDownY: number = 0;
constructor(ref: React.MutableRefObject<any>, maxRotationDeg: number | null = null) {
this.element = ref.current;
this.width = this.element.clientWidth;
this.maxRotationDeg = maxRotationDeg;
this.useRotation = maxRotationDeg !== null;
this.element.onmousedown = this.onMouseDown;
}
onMouseDown = (e: MouseEvent): void => {
e.preventDefault();
// get the mouse cursor position at startup:
this.mouseDownX = e.clientX;
this.mouseDownY = e.clientY;
// save where we initially started dragging from
// so we can do some math later
this.mouseDownInitialX = this.mouseDownX;
this.mouseDownInitialY = this.mouseDownY;
document.onmouseup = this.onMouseUp;
// call a function whenever the cursor moves:
document.onmousemove = this.onMouseMove;
};
onMouseMove = (e: MouseEvent): void => {
e.preventDefault();
const x = e.clientX;
const y = e.clientY;
this._onMouseMove(x, y);
};
_onMouseMove = (x: number, y: number): void => {
// calculate the new cursor position:
this.updatedX = this.mouseDownX - x;
this.updatedY = this.mouseDownY - y;
this.mouseDownX = x;
this.mouseDownY = y;
// set the element's new position:
this.element.style.top = this.element.offsetTop - this.updatedY + 'px';
this.element.style.left = this.element.offsetLeft - this.updatedX + 'px';
if (this.useRotation) {
const { deltaX } = this.deltas(this.mouseDownX, this.mouseDownY);
const pctWidth = deltaX / this.width;
const rotationDeg = -1 * this.maxRotationDeg * pctWidth;
this.element.style.webkitTransform = `rotate(${rotationDeg}deg)`;
}
};
onMouseUp = (e: MouseEvent): void => {
e.preventDefault();
this._onMouseUp();
};
_onMouseUp = (): void => {
// stop moving when mouse button is released:
this.cleanup();
// revert back to intitial position
this.element.style.left = `${this.initialX}px`;
this.element.style.top = `${this.initialY}px`;
if (this.useRotation) {
this.element.style.webkitTransform = 'rotate(0deg)';
}
};
cleanup = (): void => {
document.onmouseup = null;
document.onmousemove = null;
};
deltas = (x: number, y: number): IDeltas => {
const deltaX = x - this.mouseDownInitialX;
const deltaY = y - this.mouseDownInitialX;
return { deltaX, deltaY };
};
}
type StatusChange = (deltaX: number) => void;
/**
* This class adds hooks to the base DraggableElement class
* so we can update application state based on events
*/
export class LikeorDislikeDraggableElement extends DraggableElement {
private onDrag: StatusChange;
private onDrop: () => void;
constructor(
ref: React.MutableRefObject<any>,
maxRotationDeg: number,
onDrag: StatusChange,
onDrop: () => void,
) {
super(ref, maxRotationDeg);
this.onDrag = onDrag;
this.onDrop = onDrop;
}
onMouseMove = (e: MouseEvent): void => {
e.preventDefault();
const x = e.clientX;
const y = e.clientY;
const { deltaX } = this.deltas(x, y);
this.onDrag(deltaX);
this._onMouseMove(x, y);
};
onMouseUp = (): void => {
this.onDrop();
this._onMouseUp();
};
}
@@ -11,13 +11,14 @@ import InjectDebugData from '../../../os/debug/InjectDebugData';
import NewMessageGroupButton from './form/NewMessageGroupButton';
import Nui from '../../../os/nui-events/utils/Nui';
import { MessagesThemeProvider } from '../providers/MessagesThemeProvider';
import { MessageEvents } from '../../../../../typings/messages';
export const MessagesApp = () => {
const messages = useApp('MESSAGES');
const history = useHistory();
useEffect(() => {
Nui.send('phone:fetchMessageGroups');
Nui.send(MessageEvents.FETCH_MESSAGE_GROUPS);
}, []);
return (
@@ -4,6 +4,7 @@ import { Paper, Box, makeStyles, TextField, Button } from '@material-ui/core';
import SendIcon from '@material-ui/icons/Send';
import ImageIcon from '@material-ui/icons/Image';
import Nui from '../../../../os/nui-events/utils/Nui';
import { MessageEvents } from '../../../../../../typings/messages';
interface IProps {
onAddImageClick(): void;
@@ -25,7 +26,7 @@ const MessageInput = ({ messageGroupId, onAddImageClick }: IProps) => {
if (message.trim()) {
// don't allow the user to submit white space
Nui.send('phone:sendMessage', {
Nui.send(MessageEvents.SEND_MESSAGE, {
groupId: messageGroupId,
message,
});
@@ -1,16 +1,19 @@
import React, { FormEvent, useCallback, useEffect, useState } from 'react';
import React, { useCallback, useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
import { Box, Button, TextField } from '@material-ui/core';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useHistory } from 'react-router-dom';
import { Autocomplete } from '@material-ui/lab';
import { useContacts } from '../../../contacts/hooks/useContacts';
import { Contact } from '../../../../../../typings/contact';
import { MessageEvents } from '../../../../../../typings/messages';
import { PHONE_NUMBER_REGEX } from '../../../../../../typings/phone';
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
const history = useHistory();
const { t } = useTranslation();
const { addAlert } = useSnackbar();
const [participants, setParticipants] = useState([]);
const [label, setLabel] = useState('');
const { getContactByNumber, contacts } = useContacts();
@@ -24,31 +27,30 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
const isGroupChat = participants.length > 1;
const handleSubmit = useCallback(
(event: FormEvent) => {
event.preventDefault();
const handleSubmit = useCallback(() => {
// handles phone numbers in a csv format and strips all spaces and
// external characters out of them:
// 123-4567, 987-6543, 333-4444
const phoneNumbers = participants.map(({ number }) => number.replace(/[^0-9]/g, ''));
const labelValue = isGroupChat ? label.trim() : null;
// handles phone numbers in a csv format and strips all spaces and
// external characters out of them:
// 123-4567, 987-6543, 333-4444
const phoneNumbers = participants.map(({ number }) => number.replace(/[^0-9]/g, ''));
const labelValue = isGroupChat ? label.trim() : null;
if (phoneNumbers.length) {
Nui.send('phone:createMessageGroup', {
phoneNumbers,
label: labelValue,
});
setParticipants([]);
history.push('/messages');
}
},
[history, label, participants, isGroupChat],
);
if (phoneNumbers.length) {
Nui.send(MessageEvents.CREATE_MESSAGE_GROUP, {
phoneNumbers,
label: labelValue,
});
setParticipants([]);
history.push('/messages');
}
}, [history, label, participants, isGroupChat]);
const onAutocompleteChange = (_e, value: any) => {
const lastIdx = value.length - 1;
if (typeof value[lastIdx] === 'string') {
const isValid = PHONE_NUMBER_REGEX.test(value[lastIdx]);
if (!isValid) {
return addAlert({ message: t('APPS_MESSAGES_INVALID_PHONE_NUMBER'), type: 'error' });
}
value.splice(lastIdx, 1, { number: value[lastIdx] });
setParticipants(value);
return;
@@ -77,7 +79,7 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
const submitDisabled = !participants.length || (isGroupChat && !label);
return (
<form onSubmit={handleSubmit}>
<Box>
<Box px={2} py={3}>
<Autocomplete<Contact, boolean, boolean, boolean>
value={participants}
@@ -102,6 +104,7 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
)}
<Box px={2} py={3}>
<Button
onClick={() => handleSubmit()}
disabled={submitDisabled}
variant="contained"
fullWidth
@@ -111,7 +114,7 @@ const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
{t('APPS_MESSAGES_NEW_MESSAGE_GROUP_SUBMIT')}
</Button>
</Box>
</form>
</Box>
);
};
@@ -23,7 +23,7 @@ const MessageGroupItem = ({ messageGroup, handleClick }: IProps): any => {
<ListItem key={messageGroup.groupId} onClick={handleClick(messageGroup)} divider button>
<ListItemAvatar>
<Badge color="error" variant="dot" invisible={!hasUnread}>
<MuiAvatar src={messageGroup?.avatar} />
<MuiAvatar src={messageGroup.avatar} />
</Badge>
</ListItemAvatar>
<ListItemText>{messageGroup.label || messageGroup.groupDisplay}</ListItemText>
@@ -1,7 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Box, List } from '@material-ui/core';
import { MessageGroup } from '../../../../../../typings/messages';
import Nui from '../../../../os/nui-events/utils/Nui';
import useMessages from '../../hooks/useMessages';
import MessageGroupItem from './MessageGroupItem';
import useStyles from './list.styles';
@@ -15,7 +14,13 @@ const MessagesList = (): any => {
const history = useHistory();
const { t } = useTranslation();
const { messageGroups, createMessageGroupResult, clearMessageGroupResult } = useMessages();
const {
messageGroups,
createMessageGroupResult,
clearMessageGroupResult,
getMessageGroupById,
setActiveMessageGroup,
} = useMessages();
const [searchValue, setSearchValue] = useState('');
@@ -32,18 +37,24 @@ const MessagesList = (): any => {
useEffect(() => {
if (createMessageGroupResult?.groupId) {
const findGroup = messageGroups.find((g) => g.groupId === createMessageGroupResult.groupId);
const findGroup = getMessageGroupById(createMessageGroupResult.groupId);
clearMessageGroupResult();
if (findGroup) {
goToConversation(findGroup, history);
}
}
}, [messageGroups, createMessageGroupResult, clearMessageGroupResult, history]);
}, [
messageGroups,
createMessageGroupResult,
clearMessageGroupResult,
history,
setActiveMessageGroup,
getMessageGroupById,
]);
if (!messageGroups) return null;
const handleClick = (messageGroup: MessageGroup) => () => {
Nui.send('phone:fetchMessages', { groupId: messageGroup.groupId });
goToConversation(messageGroup, history);
};
@@ -10,6 +10,7 @@ import { useHistory, useLocation } from 'react-router-dom';
import { ContextMenu } from '../../../../ui/components/ContextMenu';
import { deleteQueryFromLocation } from '../../../../common/utils/deleteQueryFromLocation';
import { PictureResponsive } from '../../../../ui/components/PictureResponsive';
import { MessageEvents } from '../../../../../../typings/messages';
interface IProps {
isOpen: boolean;
@@ -34,7 +35,7 @@ export const MessageImageModal = ({ isOpen, messageGroupId, onClose, image }: IP
const sendImageMessage = useCallback(
(m) => {
Nui.send('phone:sendMessage', {
Nui.send(MessageEvents.SEND_MESSAGE, {
groupId: messageGroupId,
message: m,
});
@@ -23,6 +23,7 @@ import { useTranslation } from 'react-i18next';
import Modal from '../../../../ui/components/Modal';
import { useContacts } from '../../../contacts/hooks/useContacts';
import { useSimcard } from '../../../../os/simcard/hooks/useSimcard';
import { MessageEvents } from '../../../../../../typings/messages';
const LARGE_HEADER_CHARS = 30;
const MAX_HEADER_CHARS = 80;
@@ -77,7 +78,6 @@ export const MessageModal = () => {
useEffect(() => {
if (!groupId) return;
setActiveMessageGroup(groupId);
}, [groupId, setActiveMessageGroup]);
@@ -93,7 +93,7 @@ export const MessageModal = () => {
// sends all unread messages
useEffect(() => {
if (activeMessageGroup?.groupId && activeMessageGroup.unreadCount > 0) {
Nui.send('phone:setReadMessages', {
Nui.send(MessageEvents.SET_MESSAGE_READ, {
groupId: activeMessageGroup.groupId,
});
}
@@ -109,10 +109,11 @@ export const MessageModal = () => {
const handleAddContact = (number) => {
const exists = getContactByNumber(number);
const referal = encodeURIComponent(pathname);
if (exists) {
return history.push(`/contacts/${exists.id}/?referal=${pathname}`);
return history.push(`/contacts/${exists.id}/?referal=${referal}`);
}
return history.push(`/contacts/-1/?addNumber=${number}&referal=${pathname}`);
return history.push(`/contacts/-1/?addNumber=${number}&referal=${referal}`);
};
const phoneNumbers = activeMessageGroup?.phoneNumbers || [];
@@ -157,14 +158,14 @@ export const MessageModal = () => {
</Button>
) : null}
{!activeMessageGroup?.isGroupChat &&
getDisplayByNumber(targetNumber) == targetNumber ? (
getDisplayByNumber(targetNumber) === targetNumber ? (
<Button>
<PersonAddIcon onClick={() => handleAddContact(targetNumber)} fontSize="large" />
</Button>
) : null}
</Box>
</Paper>
{isLoaded ? (
{isLoaded && activeMessageGroup ? (
<Conversation
onClickDisplay={handleAddContact}
messages={messages}
@@ -1,5 +1,6 @@
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import { matchPath, useHistory } from 'react-router-dom';
import { useApp } from '../../../os/apps/hooks/useApps';
import { useNotifications } from '../../../os/notifications/hooks/useNotifications';
import { goToConversation } from '../utils/goToConversation';
@@ -10,13 +11,22 @@ const NOTIFICATION_ID = 'messages:broadcast';
export const useMessageNotifications = () => {
const { t } = useTranslation();
const history = useHistory();
const {
removeId,
addNotification,
addNotificationAlert,
} = useNotifications();
const { removeId, addNotification, addNotificationAlert } = useNotifications();
const { icon, notificationIcon } = useApp('MESSAGES');
const { getMessageGroupById } = useMessages();
const { getMessageGroupById, activeMessageGroup } = useMessages();
// Remove notifications from groups when opening them
history.listen((location) => {
if (
activeMessageGroup?.groupId &&
matchPath(location.pathname, {
path: `/messages/conversations/${activeMessageGroup.groupId}`,
exact: true,
})
) {
removeId(`${NOTIFICATION_ID}:${activeMessageGroup.groupId}`);
}
});
const setNotification = ({ groupId, message }) => {
const group = getMessageGroupById(groupId);
@@ -1,12 +1,20 @@
import { useSetRecoilState } from 'recoil';
import { useRecoilState, useSetRecoilState } from 'recoil';
import { messageState } from './state';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { useMessageNotifications } from './useMessageNotifications';
import { useCallback } from 'react';
import Nui from '../../../os/nui-events/utils/Nui';
import { useLocation } from 'react-router';
import { MessageEvents } from '../../../../../typings/messages';
import { TOptionsBase } from 'i18next';
export const useMessagesService = () => {
const { pathname } = useLocation();
const [activeMessageGroup, setActiveMessageGroup] = useRecoilState(
messageState.activeMessageGroup,
);
const setMessageGroups = useSetRecoilState(messageState.messageGroups);
const setMessages = useSetRecoilState(messageState.messages);
const setCreateMessageGroupResult = useSetRecoilState(messageState.createMessageGroupResult);
@@ -15,19 +23,45 @@ export const useMessagesService = () => {
const { t } = useTranslation();
const handleAddAlert = useCallback(
({ message, type }: IAlert) => {
({ message, type, options = {} }: IAlert & { options: TOptionsBase }) => {
addAlert({
message: t(`APPS_${message}`),
message: t(`${message}`, options),
type,
});
},
[addAlert, t],
);
useNuiEvent('MESSAGES', 'phone:fetchMessageGroupsSuccess', setMessageGroups);
useNuiEvent('MESSAGES', 'phone:fetchMessagesSuccess', setMessages);
useNuiEvent('MESSAGES', 'phone:createMessageGroupSuccess', setCreateMessageGroupResult);
useNuiEvent('MESSAGES', 'phone:createMessageGroupFailed', setCreateMessageGroupResult);
useNuiEvent('MESSAGES', 'createMessagesBroadcast', setNotification);
useNuiEvent('MESSAGES', 'phone:setMessagesAlert', handleAddAlert);
const handleMessageBroadcast = useCallback(
({ groupId, message }) => {
if (groupId === activeMessageGroup?.groupId) {
Nui.send(MessageEvents.FETCH_MESSAGES, { groupId: activeMessageGroup.groupId });
if (pathname.includes('messages/conversations')) {
// Dont trigger notification if conversation is open.
return;
}
}
setNotification({ groupId, message });
},
[activeMessageGroup, pathname, setNotification],
);
const _setMessageGroups = useCallback(
(groups) => {
if (activeMessageGroup && activeMessageGroup.groupId) {
setActiveMessageGroup(
(curr) => groups.find((g) => g.groupId === activeMessageGroup.groupId) || curr,
);
}
setMessageGroups(groups);
},
[activeMessageGroup, setActiveMessageGroup, setMessageGroups],
);
useNuiEvent('MESSAGES', MessageEvents.FETCH_MESSAGE_GROUPS_SUCCESS, _setMessageGroups);
useNuiEvent('MESSAGES', MessageEvents.FETCH_MESSAGES_SUCCESS, setMessages);
useNuiEvent('MESSAGES', MessageEvents.CREATE_MESSAGE_GROUP_SUCCESS, setCreateMessageGroupResult);
useNuiEvent('MESSAGES', MessageEvents.CREATE_MESSAGE_GROUP_FAILED, setCreateMessageGroupResult);
useNuiEvent('MESSAGES', MessageEvents.CREATE_MESSAGE_BROADCAST, handleMessageBroadcast);
useNuiEvent('MESSAGES', MessageEvents.ACTION_RESULT, handleAddAlert);
};
@@ -1,2 +1,8 @@
export const goToConversation = (messageGroup, history) =>
import { MessageEvents } from '../../../../../typings/messages';
import Nui from '../../../os/nui-events/utils/Nui';
export const goToConversation = (messageGroup, history) => {
if (!messageGroup?.groupId || !history) return;
history.push(`/messages/conversations/${messageGroup.groupId}`);
Nui.send(MessageEvents.FETCH_MESSAGES, { groupId: messageGroup.groupId });
};
@@ -3,6 +3,7 @@ import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { noteStates } from './state';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { NotesEvents } from '../../../../../typings/notes';
export const useNotesService = () => {
const { addAlert } = useSnackbar();
@@ -16,6 +17,6 @@ export const useNotesService = () => {
});
};
useNuiEvent('NOTES', 'setNotes', setNotes);
useNuiEvent('NOTES', 'setAlert', handleAddAlert);
useNuiEvent('NOTES', NotesEvents.SEND_NOTE, setNotes);
useNuiEvent('NOTES', NotesEvents.SEND_ALERT, handleAddAlert);
};
+4 -3
View File
@@ -16,6 +16,7 @@ import Nui from '../../../os/nui-events/utils/Nui';
import { useTranslation } from 'react-i18next';
import { useHistory } from 'react-router-dom';
import { StatusButton } from '../../../ui/components/StatusButton';
import { NotesEvents } from '../../../../../typings/notes';
export const NoteModal = () => {
const classes = useStyles();
@@ -31,14 +32,14 @@ export const NoteModal = () => {
};
const handleNoteSave = () => {
Nui.send('phone:addNote', detail);
Nui.send(NotesEvents.ADD_NOTE, detail);
setDetail(null);
onClose();
};
const handleDeleteNote = () => {
const id = detail.id;
Nui.send('phone:deleteNote', {
Nui.send(NotesEvents.DELETE_NOTE, {
id,
});
setDetail(null);
@@ -46,7 +47,7 @@ export const NoteModal = () => {
};
const handleUpdateNote = () => {
Nui.send('phone:updateNote', detail);
Nui.send(NotesEvents.UPDATE_NOTE, detail);
setDetail(null);
onClose();
};
@@ -1,6 +0,0 @@
import React from 'react';
import { SelloutList } from './SelloutList';
export const SelloutListContainer = () => {
return <SelloutList />;
};
@@ -1,5 +0,0 @@
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
import selloutTheme from '../sellout.theme';
export const SelloutThemeProvider = createAppThemeProvider(selloutTheme);
@@ -26,12 +26,14 @@ import {
VolumeUp,
FileCopy,
Book,
DeleteForever,
} from '@material-ui/icons';
import { ListSubheader } from '@material-ui/core';
import { useSettings } from '../hooks/useSettings';
import { useResetSettings, useSettings } from '../hooks/useSettings';
import { setClipboard } from '../../../os/phone/hooks/useClipboard';
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
import { IContextMenuOption } from '../../../ui/components/ContextMenu';
const SubHeaderComp = (props: { text: string }) => (
<ListSubheader color="primary" component="div" disableSticky>
@@ -48,6 +50,8 @@ export const SettingsApp = () => {
const { addAlert } = useSnackbar();
const resetSettings = useResetSettings();
const handleSettingChange = (key: string | number, value: unknown) => {
setSettings({ ...settings, [key]: value });
};
@@ -91,6 +95,23 @@ export const SettingsApp = () => {
MapSettingItem(settings.language, (val: SettingOption) => handleSettingChange('language', val)),
);
const handleResetOptions = () => {
resetSettings();
addAlert({
message: t('SETTINGS.MESSAGES.SETTINGS_RESET'),
type: 'success',
});
};
const resetSettingsOpts: IContextMenuOption[] = [
{
selected: false,
onClick: () => handleResetOptions(),
key: 'RESET_SETTINGS',
label: t('SETTINGS.OPTIONS.RESET_SETTINGS'),
},
];
const handleCopyPhoneNumber = () => {
setClipboard(simcard.number);
addAlert({
@@ -210,6 +231,15 @@ export const SettingsApp = () => {
icon={<VolumeUp />}
/>
</List>
<List disablePadding subheader={<SubHeaderComp text={t('SETTINGS.CATEGORY.ACTIONS')} />}>
<SettingItem
label={t('SETTINGS.OPTIONS.RESET_SETTINGS')}
value={`${t('SETTINGS.OPTIONS.RESET_SETTINGS_DESC')}`}
icon={<DeleteForever />}
onClick={openMenu}
options={resetSettingsOpts}
/>
</List>
</AppContent>
<ContextMenu />
</AppWrapper>
Loaded 100 of 200 files, more files were not shown because too many files have changed in this diff. Show more