@oasisomniverse/react 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (139) hide show
  1. package/README.md +69 -0
  2. package/package.json +72 -0
  3. package/src/components/App.js +504 -0
  4. package/src/components/ForgetPassword.js +126 -0
  5. package/src/components/Login.js +222 -0
  6. package/src/components/ResetPassword.js +176 -0
  7. package/src/components/Signup.js +285 -0
  8. package/src/components/VerifyEmail.js +68 -0
  9. package/src/components/common/AvatarConnect.jsx +89 -0
  10. package/src/components/common/Contact.jsx +60 -0
  11. package/src/components/common/Eggs.jsx +50 -0
  12. package/src/components/common/Game.jsx +36 -0
  13. package/src/components/common/HyperDrive.jsx +50 -0
  14. package/src/components/common/KarmaToast.jsx +38 -0
  15. package/src/components/common/Map.jsx +42 -0
  16. package/src/components/common/MenuMessage.jsx +70 -0
  17. package/src/components/common/Messaging.jsx +74 -0
  18. package/src/components/common/Mission.jsx +40 -0
  19. package/src/components/common/NFT.jsx +42 -0
  20. package/src/components/common/NavBar.jsx +52 -0
  21. package/src/components/common/Navbar.js +137 -0
  22. package/src/components/common/OApp.jsx +41 -0
  23. package/src/components/common/ONET.jsx +50 -0
  24. package/src/components/common/ONODE.jsx +49 -0
  25. package/src/components/common/OasisModal.css +9 -0
  26. package/src/components/common/OasisModal.jsx +29 -0
  27. package/src/components/common/ProviderDropdown.js +25 -0
  28. package/src/components/common/ProviderDropdown.jsx +61 -0
  29. package/src/components/common/Providers.jsx +38 -0
  30. package/src/components/common/Quest.jsx +40 -0
  31. package/src/components/common/SearchAvatars.jsx +49 -0
  32. package/src/components/common/Seeds.jsx +39 -0
  33. package/src/components/common/Settings.jsx +70 -0
  34. package/src/components/common/StarField.jsx +56 -0
  35. package/src/components/common/Wallet.jsx +45 -0
  36. package/src/components/common/message/MessageContacts.jsx +66 -0
  37. package/src/components/common/message/Messages.jsx +75 -0
  38. package/src/components/common/sidebar/Sidebar.jsx +27 -0
  39. package/src/components/common/sidebar/SidebarData.js +615 -0
  40. package/src/components/common/sidebar/SidebarMenuItem.jsx +79 -0
  41. package/src/components/index.js +26 -0
  42. package/src/components/pages/forgotPassword.js +47 -0
  43. package/src/components/popups/avatar/components/AvatarWallet.jsx +169 -0
  44. package/src/components/popups/avatar/components/EditAvatar.jsx +34 -0
  45. package/src/components/popups/avatar/components/SearchAvatar.jsx +34 -0
  46. package/src/components/popups/avatar/components/ViewAvatar.jsx +148 -0
  47. package/src/components/popups/avatar/index.jsx +39 -0
  48. package/src/components/popups/comingsoon/ComingSoon.jsx +28 -0
  49. package/src/components/popups/confirmation/Confirmation.js +30 -0
  50. package/src/components/popups/contact/index.js +100 -0
  51. package/src/components/popups/data-screen/components/AddData.jsx +89 -0
  52. package/src/components/popups/data-screen/components/CrossChainManagement.jsx +87 -0
  53. package/src/components/popups/data-screen/components/LoadData.jsx +157 -0
  54. package/src/components/popups/data-screen/components/ManageData.jsx +34 -0
  55. package/src/components/popups/data-screen/components/OffChainManagement.jsx +177 -0
  56. package/src/components/popups/data-screen/components/SearchData.jsx +34 -0
  57. package/src/components/popups/data-screen/index.jsx +52 -0
  58. package/src/components/popups/eggs/components/ManageEggs.jsx +34 -0
  59. package/src/components/popups/eggs/components/SearchEggs.jsx +34 -0
  60. package/src/components/popups/eggs/components/ViewEggs.jsx +34 -0
  61. package/src/components/popups/eggs/index.jsx +31 -0
  62. package/src/components/popups/game/components/SearchProfiles.jsx +34 -0
  63. package/src/components/popups/game/components/ViewAchievements.jsx +34 -0
  64. package/src/components/popups/game/components/ViewLeagues.jsx +34 -0
  65. package/src/components/popups/game/components/ViewTournaments.jsx +34 -0
  66. package/src/components/popups/game/index.jsx +38 -0
  67. package/src/components/popups/karma/components/SearchKarma.jsx +34 -0
  68. package/src/components/popups/karma/components/ViewAvatarKarma.jsx +139 -0
  69. package/src/components/popups/karma/components/ViewKarma.jsx +103 -0
  70. package/src/components/popups/karma/components/VoteKarma.jsx +34 -0
  71. package/src/components/popups/karma/index.jsx +34 -0
  72. package/src/components/popups/map/components/Add2dObjectMap.jsx +34 -0
  73. package/src/components/popups/map/components/Add3dObjectMap.jsx +34 -0
  74. package/src/components/popups/map/components/AddQuestToMap.jsx +34 -0
  75. package/src/components/popups/map/components/DownloadOurWorld.jsx +34 -0
  76. package/src/components/popups/map/components/ManageMap.jsx +34 -0
  77. package/src/components/popups/map/components/PlotRouteOnMap.jsx +34 -0
  78. package/src/components/popups/map/components/SearchMap.jsx +34 -0
  79. package/src/components/popups/map/components/ViewGlobal3dMap.jsx +34 -0
  80. package/src/components/popups/map/components/ViewHalonsOnMap.jsx +34 -0
  81. package/src/components/popups/map/components/ViewOappOnMap.jsx +34 -0
  82. package/src/components/popups/map/components/ViewQuestOnMap.jsx +34 -0
  83. package/src/components/popups/map/index.jsx +79 -0
  84. package/src/components/popups/messages/Message.jsx +86 -0
  85. package/src/components/popups/mission/components/ManageMission.jsx +34 -0
  86. package/src/components/popups/mission/components/SearchMission.jsx +34 -0
  87. package/src/components/popups/mission/components/ViewMission.jsx +34 -0
  88. package/src/components/popups/mission/index.jsx +32 -0
  89. package/src/components/popups/nft/ContactPopup.jsx +146 -0
  90. package/src/components/popups/nft/Solana.jsx +70 -0
  91. package/src/components/popups/nft/components/ManageOasisNft.jsx +34 -0
  92. package/src/components/popups/nft/components/PurchaseOasisNft.jsx +34 -0
  93. package/src/components/popups/nft/components/PurchaseOasisVirtualLandNft.jsx +34 -0
  94. package/src/components/popups/nft/components/SearchOasisNft.jsx +34 -0
  95. package/src/components/popups/nft/components/ViewOasisNft.jsx +34 -0
  96. package/src/components/popups/nft/index.jsx +45 -0
  97. package/src/components/popups/oapp/components/CreateOAPP.jsx +34 -0
  98. package/src/components/popups/oapp/components/DeployOAPP.jsx +34 -0
  99. package/src/components/popups/oapp/components/DownloadOurWorld.jsx +34 -0
  100. package/src/components/popups/oapp/components/EditOAPP.jsx +34 -0
  101. package/src/components/popups/oapp/components/InstallOAPP.jsx +34 -0
  102. package/src/components/popups/oapp/components/LaunchOAPP.jsx +34 -0
  103. package/src/components/popups/oapp/components/ManageOAPP.jsx +68 -0
  104. package/src/components/popups/oapp/components/SearchOAPP.jsx +34 -0
  105. package/src/components/popups/oapp/index.jsx +62 -0
  106. package/src/components/popups/provider/components/ActivityPub.jsx +34 -0
  107. package/src/components/popups/provider/components/CompareProviderSpeeds.jsx +123 -0
  108. package/src/components/popups/provider/components/Eosio.jsx +34 -0
  109. package/src/components/popups/provider/components/Ethereum.jsx +34 -0
  110. package/src/components/popups/provider/components/Holochain.jsx +34 -0
  111. package/src/components/popups/provider/components/Ipfs.jsx +35 -0
  112. package/src/components/popups/provider/components/ManageAutoFailOver.jsx +34 -0
  113. package/src/components/popups/provider/components/ManageAutoReplicaton.jsx +34 -0
  114. package/src/components/popups/provider/components/ManageLoadBalancing.jsx +34 -0
  115. package/src/components/popups/provider/components/ManageProviders.jsx +34 -0
  116. package/src/components/popups/provider/components/MongoDb.jsx +34 -0
  117. package/src/components/popups/provider/components/Neo4j.jsx +34 -0
  118. package/src/components/popups/provider/components/SearchProviders.jsx +122 -0
  119. package/src/components/popups/provider/components/Seeds.jsx +34 -0
  120. package/src/components/popups/provider/components/Solid.jsx +34 -0
  121. package/src/components/popups/provider/components/SqlLite.jsx +34 -0
  122. package/src/components/popups/provider/components/ThreeFold.jsx +34 -0
  123. package/src/components/popups/provider/components/ViewProviderStats.jsx +123 -0
  124. package/src/components/popups/provider/components/ViewProviders.jsx +121 -0
  125. package/src/components/popups/provider/index.jsx +113 -0
  126. package/src/components/popups/quest/components/ManageQuest.jsx +34 -0
  127. package/src/components/popups/quest/components/SearchQuest.jsx +34 -0
  128. package/src/components/popups/quest/components/ViewQuest.jsx +34 -0
  129. package/src/components/popups/quest/index.jsx +32 -0
  130. package/src/components/popups/seeds/components/AcceptInvite.jsx +61 -0
  131. package/src/components/popups/seeds/components/DonateSeeds.jsx +178 -0
  132. package/src/components/popups/seeds/components/ManageSeeds.jsx +34 -0
  133. package/src/components/popups/seeds/components/PayWithSeeds.jsx +233 -0
  134. package/src/components/popups/seeds/components/RewardSeeds.jsx +178 -0
  135. package/src/components/popups/seeds/components/SearchSeeds.jsx +91 -0
  136. package/src/components/popups/seeds/components/SendInvite.jsx +178 -0
  137. package/src/components/popups/seeds/components/ViewOrganizations.jsx +178 -0
  138. package/src/components/popups/seeds/components/ViewSeeds.jsx +221 -0
  139. package/src/components/popups/seeds/index.jsx +70 -0
