876 Commits
Author SHA1 Message Date
Taso 4a60164faf ci(cleanup): cleaned up scripts for deployment 2021-08-05 21:02:44 -04:00
Taso 381f298ad4 feat(ci): automatically bump versioning on tag push 2021-08-05 20:43:32 -04:00
Taso 8461c1acd2 tweak(phone): tweaked env handling to expose package.json version for sentry 2021-08-05 20:42:43 -04:00
Taso dce079222a ci(tagged-release): no longer tag releases with v*
makes this easier for semver tracking and consistency sake
2021-08-05 20:24:38 -04:00
Taso 13952fa318 ci(tagged-release): setup sentry deployment with node
and mis general cleanup
2021-08-05 19:45:29 -04:00
Taso 95c3aea1d9 ci(pre-release): cleaned up pre-release ci slightly 2021-08-05 19:44:38 -04:00
Taso 1583789341 fix(ci/pre-release): get and set step vars properly 2021-08-05 19:16:08 -04:00
Taso 04f9195444 ci(dependabot): replaced by depfu 2021-08-05 18:28:17 -04:00
Taso d0419b067a fix(ci/pre-release): set auto tag on release 2021-08-05 18:25:08 -04:00
Taso 858bd1cf78 Merge remote-tracking branch 'personal/ci-testing' 2021-08-05 18:18:00 -04:00
Taso a87b1afe2a fix(ci/pre-release): hopefully fix pre-release build 2021-08-05 18:16:22 -04:00
Taso aa294e749e Merge branch 'develop' 2021-08-05 17:14:37 -04:00
Christopher 2cbd3c934d fix(match): fix suspense issue 2021-08-02 12:22:42 +02:00
Christopher 98358e54eb chore(camera): remove unused log 2021-08-02 12:09:48 +02:00
Christopher 96aa7107ba feat(camera): disable camera mode 2021-08-02 11:58:25 +02:00
Christopher 5dcb654516 fix(player): force identifier to string 2021-08-02 11:16:32 +02:00
chip 1253c76aef Feat/refactor matchmaker promise format (#293) 2021-08-01 00:26:10 +02:00
Taso 7ed5f54709 fix(phone/call-modal): suspense fallback on contact lookup in call modal 2021-07-29 21:12:58 -04:00
Taso 553e04ef3c tweak(config): remove unused options from root config 2021-07-29 20:41:55 -04:00
Taso c644d177f1 fix(calls/modal): Fixed translation key for ringing text 2021-07-29 20:34:19 -04:00
Taso 5263a83d1f fix(calls): Fix incorrect data type being sent over net 2021-07-29 20:29:27 -04:00
Christopher 60b9e35ae8 fix(marketplace): should probably change the name of the loger too 2021-07-29 20:25:58 +02:00
Christopher bdc79aeff9 chore(marketplace): clean up references of 'sellout' 2021-07-29 19:37:02 +02:00
Christopher 7cf1e20e8f fix(browser): inputbase 2021-07-29 16:52:44 +02:00
Taso 71e9908f35 fix(phone/browser): fix class attr on iframe when webcomp is disabled 2021-07-28 22:52:38 -04:00
Taso 929663af0c tweak(phone/browser): include experimental iframe extension comp 2021-07-28 22:49:33 -04:00
Taso a06ef07902 feat(phone/browser): Added a browser app
This utilizes an iframe, meaning sites that are blocking cross-origin iframes will ultimately fail.

With this feature, a config option is added to the nui config allowing for users to specify a home page URL to default to.
2021-07-28 21:21:11 -04:00
Taso b433c2bda0 fix(phone/contacts): fix input length handling for numbers 2021-07-28 16:44:14 -04:00
Taso 334a79b68b chore(phone/build): fix various eslint warnings on build 2021-07-28 14:59:47 -04:00
Taso e2f03f411d chore(resources): rebuild lock file 2021-07-28 14:43:31 -04:00
Taso be4323f337 tweak(calls): Abstract initialize call action & own number handling 2021-07-28 14:41:19 -04:00
Taso af6e291368 fix(calls): fix some bugs encountered during refactor 2021-07-28 14:26:01 -04:00
Taso 10c5e97088 fix(calls): fix references to async selector DialerHistory 2021-07-28 14:26:01 -04:00
Taso 36d1e993bd refactor(calls): refactor of call architecture 2021-07-28 14:26:00 -04:00
Taso 92b687b130 ci(sentry): update sentry to use new hosted instance
this might not work but hey it kinda does
2021-07-28 14:25:47 -04:00
Taso b45ad53bc6 ci(main): ensure modules can be built on run 2021-07-27 23:12:12 -04:00
Taso d648b21d3b tweak(phone): update old NuiCallbacks with new wrapper func
Also switches old Nui.send() calls with fetchNui on focus input control
2021-07-27 23:08:40 -04:00
Taso fc939885a8 feat(config): configure an export to be called at toggle to control phone access
Can serve as a primitive form of access control that can for example call a client side inventory check
2021-07-27 23:06:13 -04:00
Taso b00bee0217 chore(client/animation-service): shut eslint up about explicit types 2021-07-27 22:40:59 -04:00
Taso 16626db5bd cleanup(photos): A general cleanup of photos
Removes legacy code no longer in use or cleans up code to use new type safe native wrappers
2021-07-27 22:39:18 -04:00
Taso 83ec915926 perf(client/controls): global -> local ref optimization 2021-07-27 17:49:47 -04:00
LedAndris 05343d0540 fix(phone/settings/icons): Fixed validation error 2021-07-27 23:08:21 +02:00
Christopher 35eb0ee698 feat(ci/tagged-releases): change sentry action 2021-07-27 17:06:52 -04:00
Oldarorn d2d13200ca locales(fr): update fr translations (#289) 2021-07-27 17:06:52 -04:00
Taso 1b8755049d fix(tests): remove accidental added test file 2021-07-27 17:06:52 -04:00
Taso dd99f7e241 fix(phone/contacts): provide user feedback on max length data 2021-07-27 17:06:52 -04:00
Taso 02f0abd761 feat(sentry): add wip sentry integration on server side 2021-07-27 17:06:52 -04:00
Taso 4b724dfa73 fix(phone/marketplace): fix state dispatch when selector is loading
Should fix edge cases where broadcast events are received and processed before the original fetch promise resolves
2021-07-27 17:06:52 -04:00
Taso 44599c882d ci(sentry): update sentry to use new hosted instance
this might not work but hey it kinda does
2021-07-27 17:06:49 -04:00
Bombay eaae3c7211 feat(locales/es): Added missing translations (#286) 2021-07-27 17:04:29 -04:00
Taso 3b7326dac8 feat(phone/error-handling): add top level error boundary for reload 2021-07-27 17:04:29 -04:00
Taso 908a393451 ci(releases): auto release CI 2021-07-27 17:04:29 -04:00
Christopher 68d2e66d16 chore(phone): minor changes 2021-07-27 17:04:29 -04:00
Christopher 4e8c57492b feat(camera): refactor to new promise event format 2021-07-27 17:04:28 -04:00
Taso 1566bb0fdb fix(phone/getLocationFromUrl): fix type mismatch 2021-07-27 17:04:28 -04:00
Taso 9d7ddbca6f ci(releases): fix file name for releases? 2021-07-27 17:04:28 -04:00
Taso c073965dff ci(sentry): setup sentry with source maps on release 2021-07-27 17:04:28 -04:00
Taso 4dd075a537 ci(iswtg): this is the last time im doing this GH actions 2021-07-27 17:04:28 -04:00
Taso 8498f91a1f build(env): set process.env.CI to false
don't really want to deal with the errors being thrown by CI so it happens
2021-07-27 17:04:28 -04:00
Taso 2e714ccb0f ci(releases): auto release CI 2021-07-27 17:04:28 -04:00
dependabot[bot] f474bd0148 chore(deps-dev): bump typescript from 4.3.2 to 4.3.5 (#277) 2021-07-24 01:34:51 +00:00
Taso fcae80b785 chore(deps): bumped deps and cleaned package.json 2021-07-23 21:25:50 -04:00
dependabot[bot] 80da6a0af1 chore(deps): bump i18next from 19.8.2 to 20.3.4 (#291) 2021-07-24 00:56:34 +00:00
dependabot[bot] 33c58e9931 chore(deps): bump @discordjs/collection from 0.1.6 to 0.2.0 (#275) 2021-07-24 00:53:42 +00:00
Taso 14f44a63d1 chore(dependabot): we love you man but chill 2021-07-23 20:48:16 -04:00
Noodles 4ce98e29d3 chore(misc): migrate to "new" file hosting fileglass from iodine
If I have to do this again, I am replacing all these links with imgur ones.
2021-07-22 23:00:00 -04:00
dependabot[bot] 0a2ba225cd chore(deps-dev): bump cross-env from 7.0.2 to 7.0.3 in /phone (#279) 2021-07-20 19:48:16 +00:00
dependabot[bot] ad57768745 chore(deps-dev): bump @types/react-router-dom from 5.1.7 to 5.1.8 (#276) 2021-07-20 19:47:59 +00:00
dependabot[bot] 5b017b6892 chore(deps-dev): bump @babel/preset-typescript in /resources (#273) 2021-07-20 19:47:43 +00:00
Christopher Gjelten 029e221a98 Update README.md 2021-07-16 04:50:17 +02:00
dependabot[bot] dc1677675b chore(deps): bump core-js from 3.10.1 to 3.15.2 in /phone (#268) 2021-07-08 04:13:56 +00:00
dependabot[bot] b932a0924f chore(deps-dev): bump @babel/core from 7.14.3 to 7.14.6 in /resources (#262) 2021-07-07 16:11:21 +00:00
dependabot[bot] a562ea776a chore(deps-dev): bump prettier from 2.2.1 to 2.3.2 (#266) 2021-07-07 04:43:29 +00:00
dependabot[bot] 1b9ac61d1d chore(deps-dev): bump @types/qs from 6.9.5 to 6.9.6 (#263) 2021-07-07 04:42:52 +00:00
dependabot[bot] 69e5cdf326 chore(deps): bump parse-url from 5.0.2 to 5.0.7 in /phone
Bumps [parse-url](https://github.com/IonicaBizau/parse-url) from 5.0.2 to 5.0.7.
- [Release notes](https://github.com/IonicaBizau/parse-url/releases)
- [Commits](https://github.com/IonicaBizau/parse-url/commits)

---
updated-dependencies:
- dependency-name: parse-url
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-07 00:42:08 -04:00
dependabot[bot] d2e223ca39 chore(deps-dev): bump @babel/preset-env from 7.14.4 to 7.14.7
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.14.4 to 7.14.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.14.7/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-07 00:40:59 -04:00
Taso f9956a15a8 fix(scripts/client): fix wrong response format struct on promise reject 2021-07-06 23:58:30 -04:00
Taso 833d2f282b chore(deps): add pe-utils dep to game scripts & tweak root scripts 2021-07-06 23:58:02 -04:00
Taso e288e5b50e ci(dependabot): add dependabot coverage and setup 2021-07-06 23:56:48 -04:00
Dillon Skaggs 104fda2c11 feat(global): major fixes...i dont even know that to call this commit so ill just say its global. Who even cares 2021-07-06 23:10:47 +02:00
dependabot[bot] f6395e4b8e chore(deps): bump lodash from 4.17.20 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

---
updated-dependencies:
- dependency-name: lodash
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2021-07-06 17:05:46 -04:00
Dillon Skaggs 398bfa2092 feat(): add animation and call service & controllers (#259)
* feat(): add animation and call service & controllers

- run animations on interval so we don't lose animations when walking through doors
- move cl_call.ts to a class

* fix(animation/service): make everything private except for open/closePhone and start/endPhoneCall
2021-07-06 23:02:55 +02:00
Christopher 4ef89f679f fix(resources/server): changed credentials return type 2021-06-25 21:15:45 +02:00
Christopher eb5b907091 fix(dialer/ui): fix type 2021-06-25 21:14:18 +02:00
Christopher b1b412b81e fix(resources/server): import bank stuff 2021-06-18 22:09:05 +02:00
Christopher ee8a8b62cc refactor(resources/bank): move bank stuff to controller
someone else can refactor this shit
2021-06-18 22:07:21 +02:00
Christopher b033eae51e feat(resources/server): move some functions to 'misc' 2021-06-18 22:05:06 +02:00
Christopher 4029e8c7a1 feat(resources/server): remove sv_match.ts 2021-06-12 14:06:20 +02:00
Christopher b173f0ae48 perf(resources/server): order tweets by id 2021-06-12 14:04:29 +02:00
Taso 9404a6dd26 chore(marketplace): Misc cleanups 2021-06-10 17:52:14 -04:00
Jan Lecoutere 865a8e44de chore(messages/labels): removed unnecessary npwd_messages_labels column (#253) 2021-06-09 20:21:20 +02:00
Dylan Mld 94633e53a6 feat(resources): added support for identifier prefix for older esx versions. (#244) 2021-06-09 19:08:26 +02:00
Christopher 6a3bef1e34 feat(resources/server): refactor matchmaker 2021-06-09 18:51:10 +02:00
Taso 44a9595463 refactor(notes): Refactor to new promise event format 2021-06-08 23:10:16 -04:00
Taso bb81ab6fe2 dev(webpack): Tweak source map in dev mode 2021-06-08 23:09:23 -04:00
Taso e76e6c5296 feat(phone/icon-sets): Add icon sets configurable in settings 2021-06-08 23:05:13 -04:00
Taso 2c9f260417 fix(phone/apps): Fix apps referencing 'SELLOUT' instead of marketplace 2021-06-08 16:51:35 -04:00
Taso c59137d598 Merge branch 'refactor/marketplace-state' 2021-06-08 16:46:53 -04:00
Taso 28fd09ce53 tweak(phone/contacts): Tweak contact actions to remove unneeded dep 2021-06-08 16:45:57 -04:00
Taso 5493a3de76 tweak(server/onNetPromise): Enhance logging 2021-06-08 16:45:57 -04:00
Taso f0acadbf98 types(contacts): Cleanup unused types 2021-06-08 16:45:57 -04:00
Taso 52ac061a3c tweak(contacts): Misc changes to contact handling 2021-06-08 16:45:57 -04:00
Taso ecb71cc359 refactor(contacts): Refactor contacts to efficient data fetching 2021-06-08 16:45:55 -04:00
Taso 5e225ca736 tweak(marketplace): Tweak marketplace to match current fetching std 2021-06-08 16:35:41 -04:00
Christopher 10639260e0 fix(phone): move FABs outside of AppContent 2021-06-08 15:47:19 -04:00
Taso 3df2f88759 refactor(server/marketplace): Refactor to use promise events 2021-06-08 15:46:57 -04:00
Taso 4afa9c691b refactor(phone/marketplace): Refactor state management and fetching 2021-06-08 15:46:39 -04:00
Taso 2d1e192892 tweak(server/onNetPromise): Enhance logging 2021-06-08 15:45:47 -04:00
Taso 51d8aa6322 types(contacts): Cleanup unused types 2021-06-08 15:36:56 -04:00
Taso be8e9bfa39 tweak(contacts): Misc changes to contact handling 2021-06-08 15:35:12 -04:00
Taso d036243d64 refactor(contacts): Refactor contacts to efficient data fetching 2021-06-08 14:58:05 -04:00
Christopher 1940833f56 fix(phone): move FABs outside of AppContent 2021-06-08 20:45:12 +02:00
Taso 54d456cc8a fix(resources): Silence the TS compiler 2021-06-08 12:48:48 -04:00
Taso 42b2970428 tweak(resources/server): Finally remove @ts-ignore as my PR was merged 2021-06-08 12:38:34 -04:00
Taso f1012958e2 chore(resources): General Linting 2021-06-08 12:36:10 -04:00
Taso 457926263d chore(resources/deps): Upgrade deps & configure eslint for TS 2021-06-08 12:35:39 -04:00
Taso dcb7556edc tweak(resources/promise-events): Tweak promise event resp and req types 2021-06-08 12:06:52 -04:00
Taso f54dc974a2 fix(phone/apps): Apps will no longer call not existent endpoint 2021-06-08 11:21:49 -04:00
Taso 908e467011 chore(deps/phone): Bump ts and recoil 2021-06-08 10:43:08 -04:00
Christopher 478c5ffc63 fix(calls): handle invalid numbers 2021-06-05 19:19:30 +02:00
Christopher 44a0d941b9 fix(resources/calls): fix typo 2021-06-05 17:58:41 +02:00
Christopher 3446de488e fix(resources/twitter): constructor log 2021-06-05 17:58:10 +02:00
Christopher be70534108 Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-06-05 00:46:45 +02:00
Christopher 0e9f8bc574 feat(resources/twitter): refactor twitter
Currently just commented out the sv_twitter file. Test that it works, before removing the old file.
2021-06-05 00:46:35 +02:00
Dillon Skaggs aa185224e7 Fix useEffect infinite re-render (#245) 2021-06-05 00:12:33 +02:00
Christopher 871b9e0f1d Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-06-04 23:12:27 +02:00
Taso b257f5bc73 tweak(server/onNetPromise): Tweak to be less opinionated and simpler 2021-06-04 11:55:14 -04:00
Taso fed042aea7 tweak(client/utils): Add and tweak various fetch utils for refactor 2021-06-04 10:47:25 -04:00
Christopher 99fa476124 Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-06-04 08:18:22 +02:00
GoatGeek ebe8c67369 feat: added lua linting github action (#252) 2021-06-03 12:16:11 -04:00
Christopher c48b7333e2 Merge branch 'modal' of https://github.com/AvarianKnight/new-phone-who-dis 2021-06-02 23:20:05 +02:00
dependabot[bot] 4f380a56e1 chore(deps): bump browserslist from 4.16.3 to 4.16.6 in /resources
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.3 to 4.16.6.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.16.3...4.16.6)

Signed-off-by: dependabot[bot] <[email protected]>
2021-05-27 00:25:06 -04:00
Jan Lecoutere 870aeda3c3 Disable walking when an inputfield is focused (#234)
* feat(phone) Disable walking when an input is focused

* refactor(phone) renamed var & replaced copy paste code

Instead of copying the code it now uses a custom hook

* refactor(phone/input): removed useMemo from hook

* style(phone/input): changed indentation to spaces & added de-structured import
2021-05-24 12:22:00 -04:00
Avarian Knight f10369a4e9 remove(components/tweet): don't use escape at all
- readds useKeyboardService module
2021-05-23 23:04:20 -05:00
Avarian Knight d95062d771 fix(modal): fix infinite rerender
- fix useEffect for twitter
- removes handling escape in modal
- don't limit contacts loading
- catch error on unloading
2021-05-23 23:03:56 -05:00
Christopher Gjelten 0e1d7f40b5 Update PhoneProviders.tsx 2021-05-24 02:26:32 +02:00
Christopher Gjelten e05f543cb0 Fix: Player ready stuff (#241) 2021-05-23 15:34:17 +02:00
RockySouthpaw a103ef9b2f FIX: Prevent crouch when pasting into phone. 2021-05-22 01:19:35 -04:00
Christopher fb32aaef15 fix(phone): only listen to UI Ready 2021-05-21 00:35:05 +02:00
Dillon Skaggs 2411c39b95 Fix double call history & adding contact from history (#231) 2021-05-20 23:54:01 +02:00
Dillon Skaggs 488c8df5cb feat(client/call): make pma-voice the default export (#232)
- mumble-voip is no longer maintained and is recommended to not be used.
2021-05-20 14:43:28 -04:00
Christopher 054f89c03d fix(phone): fixed? 2021-05-20 18:29:01 +02:00
Christopher 2f0f83a17e fix(resources): load config when player spawns
this is a solution for standalone
2021-05-20 16:42:34 +02:00
Christopher d279b31b8f chore(phone): remove useless sendMessage 2021-05-18 13:13:31 +02:00
Christopher 2bd4f4dc96 fix(phone): remove checks for phoneReady 2021-05-18 13:10:48 +02:00
Christopher 346d194e97 fix(resources): use database config for sql queries 2021-05-16 02:39:19 +02:00
Christopher f89ffc3060 fix(init): remove player/ui ready events 2021-05-16 02:20:17 +02:00
Christopher c5aaf32e5d fix(sql): varchar limit for contact display 2021-05-16 02:04:43 +02:00
Christopher Gjelten 7d447c118c Merge pull request #211 from project-error/cleanup/config
Cleanup of Config + Runtime Reference, Not Compile
2021-05-16 02:00:48 +02:00
Christopher Gjelten 0134b9052c Merge branch 'master' into cleanup/config 2021-05-16 01:57:30 +02:00
Christopher 46484be9bc fix(calls): check if player does not exist --no-verify 2021-05-15 05:08:51 +02:00
Christopher Gjelten 951ed914d5 Merge pull request #212 from project-error/feat/keep-input 2021-05-14 02:29:37 +02:00
Darrian d5aaa67c6c Fix: Removed net event. 2021-05-12 02:38:11 -04:00
dependabot[bot] d18ebc066b chore(deps): bump handlebars from 4.7.6 to 4.7.7 (#224)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-09 11:07:37 -04:00
dependabot[bot] aa8648c408 chore(deps): bump hosted-git-info from 2.8.8 to 2.8.9 (#225)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-09 11:07:22 -04:00
Christopher aa5eb4be2d fix(resources/calls): emit events for start and accepting calls 2021-05-09 15:18:18 +02:00
Christopher b92cf0d6fa fix(resources/messages): fix coercion comparsion 2021-05-09 15:15:20 +02:00
victorBOY ea69ba4667 Update ptbr.json (#222) 2021-05-07 15:03:28 -04:00
Taso 4c3d018751 chore(husky): enforce commit conventions in precommit script 2021-05-04 23:58:58 -04:00
Taso 1fe8541476 fix(server/players): Handle new player event in controller
For some reason this event actually lacked the new player handle
2021-05-04 23:32:48 -04:00
Christopher fd6afa927c fix(resources/notes): fetch notes after adding 2021-05-04 17:48:24 +02:00
Christopher Gjelten f53117971e Merge pull request #205 from project-error/feat/public-api
feat(player/npwd): Public facing API
2021-05-04 11:17:16 +02:00
dependabot[bot] 4b705da072 chore(deps): bump ssri from 6.0.1 to 6.0.2 (#219)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-02 22:17:11 -04:00
dependabot[bot] 532a554b77 chore(deps): bump ssri from 6.0.1 to 6.0.2 in /resources (#218)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-02 22:17:02 -04:00
Franco Sanllehi 1ac4b6dd8d tweak(lerna/setup): Slightly tweak setup for lerna monorepo
* Added @octokit/core (peer-dep for lerna)
* Added yarn bootstrap on post-install script to automatically bootstrap lerna repo
2021-05-02 22:15:24 -04:00
Franco Sanllehi ba8f722c35 Update es.json (#220)
* Update es.json

* Update es.json

* Update es.json
2021-05-02 02:44:39 -04:00
J Francisco Rader faf4edfbc6 Tweak / Effect dependencies and Fivem-Nui-lib (#216)
* Fix Nui.send effect dependencies and upgrade lib to fixed version

* Remove log
2021-04-30 22:52:35 +02:00
nullptr 34b177e827 Hungarian translation (#217) 2021-04-30 12:06:16 +02:00
クリストファー 1030ae158c Update README.md 2021-04-26 17:13:56 +02:00
Christopher 4f658181d2 fix(resources/server): fix imports 2021-04-26 17:07:57 +02:00
Darrian 000151e756 Fix: Disable additional controls. 2021-04-22 13:24:23 -04:00
Darrian 80d2d5476a Fix: Additional disable controls for vehicles + chat. 2021-04-22 12:59:49 -04:00
Darrian 95ed68dff6 RFR: Renamed file, adjusted manifest, and refactored code.
Renamed the event so its more clear what it does and added a bool to denote when it's being disabled or not. This was attached to `isPhoneOpen` which wasn't reliablly working.  Its now done within `showPhone` and `hidePhone`.

The wait was changed from `1000` to `100` in the event the phone is opened before the wait is over. Makes it more smooth as there is no longer a small duration where the mouse moves the camera.

Removed the enable of control actions as it wasn't needed.
2021-04-22 12:32:10 -04:00
Christopher 10e28b911e refactor(resources/photo): refactor photos 2021-04-21 14:34:07 +02:00
Christopher 3470700fc1 fix(resources/messages): actaully use the class property 2021-04-21 14:18:45 +02:00
Christopher 8efcf2e5b5 refactor(resources/messages): refactor messages 2021-04-21 14:01:10 +02:00
Christopher ed05ebd6a8 Merge branch 'feat/public-api' of https://github.com/project-error/new-phone-who-dis into feat/public-api 2021-04-20 13:50:33 +02:00
Christopher cd4f7e73a6 feat(resources): refactor marketplace 2021-04-19 14:14:26 -04:00
Christopher 4803753cfa fix(contacts): dont send a object when deleting a contact 2021-04-19 14:14:25 -04:00
Taso 85d4ab3c36 fix(client/twitter): Fixed profile fetch 2021-04-19 14:14:25 -04:00
Taso 3304ae9a83 fix(phone/marketplace): Fix open fetch event 2021-04-19 14:14:25 -04:00
Taso 53fbf07984 tweak(server): Add some service instantiation logs 2021-04-19 14:14:25 -04:00
Taso 9724014a9a fix(server): Actually reference PlayerService method 2021-04-19 14:14:25 -04:00
Taso 8988ea9b26 fix(server): Actually import the correct controllers 2021-04-19 14:14:25 -04:00
Taso a0c80a0e9a fix(server/notes): Temporarily use old resp format 2021-04-19 14:14:25 -04:00
Taso 048753f6d2 fix(server/contacts): Use old response structure for time being 2021-04-19 14:14:25 -04:00
Taso 4687635988 fix(client/calls): Fix call history not fetching properly 2021-04-19 14:14:25 -04:00
Taso 93fd955ae9 fix(server): Fix server's referencing old player system 2021-04-19 14:14:25 -04:00
Taso 25a629a59b feat(net-events): Initial opinionated promise wrapper around net events
Lets see how I & the rest of the team feel about this specific standard and we can tweak it from there.
2021-04-19 14:14:25 -04:00
Taso f8f722c8d2 refactor(server/contacts): Implement singleton architecture 2021-04-19 14:14:25 -04:00
Taso 16471ed1df feat(server/types): Play around with a standardized resp type 2021-04-19 14:14:25 -04:00
Taso feb9e8a5d3 refactor(server/notes): Implement singleton architecture
Also trying something out with the response structure on the server to cut down on redundant calls.
2021-04-19 14:14:25 -04:00
Taso 0f8923058f tweak(server/calls): Tweaked structure and added enum constants 2021-04-19 14:14:24 -04:00
Taso 06a67f14cd tweak(server/player): Tweaked structure slightly 2021-04-19 14:14:24 -04:00
Taso cb9c490cb5 refactor(server/calls): Calls singleton architecture 2021-04-19 14:14:24 -04:00
Taso 33a02bb203 refactor(server/player): Player singleton architecture 2021-04-19 14:14:24 -04:00
Taso 19e4ba0543 WIP 2021-04-19 14:14:24 -04:00
Taso 85eb58948d tweak(player): Altered PLAYER_IS_READY event to emit a bool
This will set the client var to true when NPWD loads a player and false when NPWD unloads a player.
2021-04-19 14:14:24 -04:00
Taso 558f2388fc refactor(server/players): Take a different approach to multichar
This changes how multicharacter support is implemented entirely.

Instead there are now events for creating a new player & unloading a player. These should be called whenever a character is switched. Documentation will be added for `npwd:newPlayer` & `npwd:unloadPlayer`
2021-04-19 14:14:24 -04:00
Taso 222070eeea fix(server/players): Aliased global.exports 2021-04-19 14:14:24 -04:00
Taso 6be602c95b feat(player/npwd): Update identifier & name
Still need to include a public facing phone number update
2021-04-19 14:14:24 -04:00
Taso 3e01fc456c tweak(phone): Split Phone component into wrapper 2021-04-19 13:28:10 -04:00
Taso 4b7a6280fd fix(phone/notes): Fixed slide transition with notes modal 2021-04-19 13:15:55 -04:00
Taso ec4ebdc54d tweak(phone): Rename PhoneContainer 2021-04-19 13:15:33 -04:00
Christopher 0df1c123b0 feat(resources): refactor marketplace 2021-04-19 19:13:56 +02:00
Christopher 6c9e2aef04 fix(contacts): dont send a object when deleting a contact 2021-04-18 21:51:41 +02:00
Taso 478d4d4519 fix(client/twitter): Fixed profile fetch 2021-04-18 15:38:51 -04:00
Taso 046aeffb76 fix(phone/marketplace): Fix open fetch event 2021-04-18 15:38:51 -04:00
Taso 0de2495bfa tweak(server): Add some service instantiation logs 2021-04-18 15:38:51 -04:00
Taso ad7adcdeb6 fix(server): Actually reference PlayerService method 2021-04-18 15:38:51 -04:00
Taso af9ff9c92f fix(server): Actually import the correct controllers 2021-04-18 15:38:51 -04:00
Taso 8af7530f18 fix(server/notes): Temporarily use old resp format 2021-04-18 15:38:51 -04:00
Taso 635dc907ce fix(server/contacts): Use old response structure for time being 2021-04-18 15:38:51 -04:00
Taso caf42c9c8a fix(client/calls): Fix call history not fetching properly 2021-04-18 15:38:51 -04:00
Taso 2dafbcc13f fix(server): Fix server's referencing old player system 2021-04-18 15:38:51 -04:00
Taso 51b5620866 feat(net-events): Initial opinionated promise wrapper around net events
Lets see how I & the rest of the team feel about this specific standard and we can tweak it from there.
2021-04-18 15:38:51 -04:00
Taso c94c69c646 refactor(server/contacts): Implement singleton architecture 2021-04-18 15:38:51 -04:00
Taso b684656379 feat(server/types): Play around with a standardized resp type 2021-04-18 15:38:51 -04:00
Taso 0bb20fff31 refactor(server/notes): Implement singleton architecture
Also trying something out with the response structure on the server to cut down on redundant calls.
2021-04-18 15:38:51 -04:00
Taso d93bdd20d8 tweak(server/calls): Tweaked structure and added enum constants 2021-04-18 15:38:51 -04:00
Taso b051ae9fac tweak(server/player): Tweaked structure slightly 2021-04-18 15:38:51 -04:00
Taso bf95ccb06b refactor(server/calls): Calls singleton architecture 2021-04-18 15:38:51 -04:00
Taso bb7d938b07 refactor(server/player): Player singleton architecture 2021-04-18 15:38:51 -04:00
Taso e01fa0ab0a WIP 2021-04-18 15:38:50 -04:00
Taso 949ea4ba4b tweak(player): Altered PLAYER_IS_READY event to emit a bool
This will set the client var to true when NPWD loads a player and false when NPWD unloads a player.
2021-04-18 15:38:50 -04:00
Taso 268bd4f4a4 refactor(server/players): Take a different approach to multichar
This changes how multicharacter support is implemented entirely.

Instead there are now events for creating a new player & unloading a player. These should be called whenever a character is switched. Documentation will be added for `npwd:newPlayer` & `npwd:unloadPlayer`
2021-04-18 15:38:50 -04:00
Taso 2ec049ca12 fix(server/players): Aliased global.exports 2021-04-18 15:38:50 -04:00
Taso db03394487 feat(player/npwd): Update identifier & name
Still need to include a public facing phone number update
2021-04-18 15:38:50 -04:00
Christopher 8861f4e503 fix(phone): remove Nui deps from useEffect 2021-04-18 21:37:47 +02:00
Christopher 6a46711a51 feat(phone/marketplace): choose images from camera 2021-04-16 15:34:45 +02:00
Christopher 1c69cd5e2e keep input 2021-04-16 09:10:10 +02:00
Taso b14562eb9d tweak(phone): Remove FontAwesome dependency
All icons were switched to @material-ui/icons
2021-04-13 22:49:05 -04:00
Taso af2b7519b6 chore(phone): Remove cp-cli dep 2021-04-13 22:09:18 -04:00
Taso dd3eac4a0e tweak(config): Config var & send as event method
config -> ResourceConfig for readability and the resource config in NUI is now being referenced consistently from state so it can be referenced at runtime and not compile time.

Also removes the need to copy the config before using `cp`
2021-04-13 22:07:22 -04:00
Taso 8ce6ec7559 fix(config): Fixed typos in resource config 2021-04-13 22:06:43 -04:00
Taso 60e38c9e5c tweak(phone/default-config): Readability differentiation for config
Makes the difference between the NUI specific build time config & the resource runtime resource config more apparent.
2021-04-13 22:06:43 -04:00
Taso 71bb73b54e fix(phone/watch): Fixed in-game watch and prevent debug inject
If using the `watch` script in game, the debug injections will not occur.
2021-04-13 22:04:23 -04:00
J Francisco RaderandTaso 8dc59c47bd fix(phone): Fix subsequent rerenders & added WDYR (#209)
Fixed an issue with infinite rerendering on app routes by making it a Pure component.

Adds `why-did-you-render` for development use.

Co-authored-by: Taso <[email protected]>
2021-04-13 21:33:18 -04:00
Taso 4fceb3750b tweak(phone/deps): Remove @types/jest as we use enzyme 2021-04-13 21:24:25 -04:00
Taso 771483b7b5 fix(phone/watch): Implement watch using craco and writing to disk 2021-04-13 21:24:25 -04:00
Taso 1ef01f291b fix(phone/tests): Fixed enzyme test for React 17 2021-04-13 21:24:25 -04:00
Taso 6154dfc7a3 tweak(phone): Bumped deps & tweaked craco
This updates our craco config to match our current custom webpack build rather than having to eject. This also bumps several of our dependencies that were outdated for React 17.
2021-04-13 21:24:25 -04:00
Taso ecd7689742 fix(phone/icons): Fixed messages icon having text in d attr 2021-04-13 20:21:24 -04:00
Taso 2b4752dc89 fix(phone/number): Fix incorrect method ref on setNumber in dev 2021-04-13 19:49:01 -04:00
Taso bd5f3016d0 tweak(phone/settings): Remove button effect on switches 2021-04-13 19:48:44 -04:00
Taso fad2ff14fa fix(scripts/client): Fix incorrect ready & config method 2021-04-13 16:49:35 -04:00
Taso 390319deda fix(types): Fixed incorrectly referenced type 2021-04-11 10:32:31 -04:00
Taso b5fca6b35b cleanup: Recoil State Type Safety + Misc Cleanup (#189)
* chore(phone/settings): Removed unused state

* cleanup(phone/photos): Added type safety to photo state

* tweak(phone/marketplace): Added type safety to marketplace state

* chore(phone/match): Removed unnecessary console.log

* tweak(phone/messages): Added type safety to messages state

Also fixed ESLint warning for exported anonymous hook in useMessages.ts

* tweak(phone/match): Added type safety to match state

* tweak(phone/dialer): Cleanup & type safety for state

Renamed some types to better represent their data

* cleanup(phone/gen): Added NUI event enums for phone events

* tweak(phone/contacts): Type safety for contacts state & variable rename

Renamed and type variable in setFilteredContacts to better represent its use

* tweak(phone/gen-state): Added type-safety to gen phone global state

* tweak(phone/settings): Type safety for settings state

* tweak(phone/photos): Tweaked type for photo referral

* fix(phone/notification-comp): Fix reference to old theme config

* chore(phone/hooks): Remove keyboard service

Removed as this was unused and ESLint was not happy with it

* chore(phone): Cleaned up eslint warnings

No more warnings hooray!

* tweak(phone): Set time in dev mode

* fix(phone): Remove useNuiService that appeared somehow

* fix(phone/gallery): Fixed missing import for gallery

* Revert removing the keyboard service as this is built upon in another PR

This reverts commit 82d12255a84e918da087d988b599af98ce1fe54d.

* fix(phone/keyboard): Add useKeyboardService hook back to Phone.tsx

* fix(phone/gallery): Fix and standardized GalleryPhoto type
2021-04-11 10:01:38 -04:00
Taso 1f20b980da fix(phone/gallery): Fix forgotten handle function 2021-04-11 09:45:17 -04:00
Taso a880ae66ea feat(config): Allow config to be edited without rebuild 2021-04-11 09:38:20 -04:00
Taso 1a3d02f1e3 fix(husky): Readd missing precommit script 2021-04-11 09:05:09 -04:00
J Francisco Rader b97cc4102d Feature / Add loading state to camera app (#200)
* (feat/camera-loading): Add loading state to camera app

* Fix imports + Add timeout

* Use actual function :D
2021-04-10 16:19:25 -03:00
dayiskuan e1e6e8440d Adding new icons (#204)
* Adding new icons
2021-04-10 14:49:15 -03:00
Oldarorn 404d526863 Adding french missing translations (#203)
french baguette ♫
2021-04-09 16:06:24 +02:00
J Francisco Rader e70c540ce8 Fix fetch on initialize (fixing notifications too) (#202)
* Fix fetch on initialize (fixing notifications too)

* Add multiline support to messages input field
2021-04-08 10:53:12 -03:00
Christopher 62038aa5fe tweak(phone/wallpaper): current wallpaper value as initial input value 2021-04-08 11:00:52 +02:00
J Francisco Rader 8e79eb1345 Make use of library instead of having code duplicated (#201)
* Use fivem-nui-react-lib
2021-04-07 19:07:10 -03:00
Christopher Gjelten 0cf5bc2bc7 tweak(phone/settings): simplify custom background (#185)
Adds the custom background option into wallpaper SettingItem, with an nice DialogForm.
2021-04-07 23:29:18 +02:00
Taso 8ef1a0aa9a tweak(scripts): Tweaked root lerna scripts
Tweaked root package.json scripts to better improve dev experience.

* Install npm dependencies for both packages using `yarn bootstrap` in root directory

* Build both NUI and game scripts using `yarn build` in the root directory.

* Precommit git hook references script rather than global pretty-quick
2021-04-05 20:12:34 -04:00
Taso 2a8230e505 chore(husky): Removed unnecessary committed files 2021-04-05 20:08:14 -04:00
RockySouthpaw fcecd2aa89 chore(sql): Adjust identifier length & remove items 2021-04-05 17:27:35 -04:00
Christopher Gjelten d8dc5b7f47 Update README.md 2021-04-04 16:45:47 +02:00
Christopher fed7b2c13a Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-04-04 02:44:39 +02:00
Christopher d6b561beb8 remove unusded variable 2021-04-04 02:41:47 +02:00
Taso 8ca8b1b5fe tweak(phone/call-modal): Tweaked appearance of call modal (#178)
Correct actions will now display if calling another player.

Also added ringing flavor text when the person calling is the transmitter.
2021-04-03 18:02:47 -04:00
Christopher 4bf3248168 tweak(phone/dialer): remove type number from dialer input
this is temporary
2021-04-03 22:32:09 +02:00
J Francisco Rader cb1aa80f83 bugfix(messages-app): Remove paste from clipboard feature (#195) 2021-04-02 18:04:44 -03:00
J Francisco Rader 9896f2384e Add kiddo theme :D 2021-04-01 16:07:32 -03:00
Taso 289207beb9 tweak(phone/twitter): Refactored nui events to use enums for method" 2021-04-01 12:37:56 -04:00
Taso 8bfdc1b8b2 fix(phone/types): Replaced debug inject methods with new enums" 2021-04-01 12:28:14 -04:00
J Francisco Rader d315d72e93 Fix first time login 2021-04-01 11:42:28 -03:00
Christopher 2992a644fe tweak(phone/apps): hiding bank app while bank resource gets done 2021-04-01 14:31:38 +02:00
victorBOY 2b633c9e80 Update pt-BR translation (#188)
* Update pt-BR translation

* Update ptbr.json

* Fix missing translations
2021-03-31 22:58:40 +02:00
Christopher dab4c1eaf7 fix(phone/dialer): missing translation 2021-03-31 20:47:39 +02:00
Dillon Skaggs 48e0dd2443 fix(sql): don't include extra SQL data (#187) 2021-03-31 15:10:34 -03:00
Christopher 3157cafd5a fix(phone/settings): fix settingsSchema properties for custom wallpaper 2021-03-30 22:30:05 +02:00
Christopher c82a48b012 remove slutty import, smh' 2021-03-30 22:23:32 +02:00
Christopher 4d46566811 feat(phone/settings): custom background 2021-03-30 22:21:41 +02:00
Christopher ee7e3a3ae1 tweak(phone/twitter): change position of tweet & showMore button 2021-03-30 16:27:07 +02:00
Christopher 31241c7e8f Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-03-30 16:06:04 +02:00
Christopher 5f2dce2dda fix(phone/marketplace): use enums events for injectData 2021-03-30 16:05:39 +02:00
J Francisco Rader 107dc43624 Improve messages error handling (#181)
* Improve messages error handling

* Add types to getPlayerFromIdentifier function

* Add phone validation regex to message group form

* Add correct alert types to enum

* Improve locale

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

* working version of swiping

* working version of profile editing

* introducing backend

* working matching system

* working profile updating

* fix all linting issues

* updated events to Enum

* working profile generation

* documentation updates

* general PR feedback

* working profile loading, matches show matchedAt

* slight modification to event strings

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

* Fix msg events

* Fix goToConversation util

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

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

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

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

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

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

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

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

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

* chore(events): Removed old events object

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

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

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

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

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

* removing profile fetch and cleaning up unused functions

* defend against null profile

* move defenseive check to top pof notifications

* fix bug where delete was visible for non owners

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

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

* Fetch messages on notification click

* Dont fetch groups if duplicate group

* Only submit new message on click submit

* Fix infinite loading when duplicated group is creatded

* Fix infinite loading when group already existed

* Make code prettier

* Centralize fetch messages on goToConversation

* Remove duplicated event

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

* Remove conflicts

* Fix media paths
2021-03-18 23:01:54 -03:00
Taso a2c0f94bd8 fix(whoops): Forgot to remove the string-parser change from last commit 2021-03-17 20:27:25 -04:00
Taso e8d28359a9 chore(server): Bumped deps & tweaked build
We are now ignoring the Cardinal and parse-connection-string warnings
that used to pop up after build.

Deps were bumped using standard `yarn upgrade`
2021-03-17 20:11:37 -04:00
Taso 67b557b7c3 fix(phone/sourcemaps): Add .map to client files 2021-03-17 17:36:45 -04:00
Taso 4b29cbbce3 fix(phone/home): Fixed incorrect props for Grid item 2021-03-17 13:59:53 -04:00
Taso 06137d77ad fix(phone/notifications): Fixed error when setting for app is not defined 2021-03-17 13:55:45 -04:00
Taso 279778e4f3 tweak(phone/webpack): Generate source maps 2021-03-17 11:18:37 -04:00
Taso f1f6a05981 tweak(dialer): Several fixes and improvements
Time has been changed to a relative format. Locale specifics are pending
merge of #168.

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

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

The input box has been unlocked so users can use their keyboard directly
rather than using the dial pad.
2021-03-17 10:26:52 -04:00
Taso a6e8c769c0 feat(locale): Added a locale setting in Settings app
This removes the need to rebuild the phone in order to change language
2021-03-17 10:24:28 -04:00
Bombay 5c6538b340 Fix : Typo (#171) 2021-03-17 06:37:48 -04:00
Taso 1ecdb7a4a8 fix(locales): Fixed Bosnian Alpha-2 code 2021-03-16 21:14:52 -04:00
Taso d5d483eee8 tweak(phone/settings): Enabled copy and paste for number 2021-03-16 17:56:40 -04:00
Taso ef30daeb65 fix(phone/twitter): Altered transform on ShowMore
I wasn't sure what the comment was referring to, but changed this to a
standard top offset, and it fixed a issue with the transform being
screwed up between tweets.
2021-03-16 17:45:54 -04:00
Taso 19e228894d tweak(phone/settings): Added streamer mode desc 2021-03-16 17:31:41 -04:00
Taso a244183976 fix(server/types): Fixed type on Tweet create sql resp 2021-03-16 16:24:27 -04:00
Taso e01057d818 refactor(server/tweets): Slight tweaks to twitter handling on server 2021-03-16 16:24:27 -04:00
Taso 9ffca0d14e chore(server/messages): Type create message response 2021-03-16 16:24:27 -04:00
Taso 1a9c21f89d fix/cleanup(server/twitter): Fix for fetch after tweet & gen cleanup 2021-03-16 16:24:27 -04:00
Taso 3031e650e3 cleanup(server/marketplace): General cleanup of marketplace
Tweaked SQL tables to reference 'marketplace' and not 'sellout'

Removed if/else in favor of if/return
2021-03-16 16:24:27 -04:00
Taso 23ef9b8cd6 chore(server/photo): Added try/catch to missing sql query 2021-03-16 16:24:27 -04:00
Taso 598bcd2eb3 chore(server/notes): Removed redundant pSource call 2021-03-16 16:24:27 -04:00
Taso 78961b788f tweak(server/messages): General cleanup changes and added missing docs
I personally don't like if else chains, so changed to if checks
2021-03-16 16:24:27 -04:00
Taso adf9758d9f tweak(server/calls): Tweaked call handling
Added Sanity checks

Switched timestamp creation to server
2021-03-16 16:24:27 -04:00
Christopher Gjelten bc8a89d825 Update discord.ts 2021-03-16 16:55:11 +01:00
Taso ff0e75d82b fix(phone/bank): Fixed transactionList 2021-03-15 12:06:39 -04:00
Christopher 458839488e tweak(resources): use 'custom appMessageEvent' 2021-03-15 10:53:02 +01:00
Christopher 5c9f36f754 feat(resource): messageEvent for each app 2021-03-15 10:52:11 +01:00
Christopher 4045acc162 yet again, we fuck off with typings 2021-03-15 10:22:12 +01:00
Christopher 9d2aeddd4b clean up bank hook 2021-03-15 10:13:25 +01:00
Taso f0c5e5101e chore(typings): Moved common typings to root dir 2021-03-14 15:19:30 -04:00
Taso 378830245d chore(server/players): Removed unused imports & misc debug logs 2021-03-14 15:07:04 -04:00
Christopher Gjelten b9fc51e61d Merge pull request #166 from EverlastRP/master
replaced all imgur images to iodine images :)
2021-03-14 00:21:42 +01:00
Hamy 7f7c54e0b5 replaced all imgur images to iodine images :)
dont mind the 347 changed files its cause i drag and dropped 👽
2021-03-13 15:07:09 +03:00
Christopher b9fbc067c6 feat(resources/call): check if receiver of call is online 2021-03-11 22:21:53 +01:00
J Francisco Rader 75a4eb176e Feature / Streamer Mode (#159)
* feat(phone/settings): Add streamer mode setting and PictureReveal component :)

* feat(phone/settings): Add PictureReveal streamer mode to twitter and improve its theme a bit
2021-03-11 16:00:04 -05:00
Christopher Gjelten d841ee0958 Merge pull request #161 from project-error/fix/message-issues
Fix checking if contact exist
2021-03-11 15:09:00 +01:00
dependabot[bot] 3ec6e5a6ae chore(deps): bump elliptic from 6.5.3 to 6.5.4 in /resources
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot[bot] <[email protected]>
2021-03-11 03:08:33 -05:00
Taso b8ef6b1695 Merge pull request #155 from project-error/tweak/remove-esx-code
feat(standalone): Allows for the phone to be free from framework requirements
2021-03-10 21:50:55 -05:00
Taso 08e477f360 tweak(server/players): Commented getPlayers command for debug 2021-03-10 21:49:10 -05:00
Taso 044f5ba39c chore(server/players): Unused import cleanup 2021-03-10 21:44:00 -05:00
Taso 7fd02913da Revert "tweak(server/player): Added regex replace to getIdentifierByPhoneNumber"
Reverted as to ensure current compatibility with messages app, messages
should be altered to deal with this in the future.

This reverts commit 258ea66746.
2021-03-10 21:27:21 -05:00
Taso b0e5458504 refactor(server/discord): Refactored Discord reports to use webhooks (#158) 2021-03-10 21:10:34 -05:00
Taso c6bdf4b331 fix(sellout/report): Fixed sellout discord reports 2021-03-10 21:04:59 -05:00
SynTer ea5b034fbe locale(pt-br): Additional keys (#163) 2021-03-10 18:24:19 -05:00
Taso 1801255c04 fix(server/players): Fixed public name setters 2021-03-10 17:21:36 -05:00
Taso 6dd57beae5 fix(server/players): Fixed getIdentifierFromPhoneNumber 2021-03-10 22:18:27 +00:00
Christopher dfc4f49b58 remove log 2021-03-10 22:47:58 +01:00
Taso e20e39728a tweak(server/player): Debug tools 2021-03-10 16:44:32 -05:00
Christopher 4c8902f16a remove unused token
no this is not valid anymore
2021-03-10 20:51:29 +01:00
J Francisco Rader c066e1a464 Add unread count from actual participant 2021-03-10 13:27:11 -05:00
Taso 258ea66746 tweak(server/player): Added regex replace to getIdentifierByPhoneNumber
Added a regex replace to match the old signature for this function. Also
migrated messages to use the new util function rather than a locally
defined query
2021-03-08 20:35:25 -05:00
Taso 6e9c3e6d1a enhance(server/player): Several enhancements
Attach a readonly username property to Player class

Implement setters/getters for Player class to ensure future
compatibility for servers who implement a character switching system

Attach a fetch argument to getIdentifierByPhoneNumber that will force a
DB query if player is not online
2021-03-08 20:18:20 -05:00
Taso e5fac800ee refactor(server/player): Added player management system internally
This system stores loaded players in maps handled entirely by NPWD.

This should entirely remove the ESX dependency on practically everything.
2021-03-08 18:43:21 -05:00
Christopher de53b12763 feat(resources): set number as keytype for Players map 2021-03-08 22:53:00 +01:00
Taso 7d233a9efa tweak(sql): Added default twitter avatar to import.sql 2021-03-08 16:22:19 -05:00
Christopher 7e9ad952cf fix(resources/notes): resolve fetch on deletion 2021-03-08 20:13:34 +01:00
Christopher ebe75dba1f fix(phone/call): resolve showing transmitter number for transmitter 2021-03-08 19:56:29 +01:00
Christopher 1d25c02083 fix(phone/messages): resolve issue around checking if contact exsist 2021-03-08 18:58:19 +01:00
Christopher Gjelten ba06dd367e Update README.md 2021-03-08 16:55:32 +01:00
Oldarorn d4232d778e Added missing french translations (#156)
New fresh baguette translation !
2021-03-08 16:03:21 +01:00
Christopher dddb99afb3 feat(translation): norwegian translation 2021-03-07 22:16:08 +01:00
Christopher 425c09edc9 update tsconfig 2021-03-07 21:29:16 +01:00
Christopher a424a67f05 tweak(resources/main): getPlayerIdentifirs use 2021-03-07 20:39:55 +01:00
Taso 8116dd074d tweak(ci): Small tweaks to job names 2021-03-07 13:19:57 -05:00
Christopher 5d456d18c1 change to playerJoining event 2021-03-07 18:59:01 +01:00
Christopher c99d0780ae feat(resources): remove all esx code, almost 2021-03-07 18:26:28 +01:00
Christopher Gjelten 6b6080c4b2 Tweak/marketplace additions (#137)
Checks for being the OP of the listing. Calling, Message, Delete and Report. 

Updates to Locale is needed.
2021-03-07 16:30:58 +01:00
Erik 0203ebbe51 Feature/Twitter Notification Filters (#147)
Feature: Twitter notification update
2021-03-07 16:25:10 +01:00
Erik 21152fa38a [Feature] Twitter retweets (#143)
Feature: Retweets
2021-03-07 16:03:33 +01:00
J Francisco Rader 1a09fa57ae Fix: Workaround for ESX errors pertaining to player loading (#153)
* Set phone ready before sending any init events + Show initializing phone message if not ready yet

* Send phone ready to nui
2021-03-06 19:25:32 -05:00
Taso 6e72e2c50e fix(phone/snackbar): Fixed animations & simplified logic (#146) 2021-03-06 17:32:01 -05:00
J Francisco Rader e56ae415dc Feat / Reusable SearchField + Fixed Messages align bottom flex with scroll (first message starts at bottom) (#151)
* feat(phone/ui): Make SearchField a reusable component

* Fixed conversation scrolling and align bottom

* feat(phone/ui): Autoscroll fix

* feat(phone/ui): Autoscroll fix remove unused deps

* feat(phone/ui): Autoscroll add needed dep for new messages
2021-03-06 16:53:48 -05:00
Hamy 1659fa1654 updated bh.json to be the correct lang code and translation (#150) 2021-03-06 12:33:40 -05:00
Christopher Gjelten 73355e7209 Update README.md 2021-03-06 17:40:11 +01:00
Christopher Gjelten c144fd3dd6 Update README.md 2021-03-06 17:39:46 +01:00
Christopher Gjelten f94dc7fb0b Update README.md 2021-03-06 17:38:08 +01:00
Christopher Gjelten ce93213238 Update README.md 2021-03-06 17:36:05 +01:00
Taso 605f957f9a feat(client/debug): Phone restart command (#145)
Trigger a UI restart by entering the command `phone:restart` in the F8 console.
2021-03-06 10:38:10 -05:00
J Francisco Rader 531a341ffd fix(messages): Sliding phone up and down when mesages apps is open is fixed now (#148) 2021-03-06 03:22:17 -05:00
J Francisco Rader 08d2de2dc7 tweak(phone/messages): Improve transition to MessageModal (conversation) (#140) 2021-03-06 02:10:13 -05:00
J Francisco Rader 0c602f1767 Bugfix / Fix message bubble, notifications slideup phone and overflow and conversation scrolling (#144)
* Fix overflow on message bubbles

* Fix messages scrolling

* fix(phone/messages): Fix notification slide when in messages app
2021-03-05 22:07:51 -05:00
Taso f4834b78c8 tweak(phone/sound): Removed howl instance console log on ready 2021-03-05 18:05:18 -05:00
Taso b303e648df tweak(phone/debug): Set default data property for mockNuiEvent 2021-03-05 17:09:09 -05:00
J Francisco Rader bdbf342270 fix(phone/messages): fixed autocomplete getting bricked (#138) 2021-03-05 16:11:50 -05:00
Taso 6419245d93 Revert "feat(phone/settings): Add localStorage settings schema validation (#139)"
This reverts commit cb5a00e57e.
Reverted due a non-descript bug in CEF. Will be reapplied after fix.
2021-03-05 12:38:22 -05:00
Taso da5694863a tweak(sql): Moved import.sql to resource root 2021-03-05 11:45:11 -05:00
J Francisco Rader cb5a00e57e feat(phone/settings): Add localStorage settings schema validation (#139)
Will reset to default settings if the schema is invalid.
2021-03-05 11:18:36 -05:00
Taso 60431d2de7 tweak(phone/settings): Altered localStorage key 2021-03-05 10:31:37 -05:00
Taso 5c9c75c36c tweak(phone/snackbar-provider): Altered API to expect a string for message, not a key (#135)
Change SnackbarProviderAlert message property to allow for any string rather than a explicit translation key
2021-03-04 22:40:17 -05:00
9abac70427 feat/messages additions (in memory of Leonard Nimoy) (#118)
* feat(resouces/messages): broadcast messagse to participants

* feat(phone/messages): notifications for messages

* remove weird empty onNet

* reformat?

* last reformat! This pr will be squashed

* tweak(phone/messages): send groupName to notification alert

* fix identifer

* fixing notification groupName

* resbasee...i think

* feat(messages): check for unread messages

* send nui event is count > 0

* remove usless test

* import.sql update

* Refactor NotificationsProvider and fix messages notifications

* Send groupId on message broadcast

* Update phone/src/apps/messages/components/modal/Conversation.tsx

* Update phone/src/apps/messages/hooks/useMessageNotifications.ts

* Update phone/src/os/notifications/providers/NotificationsProvider.tsx

* Update phone/src/common/typings/messages.ts

* Update phone/src/apps/messages/hooks/useMessageNotifications.ts

* clean sql file

* Update resources/server/sv_messages.ts

* Fetch message groups when other person created for you

* fix sql

* Select unreadCount from messageGroups

* whatever husky again

* Add members menu and add contact in messages

* Add from group bubbles

* Fix messages scroll with new msg

* Message image menu flicker + justify bottom messages

* Improve debugging

* Add container to Slider

* Improve logger

* Fix create message

* add creator identifier to group hash

* Fix dafuq i broke

* group_id bigger varchar in column

* group_id bigger varchar in column

* Phone visibility default browser

* Add debugging

Co-authored-by: J Francisco Rader <[email protected]>
Co-authored-by: J Francisco Rader <[email protected]>
2021-03-04 18:35:33 -05:00
Taso 42d3d573cb tweak(phone/sentry): Only enable in prod 2021-03-04 17:24:14 -05:00
Taso b2e3698936 fix(phone/settings): Fixed incorrect setting ref for localStore 2021-03-04 11:33:25 -05:00
Taso eae06b2dc6 tweak(phone/settings): Added a SettingItemIconAction component
Currently used for phone number
2021-03-04 11:33:25 -05:00
Taso 140a28bef7 tweak(phone/default-settings): Set default twitter noti volume to 50% 2021-03-04 11:33:25 -05:00
Taso 58868f3644 fix(phone/context-menu): Fixed issue where backdrop was fixed height 2021-03-04 11:33:25 -05:00
Taso 924d17c2f6 tweak(phone/context-menu): Lock scroll when context menu is open 2021-03-04 11:33:25 -05:00
Taso 64c4e0ec16 enhance(phone/settings): Added labels to settings and misc cleanup
This change alters the default localStorage schema, please clear your localStorage cache for testing
2021-03-04 11:33:25 -05:00
dependabot[bot] 5969d33dc3 chore(deps): bump axios from 0.21.0 to 0.21.1 in /resources (#136)
Bumps [axios](https://github.com/axios/axios) from 0.21.0 to 0.21.1.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/master/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v0.21.0...v0.21.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 22:54:05 -05:00
Taso 41b50d6429 tweak(phone/utils): Moved isImageValid util to common dir 2021-03-03 22:19:59 -05:00
Taso 18c1676c01 tweak(phone/utils): Refactored image validation to promise from cb 2021-03-03 22:19:59 -05:00
Taso e330b89889 tweak(phone/debug): Restricted global mockNuiEvent to dev env
Probably a good idea so we don't forget
2021-03-03 22:04:20 -05:00
Taso b6352ccf82 feat(phone/debug): Added a global window dispatch method
See JSDocs for usage details.
2021-03-03 21:48:45 -05:00
Christopher Gjelten 622a931ace Merge pull request #130 from project-error/bugfix/messages-overlaps-input
Bugfix / Touch height to fix messages overlapping input
2021-03-03 22:44:32 +01:00
SynTer ec053dd883 locale(pt-br): Updated missing keys 2021-03-02 21:15:05 -05:00
J Francisco Rader 2ba6de3a71 Touch height to fix messages overlapping input 2021-03-02 19:01:00 -05:00
Christopher Gjelten cf9c26428c Merge pull request #129 from project-error/bug/yarn-run-watch 2021-03-03 00:52:06 +01:00
Kire 55e909a103 added wild card for JS files in resources folder 2021-03-02 18:44:36 -05:00
Christopher 6f4ee009a9 printWidth: 100 2021-03-02 21:03:06 +01:00
Christopher d27aeb3b0e 120 in printWidth since rocky got md 2021-03-02 20:56:15 +01:00
Christopher f552c1212c more formatting 2021-03-02 20:45:41 +01:00
Christopher 046447b0fb mad formatting 2021-03-02 20:41:25 +01:00
Christopher 6777498bcc pretty quick 2021-03-02 20:38:29 +01:00
Christopher ebb3c5e06c fixed husky?? 2021-03-02 20:35:58 +01:00
Christopher aa54bdd887 fixed husky 2021-03-02 20:34:36 +01:00
Christopher cc6d587f5e fixed husky 2021-03-02 20:33:29 +01:00
Christopher 9584d2864e fixed husky 2021-03-02 20:33:09 +01:00
Christopher 91cbb8356f husky works now 2021-03-02 20:30:08 +01:00
Christopher 56f937c945 pre commit on husky 2021-03-02 20:28:10 +01:00
Christopher 1c39a48c30 fuck husky 2021-03-02 20:26:25 +01:00
Christopher 80132e48d7 more cleanup 2021-03-02 20:13:13 +01:00
Christopher bf06c1ed3f feat(resources/marketplace): more cleanup 2021-03-02 20:05:11 +01:00
Christopher 9f5d5e50a8 Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-03-02 19:56:46 +01:00
Christopher 864a6c2402 feat(resources/marketplace): added typings server side 2021-03-02 19:56:41 +01:00
Taso 52992b7d10 chore(client): Removed unused variables 2021-03-02 13:54:32 -05:00
Christopher aa7919b988 feat(resources/marketplace): added typings client side 2021-03-02 19:54:03 +01:00
Taso 95866cc51c tweak(server/logging): Added try catch and logging to calls fetch 2021-03-02 13:42:37 -05:00
J Francisco Rader e037a9b0f8 Play/Stop sound after interrupt 2021-03-02 09:31:25 -05:00
J Francisco Rader c37f6a66b4 Safely handle sound settings 2021-03-02 09:27:49 -05:00
Christopher Gjelten ba69ff4b8d Merge pull request #125 from project-error/tweak/snackbar-provider
tweak(phone/snackbarprovider): remove redunant function
2021-03-02 12:37:51 +01:00
J Francisco Rader a579d7bb8d Tweak/use sound mount before its ready to play (#128)
* Make useSound use soundProvider and be sure its mounted!

* Remove console.log
2021-03-01 22:13:44 -05:00
J Francisco Rader e9e22ce9bc Remove comma from hell and improve useRingtoneSound (#127) 2021-03-01 17:29:54 -05:00
J Francisco Rader 4eda44b9c2 Add calling and notification sounds (#119)
* Add calling and notification sounds

* Fix notification visibility on any resolution

* Add comments

* Log howler error src

* Revert removed files im stupid

* Make sliders on settings use changeCommitted instead of onChange

* Fix ringtone paths

* Break alert words overflow

* Fix tweet overflow pepega

* Remove unused hook

* Update volume sliders in real time

* Fix resolution notifications

* Fix initial value for vol sliders

* Fix call duration timer bugs

* Add alert when phone active and phone closes

* keep notification

* Stop ringing when accept
2021-03-01 17:22:58 -05:00
RockySouthpaw 8ecb91e71f Fix: Animation being triggered if the phone isn't open. 2021-03-01 17:05:05 -05:00
Christopher 8bca955ad7 update delay 2021-03-01 20:01:16 +01:00
Christopher 2a9f475cdc tweak(phone/snackbarprovider): remove redunant function 2021-03-01 19:42:48 +01:00
Oldarorn f58c30b0d9 Added missing translations (#123)
Because it was asked to us ! 

All the english keys are now translated into baguette language + fix typo
2021-03-01 13:05:59 -05:00
J Francisco Rader 52c4009dc9 Fix alerts blocking mouse (#124) 2021-03-01 13:05:09 -05:00
Bombay f866c6de47 Created locales' base for notifications + sound (#121)
* Added missing locales

* Change places for readability

* Typo

* Moved APPS_CONTACT closer to its related locale

* Update en.json

* + Space

* + Space

* bh.json base

Added a base for the language. It's no longer missing translations but some of them are in English

* tr.json base

TR locale base (relocate + added missing locales in English while keeping old ones)

* sv.json base

Base for sv. Same as the ones before.

* ptbr.json base

Same as before

* pt.json base

* Update fr.json

* fr.json base

* Added sound locale

* Added sound locale

* Update es.json

* Update fr.json

* Update pt.json

* Update ptbr.json

* Update sv.json

* Update tr.json
2021-03-01 12:49:40 -05:00
Christopher Gjelten 74967eeb26 Merge pull request #122 from project-error/feature/missing-lang-keys-script
Add script for getting missing keys
2021-03-01 18:46:05 +01:00
J Francisco Rader 12ed0bd46d Fix alerts position 2021-03-01 12:37:13 -05:00
J Francisco Rader 83a093e36b Add script for getting missing keys 2021-03-01 11:18:39 -05:00
RockySouthpaw 8587f6be73 Fix message error (#120) 2021-02-28 18:26:37 -05:00
Christopher 39d66d0ce7 quick fix for PhoneContainer 2021-02-28 17:40:15 +01:00
Christopher Gjelten a5a04cdef7 Merge pull request #110 from project-error/feat/alerts-for-apps
Feat/alerts for apps (in memory of daft punk)
2021-02-28 17:25:56 +01:00
Christopher Gjelten 51f9b20857 Merge branch 'master' into feat/alerts-for-apps 2021-02-28 02:00:34 +01:00
Christopher 4d82c8e69a feat(phone/messages): minor changes for nui 2021-02-28 01:39:26 +01:00
Christopher 09d397b6cf feat(resources/messages): server and client functionality for alerts 2021-02-28 01:37:22 +01:00
Christopher ec913fbef4 remove(phone/messages): remove alerts components 2021-02-28 01:35:02 +01:00
Christopher 1c81bfa7f2 fix(camera): resolve issue for deleting images 2021-02-28 00:05:07 +01:00
Christopher Gjelten ee7e544b23 Fix: typo in dialerHistory? 2021-02-27 21:23:29 +01:00
J Francisco Rader 9cfc3fa8ec Remove dependency comments and use useRef instead for useSound hook (#117)
* Remove dependency comments and use useRef instead for useSound hook

* Handle change URL volume and loop gracefully
2021-02-27 15:10:59 -05:00
RockySouthpaw 54bdd07e9c Fix/number generating (#114)
* Fix number not generating on player join.

* Update import.sql

* Check for existing number

Kidz pretty much did this kek

* Added error catch to esx:playerLoaded
2021-02-27 14:14:49 -05:00
J Francisco RaderandChristopher 41674968ab Notification alert stays on if it is an incoming call and phone is closed (#115)
* Phone now shows all the time slide a bit if incoming call exists | can close alerts!

* Improve animation

* Improve call controls

* Make alerts not overflow | Call modal is navigable out :)

* Open modal when accepting call

* Cant navigate back from homepage

* Avoid call route if no call active + rename things

* Impprove main apps icons sizes

* hover effect to app icons :)

* Revert interface change

* fix(phone/dialer): resolve not calling when adding contacts

Co-authored-by: Christopher <[email protected]>
2021-02-26 21:45:01 -05:00
Christopher 796548d9d5 remove more unused variables :( 2021-02-26 19:52:36 +01:00
Christopher f0305e3bb2 remove(phone/bank): remove unused hooks 2021-02-26 14:07:23 +01:00
Christopher 47218e63f5 feat(phone|resources/bank): useSnackbar for alert 2021-02-26 12:48:27 +01:00
Christopher 1afca13862 feat(phone/bank): remove alert component 2021-02-26 12:10:47 +01:00
Christopher cea0bd653b fix(phone): remove unused variables 2021-02-26 12:08:04 +01:00
Christopher a9ba633241 tweak(phone): remove bank & twitter notification components 2021-02-26 12:00:46 +01:00
RockySouthpaw d2461bab16 Sort contacts alphabetically (#116)
Does it for contacts app and phone app.
2021-02-23 22:13:36 -05:00
Christopher d4fbdc8e0c feat(phone/dialer): add contacts from dialer history 2021-02-23 23:19:29 +01:00
J Francisco Rader 51fb261e8a Fix phone stuck after calling (#113) 2021-02-23 15:46:52 -05:00
J Francisco Rader f6d7a3dbe1 Feature/floating notifications calling and twitter (#112)
* Add floating notifications :O

* Add phone notifications and refactor calling ui

* This is unsafe

* Fix controls null check

* Remove go to alert

* Fix phone stuck after call

* Remove lazy mount for Phone

* Fix open/close cl_main

* Use effect for notification visibility

* Remove all alerts when phone closes

* Avoid re-render useNuiEvent

* It works now :c
2021-02-23 13:19:10 -05:00
Christopher Gjelten 4633146d40 Merge pull request #109 from project-error/feature/notes-app-theme-provider
Feature / Notes and Dialer theme providers
2021-02-22 23:21:06 +01:00
Christopher Gjelten fef876d9a6 Merge branch 'master' into feat/alerts-for-apps 2021-02-22 21:58:19 +01:00
J Francisco Rader bf814041d7 Remove hardcoded dialer colors 2021-02-21 19:41:59 -05:00
J Francisco Rader 65c71f9cb6 Fix StatusButton shadows 2021-02-21 19:36:03 -05:00
J Francisco Rader 3171052963 Add contacts referal after creating from dialer 2021-02-21 19:34:36 -05:00
J Francisco Rader 1650929eed Make see contacts list after saving new contact 2021-02-21 19:27:56 -05:00
J Francisco Rader ada49700e5 Add dialer app theme | Add new contact button from dialer after you type number 2021-02-21 19:24:38 -05:00
J Francisco Rader 2c6358e4c3 Add status button | Revert white icons 2021-02-21 18:13:08 -05:00
Christopher d71f69f3eb Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-02-21 21:31:04 +01:00
Christopher e18c39169e del(client): remove ESX on client runtime 2021-02-21 21:30:55 +01:00
RockySouthpaw c1f3ff59ed Update read me to reflect docs. (#108) 2021-02-21 14:56:39 -05:00
J Francisco Rader bf7d94b33d Fix alerts overflow and improve message-bubble style 2021-02-21 13:03:19 -05:00
J Francisco Rader 9f04ac3243 Add theme provider for notes 2021-02-21 12:49:09 -05:00
J Francisco Rader 4acb214ec9 Task/improve hardcoded styles and types (#107)
* Add working notifications with only twitter for now

* feat(notification-bar): I didnt copy from NP

* feat(notifications): Collapse when no more notifications after closing one

* Improve overall messages styling code

* Improve Routing performance

* improve use keyboard hook

* Remove unused returns

* Button hover color :)

* Button hover color :) x2

* Added hover style to containedPrimary msg btn

* Replace custom components for custom theme providers for Messages and Contacts apps

* Improve createAppThemeProvider

* Improve createAppThemeProvider

* Final housekeeping for messages styles

* Change placeholder to label in Contacts app text fields

* Fix alerts style with navigation and fix calc copy alerrt

* Split Phone code for snackbar

* Add more options and style Context Menu

* Enable Sellout theme provider and make it work with light themes
2021-02-21 12:41:25 -05:00
Christopher 767402a6b2 feat(alerts): useSnackbar for twitter 2021-02-21 17:29:06 +01:00
Christopher 7d7c893800 Merge branch 'feat/alerts-for-apps' of https://github.com/project-error/new-phone-who-dis into feat/alerts-for-apps 2021-02-19 21:19:32 +01:00
Christopher e14bb5701a feat(Twitter): Remove success on create | useSnackbar 2021-02-19 21:19:00 +01:00
Christopher 5244ff3a57 feat(Marketplace): minor alerts 2021-02-19 18:26:53 +01:00
Christopher 283832f17e feat(Alerts): alerts for contacts 2021-02-19 18:26:52 +01:00
J Francisco Rader 75e23b783c default browser visibility == true 2021-02-19 11:14:15 -05:00
J Francisco Rader 630661b784 Fix visibility 2021-02-19 11:14:00 -05:00
J Francisco Rader ff177d65d1 Remove unused files 2021-02-19 11:03:10 -05:00
J Francisco Rader a686ae2bfc Fix import 2021-02-19 11:00:54 -05:00
J Francisco Rader 0e43851d81 I make phone break 2021-02-19 10:51:54 -05:00
Christopher 6d2961ac71 feat(Marketplace): minor alerts 2021-02-19 16:19:55 +01:00
J Francisco Rader 40ec19a349 Feature / Add working notifications with only twitter for now (#102)
* Add working notifications with only twitter for now

* feat(notification-bar): I didnt copy from NP

* Make default browser visibility true

* feat(notifications): Collapse when no more notifications after closing one
2021-02-18 19:21:07 -05:00
Christopher 9846a4e1ae feat(Alerts): alerts for contacts 2021-02-18 23:20:24 +01:00
Bombay 11af8bfb5a New phone background (#106)
Added project error wallpaper and adjusted default wallpaper.
2021-02-18 16:12:25 -05:00
Christopher 9ebc433ac9 fix(resources/core): possible fix for generating numbers
A weird 'bug' that caused phone numbers not being generated. Hopefully changing this to the event 'playerConnecting' will fix this
2021-02-18 21:32:25 +01:00
RockySouthpawandTaso 3a572cbc7b feat(client/anim): Added animation flow for calls (#104)
Co-authored-by: Taso <[email protected]>
2021-02-18 12:39:30 -05:00
Christopher Gjelten d6d2bed335 Merge pull request #101 from project-error/feature/autocomplete-contacts
Feature / Autocomplete contacts in messages + improve messages ui a bit
2021-02-17 22:02:04 +01:00
J Francisco Rader 88f1ecbd6b Fix(server/sql): resolved issue with explicit collations (#99) 2021-02-17 14:46:30 -05:00
Taso 187e534e08 chore(dependencies): Cleaned up dependencies/package.json 2021-02-17 14:43:12 -05:00
Christopher a3fa095f9f fix(phone/messages): fix posiston for Fab 2021-02-17 20:15:14 +01:00
Christopher f765f35b8c Merge branch 'feature/autocomplete-contacts' of https://github.com/project-error/new-phone-who-dis into feature/autocomplete-contacts 2021-02-17 18:37:03 +01:00
Christopher db5ef05687 tweak(resources/main): fetch contacts on initalize 2021-02-17 18:36:48 +01:00
J Francisco Rader 3a093230a5 Improve msg styles 2021-02-17 12:36:07 -05:00
Christopher Gjelten 13cd6b6f97 Merge pull request #100 from project-error/RockySouthpaw-patch-1
Fix: Call history is now sorted.
2021-02-17 16:50:09 +01:00
Christopher 1e88ca4242 not reverted, but reverted 2021-02-17 16:46:58 +01:00
Christopher a651eb9242 fix(phone/twitter): resolve isValidMessage issue
This only returned false. This commit is a temporary fix, as we need to check if there is any whitepace no matter if there is text or not
2021-02-17 16:45:10 +01:00
J Francisco Rader cf4baafb19 Autocomplete contacts + improve messages ui a bit 2021-02-17 01:23:08 -05:00
RockySouthpaw 6be68c8e9f Fix: Call history is now sorted.
Call history Is now ordered by ID so recent calls show up first instead of last. Previously it was just at the bottom.

(Courtesy of Chip)
2021-02-16 20:57:09 -05:00
Christopher b5a4c518d5 Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-02-17 00:09:24 +01:00
Christopher 7432e85a9a fix(resources/client/photos): fix toggle 2021-02-17 00:05:59 +01:00
Taso 17f5fb62d9 fix(client/photos): Fixes #98 2021-02-16 17:52:57 -05:00
Christopher Gjelten 6f0a2ba30d Merge pull request #92 from project-error/feature/message-from-contacts
Feature/message from contacts
2021-02-16 23:47:44 +01:00
Christopher Gjelten cd5131ef57 Merge branch 'master' into feature/message-from-contacts 2021-02-16 23:46:43 +01:00
Christopher Gjelten 2f2a92a673 Merge pull request #93 from project-error/enhance/source-changes
refactor(server/source-handling): Altered how we handle source
2021-02-16 23:44:40 +01:00
Christopher 7d5417ed55 fix(phone/messages): change how we get source | remove useEffect for parts 2021-02-16 23:33:37 +01:00
Christopher 15d7d3dcea fix(phone/messages): change how we get source | remove useEffect for parts 2021-02-16 23:33:23 +01:00
Christopher 4f69ae2266 fix(phone/messages): change how we get source | remove useEffect for parts 2021-02-16 23:32:27 +01:00
Taso 513407249a feat(client/net): Promisfied net events (#95) 2021-02-16 17:31:22 -05:00
J Francisco Rader be479d75cc Fix possibly\ 2021-02-16 17:10:47 -05:00
J Francisco Rader c1f72c77c5 fix new msg alone 2021-02-16 17:10:46 -05:00
J Francisco Rader de952dc555 Remove shit 2021-02-16 17:10:46 -05:00
J Francisco Rader b93d5faee1 Redirect when new msg group is created, and use contacts to push a new message from there 2021-02-16 17:10:45 -05:00
Christopher Gjelten 3bf098c5ee Merge pull request #94 from project-error/feat/useSound
feat(phone/os): useSound hook
2021-02-16 22:53:02 +01:00
Christopher 7d8824680e feat(resources/fxmanifest): I make sound work 2021-02-16 22:48:44 +01:00
RockySouthpaw cd7131e021 Update bug-report.md 2021-02-16 16:40:33 -05:00
Christopher Gjelten 107f28b89c Merge pull request #97 from dayiskuan/feature/custom-frame
Adding new phone designs
2021-02-16 22:07:59 +01:00
Dayiskuan 7e7801e28e Adding new phone designs 2021-02-16 15:55:16 -05:00
RockySouthpaw fa3b3c4ec6 Merge pull request #96 from dayiskuan/feature/custom-frame
Feature / Adding custom default phone frame
2021-02-15 16:37:05 -05:00
Dayiskuan 0c498a9d76 Adding custom default phone frame 2021-02-15 15:51:04 -05:00
Christopher 8a8f8e3bb0 Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-02-15 18:31:08 +01:00
Christopher aeb692499d fix(phone/contacts): resolve issue where avatar is undefined 2021-02-15 18:30:47 +01:00
Taso 9e648d858b Use callback optimizations 2021-02-14 23:20:39 -05:00
Taso 68360e7619 feat(phone/useSound): Initial useSound implementation 2021-02-14 23:16:09 -05:00
Taso 1aa6a383ab refactor(server/source-handling): Altered how we handle source
These changes are made in case source is not guranteed to remain the same

Due to how JS should operate, this shouldn't be an issue but this just ensures that
2021-02-14 20:17:41 -05:00
RockySouthpaw acb8e056c3 Update README.md 2021-02-14 19:03:46 -05:00
Christopher 31e692626a feat(Phone): add animation 2021-02-15 00:30:01 +01:00
Christopher e51bcca7f8 fix(phone/contacts): fixed incorrect Nui.send property | history.goBack 2021-02-15 00:23:23 +01:00
Christopher 32f6f6ebcc fix(phone/build): incorrect file reference 2021-02-14 23:53:52 +01:00
TasoandChristopher Gjelten 211576e237 feat(server/debug): Added initial implementation of new Logger (#84)
- Logs out to a file w/ relevant meta data
- Provides better readability for end user

This should help provide better troubleshooting for both
development and end users.

This also fixes any previous catches that were attempting to print stack traces,
causing the [object Object] message to appear.

Co-authored-by: Christopher Gjelten <[email protected]>
2021-02-14 17:28:13 -05:00
Christopher Gjelten a5491302b6 Merge pull request #81 from project-error/enhance/debug
Enhance/debug - Several changes to improve dev experience
2021-02-14 23:21:52 +01:00
Taso 1f07a469d8 Merge branch 'master' into enhance/debug 2021-02-14 17:15:01 -05:00
RockySouthpaw f76c27d76f Merge pull request #90 from project-error/feat/call-anim
Fix phone not opening with keybind
2021-02-14 14:20:12 -05:00
Darrian Gaylor 001f1425df Fix phone not opening with keybind 2021-02-14 14:17:07 -05:00
J Francisco Rader 7bafa7d518 I make phone work (#89) 2021-02-14 13:40:57 -05:00
Christopher Gjelten 7420a20c7e Merge pull request #87 from project-error/feat/snackbar-provider
Feat/snackbar provider + using it in notes
2021-02-14 19:00:47 +01:00
RockySouthpaw 990ebedc08 update discord URL 2021-02-14 12:52:47 -05:00
Christopher Gjelten f879085b46 Merge branch 'master' into feat/snackbar-provider 2021-02-14 14:10:42 +01:00
Christopher 5efd9aa1f0 removed unused variables 2021-02-14 14:06:51 +01:00
Christopher 92c7a352de feat(notes/server): use new alert 2021-02-14 13:58:01 +01:00
Christopher 9eefc1642a fix(SnackbarProvider): resolve context error 2021-02-14 13:56:51 +01:00
Christopher ce35041568 fix(notes/nui): remove unused variables 2021-02-14 13:31:05 +01:00
J Francisco Rader 8af43eca04 Fix copy config in windows (#86) 2021-02-13 14:25:43 -05:00
Christopher 276a283135 fix(SnackbarProvider): remove unused varable 2021-02-13 18:20:57 +01:00
Christopher 911d5b8eba fix(SnackbarProvider): remove unused varable 2021-02-13 18:19:48 +01:00
Christopher d9b26814dd tweak(notes/client|server): change to sending an object to NUI 2021-02-13 13:50:30 +01:00
Christopher b4258718d8 fix alert provider | remove alert from notes and contact 2021-02-13 13:48:05 +01:00
RockySouthpaw aebf496dbd Merge pull request #85 from Oldarorn/patch-2
Translation: Updated fr.json. Added translation for additional app names, added translation for notes app, and added translation date format.
2021-02-12 13:46:13 -05:00
Oldarorn d48d2e6845 Update fr.json
New update !
2021-02-12 12:30:55 +01:00
Taso 992719980a Merge pull request #83 from project-error/cleanup/game-scripts
Cleanup/game scripts - Misc. cleanup of game scripts
2021-02-11 16:51:28 -05:00
Taso e1f409fed3 fix(scripts/typings): Fixed reference to changed type 2021-02-11 16:40:01 -05:00
Christopher 9ba8bd683f fix(SnackbarProvider): center alert 2021-02-11 21:12:19 +01:00
Christopher 82adc9497b remove SnackBar component | improve Provider 2021-02-11 01:01:33 +01:00
Christopher 8ec2a4769d feat(useSnackbar): strict types 2021-02-11 01:00:40 +01:00
Christopher 7160fcdfac feat(Snackbar): interface 2021-02-11 01:00:14 +01:00
Taso 587185535f fix(phone/anim): Added missing phoneClose anim to handler 2021-02-10 17:46:46 -05:00
Taso 8f78423591 Merge branch 'master' into cleanup/game-scripts 2021-02-10 16:31:00 -05:00
Taso 9486fb69b9 chore(phone/nui): update for cerulean fxversion 2021-02-10 16:29:28 -05:00
Taso f0a2d8c77e refactor(phone/visibility): Improved organization of visibility flow 2021-02-10 14:25:00 -05:00
J Francisco RaderandTaso 81f5e27064 Remove client phoneConfig event (#73)
* Remove client phoneConfig event

* Remove unused debug

* Remove unused import

* Remove unused import

* Remove duplicated functions | fix useEffect dependency | etc

* Fix warnings

* Update phone/src/apps/twitter/components/TwitterApp.tsx

Co-authored-by: Taso <[email protected]>

Co-authored-by: Taso <[email protected]>
2021-02-10 12:04:28 -05:00
Taso 368a8c57f8 optimize(scripts/anims): Optimized and organized open/close animations 2021-02-09 18:45:48 -05:00
Taso 47e1f2950e fix(scripts/nui-callbacks): Fixed NUI callback stalls 2021-02-09 18:43:54 -05:00
Taso 6b21cfddd0 cleanup(scripts/cl_photo): Cleaned up code 2021-02-09 18:16:04 -05:00
Christopher c38fe9ef66 feat(SnackbarProvider): interface update | wrap around phone 2021-02-09 19:19:36 +01:00
RockySouthpaw fdfd4133e2 Added kash disclaimer. 2021-02-09 12:55:29 -05:00
Taso b73919c147 fix(phone/tweet): Fixed possible XSS vector
As we were parsing user input for \n in order to convert to <br> tags, a XSS vulnerability was introduced allowing for users to pass arbitrary script tags to be rendered in tweets.
2021-02-09 11:14:52 -05:00
Taso c0509be2d1 Refactored Contacts to use Routes and not a Modal (#80)
The new route allows for other components to directly route to contacts/:id, where id is the contact id for a users given contacts. It also adds a getContact function accessible by the useConfig hook in case a contact needs to be retrieved using a contact id.
2021-02-09 09:59:54 -05:00
Taso cd9e9e820c chore(readme): updated with dev tools instructions 2021-02-08 23:15:34 -05:00
Taso 9dfff30224 feat(build): One command to build both phone and scripts
To build for both scripts run yarn build in root
2021-02-08 23:04:06 -05:00
Taso f39ed37e73 chore(phone/build): Removed unnecessary files 2021-02-08 23:02:25 -05:00
Taso 7b6d49f661 feat(phone/webpack): Allow for use of react-devtools in game
This is dynamically added to the bundle depending on the environment. In production, react-devtools will not be bundled. Build a development bundle using `yarn build:dev`
2021-02-08 23:00:33 -05:00
Christopher babce2f568 feat(SnackbarProvider): initial provider 2021-02-09 00:35:35 +01:00
Christopher eaf27f37ef fix(Modal): add styling for closeButton back 2021-02-08 22:48:56 +01:00
Christopher Gjelten be754a3dc6 Merge pull request #79 from project-error/fix/notes-handling
Fix/notes handling
2021-02-08 22:34:22 +01:00
Christopher Gjelten 67c043f36c Merge pull request #78 from project-error/feature/quick-access-and-minor-perf-improvements
Feature/quick access and minor perf improvements
2021-02-08 22:25:09 +01:00
Christopher 1a5c85ed82 fix(notes/nui): better solution for Fab 2021-02-08 21:29:43 +01:00
Christopher d4cf6ce4f6 fix(notes/nui): fix Fab in notes list 2021-02-08 21:27:27 +01:00
Christopher 5e2b1a3aa5 fix(notes/nui): fix Fab in notes list 2021-02-08 21:27:00 +01:00
ErikandTaso ddb93b4de8 Fix twitter focusing bug (#74)
* fixes focusing bug and does some render optimizations

* fix(phone/twitter): Fixed conditional hook calls

Co-authored-by: Taso <[email protected]>
2021-02-08 15:24:42 -05:00
Christopher b57adf5a56 fix(notes/nui): remmove NoteModal content and title on save 2021-02-08 21:15:12 +01:00
Erik d793d1b635 fix(phone/twitter): Fix twitter for light theme (#64)
* fix twitter for light theme

* fixed styling on makeStyles
2021-02-08 15:13:34 -05:00
Taso 5d3fad36f7 chore(phone/twitter): Allow for use of Twitter in browser 2021-02-08 15:11:47 -05:00
Christopher 8e207ea2b1 fix(notes/nui): decreased NoteModal title maxLength 2021-02-08 20:56:24 +01:00
Christopher 0502d03b24 feat(notes/nui): maxLength prop on title 2021-02-08 20:31:43 +01:00
Taso 9dd47a2a43 fix(lol): lol 2021-02-08 13:53:42 -05:00
Christopher 491df669c4 feat(sql): add gallery format 2021-02-08 19:41:26 +01:00
Christopher 77bca6b299 tweak(os/useQuickAccess): use exact as true 2021-02-08 19:00:26 +01:00
Christopher 19a0ca7372 feat(more translation) 2021-02-08 18:54:38 +01:00
Christopher a8f025aff3 feat(notes/client|server): sending alert results! 2021-02-08 18:54:13 +01:00
Christopher 4d92847163 feat(notes/nui): use notes alert 2021-02-08 18:52:58 +01:00
Christopher 59973fcf9e feat(notes/nui): useAlet hook 2021-02-08 18:52:04 +01:00
Christopher fc1f6b3ad3 feat(notes/nui): notes alert 2021-02-08 18:51:08 +01:00
J Francisco Rader a27de26ef0 Use NavLink 2021-02-08 00:51:00 -05:00
J Francisco Rader 16623e98e0 Housekeeping :D 2021-02-08 00:46:26 -05:00
J Francisco Rader c149a1f49e Add quick access and improve Apps config 2021-02-08 00:44:57 -05:00
J Francisco Rader 6ae60b377c Delete unused component 2021-02-08 00:44:57 -05:00
J Francisco Rader 4672e613f4 Fix dialer routing and add contacts to it 2021-02-08 00:44:57 -05:00
J Francisco Rader 2bb32c453b Fix: Dialer Routing, added contacts and styling. (#77)
* Fix dialer routing and add contacts to it

* Fix styling

* Delete unused component
2021-02-07 23:55:24 -05:00
RockySouthpaw 84d9b08bff Update README.md 2021-02-07 15:49:23 -05:00
J Francisco Rader e2c8964b81 Fix NUI every render (#75) 2021-02-07 15:12:59 -05:00
RockySouthpaw 1d3a17220a Merge pull request #72 from project-error/chore/improving-readme
Improved install instructions and cleanup.
2021-02-07 13:38:49 -05:00
RockySouthpaw 603f92a06f Added requested edits. 2021-02-07 13:35:52 -05:00
RockySouthpaw 9de07224ae Delete bug_report.md 2021-02-07 03:21:59 -05:00
RockySouthpaw 2c0ba599ad Added additional issue templates. 2021-02-07 03:20:03 -05:00
RockySouthpaw 381615cabd Update issue templates 2021-02-07 03:03:19 -05:00
RockySouthpaw cb29ba5825 Forgot to ensure 2021-02-07 02:38:25 -05:00
RockySouthpaw 2c03e3a765 Improved install instructions and cleanup. 2021-02-07 02:34:03 -05:00
Christopher Gjelten cbea6c7c67 Merge pull request #67 from project-error/fix/warnings-and-call-timer
Fix warnings + Improve CallTimer
2021-02-07 04:18:33 +01:00
Christopher 4e1d85b35f feat(phone/useApps): startup event for apps | remove onClick 2021-02-07 04:16:15 +01:00
Christopher 640643e086 cleanup(GalleryGrid): remove unused variables 2021-02-07 04:14:36 +01:00
Christopher 1e771e87af feat(photo/client|sever): fetch photo on upload 2021-02-07 04:14:00 +01:00
Christopher 6fc469c4a3 feat(events): photo uploaded successful 2021-02-07 04:13:00 +01:00
J Francisco Rader 332b132352 Fix new message 2021-02-06 20:55:11 -05:00
Christopher 4e8dbf5667 fix(state) 2021-02-07 02:44:46 +01:00
Christopher 80e43f6f64 tweak(ui/callTimer): resolved timer issue 2021-02-07 02:40:23 +01:00
Christopher 10a8d792d8 Merge branch 'fix/warnings-and-call-timer' of https://github.com/project-error/new-phone-who-dis into fix/warnings-and-call-timer 2021-02-07 02:03:19 +01:00
Taso 1ac3d89f59 fix(resources/calls): Fixed save call not saving identifier 2021-02-06 20:02:40 -05:00
Christopher 17f186b935 Merge branch 'fix/warnings-and-call-timer' of https://github.com/project-error/new-phone-who-dis into fix/warnings-and-call-timer 2021-02-07 02:01:40 +01:00
Taso f626d1b0ce fix(resources/calls): invalid sql syntax 2021-02-06 19:56:48 -05:00
J Francisco Rader 892acd2f59 Fix warnings + Improve CallTimer 2021-02-06 17:22:12 -05:00
J Francisco Rader 0d356c7930 Merge pull request #71 from project-error/fix/close-share-picture-in-messages
BugFix / sharing bug
2021-02-06 17:21:16 -05:00
J Francisco Rader 1db4dafa2d Fix sharing bug 2021-02-06 17:18:44 -05:00
Christopher Gjelten ecd826dcd3 Merge pull request #65 from project-error/bug/twitter-char-limit
Bug/twitter char limit
2021-02-06 22:47:28 +01:00
J Francisco Rader 51d31ee122 Fix warnings + Improve CallTimer 2021-02-06 16:36:14 -05:00
J Francisco Rader 40f9555b39 Make Camera app use router (#69)
* Make Camera app use router

* Remove unused hooks

* Fucking communicate messages with camera with router

* Improved sharing in messages flow

* Fix clipboard

* Removeunused imports

* improve routing helpers

* Fix bug :D

* Fix stupid thing

* Add docs to useQueryParams hook
2021-02-06 22:24:50 +01:00
Taso 447c51a07e Feat/inject debug - Use new abstraction to clean up debug data (#70)
* feat(phone/debug): Inject debug data for development

* refactor(phone/debug): Refactored mock data to InjectDebugEvents

* fix(phone/debug) removed useless debug injections
2021-02-06 16:00:09 -05:00
Taso 686b86acf9 Merge pull request #68 from project-error/fix/zoom
Fixed issues with using non standard `zoom` css property
2021-02-06 13:38:05 -05:00
Taso 263275b921 tweak(phone/app-grid): Tweaked tooltip styling 2021-02-06 13:32:43 -05:00
J Francisco Rader 28b2599e75 Fix zoom origin 2021-02-06 13:29:03 -05:00
Christopher 5da2d680c6 fix(zoom): inital commit on possbile fix 2021-02-06 13:29:02 -05:00
Taso 7e9c1d0f35 fix(phone/apps): Fixed locales for apps 2021-02-06 13:18:06 -05:00
Kire 37504feec7 handle case where user spams new lines 2021-02-04 23:10:22 -05:00
Kire 1fca1ac200 twitter char limit to 160 and added scroll 2021-02-04 22:29:47 -05:00
Taso fd2aac31a0 chore(resources): Removed unnecessary true in watch script 2021-02-04 00:48:47 -05:00
RockySouthpaw e11c0c536c Organized wallpapers, and removed non existing ones. (#63) 2021-02-04 00:44:27 -05:00
Taso ea2fcdba00 chore(resources): Removed random lua file 2021-02-04 00:42:53 -05:00
RockySouthpaw d6a8c45d52 Revert "Merge pull request #62 from project-error/feature/show-app-name-on-hover"
This reverts commit 5f7875182c.
2021-02-03 22:41:45 -05:00
RockySouthpaw 5f7875182c Merge pull request #62 from project-error/feature/show-app-name-on-hover
Feature/show app name on hover
2021-02-03 20:22:30 -05:00
Kire 5a36290b83 Added typings to app configuration
Added an interface for the app configuration list and imported/used it in several places. Also found some cases where there were unused/unnecessary properties involved that didn't exist in this configuration.
2021-02-03 13:51:59 -05:00
Kire 948f8dfade Working tooltips 2021-02-03 13:43:53 -05:00
Christopher Gjelten 63aea89e2b Merge pull request #61 from project-error/feat/calling-lua-ts
Feat/calling lua ts
2021-02-03 00:00:06 +01:00
Christopher 5c3f4366ec fix(calling/state): fix state keys 2021-02-02 23:56:14 +01:00
Christopher 157407740e Merge branch 'feat/calling-lua-ts' of https://github.com/project-error/new-phone-who-dis into feat/calling-lua-ts 2021-02-02 23:51:34 +01:00
Christopher 3cbdf531db feat(updated import.sql) 2021-02-02 23:51:13 +01:00
itschip 566b55b374 Prettified Code! 2021-02-02 22:48:54 +00:00
Christopher e48864c6dc feat(calling): using unix as call time 2021-02-02 23:47:43 +01:00
Christopher 8ff9017902 Merge branch 'feat/calling-lua-ts' of https://github.com/project-error/new-phone-who-dis into feat/calling-lua-ts 2021-02-02 18:36:55 +01:00
Christopher 42cdbaab4f tweak(dial/nui): useContext instead of Consumer 2021-02-02 18:36:46 +01:00
itschip 39a46ad4dc Prettified Code! 2021-02-02 09:23:10 +00:00
Christopher ae1715f173 feat(call/client|server): use Unix 2021-02-02 10:21:50 +01:00
itschip 08d848054e Prettified Code! 2021-02-01 19:16:38 +00:00
Christopher 8472309436 fix conflicts 2021-02-01 20:15:20 +01:00
Christopher d3b04f4cd9 tweak(call/nui): duration as global state 2021-02-01 20:14:27 +01:00
itschip 8621cab587 Prettified Code! 2021-02-01 18:45:15 +00:00
Christopher dd008775f9 feat(calling/nui): Timer for calls 2021-02-01 19:44:00 +01:00
itschip 3063da94b2 Prettified Code! 2021-01-31 20:50:18 +00:00
Christopher f4b77d9f51 fix(Dial/nui): rename functions 2021-01-31 21:49:11 +01:00
Christopher c7b185014d feat(calling/dial): update interfaces 2021-01-31 21:44:24 +01:00
Christopher 8ad85d8209 feat(calling/client|server): update Call interface 2021-01-31 21:43:44 +01:00
Christopher 04afb24bda fix(dial/hooks): rename 2021-01-31 21:43:04 +01:00
Christopher 5563125d2c fix(Notification): resolved ThemeProvider issue 2021-01-31 16:38:14 +01:00
Christopher eaf764cd01 feat(phone/client): fetch contacts on dailer
This is for knowing if the contact exist, so we can show the name or the phone number, and NOT open the contacts page first
2021-01-31 16:08:12 +01:00
itschip fe4c46e8ee Prettified Code! 2021-01-31 15:00:22 +00:00
Christopher 827f98bba1 feat(DialerInput): calling from DialPage 2021-01-31 15:59:15 +01:00
itschip 856a7ef7ef Prettified Code! 2021-01-31 01:53:49 +00:00
Christopher bf79f85336 fix(calling/server): resolve issue where call is not updated when accepted 2021-01-31 02:52:44 +01:00
itschip d08e38495a Prettified Code! 2021-01-31 01:49:31 +00:00
Christopher cf65004c42 del(Phone.tsx): remove 'type' from call mock data 2021-01-31 02:48:28 +01:00
Christopher 601450e579 feat(dailer/history): showing timestamps in recent calls 2021-01-31 02:47:38 +01:00
Christopher 798c3ce3e4 feat(types/calls): timestamp type 2021-01-31 02:46:59 +01:00
Christopher 342fd9aaba feat(calling/client|server): handling timestamps for calls 2021-01-31 02:46:33 +01:00
Christopher da4592d531 feat(package/dayjs): added dayjs 2021-01-31 02:45:39 +01:00
itschip ddcb5e5a3d Prettified Code! 2021-01-29 19:10:36 +00:00
Christopher 283f872e5b fix(resovled pull issues) 2021-01-29 20:09:19 +01:00
itschip 26a4c1c31a Prettified Code! 2021-01-29 18:57:12 +00:00
Christopher 9895ea2089 tweak(calling/server|client): more history and calling 2021-01-29 19:56:00 +01:00
Christopher fbb3b07b7b feat(calling/client|server): show dail history 2021-01-29 19:54:37 +01:00
Christopher f960d1414c feat(calling/client|server): show dail history 2021-01-29 19:54:17 +01:00
Christopher 89ea248d32 feat(contacts/nui | calling/client|server): getName | close modal on add | show dail history 2021-01-29 19:53:14 +01:00
itschip 762fb237c3 Prettified Code! 2021-01-27 23:48:05 +00:00
Christopher 0f10eac796 feat(calling): working state 2021-01-28 00:46:56 +01:00
Christopher 034d996b25 fixed merge 2021-01-28 00:45:18 +01:00
Christopher 65b744e7f2 feat(typings/call): added typings for calling 2021-01-28 00:43:09 +01:00
Christopher a3ef384f35 fix(CallModal): fixed nui requests and if-else inline 2021-01-28 00:42:36 +01:00
Christopher 242d92acb3 feat(utils/nui): able to merge data 2021-01-28 00:41:31 +01:00
Christopher 804c8da9cb feat(utils/nui): able to merge data 2021-01-28 00:41:15 +01:00
Christopher d3a2ee7628 feat(calling/client|server): working calling 2021-01-28 00:40:52 +01:00
Christopher 9c71ef470c feat(events): tweaks 2021-01-28 00:40:06 +01:00
itschip 658964277b Prettified Code! 2021-01-26 21:32:13 +00:00
Christopher 552cba3e76 shit fix 2021-01-26 22:30:51 +01:00
Christopher f23af8da04 Merge branch 'feat/calling-lua-ts' of https://github.com/project-error/new-phone-who-dis into feat/calling-lua-ts 2021-01-26 22:07:38 +01:00
Christopher 7eb4b09f5c fix(adding correct events 2021-01-26 22:07:28 +01:00
itschip dbcfdd9eda Prettified Code! 2021-01-26 20:43:20 +00:00
Christopher a7f3f50f3d feat(callModal/nui): styles and functions for calling modal
Needs to be discussed
2021-01-26 21:42:11 +01:00
Christopher 5ae49f4c7a feat(calling/server): more client-side handling for calling
We need to come up with a better way of doing this
2021-01-26 21:41:28 +01:00
Christopher 1382e66b3d feat(calling/server): more server-side handling for calling 2021-01-26 21:40:49 +01:00
Christopher 7b7b96783c feat(utils/evens): events for calling 2021-01-26 21:40:18 +01:00
J Francisco Rader 20f125c9c8 Merge pull request #60 from project-error/feature/improve-sellout-images-and-create-generic-picture
Feature/improve sellout images and create generic picture
2021-01-24 19:56:06 -05:00
J Francisco RaderandJ Francisco Rader bde18ef1cf chore(phone): Types and unused variable cleanup
Co-authored-by: J Francisco Rader <[email protected]>
2021-01-24 18:30:37 -05:00
J Francisco Rader e0f9cc193b Fix shit 2021-01-24 14:45:00 -05:00
J Francisco Rader 6de92e3a7a Create shared Picture components and use them in sellout app 2021-01-24 14:42:15 -05:00
J Francisco Rader bdadf052c5 Housekeeping :D 2021-01-24 13:26:34 -05:00
RockySouthpaw 5719c67874 Updated Authors (kidz) 2021-01-24 13:10:42 -05:00
RockySouthpaw 1ac2d607b7 Added Kire to fxmanifest
silly chip
2021-01-24 13:05:57 -05:00
Christopher Gjelten 6f5c973930 Update fxmanifest.lua 2021-01-24 19:03:42 +01:00
Christopher Gjelten 3bf4cb183e Merge pull request #58 from project-error/task/cleanup-all-warnings
Fix all ts warnings
2021-01-24 18:38:26 +01:00
J Francisco Rader 2b96d93565 Merge master 2021-01-23 18:44:00 -05:00
itschip e7cafe0855 Prettified Code! 2021-01-23 19:59:33 +00:00
Christopher 03ecd5226b feat(calling/server): Using source as channel id 2021-01-23 20:58:05 +01:00
Taso d0de0e4bac Feat: Lerna integration with husky for precommit checks (#57)
* feat: Lerna integration with husky

* Lint-staged integration

* tweak(ci/cd): Removed prettier integration

* Added lint-staged to precommit hook call

* tweak: removed git add from lint-staged

* tweak(gitignore): Removed package.json from ignore
2021-01-18 15:17:41 -05:00
Taso d6e9a85b40 Feat: Dial section
Still WIP
2021-01-18 14:30:32 -05:00
Taso 5a9707ae3c chore(phone/config): Readded overwritten config fields 2021-01-18 12:18:32 -05:00
Taso 853184dba6 Merge branch 'master' into feat/calling-lua-ts 2021-01-18 12:13:08 -05:00
Taso 820354aa2e Misc(styling): Fixed AppContent shenanigans with height 2021-01-18 12:08:23 -05:00
Taso 2c06579182 enhance(phone/types): Improved types for AppWrapper & AppContent 2021-01-18 12:08:16 -05:00
itschip 4fe3229bb7 Prettified Code! 2021-01-17 21:36:50 +00:00
Christopher 8d100a5ebd possible solution for accepting call 2021-01-17 22:35:41 +01:00
Christopher e5604bd544 feat(calling/server): setting unique channel id 2021-01-17 22:29:55 +01:00
itschip 7cc3a47f7b Prettified Code! 2021-01-17 21:17:56 +00:00
Christopher c8882a618b fix(merge): fixed conflicts 2021-01-17 22:16:21 +01:00
itschip 52a32b443d Prettified Code! 2021-01-17 21:09:45 +00:00
Christopher db3bd999f2 feat(calling/client|server): partical functions for calling
Should probably reuse data
2021-01-17 22:08:29 +01:00
Christopher 77c7cc303e feat(calling/client|server): partical functions for calling
Should probably reuse data
2021-01-17 22:03:52 +01:00
Taso 8a2f281790 enhance(phone): useNuiEvent types and integrated DebugLogger 2021-01-17 15:49:22 -05:00
itschip c12b0ba126 Prettified Code! 2021-01-17 20:13:46 +01:00
Christopher c35b5f2b84 feat(modals/call/nui): inital commit for calling modal 2021-01-17 20:12:21 +01:00
Christopher 59ad36c7fd fix(contacts/client|server): fixed source for updating contacts 2021-01-17 20:12:15 +01:00
Christopher 1913dd48df fix(contacts/nui): resolved switch statement for alerts 2021-01-17 20:10:34 +01:00
TasoOneAsia 85ffdc571b Prettified Code! 2021-01-17 20:10:34 +01:00
Taso a8deb8b578 feat(call): More progress 2021-01-17 20:10:33 +01:00
itschip 03e8c4a0d5 Prettified Code! 2021-01-17 20:10:33 +01:00
Christopher 28902fb97f feat(client/server): imports 2021-01-17 20:10:33 +01:00
Christopher 085fb778f1 feat(calling/client|nui): new command and changed event name 2021-01-17 20:10:32 +01:00
Christopher 88d1cb89fd fix(calling/server|client): fixed events issue | updated calling server 2021-01-17 20:10:21 +01:00
Christopher 22c36f0920 inital ts commit 2021-01-17 20:09:35 +01:00
Christopher 28774d24d8 Merge branch 'feat/calling-lua-ts' of https://github.com/project-error/new-phone-who-dis into feat/calling-lua-ts 2021-01-17 14:30:52 +01:00
Christopher 903e3c5f64 feat(modals/call/nui): inital commit for calling modal 2021-01-17 14:29:56 +01:00
itschip 5c168c804b Prettified Code! 2021-01-15 21:08:51 +00:00
Christopher 76aee071a8 fix(contacts/client|server): fixed source for updating contacts 2021-01-15 22:07:45 +01:00
Christopher ccb5b76d29 fix(contacts/nui): resolved switch statement for alerts 2021-01-15 22:05:32 +01:00
Christopher 6bb534231b something weird happened now 2021-01-14 20:23:31 +01:00
Christopher 1ec30f341a feat(notes/nui): interface for useNoteDetail 2021-01-14 20:19:22 +01:00
Christopher 5960524b98 feat(notes/nui): interface for useNotes 2021-01-14 20:18:59 +01:00
Christopher 92579dd213 feat(notes/nui): interface for useNoteModal 2021-01-14 20:09:09 +01:00
Christopher 20e03e4981 feat(camera/nui): interface on useShareModal 2021-01-14 20:02:59 +01:00
Christopher ba027b67fd fix(bank/nui): interface for useBankModal 2021-01-14 19:37:46 +01:00
Christopher deeabd9677 fix(contacts/nui): interface for useContactDetail 2021-01-14 19:36:05 +01:00
Christopher a7100f16a9 fix(contacts/nui): interface for useContacts 2021-01-14 19:32:56 +01:00
Christopher c7f6a72180 fix(typo in useContactModal) 2021-01-14 19:02:35 +01:00
Christopher 0e0cde0ca1 feat(contacts/nui): interface for useContactModal 2021-01-14 19:01:47 +01:00
Christopher fa465a8b23 feat(contacts/nui): interface for useFilteredContacts 2021-01-14 19:00:13 +01:00
Christopher 01291abe73 feat(contacts/nui): interface for useModal 2021-01-14 18:58:50 +01:00
Taso ec1451a9aa Fix: prettier config in resources\ not being standard. 2021-01-13 20:36:03 -05:00
Taso d56112a0cb Feat: Debug logger 2021-01-13 20:31:14 -05:00
Taso 7b9d8826a6 Fix: SettingItem with no onClick 2021-01-13 16:49:30 -05:00
TasoOneAsia bcdab48bdb Prettified Code! 2021-01-13 04:13:28 +00:00
Taso 5766da5c66 feat(call): More progress 2021-01-12 23:12:00 -05:00
Taso a29ba86577 tweak(webpack): Added copy plugin to webpack allowing for easier build
Also changed build script name
2021-01-12 22:09:56 -05:00
Taso a227743bdc Merge branch 'master' into feat/calling-lua-ts 2021-01-12 21:47:24 -05:00
Taso 54daa42454 styling: Enforced styling across all files (#55) 2021-01-12 21:31:03 -05:00
Taso c9b3174505 DB: Removed explicit collation values on tables for compatability reasons 2021-01-12 21:27:37 -05:00
Taso c91d0729fb DB: Removed need for password and added docs 2021-01-12 21:27:00 -05:00
Taso 2b52612f65 bump: esx.js version 2021-01-12 21:26:38 -05:00
Christopher 3c371d4e7e Merge branch 'feat/calling-lua-ts' of https://github.com/Re-Ignited-Development/new-phone-who-dis into feat/calling-lua-ts 2021-01-12 22:11:58 +01:00
Christopher dec6614b45 feat(client/server): imports 2021-01-12 22:11:40 +01:00
itschip 6cfc9ec19c Prettified Code! 2021-01-12 21:02:42 +00:00
Christopher 4a193776ec feat(calling/client|nui): new command and changed event name 2021-01-12 22:01:24 +01:00
Christopher 4823debf2d fix(calling/server|client): fixed events issue | updated calling server 2021-01-12 21:31:49 +01:00
Xios_Bombay 6e94bef7f3 locale: Added new translations for es.json (#54) 2021-01-12 12:15:01 -05:00
Taso fded06adbb locale: European PT (#53) 2021-01-12 12:11:58 -05:00
TasoOneAsia 3269f2f270 Prettified Code! 2021-01-12 17:10:35 +00:00
Taso b7ff4b670b Merge pull request #52 from Oldarorn/patch-1
Update fr.json
2021-01-12 12:09:34 -05:00
Taso 5c23744a13 Merge branch 'master' of https://github.com/project-error/new-phone-who-dis 2021-01-12 12:06:35 -05:00
Taso 73a5bab1c7 Feat: Settings localStorage state 2021-01-12 12:04:46 -05:00
Taso d65806ffa5 Misc: cleanup for rebase of master 2021-01-12 11:30:43 -05:00
Taso 8912650f0e refactor: LocalStorage state integration 2021-01-12 11:28:20 -05:00
Christopher 8266b473a5 inital ts commit 2021-01-11 19:10:20 +01:00
HypeLevels 1efb5fb54a Update i18n.ts 2021-01-11 18:08:54 +00:00
HypeLevels e4c0a4e40c Create pt.json 2021-01-11 18:08:27 +00:00
Oldarorn 8c5595ebef Update fr.json 2021-01-11 17:55:37 +01:00
TasoOneAsia c249cfa2ec Prettified Code! 2021-01-10 22:14:48 +00:00
Taso 60828c8261 Added Brazilian Translations (#51) 2021-01-10 17:13:47 -05:00
SynTer acc0091c9e added on resources array 2021-01-10 19:12:32 -03:00
SynTer a799f6effa Added the translation on i18n.ts 2021-01-10 19:11:15 -03:00
SynTer 85b80d4de7 Brazilian Portuguese translation 2021-01-10 19:06:08 -03:00
Taso d07b5496b1 chore: removed unused .lua files that caused confusions for locales pr's 2021-01-10 17:00:44 -05:00
Christopher 5af6e4936d feat(settings): utilze useLocalStorage 2021-01-09 20:09:30 +01:00
Christopher 6458bce17f tweak(settings): switced to useLocalStorage hook 2021-01-09 18:45:18 +01:00
Christopher 5fdb9ba21c fix(localStorage): solution to localStorage issue
Still need to find a good way to re-render
2021-01-08 21:48:24 +01:00
Taso a1f0d7a289 Merge pull request #48 from project-error/feat/sentry
Feat: Added Sentry integration for exception metrics
2021-01-08 10:11:07 -05:00
Christopher 645f982074 Merge branch 'master' of https://github.com/Re-Ignited-Development/new-phone-who-dis 2021-01-07 21:45:52 +01:00
Christopher 66ccf7a73f feat(Phone): fixed warnings 2021-01-07 21:45:33 +01:00
Christopher a723167b7d feat(GridMenu): fixed warnings 2021-01-07 21:45:21 +01:00
Christopher b1481f635b feat(navbar/nui): fixed warnings 2021-01-07 21:45:04 +01:00
Christopher 9707c8da60 feat(contacts/nui): fixed warnings 2021-01-07 21:44:49 +01:00
Christopher 75896d3936 feat(settings/nui): fixed warnings 2021-01-07 21:44:25 +01:00
Christopher 1cf4d0e081 feat(notes/nui): fixed warnings 2021-01-07 21:44:07 +01:00
Christopher abf644986a feat(camera/nui): fixed warnings 2021-01-07 21:43:53 +01:00
Christopher 18db9e5a4d feat(bank/nui): fixed warnings 2021-01-07 21:43:31 +01:00
Christopher ee283c8b1c fix(bank/nui): fixed warnings 2021-01-07 21:43:07 +01:00
Christopher 310d58d3d1 fix(twitter/nui): fixed warnings 2021-01-07 21:42:53 +01:00
Christopher aaf851c5ee fix(twitter/nui): fixed warnings 2021-01-07 21:42:37 +01:00
Christopher 07dc73f0cb minor changes in localStorage - nothing to see here 2021-01-07 21:17:44 +01:00
TasoOneAsia 43b38d7f98 Prettified Code! 2021-01-06 22:26:11 +00:00
Taso 67e3b74b02 Merge pull request #47 from project-error/enhance/locale-strings
Enhance/locale strings
2021-01-06 17:25:10 -05:00
TasoOneAsia 3b42511c10 Prettified Code! 2021-01-06 16:25:12 +00:00
Taso dce7528c7a Feat: Sentry for issue tracking/exception handling 2021-01-06 11:16:05 -05:00
Taso b6d363fabd Revert "refactor(import SQL): Misc. comments/changes still WIP "
This reverts commit 3f1c8b890b.
2021-01-06 03:52:51 -05:00
TasoOneAsia af8da64849 Prettified Code! 2021-01-06 08:48:15 +00:00
Taso 0a3a341d98 Feat: Additional locales for contacts app 2021-01-06 03:44:11 -05:00
Taso fb0a402292 Feat: Added locales for Settings 2021-01-06 03:24:56 -05:00
Taso b3e6cc0c6e Merge branch 'master' of https://github.com/Re-Ignited-Development/new-phone-who-dis 2021-01-06 03:05:05 -05:00
Taso 35c5a3098b Merge pull request #45 from Hamy-os/master
added bh.json
2021-01-06 02:48:55 -05:00
Hamy fe09bb0058 Update i18n.ts
added the import thingy and there was 2 missing :|
2021-01-06 10:05:36 +03:00
Hamy ce30495cb4 added bh.json
bosnian!!!! wooooooooooo
2021-01-05 14:19:36 +03:00
Christopher Gjelten 4512a4369a Merge pull request #44 from Ruqen/master
Turkish language implemented
2021-01-04 20:37:05 +01:00
Christopher dddddc01f8 feat(localstorage): resolved issue with phone not re-rendering 2021-01-04 20:33:53 +01:00
Ruqen 12ab829791 Create tr.lua 2021-01-04 21:50:08 +03:00
Ruqen 47d62773ba Create tr.json 2021-01-04 21:49:43 +03:00
Taso d93818dbc1 Merge pull request #40 from project-error/dependabot/npm_and_yarn/resources/node-notifier-8.0.1
build(deps): bump node-notifier from 8.0.0 to 8.0.1 in /resources
2021-01-04 13:48:10 -05:00
itschip 5803b8a629 Prettified Code! 2021-01-04 18:47:24 +00:00
Christopher Gjelten fda60c3736 Merge pull request #43 from brezedc/master
helo, i add swedish yes, shoutout to 99kr
2021-01-04 19:46:12 +01:00
Breze a254d148fd walla i tror i fixed
ey
2021-01-04 19:42:55 +01:00
Breze a4f1ce9078 ey walla 2021-01-04 19:35:11 +01:00
itschip 0581947429 Prettified Code! 2021-01-04 18:29:56 +00:00
Christopher 528cfa907a feat(translation): added fr and es 2021-01-04 19:28:41 +01:00
Breze bc87f4125c added swedish edits 2021-01-04 19:17:01 +01:00
itschip 2982a346ed Prettified Code! 2021-01-04 18:10:59 +00:00
Christopher Gjelten 4c8beceb67 Merge pull request #42 from XiosBombay/master
Spanish translation (I'll update it as more apps or things get added or removed)
2021-01-04 19:09:51 +01:00
Christopher Gjelten aee41958e8 Merge pull request #41 from Oldarorn/master
First french translation shot
2021-01-04 19:01:51 +01:00
Xios_Bombay 3ca689f47e Create es.lua + Translation 2021-01-04 08:47:36 -05:00
Xios_Bombay 6e6a93b5fd Update es.json 2021-01-04 08:44:34 -05:00
Xios_Bombay fc01a56a7c Create es.json 2021-01-04 08:12:54 -05:00
Christopher Gjelten 53beb1845c Update LICENSE 2021-01-04 10:29:42 +01:00
Oldarorn 87dca03629 Create fr.lua 2021-01-04 09:32:58 +01:00
Oldarorn 61e13a407a Create fr.json 2021-01-04 09:32:04 +01:00
itschip 6dc162a107 Prettified Code! 2021-01-03 20:05:57 +00:00
Christopher Gjelten 7c6fb3bab6 Update README.md 2021-01-03 21:04:59 +01:00
Christopher Gjelten df98f07bb5 Update README.md 2021-01-03 21:04:48 +01:00
Christopher Gjelten 924dccc447 Update LICENSE 2020-12-27 19:09:37 +01:00
dependabot[bot] d9e8514e14 build(deps): bump node-notifier from 8.0.0 to 8.0.1 in /resources
Bumps [node-notifier](https://github.com/mikaelbr/node-notifier) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/mikaelbr/node-notifier/releases)
- [Changelog](https://github.com/mikaelbr/node-notifier/blob/v8.0.1/CHANGELOG.md)
- [Commits](https://github.com/mikaelbr/node-notifier/compare/v8.0.0...v8.0.1)

Signed-off-by: dependabot[bot] <[email protected]>
2020-12-22 20:57:54 +00:00
Christopher Gjelten 1d03d3c458 Update LICENSE 2020-12-16 08:13:29 +01:00
Taso 3f1c8b890b refactor(import SQL): Misc. comments/changes still WIP
The data structure can be heavily improved imo, we just need some time to sit down together and decide.
2020-12-15 21:56:07 -05:00
Taso 2172529df6 chore: Added NUI build folder (resources/html) to .gitignore 2020-12-15 14:07:07 -05:00
Taso 2b3f57e60c chore: Removed children .gitignores and relocated rules to root. 2020-12-15 13:46:38 -05:00
Taso 76a7829370 Feat: Changed SS Basic to Convar
Screenshot Basic token is now set using a replicated convar. i.e +setr "SCREENSHOT_BASIC_TOKEN" "token"
2020-12-15 13:42:28 -05:00
Taso 0200a68a4e chore: Fixed up .gitignore to ignore built files for NUI 2020-12-15 13:41:12 -05:00
Taso 6034b559ce mod(config): Generated dashed numbers by default 2020-12-15 13:38:54 -05:00
Taso 12a6ebb5aa fix(utils/events): Added missing event 2020-12-15 13:38:29 -05:00
Taso 61fd8ffea6 fix: paths for common typings folder and misc. 2020-12-15 13:18:28 -05:00
Christopher 14223c9800 feat(idontknowwhatthisis) 2020-12-14 20:27:59 +01:00
Christopher 3e03993d5b feat(settings): using local storage to save settings
Need to ensure that when a new setting is set, we re-render the phone.
2020-12-13 21:59:10 +01:00
614 changed files with 33855 additions and 15771 deletions

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
---
name: Bug Report
about: Create a report to help us improve
title: 'Bug: TITLE'
labels: New Issue
assignees: ''
---
**Is this issue related to the phone still being in development?**
If so, please consult the [gitkraken](https://app.gitkraken.com/glo/board/X9YZ_x_SVQEcMwpH) to see if it's already being tracked.
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Evidence**
If applicable, add a screenshot or a video to help explain your problem.
**Needed information (please complete the following information):**
- **Server OS**: [e.g. Windows 10]
- **Server Artifact version**: [e.g. 3486] Don't know? Do `version` into your server console.
- What version of **new-phone-who-dis** are you running?
**Additional context**
Add any other context about the problem here.
+21
View File
@@ -0,0 +1,21 @@
---
name: Feature Request
about: Suggest a feature that you would like added/improved upon.
title: 'Enhancement: TITLE'
labels: Enhancement
assignees: ''
---
**Is your feature request related to a problem or design oversight? If so, please explain it.**
Provide evidence to help support your claim so we can better understand such as pictures or a video.
**What is your suggestion?**
Please include as much details as possible. Avoid vague suggestions such as "An app to order food with.". Include as much details as possible such as: "An app that will allow a player to order a food item of their choice and have a player/npc deliver it to them."
**Does your suggestion require any dependencies? (Jobs and Money are framework dependencies.)**
**Do you have any references to help us visualize your suggestion?**
Such as "Here is a link to a similar concept: https://www.youtube.com/watch?v=j5a0jTc9S10 "
**Any additional comments or concerns?**
+22 -30
View File
@@ -1,10 +1,10 @@
name: Tests and CI
name: Test Suite
on: [push]
on: [push, pull_request]
jobs:
nui_preformatting_tests:
name: NUI Preformatting and Tests
name: Tests for NUI
runs-on: ubuntu-latest
defaults:
run:
@@ -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)"
@@ -34,21 +29,15 @@ jobs:
node-version: '14.x'
- name: Install dependencies NUI
run: yarn --frozen-lockfile
- name: Prettify Code
uses: creyD/[email protected]
with:
# This part is also where you can pass other options, for example:
prettier_options: --write **/*.{js,jsx,ts,tsx,json,css,scss,md}
only_changed: True
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run Enzyme Tests
run: yarn test
- name: Check build status
run: yarn build
env:
CI: true
game_scripts_test:
name: Formatting/Tests for Native Scripts
name: Tests for Game Scripts
runs-on: ubuntu-latest
defaults:
run:
@@ -57,26 +46,29 @@ 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:
node-version: '14.x'
- name: Install dependencies NUI
run: yarn --frozen-lockfile
- name: Prettify code
uses: creyD/[email protected]
with:
# This part is also where you can pass other options, for example:
prettier_options: --write **/*.{js,jsx,ts,tsx,json,css,scss,md}
only_changed: True
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- 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
+57
View File
@@ -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 }}
+107
View File
@@ -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 }}
+26 -1
View File
@@ -1,2 +1,27 @@
# No intellij folder
# No IDE Folders
.idea
npwd_temp
resources/html
phone/.eslintcache
# Node Modules and Built Folders
node_modules
build
dist
# Error Logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
# Mac thing
.DS_Store
# Debug logs
sv_npwd.log
# FXServer Yarn
.yarn.installed
+1
View File
@@ -0,0 +1 @@
_
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit ""
+4
View File
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn pretty-quick --staged
+9
View File
@@ -0,0 +1,9 @@
build
dist
coverage
node_modules
.idea
.github
.vscode
resources/html
resources/dist
+9
View File
@@ -0,0 +1,9 @@
{
"printWidth": 100,
"singleQuote": true,
"semi": true,
"bracketSpacing": true,
"trailingComma": "all",
"useTabs": false,
"tabWidth": 2
}
+93 -7
View File
@@ -1,11 +1,97 @@
Copyright (c) BTNGaming, itzchip, ROCKY_southpaw
Copyright (c) Kidz, ItsChip, ROCKY_southpaw, Kire and TasoOneAsia
All rights reserved.
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
Even if 'All rights reserved' is very clear :
Section 1 – Definitions.
You shall not use any piece of this software in a commercial product / service
You shall not resell this software
You shall not provide any facility to install this particular software in a commercial product / service
You are in no way allowed to redistribute this code until this private project has become public, unless given written consent by one of the copyright holders.
This copyright should appear in every part of the project code
Adapted Material means material subject to Copyright and Similar Rights that is derived from or based upon the Licensed Material and in which the Licensed Material is translated, altered, arranged, transformed, or otherwise modified in a manner requiring permission under the Copyright and Similar Rights held by the Licensor. For purposes of this Public License, where the Licensed Material is a musical work, performance, or sound recording, Adapted Material is always produced where the Licensed Material is synched in timed relation with a moving image.
Adapter's License means the license You apply to Your Copyright and Similar Rights in Your contributions to Adapted Material in accordance with the terms and conditions of this Public License.
BY-NC-SA Compatible License means a license listed at creativecommons.org/compatiblelicenses, approved by Creative Commons as essentially the equivalent of this Public License.
Copyright and Similar Rights means copyright and/or similar rights closely related to copyright including, without limitation, performance, broadcast, sound recording, and Sui Generis Database Rights, without regard to how the rights are labeled or categorized. For purposes of this Public License, the rights specified in Section 2(b)(1)-(2) are not Copyright and Similar Rights.
Effective Technological Measures means those measures that, in the absence of proper authority, may not be circumvented under laws fulfilling obligations under Article 11 of the WIPO Copyright Treaty adopted on December 20, 1996, and/or similar international agreements.
Exceptions and Limitations means fair use, fair dealing, and/or any other exception or limitation to Copyright and Similar Rights that applies to Your use of the Licensed Material.
License Elements means the license attributes listed in the name of a Creative Commons Public License. The License Elements of this Public License are Attribution, NonCommercial, and ShareAlike.
Licensed Material means the artistic or literary work, database, or other material to which the Licensor applied this Public License.
Licensed Rights means the rights granted to You subject to the terms and conditions of this Public License, which are limited to all Copyright and Similar Rights that apply to Your use of the Licensed Material and that the Licensor has authority to license.
Licensor means the individual(s) or entity(ies) granting rights under this Public License.
NonCommercial means not primarily intended for or directed towards commercial advantage or monetary compensation. For purposes of this Public License, the exchange of the Licensed Material for other material subject to Copyright and Similar Rights by digital file-sharing or similar means is NonCommercial provided there is no payment of monetary compensation in connection with the exchange.
Share means to provide material to the public by any means or process that requires permission under the Licensed Rights, such as reproduction, public display, public performance, distribution, dissemination, communication, or importation, and to make material available to the public including in ways that members of the public may access the material from a place and at a time individually chosen by them.
Sui Generis Database Rights means rights other than copyright resulting from Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, as amended and/or succeeded, as well as other essentially equivalent rights anywhere in the world.
You means the individual or entity exercising the Licensed Rights under this Public License. Your has a corresponding meaning.
Section 2 – Scope.
License grant.
Subject to the terms and conditions of this Public License, the Licensor hereby grants You a worldwide, royalty-free, non-sublicensable, non-exclusive, irrevocable license to exercise the Licensed Rights in the Licensed Material to:
reproduce and Share the Licensed Material, in whole or in part, for NonCommercial purposes only; and
produce, reproduce, and Share Adapted Material for NonCommercial purposes only.
Exceptions and Limitations. For the avoidance of doubt, where Exceptions and Limitations apply to Your use, this Public License does not apply, and You do not need to comply with its terms and conditions.
Term. The term of this Public License is specified in Section 6(a).
Media and formats; technical modifications allowed. The Licensor authorizes You to exercise the Licensed Rights in all media and formats whether now known or hereafter created, and to make technical modifications necessary to do so. The Licensor waives and/or agrees not to assert any right or authority to forbid You from making technical modifications necessary to exercise the Licensed Rights, including technical modifications necessary to circumvent Effective Technological Measures. For purposes of this Public License, simply making modifications authorized by this Section 2(a)(4) never produces Adapted Material.
Downstream recipients.
Offer from the Licensor – Licensed Material. Every recipient of the Licensed Material automatically receives an offer from the Licensor to exercise the Licensed Rights under the terms and conditions of this Public License.
Additional offer from the Licensor – Adapted Material. Every recipient of Adapted Material from You automatically receives an offer from the Licensor to exercise the Licensed Rights in the Adapted Material under the conditions of the Adapter’s License You apply.
No downstream restrictions. You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, the Licensed Material if doing so restricts exercise of the Licensed Rights by any recipient of the Licensed Material.
No endorsement. Nothing in this Public License constitutes or may be construed as permission to assert or imply that You are, or that Your use of the Licensed Material is, connected with, or sponsored, endorsed, or granted official status by, the Licensor or others designated to receive attribution as provided in Section 3(a)(1)(A)(i).
Other rights.
Moral rights, such as the right of integrity, are not licensed under this Public License, nor are publicity, privacy, and/or other similar personality rights; however, to the extent possible, the Licensor waives and/or agrees not to assert any such rights held by the Licensor to the limited extent necessary to allow You to exercise the Licensed Rights, but not otherwise.
Patent and trademark rights are not licensed under this Public License.
To the extent possible, the Licensor waives any right to collect royalties from You for the exercise of the Licensed Rights, whether directly or through a collecting society under any voluntary or waivable statutory or compulsory licensing scheme. In all other cases the Licensor expressly reserves any right to collect such royalties, including when the Licensed Material is used other than for NonCommercial purposes.
Section 3 – License Conditions.
Your exercise of the Licensed Rights is expressly made subject to the following conditions.
Attribution.
If You Share the Licensed Material (including in modified form), You must:
retain the following if it is supplied by the Licensor with the Licensed Material:
identification of the creator(s) of the Licensed Material and any others designated to receive attribution, in any reasonable manner requested by the Licensor (including by pseudonym if designated);
a copyright notice;
a notice that refers to this Public License;
a notice that refers to the disclaimer of warranties;
a URI or hyperlink to the Licensed Material to the extent reasonably practicable;
indicate if You modified the Licensed Material and retain an indication of any previous modifications; and
indicate the Licensed Material is licensed under this Public License, and include the text of, or the URI or hyperlink to, this Public License.
You may satisfy the conditions in Section 3(a)(1) in any reasonable manner based on the medium, means, and context in which You Share the Licensed Material. For example, it may be reasonable to satisfy the conditions by providing a URI or hyperlink to a resource that includes the required information.
If requested by the Licensor, You must remove any of the information required by Section 3(a)(1)(A) to the extent reasonably practicable.
ShareAlike.
In addition to the conditions in Section 3(a), if You Share Adapted Material You produce, the following conditions also apply.
The Adapter’s License You apply must be a Creative Commons license with the same License Elements, this version or later, or a BY-NC-SA Compatible License.
You must include the text of, or the URI or hyperlink to, the Adapter's License You apply. You may satisfy this condition in any reasonable manner based on the medium, means, and context in which You Share Adapted Material.
You may not offer or impose any additional or different terms or conditions on, or apply any Effective Technological Measures to, Adapted Material that restrict exercise of the rights granted under the Adapter's License You apply.
Section 4 – Sui Generis Database Rights.
Where the Licensed Rights include Sui Generis Database Rights that apply to Your use of the Licensed Material:
for the avoidance of doubt, Section 2(a)(1) grants You the right to extract, reuse, reproduce, and Share all or a substantial portion of the contents of the database for NonCommercial purposes only;
if You include all or a substantial portion of the database contents in a database in which You have Sui Generis Database Rights, then the database in which You have Sui Generis Database Rights (but not its individual contents) is Adapted Material, including for purposes of Section 3(b); and
You must comply with the conditions in Section 3(a) if You Share all or a substantial portion of the contents of the database.
For the avoidance of doubt, this Section 4 supplements and does not replace Your obligations under this Public License where the Licensed Rights include other Copyright and Similar Rights.
Section 5 – Disclaimer of Warranties and Limitation of Liability.
Unless otherwise separately undertaken by the Licensor, to the extent possible, the Licensor offers the Licensed Material as-is and as-available, and makes no representations or warranties of any kind concerning the Licensed Material, whether express, implied, statutory, or other. This includes, without limitation, warranties of title, merchantability, fitness for a particular purpose, non-infringement, absence of latent or other defects, accuracy, or the presence or absence of errors, whether or not known or discoverable. Where disclaimers of warranties are not allowed in full or in part, this disclaimer may not apply to You.
To the extent possible, in no event will the Licensor be liable to You on any legal theory (including, without limitation, negligence) or otherwise for any direct, special, indirect, incidental, consequential, punitive, exemplary, or other losses, costs, expenses, or damages arising out of this Public License or use of the Licensed Material, even if the Licensor has been advised of the possibility of such losses, costs, expenses, or damages. Where a limitation of liability is not allowed in full or in part, this limitation may not apply to You.
The disclaimer of warranties and limitation of liability provided above shall be interpreted in a manner that, to the extent possible, most closely approximates an absolute disclaimer and waiver of all liability.
Section 6 – Term and Termination.
This Public License applies for the term of the Copyright and Similar Rights licensed here. However, if You fail to comply with this Public License, then Your rights under this Public License terminate automatically.
Where Your right to use the Licensed Material has terminated under Section 6(a), it reinstates:
automatically as of the date the violation is cured, provided it is cured within 30 days of Your discovery of the violation; or
upon express reinstatement by the Licensor.
For the avoidance of doubt, this Section 6(b) does not affect any right the Licensor may have to seek remedies for Your violations of this Public License.
For the avoidance of doubt, the Licensor may also offer the Licensed Material under separate terms or conditions or stop distributing the Licensed Material at any time; however, doing so will not terminate this Public License.
Sections 1, 5, 6, 7, and 8 survive termination of this Public License.
Section 7 – Other Terms and Conditions.
The Licensor shall not be bound by any additional or different terms or conditions communicated by You unless expressly agreed.
Any arrangements, understandings, or agreements regarding the Licensed Material not stated herein are separate from and independent of the terms and conditions of this Public License.
Section 8 – Interpretation.
For the avoidance of doubt, this Public License does not, and shall not be interpreted to, reduce, limit, restrict, or impose conditions on any use of the Licensed Material that could lawfully be made without permission under this Public License.
To the extent possible, if any provision of this Public License is deemed unenforceable, it shall be automatically reformed to the minimum extent necessary to make it enforceable. If the provision cannot be reformed, it shall be severed from this Public License without affecting the enforceability of the remaining terms and conditions.
No term or condition of this Public License will be waived and no failure to comply consented to unless expressly agreed to by the Licensor.
Nothing in this Public License constitutes or may be interpreted as a limitation upon, or waiver of, any privileges and immunities that apply to the Licensor or You, including from the legal processes of any jurisdiction or authority.
+30 -61
View File
@@ -1,79 +1,48 @@
# New Phone README TITLE
# New-Phone-Who-Dis (NPWD)
TODO
## Production Server Installation
<img src="https://i.file.glass/zVkK7.png" width="500" height="300" />
### Configuration
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.
This resource is highly configurable through the [config.json](./config.json). This JSON file holds configuration for the phone itself, for the apps running on it and peripheral information.
Written completely by the Project Error Dev Team in [React](https://reactjs.org/) with a [TypeScript](https://www.typescriptlang.org/) client/server environment.
Below is the list of configuration options:
## Project Error Discord
| Option | Default | Description |
|--------------------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------|
| Locale | en | The language locale used by the app. See [fivem keybinds](https://docs.fivem.net/docs/game-references/controls/) for options |
| KeyTogglePhone | 288 (F1) | The keybind to open and close the app. See [fivem keybinds](https://docs.fivem.net/docs/game-references/controls/) for options |
| PhoneAsItem | false | whether or not the phone is an item in game |
| SwimDestroy | false | whether or not the phone will have a chance to be destroyed while swimming |
| RunRate | 10 | interval in seconds to check phone destruction |
| DestoryChance | 100 | Percent chance that phone destruction will occur |
| DestroyPhoneReCheck | 3 | Time in minutes before another phone destruction attempt will happen |
| notificationPosition.horizontal | right | Horizontal position of phone notifications. `left`, `center` or `right` |
| notificationPosition.vertical | bottom | Vertical positon of phone notifications. `top` or `bottom` |
| twitter.showNotifications | true | Whether or not to show twitter notifications |
| twitter.generateProfileNameFromUsers | true | Whether or not the server should automtically generate a player's profile name from their user in the database |
| twitter.allowEdtiableProfileName | true | Whether or not players can edit their profile name |
| twitter.allowDeleteTweets | true | Whether or not players can delete their own tweets |
| twitter.allowReportTweets | true | Whether or not players can report tweets. Optional discord integration. |
| twitter.characterLimit | 240 | Limit on how many characters tweets can contain |
| twitter.enableAvatars | true | Whether or not player's can select avatars for their twitter profile |
| twitter.enableEmojis | true | Whether or not player's can use emojis in tweets |
| twitter.enableImages | true | Whether or not player's can add images to tweets (external URLs) |
| twitter.maxImages | 3 | The maximum amount of images allowed in a tweet |
- Join the [Discord](https://discord.gg/HYwBjTbAY5) to follow current development of the project.
### Discord
## Documentation & Installation
It is possible to perform discord integration with the phone. To configure discord add the following variables to your `server.cfg` file:
- [Project-Error Docs](https://docs.projecterror.dev/#/) contains all the information regarding this resource. Please consult it for installation, dependencies, and other important information.
```
set discord_bot_token "YOUR_DISCORD_BOT_TOKEN"
set discord_channel_id "YOUR_DISCORD_CHANNEL_ID"
```
## Support
Current discord integrations with the phone:
No support is being provided currently for the resource as it is still in an unfinished state.
- Twitter: reporting tweets
Should you encounter any issues, please do the following:
- Check the [Git Kraken](https://app.gitkraken.com/glo/board/X9YZ_x_SVQEcMwpH) to see if the issue you're referring to is already tracked.
- Check the [State of Development](https://docs.projecterror.dev/#/npwd/state-of-dev?id=introduction) to see if the app is still a **WIP**.
- If the issue isn't on the Git Kraken and the app is finished, please open an issue.
- If the issue isn't on the Git Kraken and the app is **not** finished, please contact us in Discord.
## Development
We do not want issues opened that are due to the phone being **WIP** as this slows down development since we now have to address it more immediately.
This phone is a [React](https://reactjs.org/) project with a TypeScript client/server environment.
## Preview
### Prerequisites
[Latest Teaser Video (October 28th)](https://streamable.com/f1ri9r)
The development environment assumes you have the following prerequisites:
#### Apps (February 20th, 2021)
1. A windows environment and Powershell as your default terminal
1. [Git for windows](https://git-scm.com/download/win) installed
1. [LTS node.js](https://nodejs.org/en/about/releases/) installed
1. [yarn](https://yarnpkg.com/) package manager installed (`npm install -g yarn`)
1. A fivem environment that is set up according to the [setting up a server instructions](https://docs.fivem.net/docs/server-manual/setting-up-a-server/) from the fivem documentation
Most of these apps have UI that does **not** represent the final product and are subject to change.
### Development Environment
#### Steps
1. Clone the repo into your `server-data/resources/[local]` folder
1. Go into the react project: `cd phone`
1. Install node dependencies: `yarn install`
2. Install `lint-staged` globally `npm i -g lint-staged
3. Add the `new-phone-who-dis` app to your `server.cfg`
4. Start your fivem server
#### Development iteration cycle:
- If iterating on client/server Lua make your change and then `ensure new-phone-who-dis` in the fivem server terminal
- If iteration on UI changes run the project with `yarn watch` which will monitor the JavaScript project and rebuild when you make code changes and then `ensure new-phone-who-dis` after making your change
- Avoid commiting `index.html` as the development version overrides the production version
- [**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)
+3
View File
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional'],
};
+41 -31
View File
@@ -1,32 +1,42 @@
{
"Locale": "en",
"KeyTogglePhone": 288,
"KeyTakeCall": 38,
"PhoneAsItem": false,
"SwimDestroy": false,
"RunRate": 10,
"DestoryChance": 100,
"DestroyPhoneReCheck": 3,
"notificationPosition": {
"horizontal": "right",
"vertical": "top"
},
"general": {
"useDashNumber": false
},
"twitter": {
"showNotifications": true,
"generateProfileNameFromUsers": true,
"allowEdtiableProfileName": true,
"allowDeleteTweets": true,
"allowReportTweets": true,
"characterLimit": 240,
"enableAvatars": true,
"enableEmojis": true,
"enableImages": true,
"maxImages": 3
},
"bank": {
"showNotifications": true
}
}
"Locale": "en",
"PhoneAsItem": {
"enabled": false,
"exportResource": "my-core-resource",
"exportName": "myCheckerFunction"
},
"general": {
"useDashNumber": true,
"enableMultiChar": false
},
"database": {
"useIdentifierPrefix": false,
"playerTable": "users",
"identifierColumn": "identifier"
},
"twitter": {
"showNotifications": true,
"generateProfileNameFromUsers": true,
"allowEditableProfileName": true,
"allowDeleteTweets": true,
"allowReportTweets": true,
"characterLimit": 160,
"newLineLimit": 10,
"enableAvatars": true,
"enableEmojis": true,
"enableImages": true,
"maxImages": 3
},
"match": {
"generateProfileNameFromUsers": true,
"allowEditableProfileName": true
},
"bank": {
"showNotifications": true
},
"debug": {
"level": "silly",
"enabled": true,
"sentryEnabled": true
}
}
+9 -22
View File
@@ -1,34 +1,21 @@
fx_version "adamant"
fx_version "cerulean"
game "gta5"
description 'New-PHone-Who-Dis'
author { "chip", "BTNGaming", "ROCKY_southpaw" }
description 'js runtime monkaW'
authors { "itschip", "erik-sn", "TasoOneAsia", "kidz", "RockySouthpaw"}
client_script {
'@es_extended/locale.lua',
'resources/locales/*.lua',
'resources/client/*lua',
'resources/dist/client/*.client.js'
}
shared_script {
'resources/config.lua'
client_scripts {
'resources/dist/client/*.client.js',
'resources/client/*.lua'
}
server_script {
"@mysql-async/lib/MySQL.lua",
'@es_extended/locale.lua',
'resources/locales/*.lua',
'resources/server/*.lua',
'resources/dist/server/*.server.js'
}
ui_page 'resources/html/index.html'
files {
'config.json',
'resources/html/index.html',
'resources/html/*.js',
'resources/html/media/frames/*.png',
'resources/html/media/backgrounds/*.png',
'resources/html/media/backgrounds/*.jpg',
'resources/html/media/twitter/*'
}
'resources/html/**/*',
}
+164
View File
@@ -0,0 +1,164 @@
# 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;
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)
);
CREATE TABLE IF NOT EXISTS `npwd_twitter_tweets` (
`id` int NOT NULL AUTO_INCREMENT,
`message` varchar(1000) NOT NULL,
`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(48) NOT NULL,
`visible` tinyint NOT NULL DEFAULT '1',
`images` varchar(1000) DEFAULT '',
`retweet` int DEFAULT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `npwd_twitter_profiles` (
`id` int NOT NULL AUTO_INCREMENT,
`profile_name` varchar(90) NOT NULL,
`identifier` varchar(48) NOT NULL,
# Default Profile avatar can be set here
`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,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `profile_name_UNIQUE` (`profile_name`)
);
CREATE TABLE IF NOT EXISTS `npwd_twitter_likes` (
`id` int NOT NULL AUTO_INCREMENT,
`profile_id` int NOT NULL,
`tweet_id` int NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_combination` (`profile_id`,`tweet_id`),
KEY `profile_idx` (`profile_id`),
KEY `tweet_idx` (`tweet_id`),
CONSTRAINT `profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`),
CONSTRAINT `tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS `npwd_match_profiles` (
`id` int NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) NOT NULL,
`name` varchar(90) NOT NULL,
`image` varchar(255) NOT NULL,
`bio` varchar(512) DEFAULT NULL,
`location` varchar(45) DEFAULT NULL,
`job` varchar(45) DEFAULT NULL,
`tags` varchar(255) NOT NULL DEFAULT '',
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
UNIQUE KEY `name_UNIQUE` (`name`),
UNIQUE KEY `identifier_UNIQUE` (`identifier`)
);
CREATE TABLE IF NOT EXISTS `npwd_match_views` (
`id` int NOT NULL AUTO_INCREMENT,
`identifier` varchar(48) NOT NULL,
`profile` int NOT NULL,
`liked` tinyint DEFAULT '0',
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `match_profile_idx` (`profile`),
CONSTRAINT `match_profile` FOREIGN KEY (`profile`) REFERENCES `npwd_match_profiles` (`id`)
);
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(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,
PRIMARY KEY (id)
);
CREATE TABLE IF NOT EXISTS `npwd_twitter_reports` (
`id` int NOT NULL AUTO_INCREMENT,
`profile_id` int NOT NULL,
`tweet_id` int NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `unique_combination` (`profile_id`,`tweet_id`),
KEY `profile_idx` (`profile_id`),
KEY `tweet_idx` (`tweet_id`),
CONSTRAINT `report_profile` FOREIGN KEY (`profile_id`) REFERENCES `npwd_twitter_profiles` (`id`),
CONSTRAINT `report_tweet` FOREIGN KEY (`tweet_id`) REFERENCES `npwd_twitter_tweets` (`id`) ON DELETE CASCADE
);
CREATE TABLE IF NOT EXISTS `npwd_messages_groups` (
`id` int NOT NULL AUTO_INCREMENT,
`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(48) NOT NULL,
`label` varchar(60) DEFAULT '',
`unreadCount` int(11) NOT NULL DEFAULT 0,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `npwd_messages` (
`id` int NOT NULL AUTO_INCREMENT,
`message` varchar(512) 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,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`visible` tinyint NOT NULL DEFAULT '1',
PRIMARY KEY (`id`)
);
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(48) DEFAULT NULL,
`image` varchar(255) DEFAULT NULL,
PRIMARY KEY (id)
);
+5
View File
@@ -0,0 +1,5 @@
{
"packages": ["phone", "resources"],
"version": "0.0.0",
"npmClient": "yarn"
}
+29
View File
@@ -0,0 +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 test && lerna run build",
"prepare": "husky install",
"bootstrap": "lerna bootstrap",
"format:staged": "pretty-quick --staged",
"postinstall": "husky install && yarn bootstrap",
"test": "lerna run test"
},
"husky": {
"hooks": {
"pre-commit": "npx run format:staged"
}
}
}
-15
View File
@@ -1,15 +0,0 @@
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import"
]
}
+1
View File
@@ -0,0 +1 @@
REACT_APP_VERSION=$npm_package_version
-23
View File
@@ -1,23 +0,0 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
# dependencies
/node_modules
/.pnp
.pnp.js
# testing
/coverage
# production
/build
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
npm-debug.log*
yarn-debug.log*
yarn-error.log*
-2
View File
@@ -1,2 +0,0 @@
build
node_modules
+2 -1
View File
@@ -1,2 +1,3 @@
# New Phone Who Dis
A FiveM phone created with ReactJS, with the power from BTNGaming, kidz, ROCKY_shouthpaw and chip.
A FiveM phone created with ReactJS, with the power from TasoOneAsia, erik-sn (Kire), jfrader (kidz), r1OG, RockySouthpaw and itschip. Still missing commits from 99kr.
+70
View File
@@ -0,0 +1,70 @@
const path = require('path');
const {
addAfterLoader,
removeLoaders,
loaderByName,
getLoaders,
throwUnexpectedConfigError,
} = require('@craco/craco');
const throwError = (message) =>
throwUnexpectedConfigError({
packageName: 'craco',
githubRepo: 'gsoft-inc/craco',
message,
githubIssueQuery: 'webpack',
});
module.exports = {
webpack: {
configure: (webpackConfig, { paths }) => {
const { hasFoundAny, matches } = getLoaders(webpackConfig, loaderByName('babel-loader'));
if (!hasFoundAny) throwError('failed to find babel-loader');
const { hasRemovedAny, removedCount } = removeLoaders(
webpackConfig,
loaderByName('babel-loader'),
);
if (!hasRemovedAny) throwError('no babel-loader to remove');
if (removedCount !== 2) throwError('had expected to remove 2 babel loader instances');
webpackConfig.resolve.plugins = webpackConfig.resolve.plugins.filter(
({ constructor: c }) => !c || c.name !== 'ModuleScopePlugin',
);
const tsLoader = {
test: /\.tsx?$/,
loader: require.resolve('ts-loader'),
options: { transpileOnly: true },
};
const { isAdded: tsLoaderIsAdded } = addAfterLoader(
webpackConfig,
loaderByName('url-loader'),
tsLoader,
);
if (!tsLoaderIsAdded) throwError('failed to add ts-loader');
const { isAdded: babelLoaderIsAdded } = addAfterLoader(
webpackConfig,
loaderByName('ts-loader'),
matches[1].loader, // babel-loader
);
if (!babelLoaderIsAdded) throwError('failed to add back babel-loader for non-application JS');
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;
},
};
+77
View File
@@ -0,0 +1,77 @@
const args = process.argv.slice(2);
console.log(args);
const path = './src/locale/';
const langs = ['bs', 'no', 'es', 'fr', 'pt', 'ptbr', 'sv', 'tr', "hu"];
const defaultLang = 'en';
const langFiles = [];
let defaultLangFile;
const missingKeys = {};
const promises = langs
.filter((l) => (args[0] ? args[0] === l : true))
.map((l) => {
return new Promise((res, rej) => {
import(path + l + '.json')
.then((module) => {
langFiles.push(module.default.translation);
res();
})
.catch((e) => {
console.error(e);
rej(e);
});
});
});
const Load = () => Promise.all(promises);
const LoadDefault = () =>
new Promise((res, rej) => {
import(path + defaultLang + '.json')
.then((module) => {
defaultLangFile = module.default.translation;
res();
})
.catch((e) => {
console.error(e);
rej(e);
});
});
(async () => {
const filteredLangs = langs.filter((l) => (args[0] ? args[0] === l : true));
await LoadDefault();
await Load();
let idx = 0;
for (const file of langFiles) {
const currLang = filteredLangs[idx];
if (currLang === defaultLang) {
return;
}
idx++;
if (args[0] && args[0] !== currLang) {
return;
}
missingKeys[currLang] = [];
for (const dKey in defaultLangFile) {
let exists = false;
for (const key in file) {
if (key === dKey) {
exists = true;
}
}
if (!exists) {
missingKeys[currLang].push([dKey, defaultLangFile[dKey]]);
}
}
}
console.log(missingKeys);
})();
+39 -59
View File
@@ -1,78 +1,58 @@
{
"name": "new-phone",
"name": "npwd-nui",
"version": "0.1.0",
"repository": "https://github.com/project-error/new-phone-who-dis",
"private": true,
"license": "CC-BY-NC-SA-4.0",
"homepage": "/resources/html",
"dependencies": {
"@babel/polyfill": "^7.4.4",
"@fortawesome/fontawesome-free": "^5.15.1",
"@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",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/jest": "^26.0.14",
"core-js": "^3.6.5",
"emoji-mart": "^3.0.0",
"dayjs": "^1.10.4",
"dompurify": "^2.2.6",
"emoji-mart": "^3.0.1",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"i18next": "^19.7.0",
"prettier": "^2.0.5",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-hotkeys": "^2.0.0",
"fivem-nui-react-lib": "^2.2.8",
"howler": "^2.2.1",
"i18next": "^20.3.4",
"jsonschema": "^1.4.0",
"parse-url": "^5.0.7",
"qs": "^6.9.6",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-i18next": "^11.7.1",
"react-popper": "^2.2.3",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"recoil": "^0.0.10",
"styled-components": "^5.1.1"
"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",
"@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/node": "^14.11.5",
"@types/qs": "^6.9.5",
"@types/react": "^16.9.51",
"@types/react-dom": "^16.9.8",
"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",
"cra-build-watch": "^3.2.0",
"cross-env": "^7.0.2",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^4.3.0",
"ifdef-loader": "^2.1.5",
"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"
"@types/react-router-dom": "^5.1.7",
"@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": {
"start": "react-scripts start",
"watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js",
"format": "prettier --write src/**/*.{js,jsx,ts,tsx,json,css,scss,md}",
"build": "react-scripts build",
"build:resources": "cross-env NODE_ENV=production webpack --config webpack/webpack.resources.js --color -p --progress --hide-modules --display-optimization-bailout",
"test": "react-scripts 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"
"i18n:missing": "node --experimental-json-modules i18n.missingKeys.js",
"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"
-10
View File
@@ -1,10 +0,0 @@
// Taso: Including some default values for clarity sake
module.exports = {
trailingComma: "es5",
tabWidth: 2,
semi: true,
singleQuote: true,
jsxSingleQuote: true,
jsxBracketSameLine: false,
bracketSpacing: true
}
+96
View File
@@ -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' },
);
+7 -2
View File
@@ -2,10 +2,15 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap"
/>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>ReIgnited React Phone</title>
<!-- Enable experimental proxy custom iframe webcomp -->
<!-- <script type="module" src="./iframe.webcomp.js"></script>-->
<title>Project Error - New Phone Who Dis</title>
</head>
<body>
<div id="root"></div>
Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 381 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 73 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.
Binary file not shown.
Binary file not shown.
+5 -6
View File
@@ -1,12 +1,12 @@
.PhoneWrapper {
width: 100vw;
height: 100vh;
position: relative;
}
.Phone {
position: absolute;
bottom: 0vh;
right: 0vh;
right: 0;
width: 500px;
height: 1000px;
background-size: cover;
@@ -24,8 +24,6 @@
overflow: hidden;
position: absolute;
background-color: black;
border-left: 4px solid black;
border-right: 4px solid black;
bottom: 100px;
left: 50px;
right: 50px;
@@ -35,6 +33,7 @@
background-position: center;
background-size: cover;
background-repeat: no-repeat;
border-radius: 20px;
}
.PhoneAppContainer {
@@ -49,12 +48,12 @@
}
*::-webkit-scrollbar-track {
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
background-color: #f5f5f5;
background-color: #666;
}
*::-webkit-scrollbar {
width: 3px;
background-color: transparent;
}
*::-webkit-scrollbar-thumb {
background-color: #666;
background-color: #f5f5f5;
}
+7 -7
View File
@@ -1,12 +1,12 @@
import React from "react";
import { RecoilRoot } from "recoil";
import { shallow } from "enzyme";
import Phone from "./Phone";
import React from 'react';
import { RecoilRoot } from 'recoil';
import { shallow } from 'enzyme';
import { PhoneProviders } from './PhoneProviders';
it("renders Phone", () => {
it('renders Phone', () => {
shallow(
<RecoilRoot>
<Phone />
</RecoilRoot>
<PhoneProviders />
</RecoilRoot>,
);
});
+96 -294
View File
@@ -1,322 +1,124 @@
import React from 'react';
import React, { useEffect } from 'react';
import './Phone.css';
import './i18n';
import { Route } from 'react-router-dom';
import { useSettings } from './apps/settings/hooks/useSettings';
import MessageIcon from '@material-ui/icons/Email';
import { CallModal } from './modal/components/CallModal';
import { CallModal } from './os/call/components/CallModal';
import { HomeApp } from './apps/home/components/Home';
import { ThemeProvider } from '@material-ui/core';
import { useInitKeyboard } from './os/keyboard/hooks/useKeyboard';
import { NotificationIcon } from './os/notifications/components/NotificationIcon';
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 { useSelloutService } from './apps/sellout/hooks/useSelloutService';
import { useMarketplaceService } from './apps/marketplace/hooks/useMarketplaceService';
import { useBankService } from './apps/bank/hooks/useBankService';
import { useMessagesService } from './apps/messages/hooks/useMessageService';
import { useNotesService } from './apps/notes/hooks/useNotesService';
import { usePhotoService } from './apps/camera/hooks/usePhotoService';
import Nui from './os/nui-events/utils/Nui';
import { usePhone } from './os/phone/hooks/usePhone';
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 { 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 { useTranslation } from 'react-i18next';
import { useSnackbar } from './ui/hooks/useSnackbar';
import { PhoneEvents } from '../../typings/phone';
import { useKeyboardService } from './os/keyboard/hooks/useKeyboardService';
import PhoneWrapper from './PhoneWrapper';
// Inject mock data when in development env.
if (process.env.NODE_ENV === 'development') {
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'CAMERA',
method: 'setPhotos',
data: [
{
id: 1,
image: 'https://i.imgur.com/OO8wx6Z.jpg',
},
{
id: 1,
image: 'https://i.imgur.com/pqGBiST.jpg',
},
],
},
})
);
}, 1000);
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'BANK',
method: 'setCredentials',
data: {
name: 'Firstname Lastname',
balance: 2000,
},
},
})
);
}, 1000);
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'CONTACTS',
method: 'setContacts',
data: [
{
id: 1,
display: 'Ruqen',
number: '43534444',
},
{
id: 1,
display: 'Taso',
number: '43534444',
},
],
},
})
);
}, 1000);
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'SIMCARD',
method: 'setNumber',
data: '111-1134',
},
})
);
}, 1000);
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'PHONE',
method: 'setVisibility',
data: true,
},
})
);
}, 1000);
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'NOTES',
method: 'setNotes',
data: [
{
id: 1,
title: 'First note',
content: 'Hello, this is my shitty note',
},
{
id: 2,
title: 'Second note',
content: 'Hello, this is another shitty note',
},
],
},
})
);
}, 1000);
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'BANK',
method: 'setNotification',
data: {
id: 1,
message: 'ahhaha',
},
},
})
);
}, 1000);
setTimeout(() => {
new MessageEvent('messsage', {
data: {
app: 'TWITTER',
method: 'setNotification',
data: {
id: 1,
message: 'ahhaha',
},
},
});
}, 1000);
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'BANK',
method: 'setTransaction',
data: [
{
id: 1,
amount: 200,
type: 'Deposit',
source: 'chip',
},
{
id: 2,
amount: 200,
type: 'Withdraw',
source: 'chip',
},
{
id: 3,
amount: 200,
type: 'Withdraw',
source: 'chip',
},
{
id: 4,
amount: 50,
type: 'Deposit',
source: 'chip',
},
{
id: 4,
amount: 50,
type: 'Deposit',
source: 'chip',
},
{
id: 4,
amount: 50,
type: 'Deposit',
source: 'chip',
},
],
},
})
);
}, 1000);
setTimeout(() => {
window.dispatchEvent(
new MessageEvent('message', {
data: {
app: 'SELLOUT',
method: 'setListings',
data: [
{
id: 1,
name: 'Some guy',
number: '123-4567',
title: 'Car',
description: 'Selling this cool car',
url: 'https://i.imgur.com/ROmGTwi.jpeg',
},
{
id: 2,
name: 'Some other dude',
number: '666-6666',
title: 'Material',
description: 'Selling my wife',
url: '',
},
],
},
})
);
}, 1000);
}
import dayjs from 'dayjs';
import DefaultConfig from '../../config.json';
import { TopLevelErrorComponent } from './ui/components/TopLevelErrorComponent';
import { useConfig } from './os/phone/hooks/useConfig';
function Phone() {
useNuiService();
const { t, i18n } = useTranslation();
const { apps } = useApps();
const [settings] = useSettings();
const { addAlert } = useSnackbar();
// Set language from local storage
// This will only trigger on first mount & settings changes
useEffect(() => {
i18n.changeLanguage(settings.language.value).catch((e) => console.error(e));
}, [i18n, settings.language]);
useEffect(() => {
if (!isSettingsSchemaValid()) {
addAlert({
message: t('SETTINGS.MESSAGES.INVALID_SETTINGS'),
type: 'error',
});
}
// We only want to run this on first mount of the phone,
// so we leave an empty dep array. Otherwise, we hit a max depth error.
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
useConfig();
useKeyboardService();
usePhoneService();
const { visibility } = usePhone();
const { settings, currentTheme } = useSettings();
const { allApps } = useApps();
useSimcardService();
useContactsService();
useTwitterService();
useInitKeyboard();
useSelloutService();
useMarketplaceService();
useBankService();
useMessagesService();
useNotesService();
usePhotoService();
/*usePhotoService();*/
useCallService();
useDialService();
if (visibility === false) {
return null;
}
const calling = false;
document.onkeyup = function (data) {
if (data.which == 27) {
Nui.send('phone:close');
}
};
const { modal: callModal } = useCallModal();
return (
<ThemeProvider theme={currentTheme()}>
<div className='PhoneWrapper'>
<div style={{ zoom: settings.zoom }}>
<div className='Phone'>
<div
className='PhoneFrame'
style={{
backgroundImage: `url(./media/frames/${settings.frame})`,
}}
></div>
<div
id='phone'
className='PhoneScreen'
style={{
backgroundImage: `url(./media/backgrounds/${settings.wallpaper})`,
}}
>
<>
<NotificationBar
notifications={[
{
key: 'newMessage',
icon: <NotificationIcon Icon={MessageIcon} />,
},
]}
/>
<div className='PhoneAppContainer'>
{calling ? (
<CallModal />
) : (
<>
<Route exact path='/' component={HomeApp} />
{allApps.map((App) => (
<App.Route key={App.id} />
))}
</>
)}
</div>
<Navigation />
</>
</div>
<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>
</div>
</ThemeProvider>
<Navigation />
</PhoneWrapper>
</TopLevelErrorComponent>
</div>
);
}
export default Phone;
InjectDebugData<any>([
{
app: 'PHONE',
method: PhoneEvents.SET_VISIBILITY,
data: true,
},
{
app: 'PHONE',
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,
},
]);
+25
View File
@@ -0,0 +1,25 @@
import React from 'react';
import { ThemeProvider } from '@material-ui/core';
import { NotificationsProvider } from './os/notifications/providers/NotificationsProvider';
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 PhoneProviders = () => {
const currentTheme = usePhoneTheme();
return (
<NuiProvider resource="npwd">
<ThemeProvider theme={currentTheme}>
<SoundProvider>
<NotificationsProvider>
<SnackbarProvider>
<Phone />
</SnackbarProvider>
</NotificationsProvider>
</SoundProvider>
</ThemeProvider>
</NuiProvider>
);
};
+46
View File
@@ -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;
+7 -8
View File
@@ -1,4 +1,4 @@
@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap");
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&display=swap');
/* #### Generated By: http://www.cufonfonts.com #### */
@@ -7,10 +7,11 @@
font-style: normal;
font-weight: normal;
src: local('Bahnschrift Regular'), url('../fonts/BAHNSCHRIFT.woff') format('woff');
}
}
#account-section, #transaction-section {
font-family: 'Bahnschrift Regular'
#account-section,
#transaction-section {
font-family: 'Bahnschrift Regular';
}
#transaction-section .MuiTablePagination-root {
@@ -26,12 +27,10 @@
font-size: 50px;
}
#bank-app .Mui-selected {
color: #388CF8 !important;
color: #388cf8 !important;
}
#bank-app .MuiSnackbar-root {
position: absolute;
}
@@ -47,4 +46,4 @@
#actionButton a {
color: #fff;
}
}
+60 -20
View File
@@ -1,27 +1,73 @@
import React from 'react';
import { makeStyles, Paper, Typography } from '@material-ui/core';
import { makeStyles } from '@material-ui/core';
import { BankTitle } from './BankTitle';
import { AppWrapper } from '../../../ui/components';
import { AppContent } from '../../../ui/components/AppContent';
import { Button } from '../../../ui/components/Button';
import { useTranslation } from 'react-i18next';
import { useTransactions } from '../hooks/useTransactions';
import './BankApp.css';
import { TransferModal } from './transfers/TransferModal';
import { useBankModal } from '../hooks/useBankModal';
import { useCredentials } from '../hooks/useCredentials';
import { Switch, Route } from 'react-router-dom';
// image
import CreditCard from '../img/credit-card.png';
import { NavigationBar } from './navigation/NavigationBar';
import { BankHome } from './home/BankHome';
import { BankAccount } from './account/BankAccount';
import { TransactionList } from './transactions/TransactionList';
import { BankAlert } from './alert/BankAlert';
import InjectDebugData from '../../../os/debug/InjectDebugData';
InjectDebugData([
{
app: 'BANK',
method: 'setCredentials',
data: {
name: 'Firstname Lastname',
balance: 2000,
},
},
{
app: 'BANK',
method: 'setTransaction',
data: [
{
id: 1,
amount: 200,
type: 'Deposit',
source: 'chip',
},
{
id: 2,
amount: 200,
type: 'Withdraw',
source: 'chip',
},
{
id: 3,
amount: 200,
type: 'Withdraw',
source: 'chip',
},
{
id: 4,
amount: 50,
type: 'Deposit',
source: 'chip',
},
{
id: 4,
amount: 50,
type: 'Deposit',
source: 'chip',
},
{
id: 4,
amount: 50,
type: 'Deposit',
source: 'chip',
},
],
},
]);
const useStyles = makeStyles((theme) => ({
root: {
@@ -49,26 +95,20 @@ const useStyles = makeStyles((theme) => ({
}));
export const BankApp = () => {
const { showBankModal, setShowBankModal } = useBankModal();
const { t } = useTranslation();
const { showBankModal } = useBankModal();
const classes = useStyles();
const openTransactionsModal = () => {
setShowBankModal(true);
};
return (
<AppWrapper id='bank-app'>
<AppWrapper id="bank-app">
<BankTitle />
<TransferModal />
<div className={showBankModal ? classes.backgroundModal : undefined} />
<AppContent>
<Switch>
<Route path='/bank' exact component={BankHome} />
<Route path='/bank/account' exact component={BankAccount} />
<Route path='/bank/transactions' exact component={TransactionList} />
<Route path="/bank" exact component={BankHome} />
<Route path="/bank/account" exact component={BankAccount} />
<Route path="/bank/transactions" exact component={TransactionList} />
</Switch>
<BankAlert />
</AppContent>
<NavigationBar />
</AppWrapper>
+2 -3
View File
@@ -1,7 +1,6 @@
import React from 'react';
import Paper from '@material-ui/core/Paper';
import { Typography, makeStyles } from '@material-ui/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import './BankApp.css';
@@ -24,8 +23,8 @@ const useStyles = makeStyles((theme) => ({
export const BankTitle = () => {
const classes = useStyles();
return (
<Paper className={classes.root} square variant='outlined' elevation={24}>
<Typography id='bank-title' style={{ margin: 0 }} variant='h4'>
<Paper className={classes.root} square variant="outlined" elevation={24}>
<Typography id="bank-title" style={{ margin: 0 }} variant="h4">
WhoDis Banking
</Typography>
</Paper>
@@ -1,6 +1,6 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import { makeStyles, Paper, Typography, Button } from '@material-ui/core';
import { Button } from '@material-ui/core';
import { useTransactions } from '../../hooks/useTransactions';
import useStyles from './account.styles';
@@ -13,15 +13,13 @@ export const AccountTransactions = (): any => {
Transfer: classes.depositType,
};
const { transactionList } = useTransactions();
const transactionList = useTransactions();
const { t } = useTranslation();
return (
<div id='account-section'>
<div id="account-section">
<div className={classes.header}>
<h2 className={classes.title}>{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}</h2>
<Button className={classes.seeAll}>
{t('APPS_BANK_ACCOUNT_SEE_TRANSACTION')}
</Button>
<Button className={classes.seeAll}>{t('APPS_BANK_ACCOUNT_SEE_TRANSACTION')}</Button>
</div>
<div className={classes.transcationDiv}>
@@ -33,7 +31,7 @@ export const AccountTransactions = (): any => {
</div>
<div>
<p className={TransactionTypes[transaction.type]}>
{transaction.type == 'Withdraw' ? '-' : '+'}
{transaction.type === 'Withdraw' ? '-' : '+'}
{transaction.amount}
</p>
</div>
@@ -1,6 +1,5 @@
import React from 'react';
import { Button } from '../../../../ui/components/Button';
import { makeStyles, Paper, Typography } from '@material-ui/core';
import { makeStyles } from '@material-ui/core';
import { useTranslation } from 'react-i18next';
import { BankCard } from './BankCard';
import { AccountTransactions } from './AccountTransactions';
@@ -19,18 +18,14 @@ const useStyles = makeStyles((theme) => ({
export const BankAccount = () => {
const classes = useStyles();
const { credentials } = useCredentials();
const credentials = useCredentials();
const { t } = useTranslation();
return (
<div className={classes.root}>
<div>
<h1 className={classes.title}>{t('APPS_BANK_ACCOUNT_TITLE')}</h1>
</div>
<BankCard
name={credentials.name}
account='Checking'
balance={credentials.balance}
/>
<BankCard name={credentials.name} account="Checking" balance={credentials.balance} />
<AccountTransactions />
</div>
);
@@ -1,8 +0,0 @@
import React from "react";
import MuiAlert from "@material-ui/lab/Alert";
export function Alert(props) {
return <MuiAlert elevation={6} variant="filled" {...props} />;
}
export default Alert;
@@ -1,43 +0,0 @@
import React, { useState, useEffect } from 'react';
import { useBankAlert } from '../../hooks/useBankAlert';
import Snackbar from '@material-ui/core/Snackbar';
import Alert from './Alert';
import { useTranslation } from 'react-i18next';
export const BankAlert = () => {
const { t } = useTranslation();
const [open, setOpen] = useState(false);
const { bankAlert, setBankAlert } = useBankAlert();
const [message, setMessage] = useState(null);
const [severity, setSeverity] = useState('');
const _handleClose = () => {
setOpen(false);
setBankAlert(null);
};
useEffect(() => {
if (bankAlert === true) {
setOpen(true);
setMessage(t('APPS_BANK_ALERT_TRANSFER_SUCCESS'));
setSeverity('success');
} else if (bankAlert === false) {
setOpen(true);
setMessage(t('APPS_BANK_ALERT_TRANSFER_FAILURE'));
setSeverity('error');
}
}, [bankAlert]);
return (
<Snackbar
style={{ width: '80%' }}
open={open}
autoHideDuration={6000}
onClose={_handleClose}
>
<Alert onClose={_handleClose} severity={severity}>
{message}
</Alert>
</Snackbar>
);
};
@@ -12,7 +12,7 @@ import useStyles from './home.styles';
export const BankHome = () => {
const classes = useStyles();
const { setShowBankModal } = useBankModal();
const { credentials } = useCredentials();
const credentials = useCredentials();
const { t } = useTranslation();
const openTransactionsModal = () => {
@@ -24,21 +24,17 @@ export const BankHome = () => {
return (
<div className={classes.root}>
<Typography className={classes.headTitle}>
<span style={{ fontWeight: 'bold' }}>{t('APPS_BANK_HOME_TITLE')}</span>,{' '}
{credentials.name}
<span style={{ fontWeight: 'bold' }}>{t('APPS_BANK_HOME_TITLE')}</span>, {credentials.name}
</Typography>
<div className={classes.accounts}>
<h2 className={classes.accountsType}>Checking:</h2>
<p className={classes.accountBalance}>{credentials.balance}</p>
</div>
<div className={classes.actions}>
<Button id='actionButton' className={classes.actionButton}>
<NavLink to='/bank/account'>{t('APPS_BANK_ACCOUNT_LINK')}</NavLink>
<Button id="actionButton" className={classes.actionButton}>
<NavLink to="/bank/account">{t('APPS_BANK_ACCOUNT_LINK')}</NavLink>
</Button>
<Button
onClick={openTransactionsModal}
className={classes.actionButton}
>
<Button onClick={openTransactionsModal} className={classes.actionButton}>
{t('APPS_BANK_ACTIONS_TRANSFER')}
</Button>
</div>
@@ -3,12 +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: {
@@ -34,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>
);
};
@@ -1,48 +0,0 @@
import React, { useEffect, useState } from 'react';
import Notification from '../../../../ui/components/Notification';
import { usePhone } from '../../../../os/phone/hooks/usePhone';
import { useTranslation } from 'react-i18next';
import useStyles from './notification.style';
import { useBankNotification } from '../../hooks/useBankNotification';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faWonSign } from '@fortawesome/free-solid-svg-icons';
export const BankNotification = () => {
const { notification } = useBankNotification();
const classes = useStyles();
const { t } = useTranslation();
const [visible, setVisible] = useState(false);
const { config } = usePhone();
useEffect(() => {
if (notification) {
setVisible(true);
}
}, [notification?.id]);
if (!config?.bank.showNotifications || !notification) return null;
return (
<Notification
key={notification.id}
open={visible}
handleClose={() => setVisible(false)}
>
<div className={classes.content}>
<div className={classes.title}>
<div className={classes.titleLeft}>
<div className={classes.icon}>
<FontAwesomeIcon icon={faWonSign} />
</div>
<div className={classes.heading}>{notification.type}</div>
</div>
<div className={classes.justNow}>{t('APPS_BANK_TIME_JUST_NOW')}</div>
</div>
<div className={classes.message}>
{notification.source} sent you ${notification.transferAmount}.{' '}
<br></br> {notification.message}
</div>
</div>
</Notification>
);
};
@@ -1,43 +0,0 @@
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) =>
createStyles({
content: {
padding: theme.spacing(2),
overflowY: 'hidden',
},
title: {
display: 'flex',
flexFlow: 'row nowrap',
justifyContent: 'space-between',
alignItems: 'center',
},
titleLeft: {
display: 'flex',
flexFlow: 'row nowrap',
justifyContent: 'flex-start',
alignItems: 'center',
},
icon: {
marginTop: '3px',
marginRight: '5px',
},
heading: {
marginBottom: '3px',
},
justNow: {
fontSize: '18px',
fontStyle: 'italic',
paddingRight: '3px',
},
message: {
fontSize: '16px',
overflow: 'hidden',
display: '-webkit-box',
WebkitLineClamp: 2,
WebkitBoxOrient: 'vertical',
},
})
);
export default useStyles;
@@ -5,7 +5,7 @@ import TablePagination from '@material-ui/core/TablePagination';
import { useTransactions } from '../../hooks/useTransactions';
export const TransactionList = () => {
const { transactionList } = useTransactions();
const transactionList = useTransactions();
const { t } = useTranslation();
const classes = useStyles();
const [page, setPage] = useState(0);
@@ -27,7 +27,7 @@ export const TransactionList = () => {
};
return (
<div id='transaction-section'>
<div id="transaction-section">
<div className={classes.header}>
<h2 className={classes.title}>{t('APPS_BANK_ACCOUNT_TRANSACTIONS')}</h2>
</div>
@@ -43,22 +43,12 @@ export const TransactionList = () => {
</div>
<div>
<p className={TransactionTypes[transaction.type]}>
{transaction.type == 'Withdraw' ? '-' : '+'}
{transaction.type === 'Withdraw' ? '-' : '+'}
{transaction.amount}
</p>
</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,17 +1,10 @@
import React, { useState } from 'react';
import Modal from '../../../../ui/components/Modal';
import {
Button,
List,
ListItem,
TextField,
makeStyles,
} from '@material-ui/core';
import CloseIcon from '@material-ui/icons/Close';
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: {
@@ -33,14 +26,10 @@ const useStyles = makeStyles((theme) => ({
fontSize: 16,
marginBottom: 30,
},
closeButton: {
position: 'absolute',
right: 0,
width: '10%',
},
}));
export const TransferModal = () => {
const Nui = useNuiRequest();
const classes = useStyles();
const [targetID, setTargetID] = useState('');
@@ -55,7 +44,7 @@ export const TransferModal = () => {
const addTransfer = () => {
const transferAmount = parseInt(amount);
Nui.send('phone:addTransfer', {
Nui.send(BankEvents.ADD_TRANSFER, {
targetID,
transferAmount,
message,
@@ -65,16 +54,13 @@ export const TransferModal = () => {
return (
<Modal visible={showBankModal} handleClose={_handleClose}>
<Button className={classes.closeButton} onClick={_handleClose}>
<CloseIcon />
</Button>
<List style={{ marginTop: 20 }}>
<ListItem>
<TextField
inputProps={{ className: classes.modalInputCenter }}
fullWidth
type='number'
placeholder='ID'
type="number"
placeholder="ID"
value={targetID}
onChange={(e) => setTargetID(e.target.value)}
/>
@@ -82,9 +68,9 @@ export const TransferModal = () => {
<ListItem>
<TextField
inputProps={{ className: classes.modalInputCenter }}
placeholder='Amount'
placeholder="Amount"
fullWidth
type='number'
type="number"
value={amount}
onChange={(e) => setAmount(e.target.value)}
/>
@@ -92,7 +78,7 @@ export const TransferModal = () => {
<ListItem>
<TextField
inputProps={{ className: classes.modalInput }}
placeholder='Message'
placeholder="Message"
fullWidth
value={message}
multiline
+5 -9
View File
@@ -3,22 +3,18 @@ import { atom } from 'recoil';
export const bankState = {
transactions: atom({
key: 'transactionList',
default: []
default: [],
}),
bankModal: atom({
key: 'modalVisibility',
default: false,
}),
transferSuccessful: atom({
key: 'bankAlert',
default: null
}),
bankCredentials: atom({
key: 'bankCredentails',
default: null
default: null,
}),
notification: atom({
key: 'bankNotification',
default: null
})
}
default: null,
}),
};
@@ -1,7 +0,0 @@
import { useRecoilState } from 'recoil';
import { bankState } from './state';
export const useBankAlert = (): any => {
const [ bankAlert, setBankAlert ] = useRecoilState(bankState.transferSuccessful);
return { bankAlert, setBankAlert };
}
+8 -3
View File
@@ -1,7 +1,12 @@
import { useRecoilState } from 'recoil';
import { bankState } from './state';
export const useBankModal = () => {
const [ showBankModal, setShowBankModal ] = useRecoilState(bankState.bankModal);
return { showBankModal, setShowBankModal };
interface BankModalProps {
showBankModal: boolean;
setShowBankModal: (show: boolean) => void;
}
export const useBankModal = (): BankModalProps => {
const [showBankModal, setShowBankModal] = useRecoilState(bankState.bankModal);
return { showBankModal, setShowBankModal };
};
@@ -1,13 +1,8 @@
import { useRecoilValue } from 'recoil';
import { Transfer } from '../../../common/typings/bank';
import { Transfer } from '../../../../../typings/bank';
import { bankState } from './state';
interface IBankNotification {
notification: Transfer | null;
}
export const useBankNotification = (): IBankNotification => {
const notification = useRecoilValue<Transfer | null>(bankState.notification);
return { notification };
export const useBankNotification = () => {
return useRecoilValue<Transfer | null>(bankState.notification);
};
+23 -15
View File
@@ -1,22 +1,30 @@
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { useNuiEvent } from 'fivem-nui-react-lib';
import { bankState } from './state';
import { useTransactions } from './useTransactions'
import { useTransactions } from './useTransactions';
import { useCredentials } from './useCredentials';
import { useBankAlert } from './useBankAlert';
import { useSetRecoilState } from 'recoil'
import { useSetRecoilState } from 'recoil';
import { useBankNotification } from './useBankNotification';
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
import { BankEvents } from '../../../../../typings/bank';
export const useBankService = () => {
const setTransaction = useSetRecoilState(bankState.transactions)
const setCredentials = useSetRecoilState(bankState.bankCredentials)
const setAlertMessage = useSetRecoilState(bankState.transferSuccessful)
const setTransaction = useSetRecoilState(bankState.transactions);
const setCredentials = useSetRecoilState(bankState.bankCredentials);
const setNotification = useSetRecoilState(bankState.notification);
const { addAlert } = useSnackbar();
const { t } = useTranslation();
///
useNuiEvent('BANK', 'setTransaction', setTransaction);
useNuiEvent('BANK', 'setCredentials', setCredentials);
useNuiEvent('BANK', 'setAlert', setAlertMessage);
useNuiEvent('BANK', 'setNotification', setNotification);
return { useTransactions, useCredentials, useBankAlert, useBankNotification };
}
const handleAddAlert = ({ message, type }: IAlert) => {
addAlert({
message: t(`APPS_${message}`),
type,
});
};
useNuiEvent('BANK', BankEvents.SEND_TRANSFERS, setTransaction);
useNuiEvent('BANK', BankEvents.SEND_CREDENTIALS, setCredentials);
useNuiEvent('BANK', BankEvents.SEND_ALERT, handleAddAlert);
useNuiEvent('BANK', BankEvents.SEND_NOTIFICATION, setNotification);
return { useTransactions, useCredentials, useBankNotification };
};
+3 -8
View File
@@ -1,12 +1,7 @@
import { useRecoilValue } from 'recoil';
import { bankState } from './state';
import { IBankCredentials } from '../../../common/typings/bank';
import { IBankCredentials } from '../../../../../typings/bank';
interface ICredentialsHook {
credentials: IBankCredentials;
}
export const useCredentials = (): ICredentialsHook => {
const credentials = useRecoilValue(bankState.bankCredentials);
return { credentials };
export const useCredentials = () => {
return useRecoilValue<IBankCredentials>(bankState.bankCredentials);
};
+4 -4
View File
@@ -1,7 +1,7 @@
import { useRecoilValue } from "recoil";
import { bankState } from './state';
import { useRecoilValue } from 'recoil';
import { ITransactions } from '../../../../../typings/bank';
import { bankState } from './state';
export const useTransactions = () => {
const transactionList = useRecoilValue(bankState.transactions);
return { transactionList };
return useRecoilValue<ITransactions[]>(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>
);
};
@@ -1,6 +1,10 @@
import React from 'react';
import React, { useMemo } from 'react';
import { useCalculator, CalcButton } from '../hooks/useCalculator';
import { Grid, makeStyles, Box, Paper } from '@material-ui/core';
import { Grid, makeStyles, Box, Paper, Fab } from '@material-ui/core';
import { setClipboard } from '../../../os/phone/hooks/useClipboard';
import FileCopyIcon from '@material-ui/icons/FileCopy';
import { useSnackbar } from '../../../ui/hooks/useSnackbar';
import { useTranslation } from 'react-i18next';
const useStyles = makeStyles((theme) => ({
button: {
@@ -12,6 +16,12 @@ const useStyles = makeStyles((theme) => ({
textAlign: 'right',
overflow: 'hidden',
textOverflow: 'ellipsis',
position: 'relative',
},
copyFab: {
position: 'absolute',
top: '16px',
left: '16px',
},
}));
@@ -37,17 +47,43 @@ export const Calculator = ({ ...props }) => {
eight,
nine,
} = useCalculator();
const { addAlert } = useSnackbar();
const classes = useStyles();
const resultStr = useMemo(
() =>
result().toLocaleString(undefined, {
minimumFractionDigits: 0,
maximumFractionDigits: 4,
}),
[result],
);
const { t } = useTranslation();
return (
<Box display='flex' flexDirection='column'>
<Box display="flex" flexDirection="column">
<Box flexGrow={1} component={Paper} p={4} className={classes.result}>
{result().toLocaleString(undefined, {
minimumFractionDigits: 0,
maximumFractionDigits: 4,
})}
<Fab
size="small"
onClick={() => {
setClipboard(resultStr);
addAlert({
message: t('GENERIC_WRITE_TO_CLIPBOARD_MESSAGE', {
content: 'number',
}),
type: 'success',
});
}}
className={classes.copyFab}
>
<FileCopyIcon />
</Fab>
{resultStr}
</Box>
<Box>
<Grid container justify='space-around'>
<Grid container justify="space-around">
<CalcButton button={clear} className={classes.button} />
<CalcButton button={clearAll} className={classes.button} />
<CalcButton button={divider} className={classes.button} />
@@ -1,12 +1,12 @@
import React from "react";
import { AppWrapper } from "../../../ui/components";
import { AppTitle } from "../../../ui/components/AppTitle";
import { AppContent } from "../../../ui/components/AppContent";
import { Calculator } from "./Calculator";
import { useApp } from "../../../os/apps/hooks/useApps";
import React from 'react';
import { AppWrapper } from '../../../ui/components';
import { AppTitle } from '../../../ui/components/AppTitle';
import { AppContent } from '../../../ui/components/AppContent';
import { Calculator } from './Calculator';
import { useApp } from '../../../os/apps/hooks/useApps';
export const CalculatorApp = () => {
const calculator = useApp("CALCULATOR");
const calculator = useApp('CALCULATOR');
return (
<AppWrapper>
<AppTitle app={calculator} />
@@ -1,7 +1,7 @@
import React from "react";
import { SvgIcon } from "@material-ui/core";
import React from 'react';
import { SvgIcon, SvgIconProps } from '@material-ui/core';
export const CalculatorIcon = ({ ...props }) => {
export const CalculatorIcon = ({ ...props }: SvgIconProps) => {
return (
<SvgIcon {...props}>
<svg
+17 -25
View File
@@ -1,30 +1,22 @@
import { Fab } from '@material-ui/core';
import React from 'react'
import { AppWrapper } from "../../../ui/components";
import { AppContent } from "../../../ui/components/AppContent";
import { usePhotoModal } from '../hooks/usePhotoModal';
import React from 'react';
import { AppWrapper } from '../../../ui/components';
import { AppContent } from '../../../ui/components/AppContent';
import { GalleryGrid } from './grid/GalleryGrid';
import { GalleryModal } from './modal/GalleryModal';
import { Route, Switch } from 'react-router-dom';
import { LoadingSpinner } from '../../../ui/components/LoadingSpinner';
const CameraApp = () => {
const {modal} = usePhotoModal();
return (
<AppWrapper id='camera-app'>
<AppContent>
<GalleryModal />
{/*<Router>
<Switch>
<Route path="/camera/image" component={GalleryModal} />
<Route path="/" exact component={GalleryGrid} />
</Switch>
</Router>*/}
{!modal ? <GalleryGrid /> : null}
</AppContent>
</AppWrapper>
)
}
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} />
</React.Suspense>
</Switch>
</AppContent>
</AppWrapper>
);
export default CameraApp;
@@ -1,62 +1,80 @@
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 { usePhotoModal } from '../../hooks/usePhotoModal';
import { usePhotoMeta } from '../../hooks/usePhotoMeta';
import { useModal } from '../../../contacts/hooks/useModal';
//import { useHistory } from 'react-router-dom';
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 { 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';
// isMessage will work as a style handler kinda. If the gallery is rendered in the messages,
// it will have the value true, which basically means a tweak on the design to fit in a modal
export const GalleryGrid = (isMessags) => {
const classes = useStyles()
const { setMeta } = usePhotoMeta();
const { setModal } = usePhotoModal();
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);
//let history = useHistory();
const photos = usePhotos();
console.log(photos)
const handleCamera = () => {
Nui.send('phone:TakePhoto', {})
}
const referal = query.referal ? decodeURIComponent(query.referal) : '/camera/image';
const handlePhotoOpen = (photo) => {
setModal(true)
setMeta(photo)
//history.push('/camera/image')
}
history.push(addQueryToLocation(getLocationFromUrl(referal), 'image', photo.image));
};
if(!photos) return (
<Box display="flex" flexWrap="wrap" alignContent="flex-start" className={classes.root}>
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}>
<AddIcon fontSize="large"/>
<Button onClick={takePhoto} style={{ borderRadius: 0 }} className={classes.photo}>
<AddIcon fontSize="large" />
</Button>
</Box>
</Box>
)
);
return (
<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 => (
<Box onClick={() => handlePhotoOpen(photo)}>
{photos.map((photo) => (
<Box key={photo.id} onClick={() => handlePhotoOpen(photo)}>
<div style={{ backgroundImage: `url(${photo.image})` }} className={classes.photo} />
</Box>
))}
</Box>
</div>
)
}
);
};
@@ -2,7 +2,7 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
root: {
flexGrow: 1
flexGrow: 1,
},
photo: {
border: '1px inset #fff',
@@ -13,7 +13,7 @@ const useStyles = makeStyles((theme: Theme) => ({
backgroundPosition: 'center',
backgroundRepeat: 'no-repeat',
backgroundSize: 'cover',
}
}))
},
}));
export default useStyles;
export default useStyles;
@@ -1,62 +1,78 @@
import React from 'react'
import Modal from '../../../../ui/components/Modal';
import { usePhotoMeta } from '../../hooks/usePhotoMeta';
import { usePhotoModal } from '../../hooks/usePhotoModal';
import React, { useMemo, useState, useCallback } from 'react';
import useStyles from './modal.styles';
import { useHistory } from 'react-router-dom';
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 { useShareModal } from '../../hooks/useShareModal';
import { useHistory } from 'react-router-dom';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { ShareModal } from './ShareModal';
import { useShareLink } from '../../hooks/useShareLink';
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 { meta, setMeta } = usePhotoMeta();
const { modal, setModal } = usePhotoModal();
const classes = useStyles();
const history = useHistory();
const query = useQueryParams();
const { deletePhoto } = usePhotoActions();
const { addAlert } = useSnackbar();
const { t } = useTranslation();
const { shareModal ,setShareModal } = useShareModal();
const { setShareLink } = useShareLink();
const referal = query.referal || '/camera';
const meta: GalleryPhoto = useMemo(
() => ({ id: parseInt(query.id), image: query.image as string }),
[query],
);
const _handleClose = () => {
setModal(false)
setMeta(null);
}
history.push(referal);
};
const handleDeletePhoto = () => {
console.log(meta.id)
Nui.send('photo:deletePhoto', {
id: meta.id
})
setModal(false)
}
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' });
}
const handleSharePhoto = () => {
setShareModal(true)
setShareLink(meta.image)
}
if(!meta) return null;
deletePhoto(meta.image);
history.push(referal);
});
};
const handleSharePhoto = useCallback(() => {
setShareOpen(meta);
}, [meta]);
if (!meta) return null;
return (
<Paper className={modal ? classes.modal : classes.modalHide}>
<ShareModal key={meta.id} {...meta}/>
<div className={shareModal ? classes.backgroundModal : undefined} />
<Button onClick={_handleClose}><ArrowBackIcon /></Button>
<div className={classes.image} style={{ backgroundImage: `url(${meta.image})`}} />
<div className={classes.actionDiv}>
<Button onClick={handleDeletePhoto}>
<DeleteIcon fontSize="large" />
<>
<ShareModal referal={referal} meta={shareOpen} onClose={() => setShareOpen(null)} />
<Paper className={classes.modal}>
<div className={shareOpen ? classes.backgroundModal : null} />
<Button onClick={_handleClose}>
<ArrowBackIcon />
</Button>
<Button onClick={handleSharePhoto}>
<ShareIcon fontSize="large" />
</Button>
</div>
</Paper>
)
}
<div className={classes.image} style={{ backgroundImage: `url(${meta.image})` }} />
<div className={classes.actionDiv}>
<Button onClick={handleDeletePhoto}>
<DeleteIcon fontSize="large" />
</Button>
<Button onClick={handleSharePhoto}>
<ShareIcon fontSize="large" />
</Button>
</div>
</Paper>
</>
);
};
@@ -1,47 +1,42 @@
import React, { useRef, useState } from 'react';
import React from 'react';
import Modal from '../../../../ui/components/Modal';
import { useShareLink } from '../../hooks/useShareLink';
import { useShareModal } from '../../hooks/useShareModal';
import { Button } from '@material-ui/core';
import MessageIcon from '@material-ui/icons/Message';
import { setClipboard } from '../../../../os/phone/hooks/useClipboard';
import CloseIcon from '@material-ui/icons/Close';
import useStyles from './modal.styles';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useHistory } from 'react-router-dom';
import { GalleryPhoto } from '../../../../../../typings/photo';
export const ShareModal = (meta) => {
interface IShareModalProps {
meta: GalleryPhoto;
referal: string;
onClose(): void;
}
export const ShareModal = ({ meta, onClose, referal }: IShareModalProps) => {
const classes = useStyles();
const { shareModal, setShareModal } = useShareModal();
const { setShareLink } = useShareLink();
const _handleClose = () => {
setShareModal(false);
setShareLink(null);
};
const history = useHistory();
const handleCopyImage = () => {
setClipboard(meta.image);
history.push(referal);
};
return (
<Modal visible={shareModal} handleClose={_handleClose}>
<Modal visible={!!meta} handleClose={onClose}>
<div className={classes.shareModal}>
<Button
style={{ position: 'absolute', right: 0, width: '10%' }}
onClick={_handleClose}
>
<CloseIcon />
</Button>
<div className={classes.innerShareModal}>
<h4 style={{ textAlign: 'center', marginTop: 20 }}>
Where do you want to share the photo?
</h4>
<Button>{<MessageIcon />} Message</Button>
<h4>Or just copy the image here:</h4>
<Button onClick={handleCopyImage} variant='contained'>
Copy image
</Button>
<>
<h4 style={{ textAlign: 'center', marginTop: 20 }}>
Where do you want to share the photo?
</h4>
<Button>{<MessageIcon />} Message</Button>
<h4>Or just copy the image here:</h4>
<Button onClick={handleCopyImage} variant="contained">
Copy image
</Button>
</>
</div>
</div>
</Modal>
@@ -2,9 +2,9 @@ import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
backgroundModal: {
background: "black",
opacity: "0.6",
position: "absolute",
background: 'black',
opacity: '0.6',
position: 'absolute',
top: 0,
left: 0,
right: 0,
@@ -17,7 +17,7 @@ const useStyles = makeStyles((theme: Theme) => ({
width: '100%',
},
modalHide: {
display: 'none'
display: 'none',
},
image: {
width: 'auto',
@@ -27,22 +27,22 @@ const useStyles = makeStyles((theme: Theme) => ({
backgroundPosition: 'center',
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
marginTop: '4em'
marginTop: '4em',
},
actionDiv: {
marginTop: 15,
display: 'flex',
justifyContent: 'space-evenly'
justifyContent: 'space-evenly',
},
// share modal
shareModal: {
marginBottom: 50
marginBottom: 50,
},
innerShareModal: {
marginTop: 40,
textAlign: 'center'
}
}))
textAlign: 'center',
},
}));
export default useStyles;
export default useStyles;
+29 -20
View File
@@ -1,24 +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 [];
}
},
}),
}),
modal: atom({
key: 'photoModal',
default: false
}),
photoMeta: atom({
key: 'photoMeta',
default: null
}),
shareModal: atom({
key: 'phoneShareModal',
default: false
}),
shareLink: atom({
key: 'photoShareLink',
default: null
})
}
};
export const useSetPhotos = () => useSetRecoilState(photoState.photos);
export const usePhotos = () => useRecoilState(photoState.photos);
export const usePhotosValue = () => useRecoilValue(photoState.photos);
+61
View File
@@ -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,7 +0,0 @@
import { useRecoilState } from 'recoil';
import { photoState } from './state';
export const usePhotoMeta = () => {
const [meta, setMeta] = useRecoilState(photoState.photoMeta);
return { meta, setMeta};
}
@@ -1,7 +0,0 @@
import { useRecoilState } from 'recoil';
import { photoState } from './state';
export const usePhotoModal = () => {
const [modal, setModal] = useRecoilState(photoState.modal);
return { modal, setModal}
}
@@ -1,10 +0,0 @@
import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { photoState } from './state';
import { usePhotos } from './usePhotos';
export const usePhotoService = () => {
const setPhotos = useSetRecoilState(photoState.photos);
useNuiEvent('CAMERA', 'setPhotos', setPhotos);
return usePhotos();
}
-14
View File
@@ -1,14 +0,0 @@
import { useRecoilValue } from 'recoil';
import { photoState } from './state';
interface IPhotos {
image: string[];
map?: any;
}
export const usePhotos = (): IPhotos | null => {
const photos = useRecoilValue<IPhotos | null>(photoState.photos);
return photos;
}
@@ -1,7 +0,0 @@
import { useRecoilState } from 'recoil';
import { photoState } from './state';
export const useShareLink = () => {
const [ shareLink, setShareLink ] = useRecoilState(photoState.shareLink);
return { shareLink, setShareLink }
}
@@ -1,7 +0,0 @@
import { useRecoilState } from 'recoil';
import { photoState } from './state';
export const useShareModal = () => {
const [ shareModal, setShareModal ] = useRecoilState(photoState.shareModal);
return { shareModal, setShareModal }
}
+10
View File
@@ -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',
},
];
@@ -1,3 +0,0 @@
#contact-app .Mui-focused::after {
border-bottom: #2196f3 solid 4px;
}
@@ -1,87 +0,0 @@
import React, { useState } from 'react';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { Button, TextField } from '@material-ui/core';
import Nui from '../../../os/nui-events/utils/Nui';
import List from '@material-ui/core/List';
import ListItem from '@material-ui/core/ListItem';
import Modal from '../../../ui/components/Modal';
import { useModal } from '../hooks/useModal';
import ClearIcon from '@material-ui/icons/Clear';
import PersonIcon from '@material-ui/icons/Person';
import PhoneIcon from '@material-ui/icons/Phone';
import AccountCircleIcon from '@material-ui/icons/AccountCircle';
import useStyles from './styles.contactmodal';
export const AddContactModal = () => {
const [name, setName] = useState('');
const [number, setNumber] = useState('');
const [avatar, setAvatar] = useState('');
const classes = useStyles();
const { showModal, setShowModal } = useModal();
const addContact = () => {
if (name === '' || number === '') {
console.log('You need to pass in values');
} else {
Nui.send('contacts:add', {
name,
number,
avatar,
});
console.log(name, number, avatar);
}
};
const _handleClose = () => {
setShowModal(false);
};
return (
<Modal visible={showModal} handleClose={_handleClose}>
<Button onClick={_handleClose} className={classes.clearButton}>
<ClearIcon />
</Button>
<List style={{ marginTop: 30 }}>
<ListItem>
<PersonIcon className={classes.icons} />
<TextField
value={name}
inputProps={{ className: classes.textInputField }}
onChange={(e) => setName(e.target.value)}
fullWidth
variant='standard'
placeholder='Name'
/>
</ListItem>
<ListItem>
<PhoneIcon className={classes.icons} />
<TextField
value={number}
inputProps={{ className: classes.textInputField }}
onChange={(e) => setNumber(e.target.value)}
fullWidth
placeholder='Number'
variant='standard'
type='text'
/>
</ListItem>
<ListItem>
<AccountCircleIcon className={classes.icons} />
<TextField
value={avatar}
inputProps={{ className: classes.textInputField }}
onChange={(e) => setAvatar(e.target.value)}
fullWidth
placeholder='Avatar URL'
variant='standard'
type='text'
/>
</ListItem>
</List>
<Button className={classes.addBtn} onClick={addContact}>
Add Contact
</Button>
</Modal>
);
};
@@ -1,13 +0,0 @@
import React from 'react';
import Paper from '@material-ui/core/Paper';
import ContactsIcon from '@material-ui/icons/Contacts';
import useStyles from './styles.contacts';
export const ContactTitle = () => {
const classes = useStyles();
return (
<Paper className={classes.root} square variant='outlined' elevation={24}>
<ContactsIcon className={classes.icon} />
</Paper>
);
};
@@ -1,49 +1,49 @@
import React from 'react';
import { AppWrapper } from '../../../ui/components';
import { makeStyles, createStyles, Theme } from '@material-ui/core/styles';
import { AppTitle } from '../../../ui/components/AppTitle';
import { AppContent } from '../../../ui/components/AppContent';
import { ContactList } from './List/ContactList';
import { useApp } from '../../../os/apps/hooks/useApps';
import { AddContactModal } from './ContactModal';
import { useModal } from '../hooks/useModal';
import { SearchContacts } from './List/SearchContacts';
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 { InfoModal } from './modal/InfoModal';
import { useContactDetail } from '../hooks/useContactDetail';
import { ContactAlert } from './alert/ContactAlert';
import { useHistory } from 'react-router';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { LoadingSpinner } from '../../../ui/components/LoadingSpinner';
import useStyles from './styles.contacts';
const useStyles = makeStyles((theme: Theme) => ({
absolute: {
position: 'absolute',
right: theme.spacing(3),
bottom: theme.spacing(2),
},
}));
export const ContactsApp = () => {
const classes = useStyles();
const { showModal, setShowModal } = useModal();
const contacts = useApp('CONTACTS');
const { contactDetail } = useContactDetail();
const openModal = () => {
setShowModal(true);
};
const history = useHistory();
const classes = useStyles();
return (
<AppWrapper id='contact-app'>
<AppTitle app={contacts} />
<SearchContacts />
<AddContactModal />
<InfoModal key={contactDetail?.id} />
<div className={showModal ? classes.backgroundModal : undefined} />
<AppContent>
<ContactList />
<ContactsThemeProvider>
<AppWrapper id="contact-app">
<AppTitle app={contacts} />
<AppContent>
<React.Suspense fallback={<LoadingSpinner />}>
<Route path="/contacts/" exact component={ContactPage} />
<Route path="/contacts/:id" exact component={ContactsInfoPage} />
</React.Suspense>
</AppContent>
<Fab
onClick={openModal}
style={{ backgroundColor: '#2196f3', color: '#fff' }}
color="primary"
onClick={() => history.push('/contacts/-1')}
className={classes.absolute}
>
<PersonAddIcon />
</Fab>
<ContactAlert />
</AppContent>
</AppWrapper>
</AppWrapper>
</ContactsThemeProvider>
);
};
@@ -1,110 +1,68 @@
import React from 'react';
import ListItemText from '@material-ui/core/ListItemText';
import {
Button,
ListItemAvatar,
Avatar as MuiAvatar,
List,
ListItem,
TextField,
Collapse,
makeStyles,
} from '@material-ui/core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { faPen } from '@fortawesome/free-solid-svg-icons';
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
import { Button, ListItemAvatar, Avatar as MuiAvatar, List, ListItem } from '@material-ui/core';
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 { useContactModal } from '../../hooks/useContactModal';
import { useContactDetail } from '../../hooks/useContactDetail';
import Nui from '../../../../os/nui-events/utils/Nui';
import '../Contact.css';
import { ContactAlert } from '../alert/ContactAlert';
const useStyles = makeStyles((theme) => ({
updateButton: {
margin: 'auto',
fontSize: 14,
width: 150,
background: '#2196f3',
marginBottom: 10,
padding: 8,
},
collapseItem: {
margin: 'auto',
width: '50%',
},
}));
import { SearchContacts } from './SearchContacts';
import { useHistory } from 'react-router-dom';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
import { useFilteredContacts } from '../../hooks/state';
import { useCall } from '../../../../os/call/hooks/useCall';
export const ContactList = () => {
const { filteredContacts } = useFilteredContacts();
const { setShowContactModal } = useContactModal();
const { contactDetail, setContactDetail } = useContactDetail();
const filteredContacts = useFilteredContacts();
const history = useHistory();
const { initializeCall } = useCall();
const contacts = useContacts();
const openContactInfo = (contact) => {
setShowContactModal(true);
setContactDetail(contact);
console.log('CONTACT', contactDetail);
const openContactInfo = (contactId: number) => {
history.push(`/contacts/${contactId}`);
};
const startCall = (number) => {
console.log(number);
Nui.send('phone:startCall', {
number,
const startCall = (number: string) => {
LogDebugEvent({
action: 'Emitting `Start Call` to Scripts',
level: 2,
data: true,
});
initializeCall(number);
};
const handleMessage = (phoneNumber: string) => {
LogDebugEvent({
action: 'Routing to Message',
level: 1,
data: { phoneNumber },
});
history.push(`/messages/new/${phoneNumber}`);
};
return (
<List>
{contacts.contacts
.filter(
(contact) =>
contact.display.includes(filteredContacts.toLowerCase()) ||
contact.number.includes(filteredContacts.toLowerCase())
)
.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={() =>
console.log('Message: ' + contact.display, contact.number)
}
>
<ChatIcon />
</Button>
<Button
style={{ margin: -15 }}
onClick={() => openContactInfo(contact)}
>
<MoreVertIcon />
</Button>
</ListItem>
</>
<>
<SearchContacts />
<List>
{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>
</List>
</>
);
};
Loaded 100 of 614 files, more files were not shown because too many files have changed in this diff. Show more