Author SHA1 Message Date
Darrian f3076a45fb RFR: Remove items in SQL 2021-04-01 17:21:22 -04:00
Darrian 62aaaea368 RFR: Adjust identifier length + add backticks. 2021-04-01 16:30:01 -04: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
481 changed files with 27671 additions and 12162 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?**
+3 -19
View File
@@ -1,10 +1,10 @@
name: Tests and CI
name: Test Suite
on: [push]
jobs:
nui_preformatting_tests:
name: NUI Preformatting and Tests
name: Tests for NUI
runs-on: ubuntu-latest
defaults:
run:
@@ -34,21 +34,13 @@ 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
env:
CI: true
game_scripts_test:
name: Formatting/Tests for Native Scripts
name: Tests for Game Scripts
runs-on: ubuntu-latest
defaults:
run:
@@ -68,14 +60,6 @@ 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 Jest Tests
run: yarn test
env:
+21 -1
View File
@@ -1,2 +1,22 @@
# No intellij folder
# No IDE Folders
.idea
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
+1
View File
@@ -0,0 +1 @@
_
+30
View File
@@ -0,0 +1,30 @@
#!/bin/sh
if [ -z "$husky_skip_init" ]; then
debug () {
[ "$HUSKY_DEBUG" = "1" ] && echo "husky (debug) - $1"
}
readonly hook_name="$(basename "$0")"
debug "starting $hook_name..."
if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi
if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi
export readonly husky_skip_init=1
sh -e "$0" "$@"
exitCode="$?"
if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
exit $exitCode
fi
exit 0
fi
+4
View File
@@ -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
}
View File
Whitespace-only changes.
+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://beta.iodine.gg/zVkK7.png" width="500" height="300" />
### Configuration
NPWD is our current running project. Our team has been working on the project since August, 2020. This resource isn’t complete yet and currently has no ETA for release. Feel free to test it out in a dev environment by following the installation guide.
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://beta.iodine.gg/Eh53X.png)
- [**Calculator**](https://beta.iodine.gg/s6VQV.png)
- [**Camera**](https://beta.iodine.gg/vW0y9.png)
- [**Contacts**](https://beta.iodine.gg/3fujR.png)
- [**Marketplace**](https://beta.iodine.gg/5bUa8.png)
- [**Messages**](https://beta.iodine.gg/S4Lia.png)
- [**Notes**](https://beta.iodine.gg/qTkBb.png)
- [**Phone**](https://beta.iodine.gg/z0ii9.png)
- [**Settings**](https://beta.iodine.gg/mZAIt.png)
- [**Twitter**](https://beta.iodine.gg/rQZFR.png)
+40 -31
View File
@@ -1,32 +1,41 @@
{
"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",
"KeyTogglePhone": 288,
"KeyTakeCall": 38,
"PhoneAsItem": false,
"SwimDestroy": false,
"RunRate": 10,
"DestoryChance": 100,
"DestroyPhoneReCheck": 3,
"notificationPosition": {
"horizontal": "right",
"vertical": "top"
},
"general": {
"useDashNumber": true
},
"twitter": {
"showNotifications": true,
"generateProfileNameFromUsers": true,
"allowEdtiableProfileName": true,
"allowDeleteTweets": true,
"allowReportTweets": true,
"characterLimit": 160,
"newLineLimit": 10,
"enableAvatars": true,
"enableEmojis": true,
"enableImages": true,
"maxImages": 3
},
"match": {
"generateProfileNameFromUsers": true,
"allowEdtiableProfileName": true
},
"bank": {
"showNotifications": true
},
"debug": {
"level": "debug",
"enabled": true
}
}
+6 -19
View File
@@ -1,24 +1,13 @@
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'
}
server_script {
"@mysql-async/lib/MySQL.lua",
'@es_extended/locale.lua',
'resources/locales/*.lua',
'resources/server/*.lua',
'resources/dist/server/*.server.js'
}
@@ -27,8 +16,6 @@ ui_page 'resources/html/index.html'
files {
'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/*.map',
'resources/html/media/**/*'
}
+174
View File
@@ -0,0 +1,174 @@
# 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(10) DEFAULT NULL,
`display` varchar(60) 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://beta.iodine.gg/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_labels` (
`id` int NOT NULL AUTO_INCREMENT,
`user_identifier` varchar(48) NOT NULL,
`label` varchar(60) NOT NULL,
`createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`group_id` varchar(512) NOT NULL,
PRIMARY KEY (`id`)
);
CREATE TABLE IF NOT EXISTS `npwd_messages` (
`id` int NOT NULL AUTO_INCREMENT,
`message` varchar(512) NOT NULL,
`user_identifier` varchar(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"
}
+19
View File
@@ -0,0 +1,19 @@
{
"name": "npwd",
"devDependencies": {
"husky": "^5.1.3",
"lerna": "^3.22.1",
"prettier": "^2.2.1",
"pretty-quick": "^3.1.0"
},
"scripts": {
"build": "lerna run build --concurrency 1",
"prepare": "husky install",
"format": "pretty-quick"
},
"husky": {
"hooks": {
"pre-commit": "pretty-quick --staged"
}
}
}
+1 -4
View File
@@ -8,8 +8,5 @@
],
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import"
]
"plugins": ["@babel/plugin-proposal-class-properties", "@babel/plugin-syntax-dynamic-import"]
}
-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.
+58
View File
@@ -0,0 +1,58 @@
const {
addAfterLoader,
removeLoaders,
loaderByName,
getLoaders,
throwUnexpectedConfigError,
} = require('@craco/craco');
const throwError = (message) =>
throwUnexpectedConfigError({
packageName: 'craco',
githubRepo: 'gsoft-inc/craco',
message,
githubIssueQuery: 'webpack',
});
module.exports = {
webpack: {
configure: (webpackConfig, { paths }) => {
const { hasFoundAny, matches } = getLoaders(webpackConfig, loaderByName('babel-loader'));
if (!hasFoundAny) throwError('failed to find babel-loader');
const { hasRemovedAny, removedCount } = removeLoaders(
webpackConfig,
loaderByName('babel-loader'),
);
if (!hasRemovedAny) throwError('no babel-loader to remove');
if (removedCount !== 2) throwError('had expected to remove 2 babel loader instances');
webpackConfig.resolve.plugins = webpackConfig.resolve.plugins.filter(
({ constructor: c }) => !c || c.name !== 'ModuleScopePlugin',
);
const tsLoader = {
test: /\.tsx?$/,
loader: require.resolve('ts-loader'),
options: { transpileOnly: true },
};
const { isAdded: tsLoaderIsAdded } = addAfterLoader(
webpackConfig,
loaderByName('url-loader'),
tsLoader,
);
if (!tsLoaderIsAdded) throwError('failed to add ts-loader');
const { isAdded: babelLoaderIsAdded } = addAfterLoader(
webpackConfig,
loaderByName('ts-loader'),
matches[1].loader, // babel-loader
);
if (!babelLoaderIsAdded) throwError('failed to add back babel-loader for non-application JS');
return webpackConfig;
},
},
};
+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'];
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);
})();
+33 -18
View File
@@ -1,10 +1,11 @@
{
"name": "new-phone",
"name": "npwd-nui",
"version": "0.1.0",
"private": true,
"repository": "https://github.com/project-error/new-phone-who-dis",
"private": false,
"license": "CC-BY-NC-SA-4.0",
"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",
@@ -13,25 +14,27 @@
"@material-ui/icons": "^4.9.1",
"@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",
"@sentry/react": "^5.29.2",
"@sentry/tracing": "^5.29.2",
"core-js": "^3.8.3",
"dayjs": "^1.10.4",
"dompurify": "^2.2.6",
"emoji-mart": "^3.0.0",
"enzyme": "^3.11.0",
"enzyme-adapter-react-16": "^1.15.5",
"howler": "^2.2.1",
"i18next": "^19.7.0",
"prettier": "^2.0.5",
"jsonschema": "^1.4.0",
"parse-url": "^5.0.2",
"qs": "^6.9.6",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-hotkeys": "^2.0.0",
"react-i18next": "^11.7.1",
"react-popper": "^2.2.3",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.3",
"recoil": "^0.0.10",
"styled-components": "^5.1.1"
"react-scripts": "4.0.1",
"recoil": "^0.1.2"
},
"devDependencies": {
"@babel/cli": "^7.4.4",
@@ -40,21 +43,32 @@
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/preset-env": "^7.4.5",
"@babel/preset-react": "^7.0.0",
"@craco/craco": "^6.1.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"@types/enzyme": "^3.10.7",
"@types/howler": "^2.2.1",
"@types/jest": "^26.0.14",
"@types/node": "^14.11.5",
"@types/qs": "^6.9.5",
"@types/react": "^16.9.51",
"@types/react-dom": "^16.9.8",
"@types/react-router-dom": "^5.1.7",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.1.0",
"babel-plugin-styled-components": "^1.10.0",
"babel-plugin-transform-react-remove-prop-types": "^0.4.24",
"copy-webpack-plugin": "6.2.1",
"cp-cli": "^2.0.0",
"cra-build-watch": "^3.2.0",
"cross-env": "^7.0.2",
"css-loader": "^2.1.1",
"customize-cra": "^1.0.0",
"file-loader": "^3.0.1",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^4.3.0",
"ifdef-loader": "^2.1.5",
"react-devtools": "^4.10.1",
"react-test-renderer": "^16.13.1",
"style-loader": "^0.23.1",
"svg-url-loader": "^2.3.2",
@@ -65,12 +79,13 @@
"webpack-cli": "^3.3.12"
},
"scripts": {
"start": "react-scripts start",
"i18n:missing": "node --experimental-json-modules i18n.missingKeys.js",
"copy:config": "cp-cli ../config.json ./src/config.autogen.json",
"start": "craco start",
"watch": "cra-build-watch --disable-chunks --build-path ../resources/html --output-filename dev.js",
"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}",
"build": "yarn copy:config && cross-env NODE_ENV=production webpack --config webpack/prod.config.js --color -p --progress --hide-modules --display-optimization-bailout",
"build:dev": "cross-env NODE_ENV=development webpack --config webpack/dev.config.js --color -p --progress --hide-modules --display-optimization-bailout --analyze",
"test": "craco test --watchAll=false --testMatch **/src/**/*.test.{ts,js,tsx}",
"test:watch": "react-scripts test --watchAll --testMatch **/src/**/*.test.{ts,js,tsx}",
"eject": "react-scripts eject"
},
-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
}
+5 -2
View File
@@ -2,10 +2,13 @@
<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>
<title>Project Error - New Phone Who Dis</title>
</head>
<body>
<div id="root"></div>
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.
+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;
}
+6 -6
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 Phone from './Phone';
it("renders Phone", () => {
it('renders Phone', () => {
shallow(
<RecoilRoot>
<Phone />
</RecoilRoot>
</RecoilRoot>,
);
});
+115 -277
View File
@@ -1,14 +1,11 @@
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 { Box, Paper, Slide, Typography } from '@material-ui/core';
import { useKeyboardService } from './os/keyboard/hooks/useKeyboardService';
import { NotificationBar } from './os/notifications/components/NotificationBar';
import { Navigation } from './os/navigation-bar/components/Navigation';
import { useNuiService } from './os/nui-events/hooks/useNuiService';
@@ -18,310 +15,151 @@ import { useApps } from './os/apps/hooks/useApps';
import { useContactsService } from './apps/contacts/hooks/useContactsService';
import { useTwitterService } from './apps/twitter/hooks/useTwitterService';
import { useSelloutService } from './apps/sellout/hooks/useSelloutService';
import { useMatchService } from './apps/match/hooks/useMatchService';
import { useMarketplaceService } from './apps/marketplace/hooks/useMarketplaceService';
import { useBankService } from './apps/bank/hooks/useBankService';
import { useMessagesService } from './apps/messages/hooks/useMessageService';
import { useNotesService } from './apps/notes/hooks/useNotesService';
import { usePhotoService } from './apps/camera/hooks/usePhotoService';
import Nui from './os/nui-events/utils/Nui';
import { isSettingsSchemaValid, useSettings } from './apps/settings/hooks/useSettings';
import { useCallService } from './os/call/hooks/useCallService';
import { useDialService } from './apps/dialer/hooks/useDialService';
import InjectDebugData from './os/debug/InjectDebugData';
import { usePhoneVisibility } from './os/phone/hooks/usePhoneVisibility';
import { PhoneSnackbar } from './ui/components/PhoneSnackbar';
import { NotificationAlert } from './os/notifications/components/NotificationAlert';
import { useCallModal } from './os/call/hooks/useCallModal';
import WindowSnackbar from './ui/components/WindowSnackbar';
import { usePhone } from './os/phone/hooks/usePhone';
// 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',
category: 'CAR',
description: 'Selling this cool car',
url: 'https://i.imgur.com/ROmGTwi.jpeg',
price: 400,
posted: '1/9/2021',
},
{
id: 2,
name: 'Some other dude',
number: '666-6666',
title: 'Material',
description:
'Selling my wife olsdfjsdfk jfksdaj kasjfksf jdkasf jklasf jasklf jaskf',
url: '',
price: 30,
},
],
},
})
);
}, 1000);
}
import { useTranslation } from 'react-i18next';
import { useSnackbar } from './ui/hooks/useSnackbar';
function Phone() {
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
}, []);
useNuiService();
useKeyboardService();
usePhoneService();
const { visibility } = usePhone();
const { settings, currentTheme } = useSettings();
const { allApps } = useApps();
useSimcardService();
useContactsService();
useTwitterService();
useInitKeyboard();
useSelloutService();
useMatchService();
useMarketplaceService();
useBankService();
useMessagesService();
useNotesService();
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();
const { bottom, visibility } = usePhoneVisibility();
const { isPhoneReady } = usePhone();
return (
<ThemeProvider theme={currentTheme()}>
<div className='PhoneWrapper'>
<div style={{ zoom: settings.zoom }}>
<div className='Phone'>
<div>
<WindowSnackbar />
<Slide direction="up" timeout={{ enter: 500, exit: 500 }} in={visibility}>
<div className="PhoneWrapper">
<div
className="Phone"
style={{
position: 'fixed',
transformOrigin: 'right bottom',
transform: `scale(${settings.zoom.value}`,
bottom,
}}
>
<div
className='PhoneFrame'
className="PhoneFrame"
style={{
backgroundImage: `url(./media/frames/${settings.frame})`,
backgroundImage: `url(media/frames/${settings.frame.value})`,
}}
></div>
/>
<div
id='phone'
className='PhoneScreen'
id="phone"
className="PhoneScreen"
style={{
backgroundImage: `url(./media/backgrounds/${settings.wallpaper})`,
backgroundImage: settings.customWallpaper
? `url(${settings.customWallpaper})`
: `url(media/backgrounds/${settings.wallpaper.value})`,
}}
>
<>
<NotificationBar
notifications={[
{
key: 'newMessage',
icon: <NotificationIcon Icon={MessageIcon} />,
},
]}
/>
<div className='PhoneAppContainer'>
{calling ? (
<CallModal />
) : (
{isPhoneReady ? (
<>
<NotificationBar />
<div className="PhoneAppContainer">
<>
<Route exact path='/' component={HomeApp} />
{allApps.map((App) => (
<Route exact path="/" component={HomeApp} />
{callModal && <Route exact path="/call" component={CallModal} />}
{apps.map((App) => (
<App.Route key={App.id} />
))}
</>
)}
</div>
<Navigation />
</>
<NotificationAlert />
<PhoneSnackbar />
</div>
<Navigation />
</>
) : (
<Box
component={Paper}
height="100%"
width="100%"
display="flex"
flexDirection="column"
alignItems="center"
justifyContent="center"
>
<Typography paragraph variant="h6">
NPWD {t('INITIALIZING')}
</Typography>
<Typography paragraph>{t('GENERIC_WAIT')}</Typography>
</Box>
)}
</div>
</div>
</div>
</div>
</ThemeProvider>
</Slide>
</div>
);
}
export default Phone;
InjectDebugData([
{
app: 'PHONE',
method: 'setVisibility',
data: true,
},
{
app: 'PHONE',
method: 'setPhoneReady',
data: true,
},
]);
+22
View File
@@ -0,0 +1,22 @@
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 { SoundProvider } from './os/sound/providers/SoundProvider';
export const PhoneContainer = () => {
const currentTheme = usePhoneTheme();
return (
<ThemeProvider theme={currentTheme}>
<SoundProvider>
<NotificationsProvider>
<SnackbarProvider>
<Phone />
</SnackbarProvider>
</NotificationsProvider>
</SoundProvider>
</ThemeProvider>
);
};
+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>
@@ -4,11 +4,7 @@ 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 { faHome, faList, faMoneyCheck } from '@fortawesome/free-solid-svg-icons';
const useStyles = makeStyles((theme) => ({
root: {
@@ -37,17 +33,17 @@ export const NavigationBar = () => {
<BottomNavigationAction
component={Link}
icon={<FontAwesomeIcon icon={faHome} />}
to='/bank'
to="/bank"
/>
<BottomNavigationAction
component={Link}
icon={<FontAwesomeIcon icon={faMoneyCheck} />}
to='/bank/account'
to="/bank/account"
/>
<BottomNavigationAction
component={Link}
icon={<FontAwesomeIcon icon={faList} />}
to='/bank/transactions'
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,7 +43,7 @@ export const TransactionList = () => {
</div>
<div>
<p className={TransactionTypes[transaction.type]}>
{transaction.type == 'Withdraw' ? '-' : '+'}
{transaction.type === 'Withdraw' ? '-' : '+'}
{transaction.amount}
</p>
</div>
@@ -52,7 +52,7 @@ export const TransactionList = () => {
<TablePagination
rowsPerPageOptions={[3, 5]}
className={classes.pagination}
component='div'
component="div"
count={transactionList.length}
rowsPerPage={rowsPerPage}
page={page}
@@ -1,17 +1,11 @@
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 { Button, List, ListItem, TextField, makeStyles } from '@material-ui/core';
import Nui from '../../../../os/nui-events/utils/Nui';
import { useBankModal } from '../../hooks/useBankModal';
import { BankEvents } from '../../../../../../typings/bank';
const useStyles = makeStyles((theme) => ({
input: {
@@ -33,11 +27,6 @@ const useStyles = makeStyles((theme) => ({
fontSize: 16,
marginBottom: 30,
},
closeButton: {
position: 'absolute',
right: 0,
width: '10%',
},
}));
export const TransferModal = () => {
@@ -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 -14
View File
@@ -1,22 +1,31 @@
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
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';
import { PhoneEvents } from '../../../../../typings/phone';
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);
};
@@ -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
+29 -19
View File
@@ -1,30 +1,40 @@
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 InjectDebugData from '../../../os/debug/InjectDebugData';
import { Route, Switch } from 'react-router-dom';
import { PhotoEvents } from '../../../../../typings/photo';
InjectDebugData([
{
app: 'CAMERA',
method: PhotoEvents.SEND_PHOTOS,
data: [
{
id: 1,
image: 'https://beta.iodine.gg/noDcb.jpeg',
},
{
id: 2,
image: 'https://beta.iodine.gg/teUcY.jpeg',
},
],
},
]);
const CameraApp = () => {
const {modal} = usePhotoModal();
return (
<AppWrapper id='camera-app'>
<AppWrapper id="camera-app">
<AppContent>
<GalleryModal />
{/*<Router>
<Switch>
<Route path="/camera/image" component={GalleryModal} />
<Route path="/" exact component={GalleryGrid} />
</Switch>
</Router>*/}
{!modal ? <GalleryGrid /> : null}
<Switch>
<Route path="/camera" exact component={GalleryGrid} />
<Route path="/camera/image" exact component={GalleryModal} />
</Switch>
</AppContent>
</AppWrapper>
)
}
);
};
export default CameraApp;
@@ -1,62 +1,57 @@
import React from 'react'
import React from 'react';
import { Box, Button } 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 { PhotoEvents } from '../../../../../../typings/photo';
// 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 referal = query.referal ? decodeURIComponent(query.referal) : '/camera/image';
//let history = useHistory();
const photos = usePhotos();
console.log(photos)
const handleCamera = () => {
Nui.send('phone:TakePhoto', {})
}
Nui.send(PhotoEvents.TAKE_PHOTO, {});
};
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}>
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"/>
<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"/>
<AddIcon fontSize="large" />
</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,64 @@
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 { ICameraPhoto } from '../../hooks/usePhotos';
import { ShareModal } from './ShareModal';
import { useShareLink } from '../../hooks/useShareLink';
import { PhotoEvents } from '../../../../../../typings/photo';
export const GalleryModal = () => {
const { meta, setMeta } = usePhotoMeta();
const { modal, setModal } = usePhotoModal();
const classes = useStyles();
const history = useHistory();
const query = useQueryParams();
const referal = query.referal || '/camera';
const { shareModal ,setShareModal } = useShareModal();
const { setShareLink } = useShareLink();
const [shareOpen, setShareOpen] = useState(null);
const meta: ICameraPhoto = useMemo(
() => ({ id: query.id as string, 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)
}
Nui.send(PhotoEvents.DELETE_PHOTO, {
image: meta.image,
});
history.push(referal);
};
const handleSharePhoto = () => {
setShareModal(true)
setShareLink(meta.image)
}
if(!meta) return null;
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 { ICameraPhoto } from '../../hooks/usePhotos';
import { useHistory } from 'react-router-dom';
export const ShareModal = (meta) => {
interface IShareModalProps {
meta: ICameraPhoto;
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;
+2 -18
View File
@@ -3,22 +3,6 @@ import { atom } from 'recoil';
export const photoState = {
photos: atom({
key: 'galleryPhotos',
default: null
default: null,
}),
modal: atom({
key: 'photoModal',
default: false
}),
photoMeta: atom({
key: 'photoMeta',
default: null
}),
shareModal: atom({
key: 'phoneShareModal',
default: false
}),
shareLink: atom({
key: 'photoShareLink',
default: null
})
}
};
@@ -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 +1,9 @@
import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { photoState } from './state';
import { usePhotos } from './usePhotos';
import { PhotoEvents } from '../../../../../typings/photo';
export const usePhotoService = () => {
const setPhotos = useSetRecoilState(photoState.photos);
useNuiEvent('CAMERA', 'setPhotos', setPhotos);
return usePhotos();
}
useNuiEvent('CAMERA', PhotoEvents.SEND_PHOTOS, setPhotos);
};
+6 -9
View File
@@ -1,14 +1,11 @@
import { useRecoilValue } from 'recoil';
import { photoState } from './state';
interface IPhotos {
image: string[];
map?: any;
export interface ICameraPhoto {
id: string;
image: string;
}
export const usePhotos = (): IPhotos | null => {
const photos = useRecoilValue<IPhotos | null>(photoState.photos);
return photos;
}
export const usePhotos = (): ICameraPhoto[] | null => {
return useRecoilValue<ICameraPhoto[] | null>(photoState.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 }
}
@@ -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,58 @@
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 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 InjectDebugData from '../../../os/debug/InjectDebugData';
import { Route } from 'react-router-dom';
import useStyles from './styles.contacts';
import ContactsInfoPage from './views/ContactInfo';
import { ContactPage } from './views/ContactsPage';
import { ContactsThemeProvider } from '../providers/ContactsThemeProvider';
import { ContactEvents } from '../../../../../typings/contact';
export const ContactsApp = () => {
const classes = useStyles();
const { showModal, setShowModal } = useModal();
const contacts = useApp('CONTACTS');
const { contactDetail } = useContactDetail();
const openModal = () => {
setShowModal(true);
};
return (
<AppWrapper id='contact-app'>
<AppTitle app={contacts} />
<SearchContacts />
<AddContactModal />
<InfoModal key={contactDetail?.id} />
<div className={showModal ? classes.backgroundModal : undefined} />
<AppContent>
<ContactList />
<Fab
onClick={openModal}
style={{ backgroundColor: '#2196f3', color: '#fff' }}
className={classes.absolute}
>
<PersonAddIcon />
</Fab>
<ContactAlert />
</AppContent>
</AppWrapper>
<ContactsThemeProvider>
<AppWrapper id="contact-app">
<AppTitle app={contacts} />
<AppContent>
<Route path="/contacts/" exact component={ContactPage} />
<Route path="/contacts/:id" exact component={ContactsInfoPage} />
</AppContent>
</AppWrapper>
</ContactsThemeProvider>
);
};
InjectDebugData([
{
app: 'CONTACTS',
method: ContactEvents.SEND_CONTACTS,
data: [
{
id: 1,
display: 'Ruqen',
number: '555-15196',
},
{
id: 2,
display: 'Taso',
number: '215-8139',
avatar: 'http://i.tasoagc.dev/i9Ig',
},
{
id: 3,
display: 'Chip',
number: '111-1111',
},
{
id: 4,
display: 'Kidz',
number: '444-4444',
},
],
},
]);
@@ -1,110 +1,80 @@
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 { Button, ListItemAvatar, Avatar as MuiAvatar, List, ListItem } from '@material-ui/core';
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
import PhoneIcon from '@material-ui/icons/Phone';
import ChatIcon from '@material-ui/icons/Chat';
import MoreVertIcon from '@material-ui/icons/MoreVert';
import { useContacts } from '../../hooks/useContacts';
import { 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 { CallEvents } from '../../../../../../typings/call';
export const ContactList = () => {
const { filteredContacts } = useFilteredContacts();
const { setShowContactModal } = useContactModal();
const { contactDetail, setContactDetail } = useContactDetail();
const history = useHistory();
const contacts = useContacts();
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', {
const startCall = (number: string) => {
LogDebugEvent({
action: 'Emitting `Start Call` to Scripts',
level: 2,
data: true,
});
Nui.send(CallEvents.INITIALIZE_CALL, {
number,
});
};
const handleMessage = (phoneNumber: string) => {
LogDebugEvent({
action: 'Routing to Message',
level: 1,
data: { phoneNumber },
});
history.push(`/messages/new/${phoneNumber}`);
};
const filteredRegEx = new RegExp(filteredContacts, 'gi');
return (
<List>
{contacts.contacts
.filter(
(contact) =>
contact.display.includes(filteredContacts.toLowerCase()) ||
contact.number.includes(filteredContacts.toLowerCase())
)
.map((contact) => (
<>
<>
<SearchContacts />
<List>
{contacts
.filter(
(contact) =>
contact.display.match(filteredRegEx) || contact.number.match(filteredRegEx),
)
.map((contact) => (
<ListItem key={contact.id} divider>
<ListItemAvatar>
{contact.avatar ? (
<MuiAvatar src={contact.avatar} />
) : (
<MuiAvatar>
{contact.display.slice(0, 1).toUpperCase()}
</MuiAvatar>
<MuiAvatar>{contact.display.slice(0, 1).toUpperCase()}</MuiAvatar>
)}
</ListItemAvatar>
<ListItemText
primary={contact.display}
secondary={contact.number}
/>
<ListItemText primary={contact.display} secondary={contact.number} />
<Button onClick={() => startCall(contact.number)}>
<PhoneIcon />
</Button>
<Button
onClick={() =>
console.log('Message: ' + contact.display, contact.number)
}
>
<Button onClick={() => handleMessage(contact.number)}>
<ChatIcon />
</Button>
<Button
style={{ margin: -15 }}
onClick={() => openContactInfo(contact)}
>
<Button style={{ margin: -15 }} onClick={() => openContactInfo(contact.id)}>
<MoreVertIcon />
</Button>
</ListItem>
</>
))}
</List>
))}
</List>
</>
);
};
@@ -1,94 +1,22 @@
import React from 'react';
import { InputBase } from '@material-ui/core';
import SearchIcon from '@material-ui/icons/Search';
import {
createStyles,
fade,
Theme,
makeStyles,
} from '@material-ui/core/styles';
import { Box } from '@material-ui/core';
import { useTranslation } from 'react-i18next';
import { useFilteredContacts } from '../../hooks/useFilteredContacts';
const useStyles = makeStyles((theme: Theme) =>
createStyles({
bg: {
backgroundColor: '#232323',
display: 'flex',
height: 60,
justifyContent: 'center',
alignItems: 'center',
},
textFieldInput: {
fontSize: 20,
},
inputRoot: {
color: '#fff',
fontSize: 18,
},
inputInput: {
padding: theme.spacing(1, 4, 1, 4),
transition: theme.transitions.create('width'),
width: '100%',
[theme.breakpoints.up('sm')]: {
width: '13ch',
'&:focus': {
width: '20ch',
},
},
},
search: {
position: 'relative',
borderRadius: theme.shape.borderRadius,
backgroundColor: fade(theme.palette.common.white, 0.15),
'&:hover': {
backgroundColor: fade(theme.palette.common.white, 0.25),
},
marginLeft: 0,
width: '100%',
[theme.breakpoints.up('sm')]: {
marginLeft: theme.spacing(1),
width: 'auto',
},
},
searchIcon: {
padding: theme.spacing(0, 0.5),
height: '100%',
position: 'absolute',
pointerEvents: 'none',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
},
})
);
import { SearchField } from '../../../../ui/components/SearchField';
export const SearchContacts = () => {
const { setFilteredContacts } = useFilteredContacts();
const classes = useStyles();
const handleChange = (e) => {
setFilteredContacts(e.target.value);
};
const { setFilteredContacts, filteredContacts } = useFilteredContacts();
const { t } = useTranslation();
return (
<div className={classes.bg}>
<div className={classes.search}>
<div className={classes.searchIcon}>
<SearchIcon style={{ color: '#fff' }} />
</div>
<InputBase
onChange={handleChange}
placeholder='Search contacts...'
classes={{
root: classes.inputRoot,
input: classes.inputInput,
}}
inputProps={{ 'aria-label': 'search' }}
/>
</div>
</div>
<Box>
<SearchField
onChange={(e) => setFilteredContacts(e.target.value)}
placeholder={t('APPS_CONTACT_PLACEHOLDER_SEARCH_CONTACTS')}
value={filteredContacts}
/>
</Box>
);
};
@@ -1,64 +0,0 @@
import { Snackbar } from '@material-ui/core';
import React, { useState, useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import { Alert } from '../../../../ui/components/Alert';
import { useContactAlert } from '../../hooks/useAlert';
import { AlertCategory } from '../../../../common/typings/contact';
// Used as a prefix for referencing the locales
// Needed to make code cleaner
const LOCALE_PREFIX = 'APPS_';
export const ContactAlert = () => {
const { t } = useTranslation();
const { alert, setAlert } = useContactAlert();
const [open, setOpen] = useState(false);
const [message, setMessage] = useState(null);
const [severity, setSeverity] = useState('');
const _handleClose = () => {
setOpen(false);
setAlert(null);
};
function setMessageAlert(type: AlertCategory, severity: 'success' | 'error') {
setMessage(t(LOCALE_PREFIX + type));
setSeverity(severity);
setOpen(true);
}
useEffect(() => {
switch (alert) {
case 'CONTACT_ADD_FAILED':
setMessageAlert(alert, 'error');
break;
case 'CONTACT_ADD_SUCCESS':
setMessageAlert(alert, 'success');
break;
case 'CONTACT_DELETE_FAILED':
setMessageAlert(alert, 'error');
break;
case 'CONTACT_DELETE_SUCCESS':
setMessageAlert(alert, 'success');
break;
case 'CONTACT_UPDATE_FAILED':
setMessageAlert(alert, 'error');
break;
case 'CONTACT_UPDATE_SUCCESS':
setMessageAlert(alert, 'success');
}
}, [alert]);
return (
<Snackbar
style={{ width: '80%', position: 'absolute', bottom: '10%' }}
autoHideDuration={6000}
open={open}
onClose={_handleClose}
>
<Alert severity={severity} variant='filled'>
{message}
</Alert>
</Snackbar>
);
};
@@ -1,112 +0,0 @@
import React, { useState } from 'react';
import {
Paper,
Slide,
Button,
TextField,
Avatar as MuiAvatar,
} from '@material-ui/core';
import useStyles from './modal.styles';
import { useContactModal } from '../../hooks/useContactModal';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import { useTranslation } from 'react-i18next';
import { useContactDetail } from '../../hooks/useContactDetail';
import Nui from '../../../../os/nui-events/utils/Nui';
export const InfoModal = () => {
const classes = useStyles();
const { showContactModal, setShowContactModal } = useContactModal();
const { t } = useTranslation();
const { contactDetail, setContactDetail } = useContactDetail();
const [display, setDisplay] = useState(
contactDetail ? contactDetail.display : ''
);
console.log(contactDetail);
const [number, setNumber] = useState(
contactDetail ? contactDetail.number : ''
);
const [avatar, setAvatar] = useState(
contactDetail ? contactDetail.avatar : ''
);
const closeModal = () => {
setShowContactModal(false);
setContactDetail(null);
};
const updateContact = () => {
Nui.send('phone:updateContact', {
id: contactDetail.id,
display,
number,
avatar,
});
setContactDetail(null);
setShowContactModal(false);
};
const deleteContact = () => {
Nui.send('phone:deleteContact', {
id: contactDetail.id,
});
setContactDetail(null);
setShowContactModal(false);
};
return (
<Slide direction='up' in={showContactModal}>
<Paper
className={showContactModal ? classes.modalRoot : classes.modalHide}
square
>
<Button style={{ margin: 10 }} onClick={closeModal}>
<ArrowBackIcon fontSize='large' />
</Button>
<div className={classes.listContainer}>
<MuiAvatar className={classes.avatar} src={avatar} />
<TextField
className={classes.input}
value={display}
onChange={(e) => setDisplay(e.target.value)}
placeholder={t('APPS_CONTACT_FORM_NAME')}
fullWidth
inputProps={{
className: classes.inputProps,
}}
/>
<TextField
className={classes.input}
value={number}
onChange={(e) => setNumber(e.target.value)}
placeholder={t('APPS_CONTACT_FORM_NUMBER')}
fullWidth
inputProps={{
className: classes.inputProps,
}}
/>
<TextField
className={classes.input}
placeholder={t('APPS_CONTACT_FORM_AVATAR')}
fullWidth
value={avatar}
onChange={(e) => setAvatar(e.target.value)}
inputProps={{
className: classes.inputProps,
}}
/>
<div style={{ display: 'block' }}>
<Button onClick={updateContact} className={classes.updateButton}>
Update
</Button>
<Button onClick={deleteContact} className={classes.deleteButton}>
Delete
</Button>
</div>
</div>
</Paper>
</Slide>
);
};
@@ -1,49 +0,0 @@
import { makeStyles } from '@material-ui/core';
const useStyles = makeStyles((theme) => ({
modalRoot: {
zIndex: 10,
position: 'absolute',
height: '100%',
width: '100%'
},
modalHide: {
display: 'none'
},
listContainer: {
marginTop: 30,
width: '75%',
margin: '0 auto',
textAlign: 'center',
},
avatar: {
margin: 'auto',
height: '125px',
width: '124px',
marginBottom: 29
},
input: {
marginBottom: 20,
margin: 'auto',
textAlign: 'center',
},
inputProps: {
fontSize: 22
},
updateButton: {
background: '#2196f3',
width: 150,
height: 45,
fontSize: 16,
marginTop: 29,
marginBottom: 29
},
deleteButton: {
background: '#d32f2f',
width: 150,
height: 40,
fontSize: 16
}
}))
export default useStyles;
@@ -1,45 +0,0 @@
import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
button: {
margin: 5,
marginTop: 20,
},
root: {
position: 'fixed',
bottom: 380,
zIndex: 2,
background: '#232323',
marginLeft: '-4em',
height: '20%',
},
clearButton: {
width: '10%',
position: 'absolute',
right: 0,
},
textInputField: {
fontSize: 20,
borderBottomColor: 'red',
},
addBtn: {
margin: 'auto',
fontSize: 16,
width: 150,
background: '#2196f3',
marginBottom: 10,
padding: 8,
},
cancelBtn: {
margin: 'auto',
width: 150,
background: '#232323',
marginBottom: 20,
padding: 8,
},
icons: {
marginRight: 5,
},
}));
export default useStyles;
@@ -1,35 +0,0 @@
import { makeStyles, Theme } from '@material-ui/core/styles';
const useStyles = makeStyles((theme: Theme) => ({
backgroundModal: {
background: 'black',
opacity: '0.6',
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
zIndex: 5,
},
absolute: {
position: 'absolute',
bottom: theme.spacing(2),
left: theme.spacing(3),
},
// title
root: {
height: '60px',
width: '100%',
display: 'flex',
flexFlow: 'row nowrap',
justifyContent: 'center',
alignItems: 'center',
background: '#424242',
},
icon: {
color: '#fff',
fontSize: 30,
},
}));
export default useStyles;
@@ -0,0 +1,184 @@
import React, { useEffect, useState } from 'react';
import { Avatar as MuiAvatar, Box, Button, Paper, TextField } from '@material-ui/core';
import { makeStyles } from '@material-ui/core/styles';
import { useTranslation } from 'react-i18next';
import { useHistory, useParams } from 'react-router-dom';
import { useContacts } from '../../hooks/useContacts';
import Nui from '../../../../os/nui-events/utils/Nui';
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
import LogDebugEvent from '../../../../os/debug/LogDebugEvents';
import { useQueryParams } from '../../../../common/hooks/useQueryParams';
import { ContactEvents } from '../../../../../../typings/contact';
interface ContactInfoRouteParams {
mode: string;
id: string;
}
interface ContactInfoRouteQuery {
addNumber?: string;
referal?: string;
}
const useStyles = makeStyles({
root: {
height: '100%',
width: '100%',
},
listContainer: {
marginTop: 30,
width: '75%',
margin: '0 auto',
textAlign: 'center',
},
avatar: {
margin: 'auto',
height: '125px',
width: '124px',
marginBottom: 29,
},
input: {
marginBottom: 20,
margin: 'auto',
textAlign: 'center',
},
inputProps: {
fontSize: 22,
},
});
const ContactsInfoPage = () => {
const classes = useStyles();
const history = useHistory();
const { getContact } = useContacts();
const { id } = useParams<ContactInfoRouteParams>();
const { addNumber, referal } = useQueryParams<ContactInfoRouteQuery>({
referal: '/contacts',
});
const contact = getContact(parseInt(id));
// Set state after checking if null
const [name, setName] = useState(contact ? contact.display : '');
const [number, setNumber] = useState(contact ? contact.number : '');
const [avatar, setAvatar] = useState(contact ? contact.avatar : '');
const { t } = useTranslation();
useEffect(() => {
if (addNumber) {
setNumber(addNumber);
}
}, [addNumber]);
const handleContactAdd = () => {
LogDebugEvent({
action: 'Handling Contact Add',
data: contact,
level: 2,
});
Nui.send(ContactEvents.ADD_CONTACT, {
display: name,
number,
avatar,
});
history.replace(referal);
};
const handleContactSave = () => {
LogDebugEvent({
action: 'Handling Contact Update',
data: contact,
level: 2,
});
Nui.send(ContactEvents.UPDATE_CONTACT, {
id: contact.id,
display: name,
number,
avatar,
});
history.goBack();
};
const handleContactDelete = () => {
LogDebugEvent({
action: 'Handling Contact Delete',
data: contact,
level: 2,
});
Nui.send(ContactEvents.DELETE_CONTACT, {
id: contact.id,
});
history.goBack();
};
return (
<Paper className={classes.root} square>
<Button style={{ margin: 10 }} onClick={() => history.goBack()}>
<ArrowBackIcon fontSize="large" />
</Button>
<div className={classes.listContainer}>
<MuiAvatar className={classes.avatar} src={avatar} />
<TextField
autoFocus
className={classes.input}
value={name}
onChange={(e) => setName(e.target.value)}
label={t('APPS_CONTACT_FORM_NAME')}
fullWidth
inputProps={{
className: classes.inputProps,
}}
/>
<TextField
className={classes.input}
value={number}
onChange={(e) => setNumber(e.target.value)}
label={t('APPS_CONTACT_FORM_NUMBER')}
fullWidth
inputProps={{
className: classes.inputProps,
}}
/>
<TextField
className={classes.input}
label={t('APPS_CONTACT_FORM_AVATAR')}
fullWidth
value={avatar}
onChange={(e) => setAvatar(e.target.value)}
inputProps={{
className: classes.inputProps,
}}
/>
{/* Display if fetched contact */}
{contact && (
<>
<Box py={1} display="block">
<Button color="primary" variant="contained" onClick={handleContactSave}>
{t('GENERIC_UPDATE')}
</Button>
</Box>
<Box py={1} display="block">
<Button variant="contained" color="secondary" onClick={handleContactDelete}>
{t('GENERIC_DELETE')}
</Button>
</Box>
</>
)}
{/* Display if no fetched contact */}
{!contact && (
<Box display="block">
<Button color="primary" variant="contained" onClick={handleContactAdd}>
{t('APPS_CONTACT_MODAL_BUTTON_ADD')}
</Button>
</Box>
)}
</div>
</Paper>
);
};
export default ContactsInfoPage;
@@ -0,0 +1,37 @@
import React from 'react';
import Fab from '@material-ui/core/Fab';
import PersonAddIcon from '@material-ui/icons/PersonAdd';
import { useHistory } from 'react-router-dom';
import { makeStyles, Theme } from '@material-ui/core/styles';
import { ContactList } from '../List/ContactList';
const useStyles = makeStyles((theme: Theme) => ({
absolute: {
position: 'absolute',
bottom: theme.spacing(2),
right: theme.spacing(2),
},
icon: {
color: '#fff',
fontSize: 30,
},
}));
export const ContactPage = () => {
const history = useHistory();
const classes = useStyles();
return (
<>
<ContactList />
<Fab
color="primary"
onClick={() => history.push('/contacts/-1')}
className={classes.absolute}
>
<PersonAddIcon />
</Fab>
</>
);
};
+27
View File
@@ -0,0 +1,27 @@
import { blue, common } from '@material-ui/core/colors';
export const CONTACTS_APP_PRIMARY_COLOR = blue[500];
export const CONTACTS_APP_TEXT_COLOR = common.white;
const theme = {
palette: {
primary: {
main: CONTACTS_APP_PRIMARY_COLOR,
dark: blue[700],
light: blue[300],
contrastText: CONTACTS_APP_TEXT_COLOR,
},
secondary: {
main: '#d32f2f',
light: '#eb4242',
dark: '#941212',
contrastText: CONTACTS_APP_TEXT_COLOR,
},
success: {
main: '#2196f3',
contrastText: CONTACTS_APP_TEXT_COLOR,
},
},
};
export default theme;
-4
View File
@@ -21,8 +21,4 @@ export const contactsState = {
key: 'contactDetail',
default: null,
}),
contactAlert: atom({
key: 'contactAlert',
default: null,
}),
};
@@ -1,8 +0,0 @@
import { useRecoilState } from 'recoil';
import { IContactAlert } from '../../../common/typings/contact';
import { contactsState } from './state';
export const useContactAlert = (): IContactAlert => {
const [alert, setAlert] = useRecoilState(contactsState.contactAlert);
return { alert, setAlert };
};
@@ -1,7 +0,0 @@
import { useRecoilState } from 'recoil';
import { contactsState } from './state';
export const useContactDetail = (): any => {
const [ contactDetail, setContactDetail ] = useRecoilState(contactsState.contactDetail);
return { contactDetail, setContactDetail };
}
Loaded 100 of 481 files, more files were not shown because too many files have changed in this diff. Show more