Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4a60164faf | ||
|
|
381f298ad4 | ||
|
|
8461c1acd2 | ||
|
|
dce079222a | ||
|
|
13952fa318 | ||
|
|
95c3aea1d9 | ||
|
|
1583789341 | ||
|
|
04f9195444 | ||
|
|
d0419b067a | ||
|
|
858bd1cf78 | ||
|
|
a87b1afe2a | ||
|
|
aa294e749e | ||
|
|
2cbd3c934d | ||
|
|
98358e54eb | ||
|
|
96aa7107ba | ||
|
|
5dcb654516 | ||
|
|
1253c76aef | ||
|
|
7ed5f54709 | ||
|
|
553e04ef3c | ||
|
|
c644d177f1 | ||
|
|
5263a83d1f | ||
|
|
60b9e35ae8 | ||
|
|
bdc79aeff9 | ||
|
|
7cf1e20e8f | ||
|
|
71e9908f35 | ||
|
|
929663af0c | ||
|
|
a06ef07902 | ||
|
|
b433c2bda0 | ||
|
|
334a79b68b | ||
|
|
e2f03f411d | ||
|
|
be4323f337 | ||
|
|
af6e291368 | ||
|
|
10c5e97088 | ||
|
|
36d1e993bd | ||
|
|
92b687b130 | ||
|
|
b45ad53bc6 | ||
|
|
d648b21d3b | ||
|
|
fc939885a8 | ||
|
|
b00bee0217 | ||
|
|
16626db5bd | ||
|
|
83ec915926 | ||
|
|
05343d0540 | ||
|
|
35eb0ee698 | ||
|
|
d2d13200ca | ||
|
|
1b8755049d | ||
|
|
dd99f7e241 | ||
|
|
02f0abd761 | ||
|
|
4b724dfa73 | ||
|
|
44599c882d | ||
|
|
eaae3c7211 | ||
|
|
3b7326dac8 | ||
|
|
908a393451 | ||
|
|
68d2e66d16 | ||
|
|
4e8c57492b | ||
|
|
1566bb0fdb | ||
|
|
9d7ddbca6f | ||
|
|
c073965dff | ||
|
|
4dd075a537 | ||
|
|
8498f91a1f | ||
|
|
2e714ccb0f | ||
|
|
f474bd0148 | ||
|
|
fcae80b785 | ||
|
|
80da6a0af1 | ||
|
|
33c58e9931 | ||
|
|
14f44a63d1 | ||
|
|
4ce98e29d3 | ||
|
|
0a2ba225cd | ||
|
|
ad57768745 | ||
|
|
5b017b6892 | ||
|
|
029e221a98 | ||
|
|
dc1677675b | ||
|
|
b932a0924f | ||
|
|
a562ea776a | ||
|
|
1b9ac61d1d | ||
|
|
69e5cdf326 | ||
|
|
d2e223ca39 | ||
|
|
f9956a15a8 | ||
|
|
833d2f282b | ||
|
|
e288e5b50e | ||
|
|
104fda2c11 | ||
|
|
f6395e4b8e | ||
|
|
398bfa2092 | ||
|
|
4ef89f679f | ||
|
|
eb5b907091 | ||
|
|
b1b412b81e | ||
|
|
ee8a8b62cc | ||
|
|
b033eae51e | ||
|
|
4029e8c7a1 | ||
|
|
b173f0ae48 | ||
|
|
9404a6dd26 | ||
|
|
865a8e44de | ||
|
|
94633e53a6 | ||
|
|
6a3bef1e34 | ||
|
|
44a9595463 | ||
|
|
bb81ab6fe2 | ||
|
|
e76e6c5296 | ||
|
|
2c9f260417 | ||
|
|
c59137d598 | ||
|
|
28fd09ce53 | ||
|
|
5493a3de76 | ||
|
|
f0acadbf98 | ||
|
|
52ac061a3c | ||
|
|
ecb71cc359 | ||
|
|
5e225ca736 | ||
|
|
10639260e0 | ||
|
|
3df2f88759 | ||
|
|
4afa9c691b | ||
|
|
2d1e192892 | ||
|
|
51d8aa6322 | ||
|
|
be8e9bfa39 | ||
|
|
d036243d64 | ||
|
|
1940833f56 | ||
|
|
54d456cc8a | ||
|
|
42b2970428 | ||
|
|
f1012958e2 | ||
|
|
457926263d | ||
|
|
dcb7556edc | ||
|
|
f54dc974a2 | ||
|
|
908e467011 | ||
|
|
478c5ffc63 | ||
|
|
44a0d941b9 | ||
|
|
3446de488e | ||
|
|
be70534108 | ||
|
|
0e9f8bc574 | ||
|
|
aa185224e7 | ||
|
|
871b9e0f1d | ||
|
|
b257f5bc73 | ||
|
|
fed042aea7 | ||
|
|
99fa476124 | ||
|
|
ebe8c67369 | ||
|
|
c48b7333e2 | ||
|
|
4f380a56e1 | ||
|
|
870aeda3c3 | ||
|
|
f10369a4e9 | ||
|
|
d95062d771 | ||
|
|
0e1d7f40b5 | ||
|
|
e05f543cb0 | ||
|
|
a103ef9b2f | ||
|
|
fb32aaef15 | ||
|
|
2411c39b95 | ||
|
|
488c8df5cb | ||
|
|
054f89c03d | ||
|
|
2f0f83a17e | ||
|
|
d279b31b8f | ||
|
|
2bd4f4dc96 | ||
|
|
346d194e97 | ||
|
|
f89ffc3060 | ||
|
|
c5aaf32e5d | ||
|
|
7d447c118c | ||
|
|
0134b9052c | ||
|
|
46484be9bc | ||
|
|
951ed914d5 | ||
|
|
d5aaa67c6c | ||
|
|
d18ebc066b | ||
|
|
aa8648c408 | ||
|
|
aa5eb4be2d | ||
|
|
b92cf0d6fa | ||
|
|
ea69ba4667 | ||
|
|
4c3d018751 | ||
|
|
1fe8541476 | ||
|
|
fd6afa927c | ||
|
|
f53117971e | ||
|
|
4b705da072 | ||
|
|
532a554b77 | ||
|
|
1ac4b6dd8d | ||
|
|
ba8f722c35 | ||
|
|
faf4edfbc6 | ||
|
|
34b177e827 | ||
|
|
1030ae158c | ||
|
|
4f658181d2 | ||
|
|
000151e756 | ||
|
|
80d2d5476a | ||
|
|
95ed68dff6 | ||
|
|
10e28b911e | ||
|
|
3470700fc1 | ||
|
|
8efcf2e5b5 | ||
|
|
ed05ebd6a8 | ||
|
|
cd4f7e73a6 | ||
|
|
4803753cfa | ||
|
|
85d4ab3c36 | ||
|
|
3304ae9a83 | ||
|
|
53fbf07984 | ||
|
|
9724014a9a | ||
|
|
8988ea9b26 | ||
|
|
a0c80a0e9a | ||
|
|
048753f6d2 | ||
|
|
4687635988 | ||
|
|
93fd955ae9 | ||
|
|
25a629a59b | ||
|
|
f8f722c8d2 | ||
|
|
16471ed1df | ||
|
|
feb9e8a5d3 | ||
|
|
0f8923058f | ||
|
|
06a67f14cd | ||
|
|
cb9c490cb5 | ||
|
|
33a02bb203 | ||
|
|
19e4ba0543 | ||
|
|
85eb58948d | ||
|
|
558f2388fc | ||
|
|
222070eeea | ||
|
|
6be602c95b | ||
|
|
3e01fc456c | ||
|
|
4b7a6280fd | ||
|
|
ec4ebdc54d | ||
|
|
0df1c123b0 | ||
|
|
6c9e2aef04 | ||
|
|
478d4d4519 | ||
|
|
046aeffb76 | ||
|
|
0de2495bfa | ||
|
|
ad7adcdeb6 | ||
|
|
af9ff9c92f | ||
|
|
8af7530f18 | ||
|
|
635dc907ce | ||
|
|
caf42c9c8a | ||
|
|
2dafbcc13f | ||
|
|
51b5620866 | ||
|
|
c94c69c646 | ||
|
|
b684656379 | ||
|
|
0bb20fff31 | ||
|
|
d93bdd20d8 | ||
|
|
b051ae9fac | ||
|
|
bf95ccb06b | ||
|
|
bb7d938b07 | ||
|
|
e01fa0ab0a | ||
|
|
949ea4ba4b | ||
|
|
268bd4f4a4 | ||
|
|
2ec049ca12 | ||
|
|
db03394487 | ||
|
|
8861f4e503 | ||
|
|
6a46711a51 | ||
|
|
1c69cd5e2e | ||
|
|
b14562eb9d | ||
|
|
af2b7519b6 | ||
|
|
dd3eac4a0e | ||
|
|
8ce6ec7559 | ||
|
|
60e38c9e5c | ||
|
|
71bb73b54e | ||
|
|
8dc59c47bd | ||
|
|
4fceb3750b | ||
|
|
771483b7b5 | ||
|
|
1ef01f291b | ||
|
|
6154dfc7a3 | ||
|
|
ecd7689742 | ||
|
|
2b4752dc89 | ||
|
|
bd5f3016d0 | ||
|
|
fad2ff14fa | ||
|
|
390319deda | ||
|
|
b5fca6b35b | ||
|
|
1f20b980da | ||
|
|
a880ae66ea | ||
|
|
1a3d02f1e3 | ||
|
|
b97cc4102d | ||
|
|
e1e6e8440d | ||
|
|
404d526863 | ||
|
|
e70c540ce8 | ||
|
|
62038aa5fe | ||
|
|
8e79eb1345 | ||
|
|
0cf5bc2bc7 | ||
|
|
8ef1a0aa9a | ||
|
|
2a8230e505 | ||
|
|
fcecd2aa89 | ||
|
|
d8dc5b7f47 | ||
|
|
fed7b2c13a | ||
|
|
d6b561beb8 | ||
|
|
8ca8b1b5fe | ||
|
|
4bf3248168 | ||
|
|
cb1aa80f83 | ||
|
|
9896f2384e | ||
|
|
289207beb9 | ||
|
|
8bfdc1b8b2 | ||
|
|
d315d72e93 | ||
|
|
2992a644fe | ||
|
|
2b633c9e80 | ||
|
|
dab4c1eaf7 | ||
|
|
48e0dd2443 | ||
|
|
3157cafd5a | ||
|
|
c82a48b012 | ||
|
|
4d46566811 | ||
|
|
ee7e3a3ae1 | ||
|
|
31241c7e8f | ||
|
|
5f2dce2dda |
No files matched your search
@@ -1,6 +1,6 @@
|
||||
name: Test Suite
|
||||
|
||||
on: [push]
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
nui_preformatting_tests:
|
||||
@@ -13,11 +13,6 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# Make sure the actual branch is checked out when running on pull requests
|
||||
ref: ${{ github.head_ref }}
|
||||
# This is important to fetch the changes to the previous commit
|
||||
fetch-depth: 0
|
||||
- name: Get yarn cache directory path
|
||||
id: yarn-cache-dir-path
|
||||
run: echo "::set-output name=dir::$(yarn config get cacheFolder)"
|
||||
@@ -36,6 +31,8 @@ jobs:
|
||||
run: yarn --frozen-lockfile
|
||||
- name: Run Enzyme Tests
|
||||
run: yarn test
|
||||
- name: Check build status
|
||||
run: yarn build
|
||||
env:
|
||||
CI: true
|
||||
|
||||
@@ -49,11 +46,6 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
# Make sure the actual branch is checked out when running on pull requests
|
||||
ref: ${{ github.head_ref }}
|
||||
# This is important to fetch the changes to the previous commit
|
||||
fetch-depth: 0
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
@@ -62,5 +54,21 @@ jobs:
|
||||
run: yarn --frozen-lockfile
|
||||
- name: Run Jest Tests
|
||||
run: yarn test
|
||||
- name: Check build status
|
||||
run: yarn build
|
||||
env:
|
||||
CI: true
|
||||
|
||||
|
||||
lint:
|
||||
name: Lint Lua scripts
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: resources
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
- name: Lint
|
||||
uses: GoatG33k/fivem-lua-lint-action@v1
|
||||
@@ -0,0 +1,57 @@
|
||||
name: Prerelease Publisher
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
jobs:
|
||||
pre-release-build:
|
||||
name: 'Build & Create Pre-Release'
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Setup Node and Yarn Cache
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: '14'
|
||||
cache: 'yarn'
|
||||
# Get zip util
|
||||
- name: Install archive tools
|
||||
run: sudo apt install zip
|
||||
|
||||
- name: Get variables
|
||||
id: get_vars
|
||||
run: |
|
||||
echo "::set-output name=SHORT_SHA::$(git rev-parse --short HEAD)"
|
||||
echo "::set-output name=DATE::$(date +'%D')"
|
||||
|
||||
- name: Install Deps
|
||||
run: yarn --frozen-lockfile
|
||||
|
||||
- name: Run build
|
||||
run: yarn build
|
||||
|
||||
- name: Bundle and Zip files
|
||||
run: |
|
||||
mkdir -p ./temp/npwd/resources
|
||||
cp ./{LICENSE,README.md,config.json,import.sql,fxmanifest.lua} ./temp/npwd/
|
||||
cp -r ./resources/{dist,html} ./temp/npwd/resources
|
||||
cd ./temp && zip -r npwd-pre-${{ steps.get_vars.outputs.SHORT_SHA }}.zip ./npwd
|
||||
|
||||
- name: Create Release & Changelog
|
||||
uses: "marvinpinto/[email protected]"
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
title: Pre-Release Build (${{ steps.get_vars.outputs.SHORT_SHA }}) | ${{ steps.get_vars.outputs.DATE }}
|
||||
prerelease: true
|
||||
automatic_release_tag: "unstable"
|
||||
files: ./temp/npwd-pre-${{ steps.get_vars.outputs.SHORT_SHA }}.zip
|
||||
|
||||
env:
|
||||
CI: false
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -0,0 +1,107 @@
|
||||
name: Tagged Release Publisher
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
jobs:
|
||||
bump-version:
|
||||
name: Bump Version
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
VERSION_TAG: ${{ steps.get_version_tag.outputs.VERSION_TAG }}
|
||||
steps:
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Get Version Tag
|
||||
id: get_version_tag
|
||||
run: echo ::set-output name=VERSION_TAG::${GITHUB_REF/refs\/tags\//}
|
||||
|
||||
- name: Setup Node
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14.x
|
||||
|
||||
- name: Bump package shells
|
||||
run: |
|
||||
cd phone && npm version ${{ needs.bump-version.outputs.VERSION_TAG }}
|
||||
cd resources && npm version ${{ needs.bump-version.outputs.VERSION_TAG }}
|
||||
git status
|
||||
|
||||
- name: Commit and push
|
||||
uses: EndBug/[email protected]
|
||||
with:
|
||||
message: Bump version to v${{ needs.bump-version.outputs.VERSION_TAG }}
|
||||
default_author: github_actions
|
||||
branch: master
|
||||
add: |
|
||||
phone/package.json
|
||||
resources/package.json
|
||||
|
||||
create-tagged-release:
|
||||
name: Build and Create Tagged Release
|
||||
runs-on: ubuntu-latest
|
||||
needs: bump-version
|
||||
|
||||
steps:
|
||||
- name: Install archive tools
|
||||
run: sudo apt install zip
|
||||
|
||||
- name: Checkout source code
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
ref: ${{ github.ref }}
|
||||
|
||||
- name: Install dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Run build
|
||||
run: yarn build
|
||||
|
||||
- name: Create Sentry Release (NPWD)
|
||||
uses: tclindner/[email protected]
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: 'project-error'
|
||||
SENTRY_PROJECT: 'npwd'
|
||||
SENTRY_URL: https://sentry.projecterror.dev/
|
||||
SENTRY_LOG_LEVEL: debug
|
||||
with:
|
||||
environment: production
|
||||
tagName: ${{ needs.bump-version.outputs.VERSION_TAG }}
|
||||
sourceMapOptions: './resources/html/static/js'
|
||||
|
||||
- name: Create Sentry Release (NodeJS)
|
||||
uses: tclindner/[email protected]
|
||||
env:
|
||||
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
||||
SENTRY_ORG: 'project-error'
|
||||
SENTRY_PROJECT: 'npwd-s'
|
||||
SENTRY_URL: https://sentry.projecterror.dev/
|
||||
with:
|
||||
environment: production
|
||||
tagName: ${{ steps.get_vars.outputs.VERSION_TAG }}
|
||||
sourceMapOptions: './resources/html/static/js'
|
||||
|
||||
- name: Bundle built files
|
||||
run: |
|
||||
mkdir -p ./temp/npwd/resources
|
||||
cp ./{LICENSE,README.md,config.json,import.sql,fxmanifest.lua} ./temp/npwd/
|
||||
cp -r ./resources/{dist,html} ./temp/npwd/resources
|
||||
cd ./temp && zip -r npwd-${{ needs.bump-version.outputs.VERSION_TAG }}.zip ./npwd
|
||||
|
||||
- name: Create Release
|
||||
uses: "marvinpinto/[email protected]"
|
||||
id: auto_release
|
||||
with:
|
||||
repo_token: "${{ secrets.GITHUB_TOKEN }}"
|
||||
title: NPWD Release | ${{ needs.bump-version.outputs.VERSION_TAG }}
|
||||
prerelease: false
|
||||
files: npwd-${{ needs.bump-version.outputs.VERSION_TAG }}.zip
|
||||
|
||||
env:
|
||||
CI: false
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
@@ -1,6 +1,8 @@
|
||||
# No IDE Folders
|
||||
.idea
|
||||
|
||||
npwd_temp
|
||||
|
||||
resources/html
|
||||
|
||||
phone/.eslintcache
|
||||
@@ -19,4 +21,7 @@ yarn-error.log*
|
||||
.DS_Store
|
||||
|
||||
# Debug logs
|
||||
sv_npwd.log
|
||||
sv_npwd.log
|
||||
|
||||
# FXServer Yarn
|
||||
.yarn.installed
|
||||
@@ -1,30 +0,0 @@
|
||||
#!/bin/sh
|
||||
if [ -z "$husky_skip_init" ]; then
|
||||
debug () {
|
||||
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
|
||||
}
|
||||
|
||||
readonly hook_name="$(basename "$0")"
|
||||
debug "starting $hook_name..."
|
||||
|
||||
if [ "$HUSKY" = "0" ]; then
|
||||
debug "HUSKY env variable is set to 0, skipping hook"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f ~/.huskyrc ]; then
|
||||
debug "sourcing ~/.huskyrc"
|
||||
. ~/.huskyrc
|
||||
fi
|
||||
|
||||
export readonly husky_skip_init=1
|
||||
sh -e "$0" "$@"
|
||||
exitCode="$?"
|
||||
|
||||
if [ $exitCode != 0 ]; then
|
||||
echo "husky - $hook_name hook exited with code $exitCode (error)"
|
||||
exit $exitCode
|
||||
fi
|
||||
|
||||
exit 0
|
||||
fi
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install commitlint --edit ""
|
||||
@@ -1,9 +1,9 @@
|
||||
# New-Phone-Who-Dis (NPWD)
|
||||
|
||||
<img src="https://beta.iodine.gg/zVkK7.png" width="500" height="300" />
|
||||
<img src="https://i.file.glass/zVkK7.png" width="500" height="300" />
|
||||
|
||||
|
||||
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.
|
||||
NPWD is our flagship and current running project. The team has been working on the project since August, 2020. This resource isn’t complete yet and currently has a pre-release. There is however no ETA for a stable release, yet. Feel free to test it out in a dev environment by following the installation guide.
|
||||
|
||||
Written completely by the Project Error Dev Team in [React](https://reactjs.org/) with a [TypeScript](https://www.typescriptlang.org/) client/server environment.
|
||||
|
||||
@@ -36,13 +36,13 @@ We do not want issues opened that are due to the phone being **WIP** as this slo
|
||||
|
||||
Most of these apps have UI that does **not** represent the final product and are subject to change.
|
||||
|
||||
- [**Bank**](https://beta.iodine.gg/Eh53X.png)
|
||||
- [**Calculator**](https://beta.iodine.gg/s6VQV.png)
|
||||
- [**Camera**](https://beta.iodine.gg/vW0y9.png)
|
||||
- [**Contacts**](https://beta.iodine.gg/3fujR.png)
|
||||
- [**Marketplace**](https://beta.iodine.gg/5bUa8.png)
|
||||
- [**Messages**](https://beta.iodine.gg/S4Lia.png)
|
||||
- [**Notes**](https://beta.iodine.gg/qTkBb.png)
|
||||
- [**Phone**](https://beta.iodine.gg/z0ii9.png)
|
||||
- [**Settings**](https://beta.iodine.gg/mZAIt.png)
|
||||
- [**Twitter**](https://beta.iodine.gg/rQZFR.png)
|
||||
- [**Bank**](https://i.file.glass/Eh53X.png)
|
||||
- [**Calculator**](https://i.file.glass/s6VQV.png)
|
||||
- [**Camera**](https://i.file.glass/vW0y9.png)
|
||||
- [**Contacts**](https://i.file.glass/3fujR.png)
|
||||
- [**Marketplace**](https://i.file.glass/5bUa8.png)
|
||||
- [**Messages**](https://i.file.glass/S4Lia.png)
|
||||
- [**Notes**](https://i.file.glass/qTkBb.png)
|
||||
- [**Phone**](https://i.file.glass/z0ii9.png)
|
||||
- [**Settings**](https://i.file.glass/mZAIt.png)
|
||||
- [**Twitter**](https://i.file.glass/rQZFR.png)
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
};
|
||||
@@ -1,23 +1,23 @@
|
||||
{
|
||||
"Locale": "en",
|
||||
"KeyTogglePhone": 288,
|
||||
"KeyTakeCall": 38,
|
||||
"PhoneAsItem": false,
|
||||
"SwimDestroy": false,
|
||||
"RunRate": 10,
|
||||
"DestoryChance": 100,
|
||||
"DestroyPhoneReCheck": 3,
|
||||
"notificationPosition": {
|
||||
"horizontal": "right",
|
||||
"vertical": "top"
|
||||
"PhoneAsItem": {
|
||||
"enabled": false,
|
||||
"exportResource": "my-core-resource",
|
||||
"exportName": "myCheckerFunction"
|
||||
},
|
||||
"general": {
|
||||
"useDashNumber": true
|
||||
"useDashNumber": true,
|
||||
"enableMultiChar": false
|
||||
},
|
||||
"database": {
|
||||
"useIdentifierPrefix": false,
|
||||
"playerTable": "users",
|
||||
"identifierColumn": "identifier"
|
||||
},
|
||||
"twitter": {
|
||||
"showNotifications": true,
|
||||
"generateProfileNameFromUsers": true,
|
||||
"allowEdtiableProfileName": true,
|
||||
"allowEditableProfileName": true,
|
||||
"allowDeleteTweets": true,
|
||||
"allowReportTweets": true,
|
||||
"characterLimit": 160,
|
||||
@@ -29,16 +29,14 @@
|
||||
},
|
||||
"match": {
|
||||
"generateProfileNameFromUsers": true,
|
||||
"allowEdtiableProfileName": true
|
||||
},
|
||||
"email": {
|
||||
"provider": "project-error.dev"
|
||||
"allowEditableProfileName": true
|
||||
},
|
||||
"bank": {
|
||||
"showNotifications": true
|
||||
},
|
||||
"debug": {
|
||||
"level": "debug",
|
||||
"enabled": true
|
||||
"level": "silly",
|
||||
"enabled": true,
|
||||
"sentryEnabled": true
|
||||
}
|
||||
}
|
||||
@@ -3,8 +3,9 @@ game "gta5"
|
||||
description 'js runtime monkaW'
|
||||
authors { "itschip", "erik-sn", "TasoOneAsia", "kidz", "RockySouthpaw"}
|
||||
|
||||
client_script {
|
||||
'resources/dist/client/*.client.js'
|
||||
client_scripts {
|
||||
'resources/dist/client/*.client.js',
|
||||
'resources/client/*.lua'
|
||||
}
|
||||
|
||||
server_script {
|
||||
@@ -14,8 +15,7 @@ server_script {
|
||||
ui_page 'resources/html/index.html'
|
||||
|
||||
files {
|
||||
'config.json',
|
||||
'resources/html/index.html',
|
||||
'resources/html/*.js',
|
||||
'resources/html/*.map',
|
||||
'resources/html/media/**/*'
|
||||
'resources/html/**/*',
|
||||
}
|
||||
@@ -1,16 +1,13 @@
|
||||
# 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);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_phone_contacts (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
identifier varchar(60) DEFAULT NULL,
|
||||
avatar varchar(512) DEFAULT NULL,
|
||||
number varchar(10) DEFAULT NULL,
|
||||
display varchar(60) NOT NULL DEFAULT '',
|
||||
CREATE TABLE IF NOT EXISTS `npwd_phone_contacts` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(48) DEFAULT NULL,
|
||||
`avatar` varchar(512) DEFAULT NULL,
|
||||
`number` varchar(12) DEFAULT NULL,
|
||||
`display` varchar(255) NOT NULL DEFAULT '',
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
@@ -20,7 +17,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
|
||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`likes` int NOT NULL DEFAULT '0',
|
||||
`identifier` varchar(40) NOT NULL,
|
||||
`identifier` varchar(48) NOT NULL,
|
||||
`visible` tinyint NOT NULL DEFAULT '1',
|
||||
`images` varchar(1000) DEFAULT '',
|
||||
`retweet` int DEFAULT NULL,
|
||||
@@ -31,9 +28,9 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
|
||||
CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`profile_name` varchar(90) NOT NULL,
|
||||
`identifier` varchar(40) NOT NULL,
|
||||
`identifier` varchar(48) NOT NULL,
|
||||
# Default Profile avatar can be set here
|
||||
`avatar_url` varchar(255) DEFAULT 'https://beta.iodine.gg/QrEvq.png',
|
||||
`avatar_url` varchar(255) DEFAULT 'https://i.file.glass/QrEvq.png',
|
||||
`bio` varchar(512) DEFAULT NULL,
|
||||
`location` varchar(45) DEFAULT NULL,
|
||||
`job` varchar(45) DEFAULT NULL,
|
||||
@@ -57,7 +54,7 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `npwd_match_profiles` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(255) NOT NULL,
|
||||
`identifier` varchar(48) NOT NULL,
|
||||
`name` varchar(90) NOT NULL,
|
||||
`image` varchar(255) NOT NULL,
|
||||
`bio` varchar(512) DEFAULT NULL,
|
||||
@@ -69,11 +66,11 @@ CREATE TABLE IF NOT EXISTS `npwd_match_profiles` (
|
||||
PRIMARY KEY (`id`),
|
||||
UNIQUE KEY `name_UNIQUE` (`name`),
|
||||
UNIQUE KEY `identifier_UNIQUE` (`identifier`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=38 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `npwd_match_views` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(40) NOT NULL,
|
||||
`identifier` varchar(48) NOT NULL,
|
||||
`profile` int NOT NULL,
|
||||
`liked` tinyint DEFAULT '0',
|
||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
@@ -81,34 +78,34 @@ CREATE TABLE IF NOT EXISTS `npwd_match_views` (
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `match_profile_idx` (`profile`),
|
||||
CONSTRAINT `match_profile` FOREIGN KEY (`profile`) REFERENCES `npwd_match_profiles` (`id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=131 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_notes (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
identifier varchar(255) NOT NULL,
|
||||
title varchar(255) NOT NULL,
|
||||
content varchar(255) NOT NULL,
|
||||
CREATE TABLE IF NOT EXISTS `npwd_notes` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(48) NOT NULL,
|
||||
`title` varchar(255) NOT NULL,
|
||||
`content` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_marketplace_listings (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
identifier varchar(255) DEFAULT NULL,
|
||||
username varchar(255) DEFAULT NULL,
|
||||
name varchar(50) DEFAULT NULL,
|
||||
number varchar(255) NOT NULL,
|
||||
title varchar(255) DEFAULT NULL,
|
||||
url varchar(255) DEFAULT NULL,
|
||||
description varchar(255) NOT NULL,
|
||||
createdAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
updatedAt timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
CREATE TABLE IF NOT EXISTS `npwd_marketplace_listings` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(48) DEFAULT NULL,
|
||||
`username` varchar(255) DEFAULT NULL,
|
||||
`name` varchar(50) DEFAULT NULL,
|
||||
`number` varchar(255) NOT NULL,
|
||||
`title` varchar(255) DEFAULT NULL,
|
||||
`url` varchar(255) DEFAULT NULL,
|
||||
`description` varchar(255) NOT NULL,
|
||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_marketplace_reports (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
listing_id int(11) DEFAULT NULL,
|
||||
profile varchar(255) DEFAULT NULL,
|
||||
CREATE TABLE IF NOT EXISTS `npwd_marketplace_reports` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`listing_id` int(11) DEFAULT NULL,
|
||||
`profile` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
@@ -126,30 +123,20 @@ CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` (
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `npwd_messages_groups` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_identifier` varchar(40) NOT NULL,
|
||||
`user_identifier` varchar(48) NOT NULL,
|
||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`group_id` varchar(512) NOT NULL,
|
||||
`participant_identifier` varchar(40) NOT NULL,
|
||||
`participant_identifier` varchar(48) NOT NULL,
|
||||
`label` varchar(60) DEFAULT '',
|
||||
`unreadCount` int(11) NOT NULL DEFAULT 0,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `npwd_messages_labels` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`user_identifier` varchar(40) NOT NULL,
|
||||
`label` varchar(60) NOT NULL,
|
||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
`group_id` varchar(512) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `npwd_messages` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`message` varchar(512) NOT NULL,
|
||||
`user_identifier` varchar(40) NOT NULL,
|
||||
`user_identifier` varchar(48) NOT NULL,
|
||||
`group_id` varchar(512) NOT NULL,
|
||||
`isRead` tinyint NOT NULL DEFAULT '0',
|
||||
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
@@ -158,67 +145,20 @@ CREATE TABLE IF NOT EXISTS `npwd_messages` (
|
||||
PRIMARY KEY (`id`)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_calls (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
identifier varchar(255) DEFAULT NULL,
|
||||
transmitter varchar(255) NOT NULL,
|
||||
receiver varchar(255) NOT NULL,
|
||||
is_accepted tinyint(4) DEFAULT 0,
|
||||
start varchar(255) DEFAULT NULL,
|
||||
CREATE TABLE IF NOT EXISTS `npwd_calls` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(48) DEFAULT NULL,
|
||||
`transmitter` varchar(255) NOT NULL,
|
||||
`receiver` varchar(255) NOT NULL,
|
||||
`is_accepted` tinyint(4) DEFAULT 0,
|
||||
`start` varchar(255) DEFAULT NULL,
|
||||
end varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_phone_gallery (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
identifier varchar(255) DEFAULT NULL,
|
||||
image varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_emails (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
subject varchar(80) NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_emails_messages (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
parent_id int(11) DEFAULT NULL,
|
||||
email_id int(11) NOT NULL,
|
||||
sender varchar(255) NOT NULL,
|
||||
sender_identifier varchar(255),
|
||||
send_date int(11) NOT NULL,
|
||||
body TEXT,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_emails_receivers (
|
||||
id int(12) NOT NULL AUTO_INCREMENT,
|
||||
message_id int(11) NOT NULL,
|
||||
receiver varchar(255) NOT NULL,
|
||||
receiver_identifier varchar(255) NOT NULL,
|
||||
read_at int(11) DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_emails_phone_actions (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
message_id int(11) NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
close_phone int(1) DEFAULT 0,
|
||||
delete_email int(1) DEFAULT 1,
|
||||
href text NOT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS npwd_emails_external_actions (
|
||||
id int(11) NOT NULL AUTO_INCREMENT,
|
||||
message_id int(11) NOT NULL,
|
||||
label varchar(255) NOT NULL,
|
||||
close_phone int(1) DEFAULT 0,
|
||||
delete_email int(1) DEFAULT 1,
|
||||
event_name varchar(255) NOT NULL,
|
||||
event_arg text,
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`identifier` varchar(48) DEFAULT NULL,
|
||||
`image` varchar(255) DEFAULT NULL,
|
||||
PRIMARY KEY (id)
|
||||
);
|
||||
@@ -1,20 +1,29 @@
|
||||
{
|
||||
"name": "npwd",
|
||||
"version": "0.1.0",
|
||||
"description": "A FiveM phone resource, made in React & TypeScript",
|
||||
"repository": "https://github.com/project-error/new-phone-who-dis",
|
||||
"license": "CC-BY-NC-SA-4.0",
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^12.1.1",
|
||||
"@commitlint/config-conventional": "^12.1.1",
|
||||
"@octokit/core": "^3.4.0",
|
||||
"husky": "^5.1.3",
|
||||
"lerna": "^3.22.1",
|
||||
"prettier": "^2.2.1",
|
||||
"pretty-quick": "^3.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "lerna run build --concurrency 1",
|
||||
"build": "lerna run test && lerna run build",
|
||||
"prepare": "husky install",
|
||||
"format": "pretty-quick"
|
||||
"bootstrap": "lerna bootstrap",
|
||||
"format:staged": "pretty-quick --staged",
|
||||
"postinstall": "husky install && yarn bootstrap",
|
||||
"test": "lerna run test"
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "pretty-quick --staged"
|
||||
"pre-commit": "npx run format:staged"
|
||||
}
|
||||
},
|
||||
"dependencies": {}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"presets": [
|
||||
[
|
||||
"@babel/preset-env",
|
||||
{
|
||||
"modules": false
|
||||
}
|
||||
],
|
||||
"@babel/preset-react"
|
||||
],
|
||||
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-syntax-dynamic-import"]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
REACT_APP_VERSION=$npm_package_version
|
||||
@@ -1,3 +1,5 @@
|
||||
const path = require('path');
|
||||
|
||||
const {
|
||||
addAfterLoader,
|
||||
removeLoaders,
|
||||
@@ -52,7 +54,17 @@ module.exports = {
|
||||
|
||||
if (!babelLoaderIsAdded) throwError('failed to add back babel-loader for non-application JS');
|
||||
|
||||
paths.appBuild = webpackConfig.output.path = path.resolve('../resources/html');
|
||||
|
||||
if (webpackConfig.mode === 'development') {
|
||||
webpackConfig.devtool = 'eval-source-map';
|
||||
}
|
||||
|
||||
return webpackConfig;
|
||||
},
|
||||
},
|
||||
devServer: (devServerConfig) => {
|
||||
devServerConfig.writeToDisk = true;
|
||||
return devServerConfig;
|
||||
},
|
||||
};
|
||||
@@ -4,7 +4,7 @@ console.log(args);
|
||||
|
||||
const path = './src/locale/';
|
||||
|
||||
const langs = ['bs', 'no', 'es', 'fr', 'pt', 'ptbr', 'sv', 'tr'];
|
||||
const langs = ['bs', 'no', 'es', 'fr', 'pt', 'ptbr', 'sv', 'tr', "hu"];
|
||||
|
||||
const defaultLang = 'en';
|
||||
|
||||
|
||||
@@ -2,92 +2,57 @@
|
||||
"name": "npwd-nui",
|
||||
"version": "0.1.0",
|
||||
"repository": "https://github.com/project-error/new-phone-who-dis",
|
||||
"private": false,
|
||||
"private": true,
|
||||
"license": "CC-BY-NC-SA-4.0",
|
||||
"homepage": "/resources/html",
|
||||
"dependencies": {
|
||||
"@babel/polyfill": "^7.4.4",
|
||||
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
||||
"@fortawesome/free-brands-svg-icons": "^5.15.1",
|
||||
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
||||
"@fortawesome/react-fontawesome": "^0.1.11",
|
||||
"@material-ui/core": "^4.11.0",
|
||||
"@material-ui/icons": "^4.9.1",
|
||||
"@material-ui/core": "^4.11.3",
|
||||
"@material-ui/icons": "^4.11.2",
|
||||
"@material-ui/lab": "^4.0.0-alpha.56",
|
||||
"@popperjs/core": "^2.5.3",
|
||||
"@sentry/react": "^5.29.2",
|
||||
"@sentry/tracing": "^5.29.2",
|
||||
"core-js": "^3.8.3",
|
||||
"dayjs": "^1.10.4",
|
||||
"dompurify": "^2.2.6",
|
||||
"emoji-mart": "^3.0.0",
|
||||
"emoji-mart": "^3.0.1",
|
||||
"enzyme": "^3.11.0",
|
||||
"enzyme-adapter-react-16": "^1.15.5",
|
||||
"fivem-nui-react-lib": "^2.2.8",
|
||||
"howler": "^2.2.1",
|
||||
"i18next": "^19.7.0",
|
||||
"i18next": "^20.3.4",
|
||||
"jsonschema": "^1.4.0",
|
||||
"parse-url": "^5.0.2",
|
||||
"parse-url": "^5.0.7",
|
||||
"qs": "^6.9.6",
|
||||
"react": "^16.13.1",
|
||||
"react-dom": "^16.13.1",
|
||||
"react-hotkeys": "^2.0.0",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
"react-i18next": "^11.7.1",
|
||||
"react-popper": "^2.2.3",
|
||||
"react-router-dom": "^5.2.0",
|
||||
"react-scripts": "4.0.1",
|
||||
"recoil": "^0.1.2"
|
||||
"react-scripts": "4.0.3",
|
||||
"recoil": "^0.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/cli": "^7.4.4",
|
||||
"@babel/core": "^7.4.5",
|
||||
"@babel/plugin-proposal-class-properties": "^7.4.4",
|
||||
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
|
||||
"@babel/preset-env": "^7.4.5",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@craco/craco": "^6.1.1",
|
||||
"@testing-library/jest-dom": "^4.2.4",
|
||||
"@testing-library/react": "^9.5.0",
|
||||
"@testing-library/user-event": "^7.2.1",
|
||||
"@sentry/integrations": "^6.10.0",
|
||||
"@sentry/webpack-plugin": "^1.16.0",
|
||||
"@sentry/react": "^5.29.2",
|
||||
"@sentry/tracing": "^5.29.2",
|
||||
"@types/enzyme": "^3.10.7",
|
||||
"@types/howler": "^2.2.1",
|
||||
"@types/jest": "^26.0.14",
|
||||
"@types/node": "^14.11.5",
|
||||
"@types/qs": "^6.9.5",
|
||||
"@types/react": "^16.9.51",
|
||||
"@types/react-dom": "^16.9.8",
|
||||
"@types/react-router-dom": "^5.1.7",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-loader": "^8.1.0",
|
||||
"babel-plugin-styled-components": "^1.10.0",
|
||||
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
|
||||
"copy-webpack-plugin": "6.2.1",
|
||||
"cp-cli": "^2.0.0",
|
||||
"cra-build-watch": "^3.2.0",
|
||||
"cross-env": "^7.0.2",
|
||||
"css-loader": "^2.1.1",
|
||||
"customize-cra": "^1.0.0",
|
||||
"file-loader": "^3.0.1",
|
||||
"html-loader": "^0.5.5",
|
||||
"html-webpack-plugin": "^4.3.0",
|
||||
"react-devtools": "^4.10.1",
|
||||
"react-test-renderer": "^16.13.1",
|
||||
"style-loader": "^0.23.1",
|
||||
"svg-url-loader": "^2.3.2",
|
||||
"terser-webpack-plugin": "^1.3.0",
|
||||
"ts-loader": "^8.0.4",
|
||||
"typescript": "3.9.7",
|
||||
"url-loader": "^1.1.2",
|
||||
"webpack-cli": "^3.3.12"
|
||||
"@welldone-software/why-did-you-render": "^6.1.1",
|
||||
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.1",
|
||||
"cross-env": "^7.0.3",
|
||||
"dotenv": "^10.0.0",
|
||||
"ts-loader": "^8.3.0",
|
||||
"typescript": "^4.3.2"
|
||||
},
|
||||
"scripts": {
|
||||
"i18n:missing": "node --experimental-json-modules i18n.missingKeys.js",
|
||||
"copy:config": "cp-cli ../config.json ./src/config.autogen.json",
|
||||
"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": "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"
|
||||
"start": "cross-env PUBLIC_URL=/ craco start",
|
||||
"watch": "cross-env REACT_APP_IN_GAME=1 craco start",
|
||||
"build:release": "cross-env SENTRY_RELEASE=true craco build",
|
||||
"build": "craco build",
|
||||
"test": "craco test --watchAll=false --testMatch **/src/**/*.test.{ts,js,tsx}"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "react-app"
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
customElements.define(
|
||||
'x-frame-bypass',
|
||||
class extends HTMLIFrameElement {
|
||||
static get observedAttributes() {
|
||||
return ['src'];
|
||||
}
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
attributeChangedCallback() {
|
||||
this.load(this.src);
|
||||
}
|
||||
connectedCallback() {
|
||||
this.sandbox =
|
||||
'' + this.sandbox ||
|
||||
'allow-forms allow-modals allow-pointer-lock allow-same-origin allow-scripts allow-top-navigation-by-user-activation'; // all except allow-top-navigation
|
||||
}
|
||||
load(url, options) {
|
||||
if (!url || !url.startsWith('http'))
|
||||
throw new Error(`Unable to load src ${url} does not start with http(s)://`);
|
||||
this.srcdoc = `<html>
|
||||
<head>
|
||||
<style>
|
||||
.loader {
|
||||
position: absolute;
|
||||
top: calc(50% - 25px);
|
||||
left: calc(50% - 25px);
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
background-color: #333;
|
||||
border-radius: 50%;
|
||||
animation: loader 1s infinite ease-in-out;
|
||||
}
|
||||
@keyframes loader {
|
||||
0% {
|
||||
transform: scale(0);
|
||||
}
|
||||
100% {
|
||||
transform: scale(1);
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="loader"></div>
|
||||
</body>
|
||||
</html>`;
|
||||
this.fetchProxy(url, options, 0)
|
||||
.then((res) => res.text())
|
||||
.then((data) => {
|
||||
if (data)
|
||||
this.srcdoc = data.replace(
|
||||
/<head([^>]*)>/i,
|
||||
`<head$1>
|
||||
<base href="${url}">
|
||||
<script>
|
||||
// X-Frame-Bypass navigation event handlers
|
||||
document.addEventListener('click', e => {
|
||||
if (frameElement && document.activeElement && document.activeElement.href) {
|
||||
e.preventDefault()
|
||||
frameElement.load(document.activeElement.href)
|
||||
}
|
||||
})
|
||||
document.addEventListener('submit', e => {
|
||||
if (frameElement && document.activeElement && document.activeElement.form && document.activeElement.form.action) {
|
||||
e.preventDefault()
|
||||
if (document.activeElement.form.method === 'post')
|
||||
frameElement.load(document.activeElement.form.action, {method: 'post', body: new FormData(document.activeElement.form)})
|
||||
else
|
||||
frameElement.load(document.activeElement.form.action + '?' + new URLSearchParams(new FormData(document.activeElement.form)))
|
||||
}
|
||||
})
|
||||
</script>`,
|
||||
);
|
||||
})
|
||||
.catch((e) => console.error('Unable to load proxy iframe service', e));
|
||||
}
|
||||
fetchProxy(url, options, i) {
|
||||
const proxies = (options || {}).proxies || [
|
||||
'https://cors-anywhere.herokuapp.com/',
|
||||
'https://api.codetabs.com/v1/proxy/?quest=',
|
||||
];
|
||||
return fetch(proxies[i] + url, options)
|
||||
.then((res) => {
|
||||
if (!res.ok) throw new Error(`${res.status} ${res.statusText}`);
|
||||
return res;
|
||||
})
|
||||
.catch((error) => {
|
||||
if (i === proxies.length - 1) throw error;
|
||||
return this.fetchProxy(url, options, i + 1);
|
||||
});
|
||||
}
|
||||
},
|
||||
{ extends: 'iframe' },
|
||||
);
|
||||
@@ -8,6 +8,8 @@
|
||||
/>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<!-- Enable experimental proxy custom iframe webcomp -->
|
||||
<!-- <script type="module" src="./iframe.webcomp.js"></script>-->
|
||||
<title>Project Error - New Phone Who Dis</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
After Width: | Height: | Size: 24 KiB |
@@ -1 +0,0 @@
|
||||
<?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
|
||||
|
Before Width: | Height: | Size: 8.3 KiB |
@@ -1 +0,0 @@
|
||||
<?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
|
||||
|
Before Width: | Height: | Size: 5.0 KiB |
@@ -1 +0,0 @@
|
||||
<?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>
|
||||
|
Before Width: | Height: | Size: 4.7 KiB |
@@ -1 +0,0 @@
|
||||
<?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
|
||||
|
Before Width: | Height: | Size: 6.3 KiB |
@@ -1 +0,0 @@
|
||||
<?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>
|
||||
|
Before Width: | Height: | Size: 3.7 KiB |
@@ -1 +0,0 @@
|
||||
<?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
|
||||
|
Before Width: | Height: | Size: 9.9 KiB |
@@ -1 +0,0 @@
|
||||
<?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
|
||||
|
Before Width: | Height: | Size: 6.5 KiB |
@@ -1 +0,0 @@
|
||||
<?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
|
||||
|
Before Width: | Height: | Size: 6.7 KiB |
@@ -1 +0,0 @@
|
||||
<?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
|
||||
|
Before Width: | Height: | Size: 11 KiB |
@@ -1 +0,0 @@
|
||||
<?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>
|
||||
|
Before Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 39 KiB |
@@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import { RecoilRoot } from 'recoil';
|
||||
import { shallow } from 'enzyme';
|
||||
import Phone from './Phone';
|
||||
import { PhoneProviders } from './PhoneProviders';
|
||||
|
||||
it('renders Phone', () => {
|
||||
shallow(
|
||||
<RecoilRoot>
|
||||
<Phone />
|
||||
<PhoneProviders />
|
||||
</RecoilRoot>,
|
||||
);
|
||||
});
|
||||
@@ -4,36 +4,33 @@ import './i18n';
|
||||
import { Route } from 'react-router-dom';
|
||||
import { CallModal } from './os/call/components/CallModal';
|
||||
import { HomeApp } from './apps/home/components/Home';
|
||||
import { Box, Paper, Slide, Typography } from '@material-ui/core';
|
||||
import { useKeyboardService } from './os/keyboard/hooks/useKeyboardService';
|
||||
import { NotificationBar } from './os/notifications/components/NotificationBar';
|
||||
import { Navigation } from './os/navigation-bar/components/Navigation';
|
||||
import { useNuiService } from './os/nui-events/hooks/useNuiService';
|
||||
import { useSimcardService } from './os/simcard/hooks/useSimcardService';
|
||||
import { usePhoneService } from './os/phone/hooks/usePhoneService';
|
||||
import { useApps } from './os/apps/hooks/useApps';
|
||||
|
||||
import { useContactsService } from './apps/contacts/hooks/useContactsService';
|
||||
import { useTwitterService } from './apps/twitter/hooks/useTwitterService';
|
||||
import { useMatchService } from './apps/match/hooks/useMatchService';
|
||||
import { 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 { 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';
|
||||
import { usePhoneVisibility } from './os/phone/hooks/usePhoneVisibility';
|
||||
import { PhoneSnackbar } from './ui/components/PhoneSnackbar';
|
||||
import { NotificationAlert } from './os/notifications/components/NotificationAlert';
|
||||
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';
|
||||
import { PhoneEvents } from '../../typings/phone';
|
||||
import { useKeyboardService } from './os/keyboard/hooks/useKeyboardService';
|
||||
import PhoneWrapper from './PhoneWrapper';
|
||||
|
||||
import dayjs from 'dayjs';
|
||||
import DefaultConfig from '../../config.json';
|
||||
import { TopLevelErrorComponent } from './ui/components/TopLevelErrorComponent';
|
||||
import { useConfig } from './os/phone/hooks/useConfig';
|
||||
|
||||
function Phone() {
|
||||
const { t, i18n } = useTranslation();
|
||||
@@ -62,104 +59,66 @@ function Phone() {
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
useNuiService();
|
||||
useConfig();
|
||||
|
||||
useKeyboardService();
|
||||
usePhoneService();
|
||||
useSimcardService();
|
||||
useContactsService();
|
||||
useTwitterService();
|
||||
useMatchService();
|
||||
useMarketplaceService();
|
||||
useBankService();
|
||||
useMessagesService();
|
||||
useNotesService();
|
||||
usePhotoService();
|
||||
/*usePhotoService();*/
|
||||
useCallService();
|
||||
useDialService();
|
||||
useEmailService();
|
||||
|
||||
const { modal: callModal } = useCallModal();
|
||||
const { bottom, visibility } = usePhoneVisibility();
|
||||
const { isPhoneReady } = usePhone();
|
||||
|
||||
return (
|
||||
<div>
|
||||
<WindowSnackbar />
|
||||
<Slide direction="up" timeout={{ enter: 500, exit: 500 }} in={visibility}>
|
||||
<div className="PhoneWrapper">
|
||||
<div
|
||||
className="Phone"
|
||||
style={{
|
||||
position: 'fixed',
|
||||
transformOrigin: 'right bottom',
|
||||
transform: `scale(${settings.zoom.value}`,
|
||||
bottom,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="PhoneFrame"
|
||||
style={{
|
||||
backgroundImage: `url(media/frames/${settings.frame.value})`,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
id="phone"
|
||||
className="PhoneScreen"
|
||||
style={{
|
||||
backgroundImage: `url(media/backgrounds/${settings.wallpaper.value})`,
|
||||
}}
|
||||
>
|
||||
{isPhoneReady ? (
|
||||
<>
|
||||
<NotificationBar />
|
||||
<div className="PhoneAppContainer">
|
||||
<>
|
||||
<Route exact path="/" component={HomeApp} />
|
||||
{callModal && <Route exact path="/call" component={CallModal} />}
|
||||
{apps.map((App) => (
|
||||
<App.Route key={App.id} />
|
||||
))}
|
||||
</>
|
||||
<NotificationAlert />
|
||||
<PhoneSnackbar />
|
||||
</div>
|
||||
<Navigation />
|
||||
</>
|
||||
) : (
|
||||
<Box
|
||||
component={Paper}
|
||||
height="100%"
|
||||
width="100%"
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
>
|
||||
<Typography paragraph variant="h6">
|
||||
NPWD {t('INITIALIZING')}
|
||||
</Typography>
|
||||
<Typography paragraph>{t('GENERIC_WAIT')}</Typography>
|
||||
</Box>
|
||||
)}
|
||||
</div>
|
||||
<TopLevelErrorComponent>
|
||||
<WindowSnackbar />
|
||||
<PhoneWrapper>
|
||||
<NotificationBar />
|
||||
<div className="PhoneAppContainer">
|
||||
<>
|
||||
<Route exact path="/" component={HomeApp} />
|
||||
{callModal && <Route exact path="/call" component={CallModal} />}
|
||||
{apps.map((App) => (
|
||||
<App.Route key={App.id} />
|
||||
))}
|
||||
</>
|
||||
<NotificationAlert />
|
||||
<PhoneSnackbar />
|
||||
</div>
|
||||
</div>
|
||||
</Slide>
|
||||
<Navigation />
|
||||
</PhoneWrapper>
|
||||
</TopLevelErrorComponent>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default Phone;
|
||||
|
||||
InjectDebugData([
|
||||
InjectDebugData<any>([
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: 'setVisibility',
|
||||
method: PhoneEvents.SET_VISIBILITY,
|
||||
data: true,
|
||||
},
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: 'setPhoneReady',
|
||||
method: PhoneEvents.SET_PHONE_READY,
|
||||
data: true,
|
||||
},
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: PhoneEvents.SET_TIME,
|
||||
data: dayjs().format('hh:mm'),
|
||||
},
|
||||
{
|
||||
app: 'PHONE',
|
||||
method: PhoneEvents.SET_CONFIG,
|
||||
data: DefaultConfig,
|
||||
},
|
||||
]);
|
||||
@@ -4,19 +4,22 @@ import { NotificationsProvider } from './os/notifications/providers/Notification
|
||||
import { usePhoneTheme } from './os/phone/hooks/usePhoneTheme';
|
||||
import SnackbarProvider from './ui/providers/SnackbarProvider';
|
||||
import Phone from './Phone';
|
||||
import { NuiProvider } from 'fivem-nui-react-lib';
|
||||
import { SoundProvider } from './os/sound/providers/SoundProvider';
|
||||
|
||||
export const PhoneContainer = () => {
|
||||
export const PhoneProviders = () => {
|
||||
const currentTheme = usePhoneTheme();
|
||||
return (
|
||||
<ThemeProvider theme={currentTheme}>
|
||||
<SoundProvider>
|
||||
<NotificationsProvider>
|
||||
<SnackbarProvider>
|
||||
<Phone />
|
||||
</SnackbarProvider>
|
||||
</NotificationsProvider>
|
||||
</SoundProvider>
|
||||
</ThemeProvider>
|
||||
<NuiProvider resource="npwd">
|
||||
<ThemeProvider theme={currentTheme}>
|
||||
<SoundProvider>
|
||||
<NotificationsProvider>
|
||||
<SnackbarProvider>
|
||||
<Phone />
|
||||
</SnackbarProvider>
|
||||
</NotificationsProvider>
|
||||
</SoundProvider>
|
||||
</ThemeProvider>
|
||||
</NuiProvider>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
import React from 'react';
|
||||
import { isDefaultWallpaper } from './apps/settings/utils/isDefaultWallpaper';
|
||||
import { useSettings } from './apps/settings/hooks/useSettings';
|
||||
import { usePhoneVisibility } from './os/phone/hooks/usePhoneVisibility';
|
||||
import { Slide } from '@material-ui/core';
|
||||
|
||||
const PhoneWrapper: React.FC = ({ children }) => {
|
||||
const [settings] = useSettings();
|
||||
const { bottom, visibility } = usePhoneVisibility();
|
||||
|
||||
return (
|
||||
<Slide direction="up" timeout={{ enter: 500, exit: 500 }} in={visibility}>
|
||||
<div className="PhoneWrapper">
|
||||
<div
|
||||
className="Phone"
|
||||
style={{
|
||||
position: 'fixed',
|
||||
transformOrigin: 'right bottom',
|
||||
transform: `scale(${settings.zoom.value}`,
|
||||
bottom,
|
||||
}}
|
||||
>
|
||||
<div
|
||||
className="PhoneFrame"
|
||||
style={{
|
||||
backgroundImage: `url(media/frames/${settings.frame.value})`,
|
||||
}}
|
||||
/>
|
||||
<div
|
||||
id="phone"
|
||||
className="PhoneScreen"
|
||||
style={{
|
||||
backgroundImage: !isDefaultWallpaper(settings.wallpaper.value)
|
||||
? `url(${settings.wallpaper.value})`
|
||||
: `url(media/backgrounds/${settings.wallpaper.value})`,
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Slide>
|
||||
);
|
||||
};
|
||||
|
||||
export default PhoneWrapper;
|
||||
@@ -3,8 +3,7 @@ import React, { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faHome, faList, faMoneyCheck } from '@fortawesome/free-solid-svg-icons';
|
||||
import { Home, List, Payment } from '@material-ui/icons';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
@@ -30,21 +29,9 @@ export const NavigationBar = () => {
|
||||
showLabels
|
||||
className={classes.root}
|
||||
>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to="/bank"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faMoneyCheck} />}
|
||||
to="/bank/account"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faList} />}
|
||||
to="/bank/transactions"
|
||||
/>
|
||||
<BottomNavigationAction component={Link} icon={<Home />} to="/bank" />
|
||||
<BottomNavigationAction component={Link} icon={<Payment />} to="/bank/account" />
|
||||
<BottomNavigationAction component={Link} icon={<List />} to="/bank/transactions" />
|
||||
</BottomNavigation>
|
||||
);
|
||||
};
|
||||
@@ -49,16 +49,6 @@ export const TransactionList = () => {
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
<TablePagination
|
||||
rowsPerPageOptions={[3, 5]}
|
||||
className={classes.pagination}
|
||||
component="div"
|
||||
count={transactionList.length}
|
||||
rowsPerPage={rowsPerPage}
|
||||
page={page}
|
||||
onChangePage={handleChangePage}
|
||||
onChangeRowsPerPage={handleChangeRowsPerPage}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import React, { useState } from 'react';
|
||||
import Modal from '../../../../ui/components/Modal';
|
||||
import { Button, List, ListItem, TextField, makeStyles } from '@material-ui/core';
|
||||
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
|
||||
import { Button, List, ListItem, makeStyles } from '@material-ui/core';
|
||||
import { useBankModal } from '../../hooks/useBankModal';
|
||||
import { BankEvents } from '../../../../../../typings/bank';
|
||||
import { useNuiRequest } from 'fivem-nui-react-lib';
|
||||
import { TextField } from '../../../../ui/components/Input';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
input: {
|
||||
@@ -30,6 +29,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
}));
|
||||
|
||||
export const TransferModal = () => {
|
||||
const Nui = useNuiRequest();
|
||||
const classes = useStyles();
|
||||
|
||||
const [targetID, setTargetID] = useState('');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { useNuiEvent } from 'fivem-nui-react-lib';
|
||||
import { bankState } from './state';
|
||||
import { useTransactions } from './useTransactions';
|
||||
import { useCredentials } from './useCredentials';
|
||||
@@ -7,7 +7,6 @@ import { useBankNotification } from './useBankNotification';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { BankEvents } from '../../../../../typings/bank';
|
||||
import { PhoneEvents } from '../../../../../typings/phone';
|
||||
|
||||
export const useBankService = () => {
|
||||
const setTransaction = useSetRecoilState(bankState.transactions);
|
||||
|
||||
@@ -0,0 +1,108 @@
|
||||
import { AppWrapper } from '../../../ui/components';
|
||||
import React, { Reducer, useReducer, useRef } from 'react';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import { Box, makeStyles } from '@material-ui/core';
|
||||
import { BrowserURLBar } from './BrowserURLBar';
|
||||
import { promiseTimeout } from '../../../utils/promiseTimeout';
|
||||
import { usePhoneConfig } from '../../../config/hooks/usePhoneConfig';
|
||||
|
||||
const useStyles = makeStyles(() => ({
|
||||
iframe: {
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
zoom: 0.5,
|
||||
border: 'none',
|
||||
},
|
||||
root: {
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
},
|
||||
}));
|
||||
|
||||
interface BrowserState {
|
||||
browserUrl: string;
|
||||
browserHistory: string[];
|
||||
}
|
||||
|
||||
interface ReducerAction {
|
||||
payload: any;
|
||||
type: ReducerActionsType;
|
||||
}
|
||||
|
||||
enum ReducerActionsType {
|
||||
SET_URL,
|
||||
ADD_HISTORY,
|
||||
RELOAD,
|
||||
}
|
||||
|
||||
const browserReducer: Reducer<BrowserState, ReducerAction> = (state, action) => {
|
||||
switch (action.type) {
|
||||
case ReducerActionsType.ADD_HISTORY:
|
||||
if (action.payload === 'about:blank') return state;
|
||||
return { ...state, browserHistory: state.browserHistory.concat(action.payload) };
|
||||
case ReducerActionsType.SET_URL:
|
||||
return { ...state, browserUrl: action.payload };
|
||||
default:
|
||||
throw new Error('Invalid reducer action type');
|
||||
}
|
||||
};
|
||||
|
||||
export const BrowserApp: React.FC = () => {
|
||||
const classes = useStyles();
|
||||
const [{ appSettings }] = usePhoneConfig();
|
||||
const [browserState, dispatch] = useReducer(browserReducer, {
|
||||
browserUrl: appSettings.browserHomePage,
|
||||
browserHistory: [appSettings.browserHomePage],
|
||||
});
|
||||
|
||||
const { browserHistory, browserUrl } = browserState;
|
||||
|
||||
const iframeRef = useRef<HTMLIFrameElement | null>(null);
|
||||
const _setBrowserUrl = (newUrl: string) => {
|
||||
const formattedUrl = newUrl.match(/^(http|https):\/\//) ? newUrl : 'https://' + newUrl;
|
||||
dispatch({ payload: browserUrl, type: ReducerActionsType.ADD_HISTORY });
|
||||
dispatch({ payload: formattedUrl, type: ReducerActionsType.SET_URL });
|
||||
};
|
||||
|
||||
const handleGoBack = () => {
|
||||
if (browserHistory.length <= 1) return;
|
||||
// Get last page from history
|
||||
const lastPage = browserHistory[browserHistory.length - 1];
|
||||
|
||||
// Bail if last page is same as current
|
||||
if (lastPage === browserUrl) return;
|
||||
_setBrowserUrl(lastPage);
|
||||
};
|
||||
|
||||
const reloadPage = async () => {
|
||||
const strCopy = browserUrl.slice();
|
||||
dispatch({ payload: 'about:blank', type: ReducerActionsType.SET_URL });
|
||||
await promiseTimeout(100);
|
||||
dispatch({ payload: strCopy, type: ReducerActionsType.SET_URL });
|
||||
};
|
||||
|
||||
return (
|
||||
<AppWrapper id="browser">
|
||||
<AppContent className={classes.root}>
|
||||
<BrowserURLBar
|
||||
browserUrl={browserUrl}
|
||||
browserHasHistory={browserHistory.length > 1}
|
||||
setBrowser={_setBrowserUrl}
|
||||
goBack={handleGoBack}
|
||||
reloadPage={reloadPage}
|
||||
/>
|
||||
<Box flexGrow={1}>
|
||||
<iframe
|
||||
is="x-frame-bypass"
|
||||
src={browserUrl}
|
||||
// @ts-ignore
|
||||
className={classes.iframe}
|
||||
title="npwd-browser"
|
||||
ref={iframeRef}
|
||||
/>
|
||||
</Box>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
);
|
||||
};
|
||||
@@ -0,0 +1,92 @@
|
||||
import React, { FocusEventHandler, useRef, useState } from 'react';
|
||||
import { makeStyles, Theme, Box, IconButton } from '@material-ui/core';
|
||||
import { Cached, KeyboardArrowLeft } from '@material-ui/icons';
|
||||
import { InputBase } from '../../../ui/components/Input';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
urlInput: {
|
||||
borderRadius: 18,
|
||||
borderWidth: 1,
|
||||
borderStyle: 'solid',
|
||||
paddingRight: 10,
|
||||
paddingLeft: 10,
|
||||
marginLeft: 5,
|
||||
borderColor: '#787878FF',
|
||||
color: '#909090',
|
||||
transition: 'color 0.1s ease',
|
||||
},
|
||||
urlInputFocused: {
|
||||
color: '#fff',
|
||||
},
|
||||
root: {},
|
||||
}));
|
||||
|
||||
interface BrowserControlsProps {
|
||||
setBrowser: (url: string) => void;
|
||||
browserUrl: string;
|
||||
reloadPage: () => void;
|
||||
browserHasHistory: boolean;
|
||||
goBack: () => void;
|
||||
}
|
||||
|
||||
export const BrowserURLBar: React.FC<BrowserControlsProps> = ({
|
||||
goBack,
|
||||
reloadPage,
|
||||
browserHasHistory,
|
||||
browserUrl,
|
||||
setBrowser,
|
||||
}) => {
|
||||
const classes = useStyles();
|
||||
const inputRef = useRef<HTMLInputElement>(null);
|
||||
const [inputState, setInputState] = useState('');
|
||||
const [isFocused, setFocus] = useState(false);
|
||||
|
||||
const handleFocus: FocusEventHandler = (e) => {
|
||||
setInputState(browserUrl);
|
||||
setFocus(true);
|
||||
};
|
||||
|
||||
const handleFocusOut: FocusEventHandler = (e) => {
|
||||
setFocus(false);
|
||||
setInputState(browserUrl);
|
||||
};
|
||||
|
||||
const handleChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
|
||||
setInputState(e.target.value);
|
||||
};
|
||||
|
||||
const onEnter: React.KeyboardEventHandler<HTMLInputElement> = (e) => {
|
||||
if ((e as any).code !== 'Enter') return;
|
||||
setBrowser(inputState);
|
||||
e.currentTarget.blur();
|
||||
};
|
||||
|
||||
const styledUrl = browserUrl.replace(/(^\w+:|^)\/\//, '');
|
||||
|
||||
const transformedUrl = isFocused ? inputState : styledUrl;
|
||||
|
||||
return (
|
||||
<Box display="flex" py={1} className={classes.root} px={1}>
|
||||
<IconButton size="small" onClick={() => reloadPage()}>
|
||||
<Cached />
|
||||
</IconButton>
|
||||
{browserHasHistory && (
|
||||
<IconButton size="small" onClick={() => goBack()}>
|
||||
<KeyboardArrowLeft />
|
||||
</IconButton>
|
||||
)}
|
||||
<InputBase
|
||||
className={classes.urlInput}
|
||||
ref={inputRef}
|
||||
fullWidth
|
||||
onChange={handleChange}
|
||||
onKeyDown={onEnter}
|
||||
value={transformedUrl}
|
||||
classes={{ focused: classes.urlInputFocused }}
|
||||
onFocus={handleFocus}
|
||||
spellCheck={false}
|
||||
onBlur={handleFocusOut}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
@@ -3,37 +3,20 @@ import { AppWrapper } from '../../../ui/components';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import { GalleryGrid } from './grid/GalleryGrid';
|
||||
import { GalleryModal } from './modal/GalleryModal';
|
||||
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||
import { Route, Switch } from 'react-router-dom';
|
||||
import { LoadingSpinner } from '../../../ui/components/LoadingSpinner';
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'CAMERA',
|
||||
method: 'setPhotos',
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
image: 'https://beta.iodine.gg/noDcb.jpeg',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
image: 'https://beta.iodine.gg/teUcY.jpeg',
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
|
||||
const CameraApp = () => {
|
||||
return (
|
||||
<AppWrapper id="camera-app">
|
||||
<AppContent>
|
||||
<Switch>
|
||||
const CameraApp: React.FC = () => (
|
||||
<AppWrapper id="camera-app">
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<React.Suspense fallback={<LoadingSpinner />}>
|
||||
<Route path="/camera" exact component={GalleryGrid} />
|
||||
<Route path="/camera/image" exact component={GalleryModal} />
|
||||
</Switch>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
);
|
||||
};
|
||||
</React.Suspense>
|
||||
</Switch>
|
||||
</AppContent>
|
||||
</AppWrapper>
|
||||
);
|
||||
|
||||
export default CameraApp;
|
||||
@@ -1,37 +1,55 @@
|
||||
import React from 'react';
|
||||
import { Box, Button } from '@material-ui/core';
|
||||
import React, { useState } from 'react';
|
||||
import { Box, Button, CircularProgress } from '@material-ui/core';
|
||||
import useStyles from './grid.styles';
|
||||
import { usePhotos } from '../../hooks/usePhotos';
|
||||
import AddIcon from '@material-ui/icons/Add';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
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';
|
||||
import { fetchNui } from '../../../../utils/fetchNui';
|
||||
import { ServerPromiseResp } from '../../../../../../typings/common';
|
||||
import { GalleryPhoto, PhotoEvents } from '../../../../../../typings/photo';
|
||||
import { usePhotoActions } from '../../hooks/usePhotoActions';
|
||||
import { usePhotosValue } from '../../hooks/state';
|
||||
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const GalleryGrid = () => {
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
const query = useQueryParams();
|
||||
const { addAlert } = useSnackbar();
|
||||
const { t } = useTranslation();
|
||||
const photos = usePhotosValue();
|
||||
const { takePhoto } = usePhotoActions();
|
||||
const [isLoading, setIsLoading] = useState<boolean>(false);
|
||||
|
||||
const referal = query.referal ? decodeURIComponent(query.referal) : '/camera/image';
|
||||
|
||||
const photos = usePhotos();
|
||||
|
||||
const handleCamera = () => {
|
||||
Nui.send(PhotoEvents.TAKE_PHOTO, {});
|
||||
};
|
||||
|
||||
const handlePhotoOpen = (photo) => {
|
||||
history.push(addQueryToLocation(getLocationFromUrl(referal), 'image', photo.image));
|
||||
};
|
||||
|
||||
const handleTakePhoto = () => {
|
||||
setIsLoading(true);
|
||||
fetchNui<ServerPromiseResp<GalleryPhoto>>(PhotoEvents.TAKE_PHOTO).then((serverResp) => {
|
||||
if (serverResp.status !== 'ok') {
|
||||
return addAlert({
|
||||
message: t('APPS_CAMERA_FAILED_TO_TAKE_PHOTO'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
takePhoto(serverResp.data);
|
||||
setIsLoading(false);
|
||||
});
|
||||
};
|
||||
|
||||
if (!photos)
|
||||
return (
|
||||
<Box display="flex" flexWrap="wrap" alignContent="flex-start" className={classes.root}>
|
||||
<Box>
|
||||
<Button onClick={handleCamera} style={{ borderRadius: 0 }} className={classes.photo}>
|
||||
<Button onClick={takePhoto} style={{ borderRadius: 0 }} className={classes.photo}>
|
||||
<AddIcon fontSize="large" />
|
||||
</Button>
|
||||
</Box>
|
||||
@@ -42,8 +60,13 @@ export const GalleryGrid = () => {
|
||||
<div>
|
||||
<Box display="flex" flexWrap="wrap" alignContent="flex-start" className={classes.root}>
|
||||
<Box>
|
||||
<Button onClick={handleCamera} style={{ borderRadius: 0 }} className={classes.photo}>
|
||||
<AddIcon fontSize="large" />
|
||||
<Button
|
||||
disabled={isLoading}
|
||||
onClick={handleTakePhoto}
|
||||
style={{ borderRadius: 0 }}
|
||||
className={classes.photo}
|
||||
>
|
||||
{!isLoading ? <AddIcon fontSize="large" /> : <CircularProgress />}
|
||||
</Button>
|
||||
</Box>
|
||||
{photos.map((photo) => (
|
||||
|
||||
@@ -4,23 +4,30 @@ import { Button, Paper } from '@material-ui/core';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
import DeleteIcon from '@material-ui/icons/Delete';
|
||||
import ShareIcon from '@material-ui/icons/Share';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
|
||||
import { ICameraPhoto } from '../../hooks/usePhotos';
|
||||
import { ShareModal } from './ShareModal';
|
||||
import { PhotoEvents } from '../../../../../../typings/photo';
|
||||
import { GalleryPhoto, PhotoEvents } from '../../../../../../typings/photo';
|
||||
import { usePhotoActions } from '../../hooks/usePhotoActions';
|
||||
import { fetchNui } from '../../../../utils/fetchNui';
|
||||
import { ServerPromiseResp } from '../../../../../../typings/common';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
|
||||
|
||||
export const GalleryModal = () => {
|
||||
const [shareOpen, setShareOpen] = useState(null);
|
||||
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
const query = useQueryParams();
|
||||
const { deletePhoto } = usePhotoActions();
|
||||
const { addAlert } = useSnackbar();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const referal = query.referal || '/camera';
|
||||
|
||||
const [shareOpen, setShareOpen] = useState(null);
|
||||
|
||||
const meta: ICameraPhoto = useMemo(
|
||||
() => ({ id: query.id as string, image: query.image as string }),
|
||||
const meta: GalleryPhoto = useMemo(
|
||||
() => ({ id: parseInt(query.id), image: query.image as string }),
|
||||
[query],
|
||||
);
|
||||
|
||||
@@ -29,10 +36,17 @@ export const GalleryModal = () => {
|
||||
};
|
||||
|
||||
const handleDeletePhoto = () => {
|
||||
Nui.send(PhotoEvents.DELETE_PHOTO, {
|
||||
fetchNui<ServerPromiseResp<GalleryPhoto>>(PhotoEvents.DELETE_PHOTO, {
|
||||
image: meta.image,
|
||||
}).then((serverResp) => {
|
||||
if (serverResp.status !== 'ok') {
|
||||
return addAlert({ message: t('APPS_CAMERA_FAILED_TO_DELETE_PHOTO'), type: 'error' });
|
||||
}
|
||||
|
||||
deletePhoto(meta.image);
|
||||
|
||||
history.push(referal);
|
||||
});
|
||||
history.push(referal);
|
||||
};
|
||||
|
||||
const handleSharePhoto = useCallback(() => {
|
||||
|
||||
@@ -5,11 +5,11 @@ import MessageIcon from '@material-ui/icons/Message';
|
||||
import { setClipboard } from '../../../../os/phone/hooks/useClipboard';
|
||||
|
||||
import useStyles from './modal.styles';
|
||||
import { ICameraPhoto } from '../../hooks/usePhotos';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { GalleryPhoto } from '../../../../../../typings/photo';
|
||||
|
||||
interface IShareModalProps {
|
||||
meta: ICameraPhoto;
|
||||
meta: GalleryPhoto;
|
||||
referal: string;
|
||||
onClose(): void;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,33 @@
|
||||
import { atom } from 'recoil';
|
||||
import { atom, selector, useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
import { ServerPromiseResp } from '../../../../../typings/common';
|
||||
import { GalleryPhoto, PhotoEvents } from '../../../../../typings/photo';
|
||||
import { fetchNui } from '../../../utils/fetchNui';
|
||||
import LogDebugEvent from '../../../os/debug/LogDebugEvents';
|
||||
import { isEnvBrowser } from '../../../utils/misc';
|
||||
import { MockPhotoData } from '../utils/constants';
|
||||
|
||||
export const photoState = {
|
||||
photos: atom({
|
||||
photos: atom<GalleryPhoto[]>({
|
||||
key: 'galleryPhotos',
|
||||
default: null,
|
||||
default: selector({
|
||||
key: 'defaultGalleryPhotos',
|
||||
get: async () => {
|
||||
try {
|
||||
const resp = await fetchNui<ServerPromiseResp<GalleryPhoto[]>>(PhotoEvents.FETCH_PHOTOS);
|
||||
LogDebugEvent({ action: 'PhotosFetched', data: resp.data });
|
||||
return resp.data;
|
||||
} catch (e) {
|
||||
if (isEnvBrowser()) {
|
||||
return MockPhotoData;
|
||||
}
|
||||
console.error(e);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
}),
|
||||
}),
|
||||
};
|
||||
|
||||
export const useSetPhotos = () => useSetRecoilState(photoState.photos);
|
||||
export const usePhotos = () => useRecoilState(photoState.photos);
|
||||
export const usePhotosValue = () => useRecoilValue(photoState.photos);
|
||||
@@ -0,0 +1,61 @@
|
||||
import { useCallback, useState } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { SetterOrUpdater, useRecoilState } from 'recoil';
|
||||
import { GalleryPhoto, PhotoEvents } from '../../../../../typings/photo';
|
||||
import { useNuiEvent, useNuiCallback } from 'fivem-nui-react-lib/';
|
||||
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { photoState } from './state';
|
||||
|
||||
interface IUseCamera {
|
||||
photos: GalleryPhoto[];
|
||||
setPhotos: SetterOrUpdater<GalleryPhoto[]>;
|
||||
takePhoto: () => void;
|
||||
isLoading: boolean;
|
||||
}
|
||||
|
||||
export const useCamera = (): IUseCamera => {
|
||||
const { t } = useTranslation();
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
const [photos, setPhotos] = useRecoilState<GalleryPhoto[]>(photoState.photos);
|
||||
|
||||
const [isUploading, setUploading] = useState(false);
|
||||
|
||||
const onPhotoSuccess = useCallback(
|
||||
(photo) => {
|
||||
setUploading(false);
|
||||
if (!photo?.image) return;
|
||||
setPhotos((curr) => [photo, ...curr]);
|
||||
},
|
||||
[setPhotos],
|
||||
);
|
||||
|
||||
const onPhotoError = useCallback(
|
||||
(i18nKey) => {
|
||||
setUploading(false);
|
||||
addAlert({ type: 'error', message: t(i18nKey) });
|
||||
},
|
||||
[addAlert, t],
|
||||
);
|
||||
|
||||
const [_takePhoto] = useNuiCallback<void, GalleryPhoto>(
|
||||
'CAMERA',
|
||||
PhotoEvents.TAKE_PHOTO,
|
||||
onPhotoSuccess,
|
||||
onPhotoError,
|
||||
);
|
||||
|
||||
useNuiEvent('CAMERA', PhotoEvents.UPLOAD_PHOTO, () => setUploading(true));
|
||||
|
||||
const takePhoto = () => {
|
||||
// Timeout at 1 minute
|
||||
_takePhoto(undefined, { timeout: 60000 });
|
||||
};
|
||||
|
||||
return {
|
||||
photos,
|
||||
setPhotos,
|
||||
takePhoto,
|
||||
isLoading: isUploading,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
import { useSetPhotos } from './state';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
export const usePhotoActions = () => {
|
||||
const setPhotos = useSetPhotos();
|
||||
|
||||
const takePhoto = useCallback(
|
||||
(photo) => {
|
||||
setPhotos((curPhotos) => [photo, ...curPhotos]);
|
||||
},
|
||||
[setPhotos],
|
||||
);
|
||||
|
||||
const deletePhoto = useCallback(
|
||||
(image: string) => {
|
||||
setPhotos((curPhotos) => [...curPhotos].filter((meta) => meta.image !== image));
|
||||
},
|
||||
[setPhotos],
|
||||
);
|
||||
|
||||
return { takePhoto, deletePhoto };
|
||||
};
|
||||
@@ -1,8 +0,0 @@
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { photoState } from './state';
|
||||
|
||||
export const usePhotoService = () => {
|
||||
const setPhotos = useSetRecoilState(photoState.photos);
|
||||
useNuiEvent('CAMERA', 'setPhotos', setPhotos);
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { photoState } from './state';
|
||||
|
||||
export interface ICameraPhoto {
|
||||
id: string;
|
||||
image: string;
|
||||
}
|
||||
|
||||
export const usePhotos = (): ICameraPhoto[] | null => {
|
||||
return useRecoilValue<ICameraPhoto[] | null>(photoState.photos);
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
export const MockPhotoData = [
|
||||
{
|
||||
id: 1,
|
||||
image: 'https://beta.iodine.gg/noDcb.jpeg',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
image: 'https://beta.iodine.gg/teUcY.jpeg',
|
||||
},
|
||||
];
|
||||
@@ -3,55 +3,47 @@ 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 { Route } from 'react-router-dom';
|
||||
|
||||
import ContactsInfoPage from './views/ContactInfo';
|
||||
import { ContactPage } from './views/ContactsPage';
|
||||
import { ContactsThemeProvider } from '../providers/ContactsThemeProvider';
|
||||
import PersonAddIcon from '@material-ui/icons/PersonAdd';
|
||||
import Fab from '@material-ui/core/Fab';
|
||||
import { useHistory } from 'react-router';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import { LoadingSpinner } from '../../../ui/components/LoadingSpinner';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
absolute: {
|
||||
position: 'absolute',
|
||||
right: theme.spacing(3),
|
||||
bottom: theme.spacing(2),
|
||||
},
|
||||
}));
|
||||
|
||||
export const ContactsApp = () => {
|
||||
const contacts = useApp('CONTACTS');
|
||||
const history = useHistory();
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<ContactsThemeProvider>
|
||||
<AppWrapper id="contact-app">
|
||||
<AppTitle app={contacts} />
|
||||
<AppContent>
|
||||
<Route path="/contacts/" exact component={ContactPage} />
|
||||
<Route path="/contacts/:id" exact component={ContactsInfoPage} />
|
||||
<React.Suspense fallback={<LoadingSpinner />}>
|
||||
<Route path="/contacts/" exact component={ContactPage} />
|
||||
<Route path="/contacts/:id" exact component={ContactsInfoPage} />
|
||||
</React.Suspense>
|
||||
</AppContent>
|
||||
<Fab
|
||||
color="primary"
|
||||
onClick={() => history.push('/contacts/-1')}
|
||||
className={classes.absolute}
|
||||
>
|
||||
<PersonAddIcon />
|
||||
</Fab>
|
||||
</AppWrapper>
|
||||
</ContactsThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'CONTACTS',
|
||||
method: 'setContacts',
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
display: 'Ruqen',
|
||||
number: '555-15196',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
display: 'Taso',
|
||||
number: '215-8139',
|
||||
avatar: 'http://i.tasoagc.dev/i9Ig',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
display: 'Chip',
|
||||
number: '111-1111',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
display: 'Kidz',
|
||||
number: '444-4444',
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
@@ -1,22 +1,19 @@
|
||||
import React from 'react';
|
||||
import ListItemText from '@material-ui/core/ListItemText';
|
||||
import { Button, ListItemAvatar, Avatar as MuiAvatar, List, ListItem } from '@material-ui/core';
|
||||
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
|
||||
import PhoneIcon from '@material-ui/icons/Phone';
|
||||
import ChatIcon from '@material-ui/icons/Chat';
|
||||
import MoreVertIcon from '@material-ui/icons/MoreVert';
|
||||
import { useContacts } from '../../hooks/useContacts';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { SearchContacts } from './SearchContacts';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
|
||||
import { CallEvents } from '../../../../../../typings/call';
|
||||
import { useFilteredContacts } from '../../hooks/state';
|
||||
import { useCall } from '../../../../os/call/hooks/useCall';
|
||||
|
||||
export const ContactList = () => {
|
||||
const { filteredContacts } = useFilteredContacts();
|
||||
const filteredContacts = useFilteredContacts();
|
||||
const history = useHistory();
|
||||
|
||||
const { contacts } = useContacts();
|
||||
const { initializeCall } = useCall();
|
||||
|
||||
const openContactInfo = (contactId: number) => {
|
||||
history.push(`/contacts/${contactId}`);
|
||||
@@ -28,9 +25,7 @@ export const ContactList = () => {
|
||||
level: 2,
|
||||
data: true,
|
||||
});
|
||||
Nui.send(CallEvents.INITIALIZE_CALL, {
|
||||
number,
|
||||
});
|
||||
initializeCall(number);
|
||||
};
|
||||
|
||||
const handleMessage = (phoneNumber: string) => {
|
||||
@@ -42,38 +37,31 @@ export const ContactList = () => {
|
||||
history.push(`/messages/new/${phoneNumber}`);
|
||||
};
|
||||
|
||||
const filteredRegEx = new RegExp(filteredContacts, 'gi');
|
||||
|
||||
return (
|
||||
<>
|
||||
<SearchContacts />
|
||||
<List>
|
||||
{contacts
|
||||
.filter(
|
||||
(contact) =>
|
||||
contact.display.match(filteredRegEx) || contact.number.match(filteredRegEx),
|
||||
)
|
||||
.map((contact) => (
|
||||
<ListItem key={contact.id} divider>
|
||||
<ListItemAvatar>
|
||||
{contact.avatar ? (
|
||||
<MuiAvatar src={contact.avatar} />
|
||||
) : (
|
||||
<MuiAvatar>{contact.display.slice(0, 1).toUpperCase()}</MuiAvatar>
|
||||
)}
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary={contact.display} secondary={contact.number} />
|
||||
<Button onClick={() => startCall(contact.number)}>
|
||||
<PhoneIcon />
|
||||
</Button>
|
||||
<Button onClick={() => handleMessage(contact.number)}>
|
||||
<ChatIcon />
|
||||
</Button>
|
||||
<Button style={{ margin: -15 }} onClick={() => openContactInfo(contact.id)}>
|
||||
<MoreVertIcon />
|
||||
</Button>
|
||||
</ListItem>
|
||||
))}
|
||||
{filteredContacts.map((contact) => (
|
||||
<ListItem key={contact.id} divider>
|
||||
<ListItemAvatar>
|
||||
{contact.avatar ? (
|
||||
<MuiAvatar src={contact.avatar} />
|
||||
) : (
|
||||
<MuiAvatar>{contact.display.slice(0, 1).toUpperCase()}</MuiAvatar>
|
||||
)}
|
||||
</ListItemAvatar>
|
||||
<ListItemText primary={contact.display} secondary={contact.number} />
|
||||
<Button onClick={() => startCall(contact.number)}>
|
||||
<PhoneIcon />
|
||||
</Button>
|
||||
<Button onClick={() => handleMessage(contact.number)}>
|
||||
<ChatIcon />
|
||||
</Button>
|
||||
<Button style={{ margin: -15 }} onClick={() => openContactInfo(contact.id)}>
|
||||
<MoreVertIcon />
|
||||
</Button>
|
||||
</ListItem>
|
||||
))}
|
||||
</List>
|
||||
</>
|
||||
);
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
import React from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Box } from '@material-ui/core';
|
||||
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
|
||||
import { SearchField } from '../../../../ui/components/SearchField';
|
||||
import { useDebounce } from '../../../../os/phone/hooks/useDebounce';
|
||||
import { useSetContactFilterInput } from '../../hooks/state';
|
||||
|
||||
export const SearchContacts = () => {
|
||||
const { setFilteredContacts, filteredContacts } = useFilteredContacts();
|
||||
const { t } = useTranslation();
|
||||
const setFilterVal = useSetContactFilterInput();
|
||||
const [inputVal, setInputVal] = useState('');
|
||||
|
||||
const debouncedVal = useDebounce<string>(inputVal, 500);
|
||||
|
||||
useEffect(() => {
|
||||
setFilterVal(debouncedVal);
|
||||
}, [debouncedVal, setFilterVal]);
|
||||
|
||||
return (
|
||||
<Box>
|
||||
<SearchField
|
||||
onChange={(e) => setFilteredContacts(e.target.value)}
|
||||
onChange={(e) => setInputVal(e.target.value)}
|
||||
placeholder={t('APPS_CONTACT_PLACEHOLDER_SEARCH_CONTACTS')}
|
||||
value={filteredContacts}
|
||||
value={inputVal}
|
||||
/>
|
||||
</Box>
|
||||
);
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Avatar as MuiAvatar, Box, Button, Paper, TextField } from '@material-ui/core';
|
||||
import { Avatar as MuiAvatar, Box, Button, Paper } from '@material-ui/core';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHistory, useParams } from 'react-router-dom';
|
||||
import { useContacts } from '../../hooks/useContacts';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useContactActions } from '../../hooks/useContactActions';
|
||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
|
||||
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
|
||||
import { ContactEvents } from '../../../../../../typings/contact';
|
||||
import { Contact, ContactEvents, ContactsDatabaseLimits } from '../../../../../../typings/contact';
|
||||
import { TextField } from '../../../../ui/components/Input';
|
||||
import { fetchNui } from '../../../../utils/fetchNui';
|
||||
import { ServerPromiseResp } from '../../../../../../typings/common';
|
||||
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
|
||||
|
||||
interface ContactInfoRouteParams {
|
||||
mode: string;
|
||||
@@ -49,10 +52,11 @@ const useStyles = makeStyles({
|
||||
|
||||
const ContactsInfoPage = () => {
|
||||
const classes = useStyles();
|
||||
|
||||
const history = useHistory();
|
||||
|
||||
const { getContact } = useContacts();
|
||||
const { getContact, addContact, updateContact, deleteContact } = useContactActions();
|
||||
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
const { id } = useParams<ContactInfoRouteParams>();
|
||||
const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({
|
||||
@@ -68,6 +72,24 @@ const ContactsInfoPage = () => {
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleNumberChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
|
||||
const inputVal = e.target.value;
|
||||
if (inputVal.length === ContactsDatabaseLimits.number) return;
|
||||
setNumber(e.target.value);
|
||||
};
|
||||
|
||||
const handleDisplayChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
|
||||
const inputVal = e.target.value;
|
||||
if (inputVal.length === ContactsDatabaseLimits.display) return;
|
||||
setName(e.target.value);
|
||||
};
|
||||
|
||||
const handleAvatarChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
|
||||
const inputVal = e.target.value;
|
||||
if (inputVal.length === ContactsDatabaseLimits.avatar) return;
|
||||
setAvatar(e.target.value);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
if (addNumber) {
|
||||
setNumber(addNumber);
|
||||
@@ -80,12 +102,27 @@ const ContactsInfoPage = () => {
|
||||
data: contact,
|
||||
level: 2,
|
||||
});
|
||||
Nui.send(ContactEvents.ADD_CONTACT, {
|
||||
fetchNui<ServerPromiseResp<Contact>>(ContactEvents.ADD_CONTACT, {
|
||||
display: name,
|
||||
number,
|
||||
avatar,
|
||||
}).then((serverResp) => {
|
||||
if (serverResp.status !== 'ok') {
|
||||
return addAlert({
|
||||
message: t('APPS_CONTACT_ADD_FAILED'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
// Sanity checks maybe?
|
||||
|
||||
addContact(serverResp.data);
|
||||
addAlert({
|
||||
message: t('APPS_CONTACT_ADD_SUCCESS'),
|
||||
type: 'success',
|
||||
});
|
||||
history.replace(referal);
|
||||
});
|
||||
history.replace(referal);
|
||||
};
|
||||
|
||||
const handleContactSave = () => {
|
||||
@@ -94,13 +131,33 @@ const ContactsInfoPage = () => {
|
||||
data: contact,
|
||||
level: 2,
|
||||
});
|
||||
Nui.send(ContactEvents.UPDATE_CONTACT, {
|
||||
fetchNui<ServerPromiseResp>(ContactEvents.UPDATE_CONTACT, {
|
||||
id: contact.id,
|
||||
display: name,
|
||||
number,
|
||||
avatar,
|
||||
}).then((resp) => {
|
||||
if (resp.status !== 'ok') {
|
||||
return addAlert({
|
||||
message: t('APPS_CONTACT_UPDATE_FAILED'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
updateContact({
|
||||
id: contact.id,
|
||||
display: name,
|
||||
number,
|
||||
avatar,
|
||||
});
|
||||
|
||||
addAlert({
|
||||
message: t('APPS_CONTACT_UPDATE_SUCCESS'),
|
||||
type: 'success',
|
||||
});
|
||||
|
||||
history.goBack();
|
||||
});
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
const handleContactDelete = () => {
|
||||
@@ -109,10 +166,20 @@ const ContactsInfoPage = () => {
|
||||
data: contact,
|
||||
level: 2,
|
||||
});
|
||||
Nui.send(ContactEvents.DELETE_CONTACT, {
|
||||
id: contact.id,
|
||||
fetchNui<ServerPromiseResp>(ContactEvents.DELETE_CONTACT, { id: contact.id }).then((resp) => {
|
||||
if (resp.status !== 'ok') {
|
||||
return addAlert({
|
||||
message: t('APPS_CONTACT_DELETE_FAILED'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
history.goBack();
|
||||
deleteContact(contact.id);
|
||||
addAlert({
|
||||
message: t('APPS_CONTACT_DELETE_SUCCESS'),
|
||||
type: 'error',
|
||||
});
|
||||
});
|
||||
history.goBack();
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -124,9 +191,10 @@ const ContactsInfoPage = () => {
|
||||
<MuiAvatar className={classes.avatar} src={avatar} />
|
||||
<TextField
|
||||
autoFocus
|
||||
error={name.length === ContactsDatabaseLimits.display}
|
||||
className={classes.input}
|
||||
value={name}
|
||||
onChange={(e) => setName(e.target.value)}
|
||||
onChange={handleDisplayChange}
|
||||
label={t('APPS_CONTACT_FORM_NAME')}
|
||||
fullWidth
|
||||
inputProps={{
|
||||
@@ -135,8 +203,9 @@ const ContactsInfoPage = () => {
|
||||
/>
|
||||
<TextField
|
||||
className={classes.input}
|
||||
error={number.length === ContactsDatabaseLimits.number}
|
||||
value={number}
|
||||
onChange={(e) => setNumber(e.target.value)}
|
||||
onChange={handleNumberChange}
|
||||
label={t('APPS_CONTACT_FORM_NUMBER')}
|
||||
fullWidth
|
||||
inputProps={{
|
||||
@@ -144,11 +213,12 @@ const ContactsInfoPage = () => {
|
||||
}}
|
||||
/>
|
||||
<TextField
|
||||
error={avatar.length === ContactsDatabaseLimits.avatar}
|
||||
className={classes.input}
|
||||
label={t('APPS_CONTACT_FORM_AVATAR')}
|
||||
fullWidth
|
||||
value={avatar}
|
||||
onChange={(e) => setAvatar(e.target.value)}
|
||||
onChange={handleAvatarChange}
|
||||
inputProps={{
|
||||
className: classes.inputProps,
|
||||
}}
|
||||
|
||||
@@ -1,37 +1,10 @@
|
||||
import React from 'react';
|
||||
import Fab from '@material-ui/core/Fab';
|
||||
import PersonAddIcon from '@material-ui/icons/PersonAdd';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import { ContactList } from '../List/ContactList';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
absolute: {
|
||||
position: 'absolute',
|
||||
bottom: theme.spacing(2),
|
||||
right: theme.spacing(2),
|
||||
},
|
||||
icon: {
|
||||
color: '#fff',
|
||||
fontSize: 30,
|
||||
},
|
||||
}));
|
||||
|
||||
export const ContactPage = () => {
|
||||
const history = useHistory();
|
||||
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<>
|
||||
<div style={{ paddingBottom: 60 }}>
|
||||
<ContactList />
|
||||
<Fab
|
||||
color="primary"
|
||||
onClick={() => history.push('/contacts/-1')}
|
||||
className={classes.absolute}
|
||||
>
|
||||
<PersonAddIcon />
|
||||
</Fab>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
@@ -1,24 +1,57 @@
|
||||
import { atom } from 'recoil';
|
||||
import { atom, selector, useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
import { Contact, ContactEvents } from '../../../../../typings/contact';
|
||||
import { fetchNui } from '../../../utils/fetchNui';
|
||||
import { ServerPromiseResp } from '../../../../../typings/common';
|
||||
import { isEnvBrowser } from '../../../utils/misc';
|
||||
import LogDebugEvent from '../../../os/debug/LogDebugEvents';
|
||||
import { BrowserContactsState } from '../utils/constants';
|
||||
|
||||
export const contactsState = {
|
||||
contacts: atom({
|
||||
contacts: atom<Contact[]>({
|
||||
key: 'contactsList',
|
||||
default: [],
|
||||
default: selector({
|
||||
key: 'contactsListDefault',
|
||||
get: async () => {
|
||||
try {
|
||||
const resp = await fetchNui<ServerPromiseResp<Contact[]>>(ContactEvents.GET_CONTACTS);
|
||||
LogDebugEvent({ action: 'ContactsFetched', data: resp.data });
|
||||
return resp.data;
|
||||
} catch (e) {
|
||||
if (isEnvBrowser()) {
|
||||
return BrowserContactsState;
|
||||
}
|
||||
console.error(e);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
}),
|
||||
}),
|
||||
showModal: atom({
|
||||
key: 'showModal',
|
||||
default: false,
|
||||
}),
|
||||
filterContacts: atom({
|
||||
key: 'filterContacts',
|
||||
filterInput: atom<string>({
|
||||
key: 'filterInput',
|
||||
default: '',
|
||||
}),
|
||||
showContactsModal: atom({
|
||||
key: 'showContactModal',
|
||||
default: false,
|
||||
}),
|
||||
contactDetail: atom({
|
||||
key: 'contactDetail',
|
||||
default: null,
|
||||
filteredContacts: selector({
|
||||
key: 'filteredContacts',
|
||||
get: ({ get }) => {
|
||||
const filterInputVal: string = get(contactsState.filterInput);
|
||||
const contacts: Contact[] = get(contactsState.contacts);
|
||||
|
||||
if (!filterInputVal) return contacts;
|
||||
|
||||
const regExp = new RegExp(filterInputVal, 'gi');
|
||||
|
||||
return contacts.filter(
|
||||
(contact) => contact.display.match(regExp) || contact.number.match(regExp),
|
||||
);
|
||||
},
|
||||
}),
|
||||
};
|
||||
|
||||
export const useSetContacts = () => useSetRecoilState(contactsState.contacts);
|
||||
export const useContacts = () => useRecoilState(contactsState.contacts);
|
||||
export const useContactsValue = () => useRecoilValue(contactsState.contacts);
|
||||
|
||||
export const useFilteredContacts = () => useRecoilValue(contactsState.filteredContacts);
|
||||
|
||||
export const useContactFilterInput = () => useRecoilState(contactsState.filterInput);
|
||||
export const useSetContactFilterInput = () => useSetRecoilState(contactsState.filterInput);
|
||||
@@ -0,0 +1,92 @@
|
||||
import { useContacts } from './state';
|
||||
|
||||
import { Contact } from '../../../../../typings/contact';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
interface UseContactsValue {
|
||||
getDisplayByNumber: (number: string) => string;
|
||||
getContactByNumber: (number: string) => Contact | null;
|
||||
getContact: (id: number) => Contact | null;
|
||||
getPictureByNumber: (number: string) => string | null;
|
||||
deleteContact: (id: number) => void;
|
||||
addContact: (contact: Contact) => void;
|
||||
updateContact: (contact: Contact) => void;
|
||||
}
|
||||
|
||||
export const useContactActions = (): UseContactsValue => {
|
||||
const [contacts, setContacts] = useContacts();
|
||||
|
||||
const getDisplayByNumber = useCallback(
|
||||
(number: string) => {
|
||||
const found = contacts.find((contact) => contact.number === number);
|
||||
return found ? found.display : number;
|
||||
},
|
||||
[contacts],
|
||||
);
|
||||
|
||||
const getPictureByNumber = useCallback(
|
||||
(number: string) => {
|
||||
const found = contacts.find((contact) => contact.number === number);
|
||||
return found ? found.avatar : null;
|
||||
},
|
||||
[contacts],
|
||||
);
|
||||
|
||||
const getContactByNumber = useCallback(
|
||||
(number: string): Contact | null => {
|
||||
for (const contact of contacts) {
|
||||
if (contact.number === number) return contact;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
[contacts],
|
||||
);
|
||||
|
||||
const getContact = useCallback(
|
||||
(id: number): Contact | null => {
|
||||
for (const contact of contacts) {
|
||||
if (contact.id === id) return contact;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
[contacts],
|
||||
);
|
||||
|
||||
const deleteContact = useCallback(
|
||||
(id: number): void => {
|
||||
setContacts((curContacts) => [...curContacts].filter((contact) => contact.id !== id));
|
||||
},
|
||||
[setContacts],
|
||||
);
|
||||
|
||||
const addContact = useCallback(
|
||||
(contact: Contact) => {
|
||||
setContacts((curContacts) => [...curContacts, contact]);
|
||||
},
|
||||
[setContacts],
|
||||
);
|
||||
|
||||
const updateContact = useCallback(
|
||||
(updatedContact: Contact) => {
|
||||
setContacts((curContacts) => {
|
||||
const targetContactIndex = curContacts.findIndex(
|
||||
(contact) => contact.id === updatedContact.id,
|
||||
);
|
||||
const newContactsArray = [...curContacts];
|
||||
newContactsArray[targetContactIndex] = updatedContact;
|
||||
return newContactsArray;
|
||||
});
|
||||
},
|
||||
[setContacts],
|
||||
);
|
||||
|
||||
return {
|
||||
getDisplayByNumber,
|
||||
getContact,
|
||||
getContactByNumber,
|
||||
getPictureByNumber,
|
||||
deleteContact,
|
||||
updateContact,
|
||||
addContact,
|
||||
};
|
||||
};
|
||||
@@ -1,46 +0,0 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { contactsState } from './state';
|
||||
|
||||
import { Contact } from '../../../../../typings/contact';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
interface IUseContacts {
|
||||
contacts: Contact[];
|
||||
getDisplayByNumber: (number: string) => string;
|
||||
getContactByNumber: (number: string) => Contact | null;
|
||||
getContact: (id: number) => Contact | null;
|
||||
}
|
||||
|
||||
export const useContacts = (): IUseContacts => {
|
||||
const contacts = useRecoilValue(contactsState.contacts);
|
||||
|
||||
const getDisplayByNumber = useCallback(
|
||||
(number: string) => {
|
||||
const found = contacts.find((contact) => contact.number === number);
|
||||
return found ? found.display : number;
|
||||
},
|
||||
[contacts],
|
||||
);
|
||||
|
||||
const getContactByNumber = useCallback(
|
||||
(number: string): Contact | null => {
|
||||
for (const contact of contacts) {
|
||||
if (contact.number === number) return contact;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
[contacts],
|
||||
);
|
||||
|
||||
const getContact = useCallback(
|
||||
(id: number): Contact | null => {
|
||||
for (const contact of contacts) {
|
||||
if (contact.id === id) return contact;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
[contacts],
|
||||
);
|
||||
|
||||
return { contacts, getDisplayByNumber, getContact, getContactByNumber };
|
||||
};
|
||||
@@ -1,24 +0,0 @@
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { contactsState } from './state';
|
||||
import { useContacts } from './useContacts';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { ContactEvents } from '../../../../../typings/contact';
|
||||
|
||||
export const useContactsService = () => {
|
||||
const setContacts = useSetRecoilState(contactsState.contacts);
|
||||
const { addAlert } = useSnackbar();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleAddAlert = ({ message, type }: IAlert) => {
|
||||
addAlert({
|
||||
message: t(`APPS_${message}`),
|
||||
type,
|
||||
});
|
||||
};
|
||||
|
||||
useNuiEvent('CONTACTS', ContactEvents.SEND_CONTACTS, setContacts);
|
||||
useNuiEvent('CONTACTS', ContactEvents.SEND_ALERT, handleAddAlert);
|
||||
return useContacts();
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { contactsState } from './state';
|
||||
|
||||
interface FilterdContactsProps {
|
||||
filteredContacts: string;
|
||||
setFilteredContacts: (contact: any) => void;
|
||||
}
|
||||
|
||||
export const useFilteredContacts = (): FilterdContactsProps => {
|
||||
const [filteredContacts, setFilteredContacts] = useRecoilState(contactsState.filterContacts);
|
||||
return { filteredContacts, setFilteredContacts };
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { contactsState } from './state';
|
||||
|
||||
interface ModalProps {
|
||||
showModal: boolean;
|
||||
setShowModal: (show: boolean) => void;
|
||||
}
|
||||
|
||||
export const useModal = (): ModalProps => {
|
||||
const [showModal, setShowModal] = useRecoilState(contactsState.showModal);
|
||||
return { showModal, setShowModal };
|
||||
};
|
||||
@@ -0,0 +1,24 @@
|
||||
export const BrowserContactsState = [
|
||||
{
|
||||
id: 1,
|
||||
display: 'Ruqen',
|
||||
number: '555-15196',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
display: 'Taso',
|
||||
number: '215-8139',
|
||||
avatar: 'http://i.tasoagc.dev/i9Ig',
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
display: 'Chip',
|
||||
number: '603-275-8373',
|
||||
avatar: 'http://i.tasoagc.dev/2QYV',
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
display: 'Kidz',
|
||||
number: '444-4444',
|
||||
},
|
||||
];
|
||||
@@ -7,14 +7,17 @@ import { useApp } from '../../../os/apps/hooks/useApps';
|
||||
import { Switch, Route } from 'react-router-dom';
|
||||
import DialPage from './views/DialPage';
|
||||
import DialerNavBar from './DialerNavBar';
|
||||
import { useDialHistory } from '../hooks/useDialHistory';
|
||||
import InjectDebugData from '../../../os/debug/InjectDebugData';
|
||||
import { ContactList } from '../../contacts/components/List/ContactList';
|
||||
import { DialerThemeProvider } from '../providers/DialerThemeProvider';
|
||||
import { Box, CircularProgress } from '@material-ui/core';
|
||||
|
||||
const LoadingSpinner: React.FC = () => (
|
||||
<Box>
|
||||
<CircularProgress />
|
||||
</Box>
|
||||
);
|
||||
|
||||
export const DialerApp = () => {
|
||||
const history = useDialHistory();
|
||||
|
||||
const dialer = useApp('DIALER');
|
||||
return (
|
||||
<DialerThemeProvider>
|
||||
@@ -26,7 +29,9 @@ export const DialerApp = () => {
|
||||
<DialPage />
|
||||
</Route>
|
||||
<Route exact path="/phone">
|
||||
<DialerHistory calls={history} />
|
||||
<React.Suspense fallback={<LoadingSpinner />}>
|
||||
<DialerHistory />
|
||||
</React.Suspense>
|
||||
</Route>
|
||||
<Route path="/phone/contacts" component={ContactList} />
|
||||
</Switch>
|
||||
@@ -36,22 +41,3 @@ export const DialerApp = () => {
|
||||
</DialerThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'DIALER',
|
||||
method: 'setHistory',
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
transmitter: '636-6496',
|
||||
start: 1615946292,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
transmitter: '777-7777',
|
||||
start: 1615946292,
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
@@ -1,12 +1,13 @@
|
||||
import React, { useContext } from 'react';
|
||||
import { Box, IconButton, InputBase, Paper } from '@material-ui/core';
|
||||
import { Box, IconButton, 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, IDialInputCtx } from '../context/InputContext';
|
||||
import Nui from '../../../os/nui-events/utils/Nui';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { CallEvents } from '../../../../../typings/call';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { InputBase } from '../../../ui/components/Input';
|
||||
import { useCall } from '../../../os/call/hooks/useCall';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
root: {
|
||||
@@ -30,13 +31,13 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||
export const DialerInput = () => {
|
||||
const classes = useStyles();
|
||||
const history = useHistory();
|
||||
const { t } = useTranslation();
|
||||
const { initializeCall } = useCall();
|
||||
|
||||
const { inputVal, set } = useContext<IDialInputCtx>(DialInputCtx);
|
||||
|
||||
const handleCall = (number: string) => {
|
||||
Nui.send(CallEvents.INITIALIZE_CALL, {
|
||||
number,
|
||||
});
|
||||
initializeCall(number);
|
||||
};
|
||||
|
||||
const handleNewContact = (number: string) => {
|
||||
@@ -46,11 +47,10 @@ export const DialerInput = () => {
|
||||
return (
|
||||
<Box component={Paper} className={classes.root}>
|
||||
<InputBase
|
||||
placeholder="Enter a number"
|
||||
placeholder={t('APPS_DIALER_INPUT_PLACEHOLDER')}
|
||||
className={classes.input}
|
||||
value={inputVal}
|
||||
onChange={(e) => set(e.target.value)}
|
||||
type="number"
|
||||
/>
|
||||
<IconButton color="primary" className={classes.iconBtn} disabled={inputVal <= ''}>
|
||||
<PhoneIcon fontSize="large" onClick={() => handleCall(inputVal)} />
|
||||
|
||||
@@ -5,6 +5,7 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import PhoneIcon from '@material-ui/icons/Phone';
|
||||
import PersonIcon from '@material-ui/icons/Person';
|
||||
import HistoryIcon from '@material-ui/icons/History';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
root: {
|
||||
@@ -20,6 +21,7 @@ const DialerNavBar = () => {
|
||||
const classes = useStyles();
|
||||
const { pathname } = useLocation();
|
||||
const [page, setPage] = useState(pathname);
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleChange = (_e, newPage) => {
|
||||
setPage(newPage);
|
||||
@@ -28,14 +30,14 @@ const DialerNavBar = () => {
|
||||
return (
|
||||
<BottomNavigation value={page} onChange={handleChange} showLabels className={classes.root}>
|
||||
<BottomNavigationAction
|
||||
label="History"
|
||||
label={t('APPS_DIALER_NAVBAR_HISTORY')}
|
||||
value="/phone"
|
||||
component={NavLink}
|
||||
icon={<HistoryIcon />}
|
||||
to="/phone"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
label="Dial"
|
||||
label={t('APPS_DIALER_NAVBAR_DIAL')}
|
||||
value="/phone/dial"
|
||||
color="secondary"
|
||||
component={NavLink}
|
||||
@@ -43,7 +45,7 @@ const DialerNavBar = () => {
|
||||
to="/phone/dial"
|
||||
/>
|
||||
<BottomNavigationAction
|
||||
label="Contacts"
|
||||
label={t('APPS_DIALER_NAVBAR_CONTACTS')}
|
||||
value="/phone/contacts"
|
||||
color="secondary"
|
||||
component={NavLink}
|
||||
|
||||
@@ -5,15 +5,16 @@ import PhoneIcon from '@material-ui/icons/Phone';
|
||||
import PersonAddIcon from '@material-ui/icons/PersonAdd';
|
||||
import { List } from '../../../../ui/components/List';
|
||||
import { ListItem } from '../../../../ui/components/ListItem';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useSimcard } from '../../../../os/simcard/hooks/useSimcard';
|
||||
import { useContacts } from '../../../contacts/hooks/useContacts';
|
||||
import { CallEvents, ICall } from '../../../../../../typings/call';
|
||||
import { useContactActions } from '../../../contacts/hooks/useContactActions';
|
||||
import { CallHistoryItem } 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';
|
||||
import { useMyPhoneNumber } from '../../../../os/simcard/hooks/useMyPhoneNumber';
|
||||
import { useDialHistory } from '../../hooks/useDialHistory';
|
||||
import { useCall } from '../../../../os/call/hooks/useCall';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
callForward: {
|
||||
@@ -24,20 +25,17 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const DialerHistory = ({ calls }) => {
|
||||
const { number: myNumber } = useSimcard();
|
||||
const { getDisplayByNumber } = useContacts();
|
||||
|
||||
export const DialerHistory: React.FC = () => {
|
||||
const myNumber = useMyPhoneNumber();
|
||||
const { getDisplayByNumber } = useContactActions();
|
||||
const { initializeCall } = useCall();
|
||||
const calls = useDialHistory();
|
||||
const classes = useStyles();
|
||||
|
||||
const history = useHistory();
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleCall = (phoneNumber) => {
|
||||
Nui.send(CallEvents.INITIALIZE_CALL, {
|
||||
number: phoneNumber,
|
||||
});
|
||||
initializeCall(phoneNumber);
|
||||
};
|
||||
|
||||
if (!calls?.length) {
|
||||
@@ -55,7 +53,7 @@ export const DialerHistory = ({ calls }) => {
|
||||
|
||||
return (
|
||||
<List disablePadding>
|
||||
{calls.map((call: ICall) =>
|
||||
{calls.map((call: CallHistoryItem) =>
|
||||
call.transmitter === myNumber ? (
|
||||
<ListItem key={call.id} divider>
|
||||
<ListItemIcon>
|
||||
@@ -66,15 +64,15 @@ export const DialerHistory = ({ calls }) => {
|
||||
primary={getDisplayByNumber(call.receiver)}
|
||||
secondary={
|
||||
// TODO: Locale changes are pending #168 merge
|
||||
dayjs().to(dayjs.unix(call.start))
|
||||
dayjs().to(dayjs.unix(parseInt(call.start)))
|
||||
}
|
||||
/>
|
||||
<IconButton onClick={() => handleCall(call.receiver)}>{<PhoneIcon />}</IconButton>
|
||||
|
||||
{getDisplayByNumber(call.transmitter) === call.transmitter && (
|
||||
{getDisplayByNumber(call.receiver) === call.receiver && (
|
||||
<IconButton
|
||||
onClick={() =>
|
||||
history.push(`/contacts/-1?addNumber=${call.transmitter}&referal=/phone/contacts`)
|
||||
history.push(`/contacts/-1?addNumber=${call.receiver}&referal=/phone/contacts`)
|
||||
}
|
||||
>
|
||||
<PersonAddIcon />
|
||||
@@ -91,7 +89,7 @@ export const DialerHistory = ({ calls }) => {
|
||||
primary={getDisplayByNumber(call.transmitter)}
|
||||
secondary={
|
||||
// TODO: Locale changes are pending #168 merge
|
||||
dayjs().to(dayjs.unix(call.start))
|
||||
dayjs().to(dayjs.unix(parseInt(call.start)))
|
||||
}
|
||||
/>
|
||||
<IconButton onClick={() => handleCall(call.transmitter)}>
|
||||
|
||||
@@ -1,8 +1,29 @@
|
||||
import { atom } from 'recoil';
|
||||
import { atom, selector } from 'recoil';
|
||||
import { CallEvents, CallHistoryItem } from '../../../../../typings/call';
|
||||
import { fetchNui } from '../../../utils/fetchNui';
|
||||
import { ServerPromiseResp } from '../../../../../typings/common';
|
||||
import LogDebugEvent from '../../../os/debug/LogDebugEvents';
|
||||
import { isEnvBrowser } from '../../../utils/misc';
|
||||
import { MockHistoryData } from '../utils/constants';
|
||||
|
||||
export const dialState = {
|
||||
history: atom({
|
||||
history: atom<CallHistoryItem[]>({
|
||||
key: 'dialHistory',
|
||||
default: [],
|
||||
default: selector({
|
||||
key: 'dialHistoryDefault',
|
||||
get: async () => {
|
||||
try {
|
||||
const resp = await fetchNui<ServerPromiseResp<CallHistoryItem[]>>(CallEvents.FETCH_CALLS);
|
||||
LogDebugEvent({ action: 'ContactsFetched', data: resp.data });
|
||||
return resp.data;
|
||||
} catch (e) {
|
||||
if (isEnvBrowser()) {
|
||||
return MockHistoryData;
|
||||
}
|
||||
console.error(e);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
}),
|
||||
}),
|
||||
};
|
||||
@@ -1,7 +1,4 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { ICall } from '../../../../../typings/call';
|
||||
import { dialState } from './state';
|
||||
|
||||
export const useDialHistory = () => {
|
||||
return useRecoilValue<ICall[]>(dialState.history);
|
||||
};
|
||||
export const useDialHistory = () => useRecoilValue(dialState.history);
|
||||
@@ -1,9 +1,18 @@
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { dialState } from './state';
|
||||
import { useNuiEvent } from 'fivem-nui-react-lib';
|
||||
import { CallEvents } from '../../../../../typings/call';
|
||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const useDialService = () => {
|
||||
const setHistory = useSetRecoilState(dialState.history);
|
||||
useNuiEvent('DIALER', CallEvents.SET_CALL_HISTORY, setHistory);
|
||||
const { addAlert } = useSnackbar();
|
||||
const { t } = useTranslation();
|
||||
|
||||
const handleAddAlert = ({ message, type }: IAlert) => {
|
||||
addAlert({
|
||||
message: t(`APPS_${message}`),
|
||||
type,
|
||||
});
|
||||
};
|
||||
|
||||
useNuiEvent('DIALER', CallEvents.SEND_ALERT, handleAddAlert);
|
||||
};
|
||||
@@ -0,0 +1,22 @@
|
||||
import { CallHistoryItem } from '../../../../../typings/call';
|
||||
|
||||
export const MockHistoryData: CallHistoryItem[] = [
|
||||
{
|
||||
id: 1,
|
||||
identifier: 'ca839e8c-ef9d-40bd-b6a3-d531ee58149f',
|
||||
transmitter: '704-1549',
|
||||
receiver: '704-1549',
|
||||
is_accepted: true,
|
||||
start: '1615939174',
|
||||
end: null,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
identifier: 'b8080a50-ad30-4ee9-84cb-00688e2bf167',
|
||||
transmitter: '704-1549',
|
||||
receiver: '704-1549',
|
||||
is_accepted: false,
|
||||
start: '1615939850',
|
||||
end: null,
|
||||
},
|
||||
];
|
||||
@@ -1,34 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,60 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,78 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,55 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,118 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,14 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,51 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,97 +0,0 @@
|
||||
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>
|
||||
);
|
||||
};
|
||||
@@ -1,28 +0,0 @@
|
||||
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;
|
||||
@@ -1,25 +0,0 @@
|
||||
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',
|
||||
}),
|
||||
};
|
||||
@@ -1,64 +0,0 @@
|
||||
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 };
|
||||
};
|
||||
@@ -1,221 +0,0 @@
|
||||
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,
|
||||
);
|
||||
@@ -1,4 +0,0 @@
|
||||
import { createAppThemeProvider } from '../../../os/apps/utils/createAppThemeProvider';
|
||||
import theme from '../email.theme';
|
||||
|
||||
export const EmailThemeProvider = createAppThemeProvider(theme);
|
||||
@@ -1,4 +1,4 @@
|
||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||
import { useNuiEvent } from 'fivem-nui-react-lib';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { exampleState } from './state';
|
||||
import { useExample } from './useExample';
|
||||
|
||||
@@ -1,20 +1,21 @@
|
||||
import React from 'react';
|
||||
import { AppWrapper } from '../../../ui/components/AppWrapper';
|
||||
import { AppWrapper } from '../../../ui/components';
|
||||
import { AppContent } from '../../../ui/components/AppContent';
|
||||
import { MarketplaceTitle } from './MarketplaceTitle';
|
||||
import { MarketplaceListContainer } from './SelloutList/MarketplaceListContainer';
|
||||
import { MarketplaceListContainer } from './MarketplaceList/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 { MarketplaceThemeProvider } from '../providers/MarketplaceThemeProvider';
|
||||
import { MarketplaceEvents } from '../../../../../typings/marketplace';
|
||||
import { AppTitle } from '../../../ui/components/AppTitle';
|
||||
import { useApp } from '../../../os/apps/hooks/useApps';
|
||||
|
||||
export const MarketplaceApp = () => {
|
||||
const marketplaceApp = useApp('MARKETPLACE');
|
||||
|
||||
return (
|
||||
<MarketplaceThemeProvider>
|
||||
<AppWrapper id="sellout-app">
|
||||
<MarketplaceTitle />
|
||||
<AppWrapper id="marketplace-app">
|
||||
<AppTitle app={marketplaceApp} />
|
||||
<AppContent>
|
||||
<Switch>
|
||||
<Route path="/marketplace" exact component={MarketplaceListContainer} />
|
||||
@@ -26,29 +27,3 @@ export const MarketplaceApp = () => {
|
||||
</MarketplaceThemeProvider>
|
||||
);
|
||||
};
|
||||
|
||||
InjectDebugData([
|
||||
{
|
||||
app: 'SELLOUT',
|
||||
method: MarketplaceEvents.SEND_LISTING,
|
||||
data: [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Some guy',
|
||||
number: '111-1134',
|
||||
title: 'eeeeeeeeeeeeeeeeeeeeeeeee',
|
||||
description:
|
||||
'skldfsdEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
|
||||
url: 'https://beta.iodine.gg/706Y3.jpeg',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Some other dude',
|
||||
number: '666-6666',
|
||||
title: 'Material',
|
||||
description: 'Selling my wife',
|
||||
url: '',
|
||||
},
|
||||
],
|
||||
},
|
||||
]);
|
||||
@@ -2,15 +2,17 @@ import { Box, Tooltip, Button } from '@material-ui/core';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import React from 'react';
|
||||
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';
|
||||
import ChatIcon from '@material-ui/icons/Chat';
|
||||
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';
|
||||
import { fetchNui } from '../../../../utils/fetchNui';
|
||||
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
|
||||
import { ServerPromiseResp } from '../../../../../../typings/common';
|
||||
import { useMyPhoneNumber } from '../../../../os/simcard/hooks/useMyPhoneNumber';
|
||||
import { useCall } from '../../../../os/call/hooks/useCall';
|
||||
|
||||
const useStyles = makeStyles((theme: Theme) => ({
|
||||
icon: {
|
||||
@@ -18,26 +20,52 @@ const useStyles = makeStyles((theme: Theme) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const ListingActions = ({ listing }: { listing: MarketplaceListing }) => {
|
||||
export const ListingActions: React.FC<MarketplaceListing> = ({ children, ...listing }) => {
|
||||
const classes = useStyles();
|
||||
const { number: myNumber } = useSimcard();
|
||||
const myNumber = useMyPhoneNumber();
|
||||
const { t } = useTranslation();
|
||||
const history = useHistory();
|
||||
const { initializeCall } = useCall();
|
||||
const { addAlert } = useSnackbar();
|
||||
|
||||
const handleDeleteListing = () => {
|
||||
Nui.send(MarketplaceEvents.DELETE_LISTING, {
|
||||
fetchNui<ServerPromiseResp>(MarketplaceEvents.DELETE_LISTING, {
|
||||
id: listing.id,
|
||||
}).then((resp) => {
|
||||
if (resp.status !== 'ok') {
|
||||
return addAlert({
|
||||
message: t('APPS_MARKETPLACE_DELETE_LISTING_FAILED'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
addAlert({
|
||||
message: t('APPS_MARKETPLACE_DELETE_LISTING_SUCCESS'),
|
||||
type: 'success',
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const handleReportListing = () => {
|
||||
Nui.send(MarketplaceEvents.REPORT_LISTING, listing);
|
||||
fetchNui<ServerPromiseResp>(MarketplaceEvents.REPORT_LISTING, {
|
||||
listingId: listing.id,
|
||||
}).then((resp) => {
|
||||
if (resp.status !== 'ok') {
|
||||
return addAlert({
|
||||
message: t('APPS_MARKETPLACE_REPORT_LISTING_FAILED'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
addAlert({
|
||||
message: t('APPS_MARKETPLACE_REPORT_LISTING_SUCCESS'),
|
||||
type: 'success',
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const handleCall = () => {
|
||||
Nui.send(CallEvents.INITIALIZE_CALL, {
|
||||
number: listing.number,
|
||||
});
|
||||
initializeCall(listing.number);
|
||||
};
|
||||
|
||||
const handleMessage = () => {
|
||||
@@ -45,9 +73,9 @@ export const ListingActions = ({ listing }: { listing: MarketplaceListing }) =>
|
||||
};
|
||||
|
||||
return (
|
||||
<Box flex justifyContent="space-between" alignItems="center">
|
||||
<Box justifyContent="space-between" alignItems="center">
|
||||
<div style={{ float: 'left' }}>
|
||||
{listing.number !== myNumber ? (
|
||||
{listing.number !== myNumber && (
|
||||
<>
|
||||
<Tooltip title={t('GENERIC_MESSAGE')}>
|
||||
<Button onClick={handleMessage}>
|
||||
@@ -60,7 +88,7 @@ export const ListingActions = ({ listing }: { listing: MarketplaceListing }) =>
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</>
|
||||
) : null}
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div style={{ float: 'right' }}>
|
||||
@@ -41,7 +41,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
},
|
||||
}));
|
||||
|
||||
export const MarketplaceItem = (listing: MarketplaceListing) => {
|
||||
export const MarketplaceItem: React.FC<MarketplaceListing> = ({ children, ...listing }) => {
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
@@ -73,7 +73,7 @@ export const MarketplaceItem = (listing: MarketplaceListing) => {
|
||||
<Typography variant="body1" className={classes.listingContent}>
|
||||
{listing.description}
|
||||
</Typography>
|
||||
<ListingActions listing={listing} />
|
||||
<ListingActions {...listing} />
|
||||
</Paper>
|
||||
</div>
|
||||
</ListItem>
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { List } from '../../../../ui/components/List';
|
||||
import { useListing } from '../../hooks/useListing';
|
||||
import { useListingValue } from '../../hooks/state';
|
||||
import { MarketplaceItem } from './MarketplaceItem';
|
||||
|
||||
export const MarketplaceList = () => {
|
||||
const listings = useListing();
|
||||
export const MarketplaceList: React.FC = () => {
|
||||
const listings = useListingValue();
|
||||
|
||||
return (
|
||||
<List>
|
||||
@@ -0,0 +1,11 @@
|
||||
import React from 'react';
|
||||
import { MarketplaceList } from './MarketplaceList';
|
||||
import { LoadingSpinner } from '../../../../ui/components/LoadingSpinner';
|
||||
|
||||
export const MarketplaceListContainer: React.FC = () => {
|
||||
return (
|
||||
<React.Suspense fallback={<LoadingSpinner />}>
|
||||
<MarketplaceList />
|
||||
</React.Suspense>
|
||||
);
|
||||
};
|
||||
@@ -1,30 +0,0 @@
|
||||
import React from 'react';
|
||||
import Paper from '@material-ui/core/Paper';
|
||||
import { makeStyles } from '@material-ui/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faAd } from '@fortawesome/free-solid-svg-icons';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
height: '60px',
|
||||
width: '100%',
|
||||
display: 'flex',
|
||||
flexFlow: 'row nowrap',
|
||||
justifyContent: 'center',
|
||||
alignItems: 'center',
|
||||
background: theme.palette.background.default,
|
||||
},
|
||||
icon: {
|
||||
color: theme.palette.primary.main,
|
||||
fontSize: 40,
|
||||
},
|
||||
}));
|
||||
|
||||
export const MarketplaceTitle = () => {
|
||||
const classes = useStyles();
|
||||
return (
|
||||
<Paper className={classes.root} square variant="outlined" elevation={24}>
|
||||
<FontAwesomeIcon icon={faAd} className={classes.icon} />
|
||||
</Paper>
|
||||
);
|
||||
};
|
||||
@@ -1,6 +0,0 @@
|
||||
import React from 'react';
|
||||
import { MarketplaceList } from './MarketplaceList';
|
||||
|
||||
export const MarketplaceListContainer = () => {
|
||||
return <MarketplaceList />;
|
||||
};
|
||||
@@ -1,10 +1,16 @@
|
||||
import React, { useState } from 'react';
|
||||
import { makeStyles, Button, TextField, Typography } from '@material-ui/core';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { MarketplaceEvents } from '../../../../../../typings/marketplace';
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { makeStyles, Button, Box } from '@material-ui/core';
|
||||
import { MarketplaceEvents, MarketplaceListing } from '../../../../../../typings/marketplace';
|
||||
import { useSnackbar } from '../../../../ui/hooks/useSnackbar';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHistory } from 'react-router';
|
||||
import ImageIcon from '@material-ui/icons/Image';
|
||||
import { useHistory, useLocation } from 'react-router-dom';
|
||||
import qs from 'qs';
|
||||
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
|
||||
import { deleteQueryFromLocation } from '../../../../common/utils/deleteQueryFromLocation';
|
||||
import { TextField } from '../../../../ui/components/Input';
|
||||
import { fetchNui } from '../../../../utils/fetchNui';
|
||||
import { ServerPromiseResp } from '../../../../../../typings/common';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
@@ -35,6 +41,8 @@ export const ListingForm = () => {
|
||||
const { t } = useTranslation();
|
||||
const { addAlert } = useSnackbar();
|
||||
const history = useHistory();
|
||||
const { pathname, search } = useLocation();
|
||||
const query = useQueryParams();
|
||||
|
||||
const [title, setTitle] = useState('');
|
||||
const [url, setUrl] = useState('');
|
||||
@@ -42,12 +50,24 @@ export const ListingForm = () => {
|
||||
|
||||
const addListing = () => {
|
||||
if (title !== '' && description !== '') {
|
||||
Nui.send(MarketplaceEvents.ADD_LISTING, {
|
||||
fetchNui<ServerPromiseResp<MarketplaceListing[]>>(MarketplaceEvents.ADD_LISTING, {
|
||||
title,
|
||||
url,
|
||||
description,
|
||||
url,
|
||||
}).then((resp) => {
|
||||
if (resp.status !== 'ok') {
|
||||
return addAlert({
|
||||
message: t('APPS_MARKETPLACE_CREATE_LISTING_FAILED'),
|
||||
type: 'error',
|
||||
});
|
||||
}
|
||||
|
||||
addAlert({
|
||||
message: t('APPS_MARKETPLACE_CREATE_LISTING_SUCCESS'),
|
||||
type: 'success',
|
||||
});
|
||||
history.push('/marketplace');
|
||||
});
|
||||
history.push('/marketplace');
|
||||
} else {
|
||||
addAlert({
|
||||
message: t('APPS_MARKETPLACE_REQUIRED_FIELDS'),
|
||||
@@ -56,6 +76,26 @@ export const ListingForm = () => {
|
||||
}
|
||||
};
|
||||
|
||||
/*const handleChooseImage = () => {
|
||||
history.push(`/camera?${qs.stringify({
|
||||
referal: encodeURIComponent(pathname + search),
|
||||
})}`)
|
||||
}*/
|
||||
|
||||
const handleChooseImage = useCallback(() => {
|
||||
history.push(
|
||||
`/camera?${qs.stringify({
|
||||
referal: encodeURIComponent(pathname + search),
|
||||
})}`,
|
||||
);
|
||||
}, [history, pathname, search]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!query?.image) return;
|
||||
setUrl(query?.image);
|
||||
history.replace(deleteQueryFromLocation({ pathname, search }, 'image'));
|
||||
}, [query?.image, history, pathname, search]);
|
||||
|
||||
return (
|
||||
<div className={classes.root}>
|
||||
<h1>New Listing</h1>
|
||||
@@ -75,10 +115,19 @@ export const ListingForm = () => {
|
||||
}}
|
||||
/>
|
||||
|
||||
<Box display="flex" alignItems="center" paddingLeft={5}>
|
||||
<div>
|
||||
<ImageIcon />
|
||||
</div>
|
||||
<div>
|
||||
<Button onClick={handleChooseImage}>Choose a image</Button>
|
||||
</div>
|
||||
</Box>
|
||||
<TextField
|
||||
className={classes.input}
|
||||
placeholder={t('APPS_MARKETPLACE_FORM_IMAGE')}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
value={url}
|
||||
onChange={(e) => setUrl(e.currentTarget.value)}
|
||||
inputProps={{ className: classes.textFieldInput }}
|
||||
style={{ width: '80%' }}
|
||||
size="medium"
|
||||
|
||||
@@ -2,9 +2,7 @@ import React, { useState } from 'react';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { BottomNavigation, BottomNavigationAction } from '@material-ui/core';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
import { faHome } from '@fortawesome/free-solid-svg-icons';
|
||||
import AddCircleIcon from '@material-ui/icons/AddCircle';
|
||||
import { AddCircle, Home } from '@material-ui/icons/';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
@@ -28,12 +26,8 @@ export const NavigationBar = () => {
|
||||
showLabels
|
||||
className={classes.root}
|
||||
>
|
||||
<BottomNavigationAction
|
||||
component={Link}
|
||||
icon={<FontAwesomeIcon icon={faHome} />}
|
||||
to="/marketplace"
|
||||
/>
|
||||
<BottomNavigationAction component={Link} icon={<AddCircleIcon />} to="/marketplace/new" />
|
||||
<BottomNavigationAction component={Link} icon={<Home />} to="/marketplace" />
|
||||
<BottomNavigationAction component={Link} icon={<AddCircle />} to="/marketplace/new" />
|
||||
</BottomNavigation>
|
||||
);
|
||||
};
|
||||
@@ -1,8 +1,53 @@
|
||||
import { atom } from 'recoil';
|
||||
import { atom, selector, useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil';
|
||||
import { ServerPromiseResp } from '../../../../../typings/common';
|
||||
import { MarketplaceEvents, MarketplaceListing } from '../../../../../typings/marketplace';
|
||||
import { fetchNui } from '../../../utils/fetchNui';
|
||||
import { isEnvBrowser } from '../../../utils/misc';
|
||||
|
||||
export const selloutState = {
|
||||
listing: atom({
|
||||
key: 'listing',
|
||||
default: [],
|
||||
const defaultData: MarketplaceListing[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Some guy',
|
||||
number: '111-1134',
|
||||
username: 'Taso',
|
||||
title: 'eeeeeeeeeeeeeeeeeeeeeeeee',
|
||||
description:
|
||||
'skldfsdEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE',
|
||||
url: 'https://i.file.glass/706Y3.jpeg',
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Some other dude',
|
||||
number: '666-6666',
|
||||
username: 'Taso',
|
||||
title: 'Material',
|
||||
description: 'Selling my wife',
|
||||
url: '',
|
||||
},
|
||||
];
|
||||
|
||||
export const listingState = atom<MarketplaceListing[]>({
|
||||
key: 'listings',
|
||||
default: selector({
|
||||
key: 'defaultListings',
|
||||
get: async () => {
|
||||
try {
|
||||
const resp = await fetchNui<ServerPromiseResp<MarketplaceListing[]>>(
|
||||
MarketplaceEvents.FETCH_LISTING,
|
||||
);
|
||||
|
||||
return resp.data;
|
||||
} catch (e) {
|
||||
if (isEnvBrowser()) {
|
||||
return defaultData;
|
||||
}
|
||||
console.error(e);
|
||||
return [];
|
||||
}
|
||||
},
|
||||
}),
|
||||
};
|
||||
});
|
||||
|
||||
export const useListingValue = () => useRecoilValue(listingState);
|
||||
export const useSetListings = () => useSetRecoilState(listingState);
|
||||
export const useListings = () => useRecoilState(listingState);
|
||||
@@ -1,7 +0,0 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { MarketplaceListing } from '../../../../../typings/marketplace';
|
||||
import { selloutState } from './state';
|
||||
|
||||
export const useListing = () => {
|
||||
return useRecoilValue<MarketplaceListing[]>(selloutState.listing);
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
import { useCallback } from 'react';
|
||||
import { listingState, useSetListings } from './state';
|
||||
import { MarketplaceListing } from '../../../../../typings/marketplace';
|
||||
import { useRecoilValueLoadable } from 'recoil';
|
||||
|
||||
interface MarketplaceActionValues {
|
||||
deleteListing: (id: number) => void;
|
||||
addListing: (listing: MarketplaceListing) => void;
|
||||
}
|
||||
|
||||
export const useMarketplaceActions = (): MarketplaceActionValues => {
|
||||
const { state: valueLoading, contents } = useRecoilValueLoadable(listingState);
|
||||
const setListings = useSetListings();
|
||||
|
||||
const deleteListing = useCallback(
|
||||
(id: number) => {
|
||||
// Make sure our atom is actually loaded before we attempt a dispatch
|
||||
if (valueLoading !== 'hasValue') return;
|
||||
// Tts possible for the init fetch to fail and empty array is passed. In that case
|
||||
// block dispatch
|
||||
if (!contents.length) return;
|
||||
|
||||
setListings((curListings) => [...curListings].filter((listing) => listing.id !== id));
|
||||
},
|
||||
[setListings, valueLoading, contents],
|
||||
);
|
||||
|
||||
const addListing = useCallback(
|
||||
(listing: MarketplaceListing) => {
|
||||
// Make sure our atom is actually loaded before we attempt a dispatch
|
||||
if (valueLoading !== 'hasValue') return;
|
||||
setListings((curListings) => [...curListings, listing]);
|
||||
},
|
||||
[setListings, valueLoading],
|
||||
);
|
||||
|
||||
return { deleteListing, addListing };
|
||||
};
|
||||