@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
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+
3
+ import AddData from './components/AddData';
4
+ import LoadData from './components/LoadData';
5
+ import OffChainManagement from './components/OffChainManagement';
6
+ import CrossChainManagement from './components/CrossChainManagement';
7
+
8
+ import "../../../assets/scss/data-screen.scss";
9
+ import SearchData from './components/SearchData';
10
+ import ManageData from './components/ManageData';
11
+
12
+ class DataScreen extends React.Component {
13
+
14
+ render() {
15
+ const props=this.props;
16
+ return(
17
+ <>
18
+ <AddData
19
+ show={props.data.sendData}
20
+ hide={props.toggleScreenPopup}
21
+ />
22
+
23
+ <LoadData
24
+ show={props.data.loadData}
25
+ hide={props.toggleScreenPopup}
26
+ />
27
+
28
+ <ManageData
29
+ show={props.data.manageData}
30
+ hide={props.toggleScreenPopup}
31
+ />
32
+
33
+ <OffChainManagement
34
+ show={props.data.offChainManagement}
35
+ hide={props.toggleScreenPopup}
36
+ />
37
+
38
+ <CrossChainManagement
39
+ show={props.data.crossChainManagement}
40
+ hide={props.toggleScreenPopup}
41
+ />
42
+
43
+ <SearchData
44
+ show={props.data.searchData}
45
+ hide={props.toggleScreenPopup}
46
+ />
47
+ </>
48
+ )
49
+ }
50
+ }
51
+
52
+ export default DataScreen;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class ManageEggs extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('eggs', 'manageEggs')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>Coming Soon</h2>
25
+ <p>This module is coming soon...</p>
26
+ <button onClick={() => hide('eggs', 'manageEggs')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default ManageEggs;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class SearchEggs extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('eggs', 'searchEggs')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>Coming Soon</h2>
25
+ <p>This module is coming soon...</p>
26
+ <button onClick={() => hide('eggs', 'searchEggs')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default SearchEggs;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class ViewEggs extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('eggs', 'viewEggs')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>Coming Soon</h2>
25
+ <p>This module is coming soon...</p>
26
+ <button onClick={() => hide('eggs', 'viewEggs')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default ViewEggs;
@@ -0,0 +1,31 @@
1
+ import React from 'react';
2
+ import ManageEggs from './components/ManageEggs';
3
+ import SearchEggs from './components/SearchEggs';
4
+ import ViewEggs from './components/ViewEggs';
5
+
6
+ class Eggs extends React.Component {
7
+
8
+ render() {
9
+ const props=this.props;
10
+ return(
11
+ <>
12
+ <ViewEggs
13
+ show={props.eggs.viewEggs}
14
+ hide={props.toggleScreenPopup}
15
+ />
16
+
17
+ <ManageEggs
18
+ show={props.eggs.manageEggs}
19
+ hide={props.toggleScreenPopup}
20
+ />
21
+
22
+ <SearchEggs
23
+ show={props.eggs.searchEggs}
24
+ hide={props.toggleScreenPopup}
25
+ />
26
+ </>
27
+ )
28
+ }
29
+ }
30
+
31
+ export default Eggs;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class SearchProfiles extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('game', 'searchProfiles')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>Coming Soon</h2>
25
+ <p>This module is coming soon...</p>
26
+ <button onClick={() => hide('game', 'searchProfiles')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default SearchProfiles;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class ViewAchievements extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('game', 'viewAchievements')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>Coming Soon</h2>
25
+ <p>This module is coming soon...</p>
26
+ <button onClick={() => hide('game', 'viewAchievements')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default ViewAchievements;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class ViewLeagues extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('game', 'viewLeagues')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>Coming Soon</h2>
25
+ <p>This module is coming soon...</p>
26
+ <button onClick={() => hide('game', 'viewLeagues')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default ViewLeagues;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class ViewTournaments extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('game', 'viewTournaments')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>Coming Soon</h2>
25
+ <p>This module is coming soon...</p>
26
+ <button onClick={() => hide('game', 'viewTournaments')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default ViewTournaments;
@@ -0,0 +1,38 @@
1
+ import React from 'react';
2
+
3
+ import SearchProfiles from './components/SearchProfiles';
4
+ import ViewAchievements from './components/ViewAchievements';
5
+ import ViewLeagues from './components/ViewLeagues';
6
+ import ViewTournaments from './components/ViewTournaments';
7
+
8
+ class Game extends React.Component {
9
+
10
+ render() {
11
+ const props=this.props;
12
+ return(
13
+ <>
14
+ <SearchProfiles
15
+ show={props.game.searchProfiles}
16
+ hide={props.toggleScreenPopup}
17
+ />
18
+
19
+ <ViewTournaments
20
+ show={props.game.viewTournaments}
21
+ hide={props.toggleScreenPopup}
22
+ />
23
+
24
+ <ViewLeagues
25
+ show={props.game.viewLeagues}
26
+ hide={props.toggleScreenPopup}
27
+ />
28
+
29
+ <ViewAchievements
30
+ show={props.game.viewAchievements}
31
+ hide={props.toggleScreenPopup}
32
+ />
33
+ </>
34
+ )
35
+ }
36
+ }
37
+
38
+ export default Game;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class SearchKarma extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('karma', 'searchKarma')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>UI Coming Soon</h2>
25
+ <p>You can use this functionality directly by accessing the OASIS API from the Developer menu.</p>
26
+ <button onClick={() => hide('karma', 'searchKarma')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default SearchKarma;
@@ -0,0 +1,139 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ // import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ import axios from "axios";
7
+ import { toast } from 'react-toastify';
8
+ import { AgGridReact } from 'ag-grid-react';
9
+ import API_BASE_URL from "../../../../config/api";
10
+
11
+ class ViewAvatarKarma extends React.Component {
12
+ state = {
13
+ columnDefs: [
14
+ {
15
+ field: "date",
16
+ headerName: "Date"
17
+ },
18
+ {
19
+ field: 'level',
20
+
21
+ },
22
+ {
23
+ field: "type",
24
+ headerName: "Type"
25
+ },
26
+ {
27
+ field: "karma",
28
+ headerName: "Karma",
29
+ },
30
+ {
31
+ field: "source",
32
+ headerName: "Source"
33
+ },
34
+ {
35
+ field: "title",
36
+ headerName: "Title"
37
+ },
38
+ {
39
+ field: "description",
40
+ headerName: "Description"
41
+ },
42
+ {
43
+ field: "weblink",
44
+ headerName: "Weblink"
45
+ },
46
+ ],
47
+ defaultColDef: {
48
+ flex: 1,
49
+ minWidth: 150,
50
+ filter: true,
51
+ sortable: true,
52
+ floatingFilter: true,
53
+ resizable: true,
54
+ // overflow:true
55
+ },
56
+ rowData: null,
57
+ };
58
+
59
+ onGridReady = (params) => {
60
+ this.gridApi = params.api;
61
+ this.gridColumnApi = params.columnApi;
62
+
63
+ const updateData = (data) => {
64
+ this.setState({ rowData: data });
65
+ };
66
+
67
+ fetch('https://www.ag-grid.com/example-assets/olympic-winners.json')
68
+ .then((resp) => resp.json())
69
+ .then((data) => updateData(data));
70
+ };
71
+
72
+ getApiData = () => {
73
+ this.setState({ loading: true })
74
+
75
+ axios({
76
+ method: 'get',
77
+ url: API_BASE_URL,
78
+ headers: {
79
+ 'Content-Type': 'application/json'
80
+ },
81
+ })
82
+ .then((response) => {
83
+ this.setState({loading: false})
84
+
85
+ if (response.data.result?.isError) {
86
+ toast.error(response.data.result.message);
87
+ return;
88
+ }
89
+
90
+ toast.success(response.data.result.message);
91
+ })
92
+ .catch((err) => {
93
+ toast.error('err');
94
+ this.setState({loading: false})
95
+ return { error: true, data: err };
96
+ });
97
+ }
98
+
99
+ render() {
100
+ const { show, hide } = this.props;
101
+
102
+ return (
103
+ <>
104
+ <Modal
105
+ size="xl"
106
+ centered
107
+ className="custom-modal custom-popup-component light-custom-popup"
108
+ show={show}
109
+ onHide={() => hide('karma', 'viewAvatarKarma')}
110
+ >
111
+ <Modal.Body>
112
+ <span className="form-cross-icon" onClick={() => hide('karma', 'viewAvatarKarma')}>
113
+ <i className="fa fa-times"></i>
114
+ </span>
115
+
116
+ <h1 className="single-heading">Karma</h1>
117
+
118
+ <div className="grids-container">
119
+ <div className="single-grid">
120
+ <p className="heading">Seeds Sent</p>
121
+
122
+ <div className="ag-theme-alpine custom-ag-parent">
123
+ <AgGridReact
124
+ columnDefs={this.state.columnDefs}
125
+ defaultColDef={this.state.defaultColDef}
126
+ onGridReady={this.onGridReady}
127
+ rowData={this.state.rowData}
128
+ />
129
+ </div>
130
+ </div>
131
+ </div>
132
+ </Modal.Body>
133
+ </Modal>
134
+ </>
135
+ );
136
+ }
137
+ }
138
+
139
+ export default ViewAvatarKarma;
@@ -0,0 +1,103 @@
1
+ import React from 'react';
2
+ import { Modal } from 'react-bootstrap';
3
+ // import Loader from "react-loader-spinner";
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+ import oasisApi from "oasis-api";
6
+
7
+ class ViewKarma extends React.Component {
8
+
9
+ constructor(props) {
10
+ super(props);
11
+ this.state = {
12
+ columnDefs: [
13
+ { field: 'date' },
14
+ { field: 'avatar' },
15
+ { field: 'positive/negative' },
16
+ { field: 'type' },
17
+ { field: 'karma' },
18
+ { field: 'source' },
19
+ { field: 'description' },
20
+ { field: 'weblink' },
21
+ ],
22
+ defaultColDef: {
23
+ flex: 1,
24
+ minWidth: 150,
25
+ filter: true,
26
+ sortable: true,
27
+ floatingFilter: true,
28
+ resizable: true,
29
+ },
30
+ rowData: null,
31
+ // loading: true,
32
+ // loggedIn: true,
33
+ };
34
+ }
35
+
36
+ onGridReady = async (params) => {
37
+ this.gridApi = params.api;
38
+ this.gridColumnApi = params.columnApi;
39
+ let karmaRecords = []
40
+
41
+ const avatarApi = new oasisApi.Avatar()
42
+ const karmaApi = new oasisApi.Karma()
43
+
44
+ const avatarRes = await avatarApi.getAll()
45
+ if(!avatarRes.error){
46
+ const avatars = avatarRes.data.result
47
+ for(let i=0; i<=avatars.length-1; i++){
48
+ const avatar = avatars[i]
49
+ const karmaRes = await karmaApi.getKarmaAkashicRecordsForAvatar(avatar.avatarId)
50
+ if(!karmaRes.error){
51
+ if(karmaRes.data.result){
52
+ const karmas = karmaRes.data.result
53
+ for(let j=0; j<=karmas.length-1; j++){
54
+ const karma = karmas[j]
55
+ console.log(karma)
56
+ const karmaRecord = {
57
+ date: karma.date,
58
+ avatar: avatar.username,
59
+ 'positive/negative': karma.karmaTypePositive.value,
60
+ type: karma.karmaTypePositive.name,
61
+ source: karma.karmaSource.name,
62
+ description: karma.karmaSourceDesc,
63
+ weblink: 'oasisweb4.one',
64
+ karma: karma.karma
65
+ }
66
+ karmaRecords.push(karmaRecord)
67
+ console.log(karmaRecord)
68
+ };
69
+ }
70
+ }
71
+ };
72
+ }
73
+ console.log(karmaRecords);
74
+ this.setState({rowData: karmaRecords})
75
+ }
76
+ //run this after component mounts
77
+ render() {
78
+ const { show, hide } = this.props;
79
+ return (
80
+ <>
81
+ <Modal
82
+ size="sm"
83
+ show={show}
84
+ dialogClassName=""
85
+ onHide={() => hide('karma', 'viewKarmaWeightings')}
86
+ >
87
+ <Modal.Body className="text-center coming-soon">
88
+ <img
89
+ src={InfoIcon}
90
+ alt="icon"
91
+ />
92
+ <h2>UI Coming Soon</h2>
93
+ <p>This module is coming soon...</p>
94
+ <button onClick={() => hide('karma', 'viewKarmaWeightings')}>OK</button>
95
+ </Modal.Body>
96
+ </Modal>
97
+ </>
98
+ );
99
+
100
+ }
101
+ }
102
+
103
+ export default ViewKarma;
@@ -0,0 +1,34 @@
1
+ import React from 'react';
2
+ import { Modal } from "react-bootstrap";
3
+ import '../../../../assets/scss/coming-soon.scss';
4
+ import InfoIcon from '../../../../assets/images/icon-info.svg'
5
+
6
+ class VoteKarma extends React.Component {
7
+ state = { }
8
+ render() {
9
+ const { show, hide } = this.props;
10
+
11
+ return (
12
+ <>
13
+ <Modal
14
+ size="sm"
15
+ show={show}
16
+ dialogClassName=""
17
+ onHide={() => hide('karma', 'voteKarma')}
18
+ >
19
+ <Modal.Body className="text-center coming-soon">
20
+ <img
21
+ src={InfoIcon}
22
+ alt="icon"
23
+ />
24
+ <h2>Coming Soon</h2>
25
+ <p>This module is coming soon...</p>
26
+ <button onClick={() => hide('karma', 'voteKarma')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default VoteKarma;