package/README.md ADDED
@@ -0,0 +1,69 @@
1
+ # WEB4 OASIS API React Component Library
2
+
3
+ This is the WEB4 OASIS React UI Components Library that can be used to pick n mix into other React sites who wish to integrate into the WEB4 OASIS API. It is also the main OASIS Portal site and example site of how to build a UI on the WEB4 OASIS API.
4
+
5
+ This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
6
+
7
+ ## Documentation
8
+
9
+ - [React Style Guide](Docs/react_style_guide.md) - Coding standards and CSS naming conventions for contributing components
10
+ - [React Install Guide](Docs/react_style_guide_install.md) - Step-by-step installation and setup instructions
11
+ - [Contributing Guide](Docs/smart_commits.md) - How to contribute using smart commits
12
+
13
+ ## Project Structure
14
+ ```
15
+ ├── react-app
16
+ │ ├── public
17
+ │ │ └── index.html
18
+ │ ├── src
19
+ | | ├── assets
20
+ | | | ├── images
21
+ | | | ├── scss
22
+ | | ├── components
23
+ | | | ├── common
24
+ | | | | ├── sidebar
25
+ | | | ├── popups
26
+ │ │ └── index.js
27
+ ```
28
+
29
+ All of the files are stored in react-app folder.
30
+
31
+ - `index.html` is the main html file
32
+ - `assets` folder contains all assets files for each component like images and css/scss files.
33
+ - `components` folder contains different components used in the app.
34
+ - `components/common` folder contains different components tha are common like sidebar, navbar etc.
35
+ - `components/popups` folder contains different popup components.
36
+ - `index.js` is the main javaScript file needed for the react-app.
37
+
38
+ ## CSS Syntax rules
39
+ Please follow these rules so that the other CSS classes does not gets messed up.
40
+
41
+ For example if you create a component called `Login.js` It's outer most tag element should have a class of `login` and the child elements of login should have a class name started with `login-`
42
+
43
+ The CSS file should be named `Login.css` and should be stored under the `CSS` folder.
44
+
45
+ ## How to run the app
46
+
47
+ First make sure you are in the react-app folder. Then run this command
48
+
49
+ ```
50
+ npm i
51
+ ```
52
+ This will install all the third-part components used in the project
53
+
54
+ After this run the following command to open the project in dev mode
55
+ ```
56
+ npm start
57
+ ```
58
+
59
+ ## API Configuration
60
+
61
+ The app uses a single shared API base URL defined in `src/config/api.js`.
62
+
63
+ By default it points to `https://api.oasisweb4.one/api`, but you can override it by setting:
64
+
65
+ ```bash
66
+ REACT_APP_API_URL=https://your-api-host/api
67
+ ```
68
+
69
+ This lets you switch environments without changing every request in the codebase.
package/package.json ADDED
@@ -0,0 +1,72 @@
1
+ {
2
+ "name": "@oasisomniverse/react",
3
+ "version": "1.0.0",
4
+ "description": "OASIS Omniverse React UI components",
5
+ "keywords": ["oasis", "omniverse", "react", "components"],
6
+ "author": "NextGenSoftware",
7
+ "license": "MIT",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/NextGenSoftwareUK/OASIS-React-UI-Component-Library.git"
11
+ },
12
+ "main": "src/components/index.js",
13
+ "module": "src/components/index.js",
14
+ "exports": {
15
+ ".": "./src/components/index.js",
16
+ "./components/*": "./src/components/*.jsx"
17
+ },
18
+ "files": ["src/components"],
19
+ "dependencies": {
20
+ "@devexpress/dx-react-core": "^2.7.6",
21
+ "@material-ui/core": "^4.12.3",
22
+ "@material-ui/icons": "^4.11.2",
23
+ "@testing-library/jest-dom": "^5.14.1",
24
+ "@testing-library/react": "^11.2.7",
25
+ "@testing-library/user-event": "^12.8.3",
26
+ "ag-grid-community": "^26.0.0",
27
+ "ag-grid-react": "^26.0.0",
28
+ "axios": "^0.21.1",
29
+ "bootstrap": "^4.6.0",
30
+ "font-awesome": "^4.7.0",
31
+ "formik": "^2.2.9",
32
+ "oasis-api": "^0.0.3",
33
+ "react": "^19.2.7",
34
+ "react-bootstrap": "^1.6.3",
35
+ "react-dom": "^19.2.7",
36
+ "react-dual-listbox": "^2.2.0",
37
+ "react-loader-spinner": "^4.0.0",
38
+ "react-router-dom": "^5.2.1",
39
+ "react-slide-toggle": "^0.3.5",
40
+ "react-toastify": "^8.0.3",
41
+ "web-vitals": "^1.1.2",
42
+ "yup": "^0.32.9"
43
+ },
44
+ "scripts": {
45
+ "start": "vite",
46
+ "build": "vite build",
47
+ "preview": "vite preview"
48
+ },
49
+ "engines": {
50
+ "node": "22.x"
51
+ },
52
+ "browserslist": {
53
+ "production": [
54
+ ">0.2%",
55
+ "not dead",
56
+ "not op_mini all"
57
+ ],
58
+ "development": [
59
+ "last 1 chrome version",
60
+ "last 1 firefox version",
61
+ "last 1 safari version"
62
+ ]
63
+ },
64
+ "devDependencies": {
65
+ "@vitejs/plugin-react": "^4.3.4",
66
+ "sass": "^1.100.0",
67
+ "vite": "^6.3.5"
68
+ },
69
+ "publishConfig": {
70
+ "access": "public"
71
+ }
72
+ }
@@ -0,0 +1,504 @@
1
+ import React from "react";
2
+
3
+ import Navbar from "./common/Navbar";
4
+ import Sidebar from "./common/sidebar/Sidebar";
5
+ import Login from "./Login";
6
+ import Signup from "./Signup";
7
+ import Solana from "./popups/nft/Solana";
8
+ // import ContactPopup from "./popups/nft/ContactPopup";
9
+ import ContactPopup from "./popups/contact/index";
10
+ import Karma from "./popups/karma";
11
+
12
+ import "../assets/scss/general.scss";
13
+ import "../assets/scss/style.scss";
14
+
15
+ // import axios from "axios";
16
+ import "react-toastify/dist/ReactToastify.css";
17
+ import { ToastContainer, toast } from "react-toastify";
18
+ import Avatar from "./popups/avatar";
19
+ import DataScreen from "./popups/data-screen";
20
+ import Seeds from "./popups/seeds";
21
+
22
+ // import { BrowserRouter as Router, HashRouter, Switch, Route } from 'react-router-dom';
23
+ import { HashRouter, Switch, Route } from "react-router-dom";
24
+
25
+ import VerifyEmail from "./VerifyEmail";
26
+ import Game from "./popups/game";
27
+ import Eggs from "./popups/eggs";
28
+ import Mission from "./popups/mission";
29
+ import Quest from "./popups/quest";
30
+ import OAPP from "./popups/oapp";
31
+ import Map from "./popups/map";
32
+ import Provider from "./popups/provider";
33
+ import Nft from "./popups/nft";
34
+ // import ForgotPassword from "./pages/forgotPassword";
35
+ import ResetPassword from "./ResetPassword";
36
+ import SidebarData from "./common/sidebar/SidebarData";
37
+ import Confirmation from "./popups/confirmation/Confirmation.js";
38
+
39
+ class App extends React.Component {
40
+ state = {
41
+ showSidebar: false,
42
+ showLogin: false,
43
+ showSignup: false,
44
+ showConfirm: false,
45
+ showForgetPassword: false,
46
+ user: null,
47
+ loggedIn: false,
48
+ sidebarMenuOption: [
49
+ {
50
+ data: {
51
+ loadData: false,
52
+ sendData: false,
53
+ manageData: false,
54
+ offChainManagement: false,
55
+ crossChainManagement: false,
56
+ searchData: false,
57
+ },
58
+ },
59
+ {
60
+ nft: {
61
+ solana: false,
62
+ contactPopup: false,
63
+ },
64
+ },
65
+ {
66
+ seeds: {
67
+ payWithSeeds: false,
68
+ donateSeeds: false,
69
+ rewardSeeds: false,
70
+ sendInvite: false,
71
+ viewSeeds: false,
72
+ viewOrganizations: false,
73
+ manageSeeds: false,
74
+ searchSeeds: false,
75
+ },
76
+ },
77
+ {
78
+ avatar: {
79
+ viewAvatar: false,
80
+ editAvatar: false,
81
+ searchAvatar: false,
82
+ avatarWallet: false,
83
+ },
84
+ },
85
+ {
86
+ karma: {
87
+ viewKarmaWeightings: false,
88
+ voteKarma: false,
89
+ viewAvatarKarma: false,
90
+ searchKarma: false
91
+ },
92
+ },
93
+ {
94
+ game: {
95
+ viewLeagues: false,
96
+ viewTournaments: false,
97
+ viewAchievements: false,
98
+ searchProfiles: false
99
+ },
100
+ },
101
+ {
102
+ eggs: {
103
+ viewEggs: false,
104
+ manageEggs: false,
105
+ searchEggs: false
106
+ },
107
+ },
108
+ {
109
+ mission: {
110
+ viewMission: false,
111
+ manageMission: false,
112
+ searchMission: false
113
+ },
114
+ },
115
+ {
116
+ quest: {
117
+ viewQuest: false,
118
+ manageQuest: false,
119
+ searchQuest: false
120
+ },
121
+ },
122
+ {
123
+ oapp: {
124
+ installOAPP: false,
125
+ manageOAPP: false,
126
+ createOAPP: false,
127
+ deployOAPP: false,
128
+ editOAPP: false,
129
+ launchOAPP: false,
130
+ searchOAPP: false,
131
+ downloadOurWorld: false,
132
+ }
133
+ },
134
+ {
135
+ map: {
136
+ viewGlobal3dMap: false,
137
+ manageMap: false,
138
+ addQuestToMap: false,
139
+ add2dObjectMap: false,
140
+ add3dObjectMap: false,
141
+ plotRouteOnMap: false,
142
+ viewOappOnMap: false,
143
+ viewHalonsOnMap: false,
144
+ viewQuestOnMap: false,
145
+ searchMap: false,
146
+ downloadOurWorld: false,
147
+ }
148
+ },
149
+ {
150
+ providers: {
151
+ viewProviders: false,
152
+ manageProviders: false,
153
+ manageAutoReplicaton: false,
154
+ manageAutoFailOver: false,
155
+ manageLoadBalancing: false,
156
+ viewProviderStats: false,
157
+ compareProviderSpeeds: false,
158
+ searchProviders: false,
159
+ holochain: false,
160
+ seeds: false,
161
+ eosio: false,
162
+ ethereum: false,
163
+ ipfs: false,
164
+ threeFold: false,
165
+ solid: false,
166
+ activityPub: false,
167
+ mongoDb: false,
168
+ sqlLite: false,
169
+ neo4j: false,
170
+ solana: false
171
+ }
172
+ },
173
+ {
174
+ nft: {
175
+ manageOasisNft: false,
176
+ purchaseOasisNft: false,
177
+ purchaseOasisVirtualLandNft: false,
178
+ searchOasisNft: false,
179
+ viewOasisNft: false
180
+ },
181
+ },
182
+ {
183
+ comingSoon: false,
184
+ },
185
+ ],
186
+ contact: {
187
+ contactPopup: false
188
+ },
189
+ shortName: ''
190
+ };
191
+
192
+ componentDidMount() {
193
+ const jwtToken = localStorage.getItem("jwtToken");
194
+ const refreshToken = localStorage.getItem("refreshToken");
195
+
196
+ let loggedIn = (jwtToken && refreshToken) ? true : false;
197
+ this.setState({ loggedIn: loggedIn });
198
+
199
+ if(loggedIn) {
200
+ let user = {
201
+ email: localStorage.getItem("email"),
202
+ name: localStorage.getItem("name")
203
+ }
204
+
205
+ this.setState({
206
+ user: user
207
+ })
208
+ }
209
+ }
210
+
211
+ setUserData = (data) => {
212
+ localStorage.setItem("name", data.fullName)
213
+ localStorage.setItem("jwtToken", data.jwtToken)
214
+ localStorage.setItem("refreshToken", data.refreshToken)
215
+ localStorage.setItem("email", data.email)
216
+
217
+ let user = {
218
+ email: data.email,
219
+ name: data.fullName
220
+ }
221
+
222
+ this.setState({
223
+ user: user,
224
+ loggedIn: true
225
+ })
226
+
227
+ const name = localStorage.getItem("name");
228
+
229
+ if(name) {
230
+ const words = name.split(' ');
231
+ const fl = words.map(word => word.charAt(0).toUpperCase());
232
+ this.setState({
233
+ shortName: fl.join('')
234
+ })
235
+ }
236
+ };
237
+
238
+ toggleSidebar = () => {
239
+ this.setState({
240
+ showSidebar: !this.state.showSidebar,
241
+ });
242
+ };
243
+
244
+ hidePopups = () => {
245
+ this.setState({
246
+ showLogin: false,
247
+ showSignup: false,
248
+ showForgetPassword: false
249
+ });
250
+ };
251
+
252
+ hideLogin = () => {
253
+ this.setState({
254
+ showLogin: false,
255
+ });
256
+ };
257
+
258
+ hideSignup = () => {
259
+ this.setState({
260
+ showSignup: false,
261
+ });
262
+ };
263
+
264
+ showLogin = () => {
265
+ this.setState({
266
+ showLogin: true,
267
+ showSignup: false,
268
+ showForgetPassword: false
269
+ });
270
+ };
271
+
272
+ showSignup = () => {
273
+ this.setState({
274
+ showSignup: true,
275
+ showLogin: false,
276
+ showForgetPassword: false
277
+ });
278
+ };
279
+
280
+ showConfirmation = () => {
281
+ this.setState({
282
+ showConfirm: true
283
+ })
284
+ }
285
+
286
+ hideConfirmation = () => {
287
+ this.setState({
288
+ showConfirm: false
289
+ })
290
+ }
291
+
292
+ showContactPopup = () => {
293
+ this.setState({
294
+ contact: {
295
+ contactPopup: true
296
+ }
297
+ })
298
+ }
299
+
300
+ hideContactPopup = () => {
301
+ this.setState({
302
+ contact: {
303
+ contactPopup: false
304
+ }
305
+ })
306
+ }
307
+
308
+ handleLogout = () => {
309
+ const token = localStorage.getItem("jwtToken");
310
+ const refreshToken = localStorage.getItem("refreshToken");
311
+
312
+ console.log(token)
313
+ console.log(refreshToken)
314
+ // axios
315
+ // .post("shared API base URL + /avatar/revoke-token", {token: refreshToken}, {
316
+ // headers: {
317
+ // Authorization: `Bearer ${token}`,
318
+ // }
319
+ // })
320
+ // .then((res) => {
321
+ // this.setState({ user: null });
322
+ // localStorage.removeItem("user");
323
+ // localStorage.removeItem("credentials");
324
+
325
+ // localStorage.clear();
326
+ // })
327
+ // .catch((err) => {
328
+ // this.setState({ user: null });
329
+ // localStorage.removeItem("user");
330
+ // localStorage.removeItem("credentials");
331
+ // localStorage.clear();
332
+ // });
333
+ localStorage.clear();
334
+ this.setState({
335
+ loggedIn: false,
336
+ showConfirm: false
337
+ })
338
+ };
339
+
340
+ toggleScreenPopup = (menuName, popupName) => {
341
+ let jwtToken = localStorage.getItem("jwtToken");
342
+ let refreshToken = localStorage.getItem("refreshToken");
343
+
344
+ let sidebarMenuOption = [...this.state.sidebarMenuOption];
345
+
346
+ SidebarData.map((item) => {
347
+ if(item.name === menuName) {
348
+ item.subMenu.map((subItem) => {
349
+ if(subItem.popupName === popupName) {
350
+ sidebarMenuOption.map((option) => {
351
+ if(option[menuName]) {
352
+ if(subItem.loginRequired) {
353
+ if(jwtToken && refreshToken) {
354
+ option[menuName][popupName] = !option[menuName][popupName];
355
+ } else {
356
+ toast.error("You are not currently beamed in, please Beam In first.")
357
+ }
358
+ } else {
359
+ option[menuName][popupName] = !option[menuName][popupName];
360
+ }
361
+ }
362
+ })
363
+ }
364
+ })
365
+ }
366
+ })
367
+
368
+ this.setState({
369
+ sidebarMenuOption
370
+ })
371
+ };
372
+
373
+ render() {
374
+ return (
375
+ <HashRouter hashType="slash">
376
+ <Switch>
377
+ <Route path="/avatar/verify-email" component={VerifyEmail} />
378
+ <Route path="/avatar/reset-password" component={ResetPassword} />
379
+ </Switch>
380
+
381
+ <ToastContainer position="top-center" />
382
+
383
+ <div className="main-container">
384
+ <header>
385
+ <Navbar
386
+ showSidebar={this.state.showSidebar}
387
+ toggleSidebar={this.toggleSidebar}
388
+ showLogin={this.showLogin}
389
+ showSignup={this.showSignup}
390
+ handleLogout={this.handleLogout}
391
+ loggedIn={this.state.loggedIn}
392
+ user={this.state.user}
393
+ shortName={this.state.shortName}
394
+ showConfirm={this.showConfirmation}
395
+ showContactPopup={this.showContactPopup}
396
+ />
397
+
398
+ <Sidebar
399
+ showSidebar={this.state.showSidebar}
400
+ toggleSidebar={this.toggleSidebar}
401
+ toggleScreenPopup={this.toggleScreenPopup}
402
+ />
403
+ </header>
404
+
405
+ <Confirmation
406
+ className="custom-form"
407
+ show={this.state.showConfirm}
408
+ hide={this.hideConfirmation}
409
+ logout={this.handleLogout}
410
+ />
411
+
412
+ <Login
413
+ className="custom-form"
414
+ show={this.state.showLogin}
415
+ hide={this.hideLogin}
416
+ change={this.showSignup}
417
+ setUserStateData={this.setUserData}
418
+ />
419
+
420
+ <Signup
421
+ className="custom-form"
422
+ show={this.state.showSignup}
423
+ hide={this.hideSignup}
424
+ change={this.showLogin}
425
+ showLogin={this.showLogin}
426
+ />
427
+
428
+ <DataScreen
429
+ data={this.state.sidebarMenuOption[0].data}
430
+ toggleScreenPopup={this.toggleScreenPopup}
431
+ />
432
+
433
+ <Solana
434
+ show={this.state.sidebarMenuOption[1].nft.solana}
435
+ hide={this.toggleScreenPopup}
436
+ />
437
+
438
+ <Seeds
439
+ seeds={this.state.sidebarMenuOption[2].seeds}
440
+ toggleScreenPopup={this.toggleScreenPopup}
441
+ />
442
+
443
+ <Avatar
444
+ avatar={this.state.sidebarMenuOption[3].avatar}
445
+ toggleScreenPopup={this.toggleScreenPopup}
446
+ />
447
+
448
+ <Karma
449
+ karma={this.state.sidebarMenuOption[4].karma}
450
+ toggleScreenPopup={this.toggleScreenPopup}
451
+ />
452
+
453
+ <Game
454
+ game={this.state.sidebarMenuOption[5].game}
455
+ toggleScreenPopup={this.toggleScreenPopup}
456
+ />
457
+
458
+ <Eggs
459
+ eggs={this.state.sidebarMenuOption[6].eggs}
460
+ toggleScreenPopup={this.toggleScreenPopup}
461
+ />
462
+
463
+ <Mission
464
+ mission={this.state.sidebarMenuOption[7].mission}
465
+ toggleScreenPopup={this.toggleScreenPopup}
466
+ />
467
+
468
+ <Quest
469
+ quest={this.state.sidebarMenuOption[8].quest}
470
+ toggleScreenPopup={this.toggleScreenPopup}
471
+ />
472
+
473
+ <OAPP
474
+ oapp={this.state.sidebarMenuOption[9].oapp}
475
+ toggleScreenPopup={this.toggleScreenPopup}
476
+ />
477
+
478
+ <Map
479
+ map={this.state.sidebarMenuOption[10].map}
480
+ toggleScreenPopup={this.toggleScreenPopup}
481
+ />
482
+
483
+ <Provider
484
+ providers={this.state.sidebarMenuOption[11].providers}
485
+ toggleScreenPopup={this.toggleScreenPopup}
486
+ />
487
+
488
+ <Nft
489
+ nft={this.state.sidebarMenuOption[12].nft}
490
+ toggleScreenPopup={this.toggleScreenPopup}
491
+ />
492
+
493
+ <ContactPopup
494
+ show={this.state.contact.contactPopup}
495
+ showPopup={this.showContactPopup}
496
+ hide={this.hideContactPopup}
497
+ />
498
+ </div>
499
+ </HashRouter>
500
+ );
501
+ }
502
+ }
503
+
504
+ export default App;