@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,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 ManageQuest 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('quest', 'manageQuest')}
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('quest', 'manageQuest')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default ManageQuest;
@@ -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 SearchQuest 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('quest', 'searchQuest')}
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('quest', 'searchQuest')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default SearchQuest;
@@ -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 ViewQuest 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('quest', 'viewQuest')}
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('quest', 'viewQuest')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default ViewQuest;
@@ -0,0 +1,32 @@
1
+ import React from 'react';
2
+
3
+ import ManageQuest from './components/ManageQuest';
4
+ import SearchQuest from './components/SearchQuest';
5
+ import ViewQuest from './components/ViewQuest';
6
+
7
+ class Quest extends React.Component {
8
+
9
+ render() {
10
+ const props=this.props;
11
+ return(
12
+ <>
13
+ <ViewQuest
14
+ show={props.quest.viewQuest}
15
+ hide={props.toggleScreenPopup}
16
+ />
17
+
18
+ <ManageQuest
19
+ show={props.quest.manageQuest}
20
+ hide={props.toggleScreenPopup}
21
+ />
22
+
23
+ <SearchQuest
24
+ show={props.quest.searchQuest}
25
+ hide={props.toggleScreenPopup}
26
+ />
27
+ </>
28
+ )
29
+ }
30
+ }
31
+
32
+ export default Quest;
@@ -0,0 +1,61 @@
1
+ import React from 'react';
2
+
3
+ import { Modal } from 'react-bootstrap';
4
+
5
+ class AcceptInvite extends React.Component {
6
+ render() {
7
+ const { show, hide } = this.props;
8
+
9
+ return (
10
+ <>
11
+ <Modal
12
+ centered
13
+ className="custom-modal custom-popup-component"
14
+ show={show}
15
+ onHide={() => hide('seeds', 'acceptInvite')}
16
+ >
17
+ <Modal.Body>
18
+ <span className="form-cross-icon" onClick={() => hide('seeds', 'acceptInvite')}>
19
+ <i className="fa fa-times"></i>
20
+ </span>
21
+
22
+ <div className="popup-container default-popup">
23
+ <div className="seed-container paywith-seeds">
24
+ <h1 className="single-heading">
25
+ Accept Invite to Join Seeds
26
+ </h1>
27
+ <div className="form-container">
28
+ <form>
29
+ <p className="single-form-row">
30
+ <label className="radio-btn">
31
+ <input type="radio" id="html" name="fav_language" value="HTML" />
32
+ Avatar
33
+ <input type="radio" id="html" name="fav_language" value="HTML" />
34
+ Seed Username
35
+ </label>
36
+ <input type="text" placeholder="username" />
37
+ </p>
38
+
39
+ <p className="single-form-row mb-30">
40
+ <label>Invite Secret</label>
41
+ <input type="text" />
42
+ </p>
43
+
44
+ <p className="single-form-row btn-right">
45
+ <button
46
+ className=" btn-width sm-button"
47
+ type="submit"
48
+ >Accept Invitation</button>
49
+ </p>
50
+ </form>
51
+ </div>
52
+ </div>
53
+ </div>
54
+ </Modal.Body>
55
+ </Modal>
56
+ </>
57
+ );
58
+ }
59
+ }
60
+
61
+ export default AcceptInvite;
@@ -0,0 +1,178 @@
1
+ import React from 'react';
2
+
3
+ import { Modal } from 'react-bootstrap';
4
+ import axios from "axios";
5
+ import { toast } from "react-toastify";
6
+ import API_BASE_URL from "../../../../config/api";
7
+
8
+ class DonateSeeds extends React.Component {
9
+ constructor(){
10
+ super()
11
+ this.state = {
12
+ // avatar: {
13
+ // selected: false,
14
+ // avatar: ''
15
+ // },
16
+ // username: {
17
+ // selected: false,
18
+ // username: '',
19
+ // amount: '',
20
+ // note: ''
21
+ // },
22
+ group: '',
23
+ avatar: '',
24
+ seedUser: '',
25
+ amount: '',
26
+ note: ''
27
+ }
28
+ }
29
+
30
+ handleChange = (e) => {
31
+ console.log(e.target.value)
32
+
33
+ if(e.target.value === "avatar_section" || e.target.value === "username_section") {
34
+ this.setState({
35
+ group: e.target.value
36
+ })
37
+ } else {
38
+ this.setState({[e.target.name]: e.target.value})
39
+ }
40
+ }
41
+
42
+ handleSubmit=(e) => {
43
+ e.preventDefault()
44
+ }
45
+
46
+ getApiData = () => {
47
+ this.setState({ loading: true })
48
+
49
+ axios({
50
+ method: 'post',
51
+ url: API_BASE_URL,
52
+ headers: {
53
+ 'Content-Type': 'application/json'
54
+ },
55
+ })
56
+ .then((response) => {
57
+ this.setState({loading: false})
58
+
59
+ if (response.data.result?.isError) {
60
+ toast.error(response.data.result.message);
61
+ return;
62
+ }
63
+
64
+ toast.success(response.data.result.message);
65
+ })
66
+ .catch((err) => {
67
+ toast.error('err');
68
+ this.setState({loading: false})
69
+ return { error: true, data: err };
70
+ });
71
+ }
72
+
73
+ render() {
74
+ const { show, hide } = this.props;
75
+
76
+ return (
77
+ <>
78
+ <Modal
79
+ centered
80
+ className="custom-modal custom-popup-component"
81
+ show={show}
82
+ onHide={() => hide('seeds', 'donateSeeds')}
83
+ >
84
+ <Modal.Body>
85
+ <span className="form-cross-icon" onClick={() => hide('seeds', 'donateSeeds')}>
86
+ <i className="fa fa-times"></i>
87
+ </span>
88
+
89
+ <div className="popup-container default-popup">
90
+ <div className="seed-container paywith-seeds">
91
+ <h1 className="single-heading">
92
+ Pay with Seeds
93
+ </h1>
94
+ <div className="form-container">
95
+ <form onSubmit={this.handleSubmit}>
96
+ <p className="single-form-row">
97
+ <label className="single-radio-btn">
98
+ <input
99
+ type="radio"
100
+ value="avatar_section"
101
+ checked={this.state.group === "avatar_section"}
102
+ onChange={this.handleChange}
103
+ />
104
+ Avatar
105
+ </label>
106
+ <input
107
+ type="text"
108
+ placeholder="username"
109
+ name="avatar"
110
+ value={this.state.avatar}
111
+ onChange={this.handleChange}
112
+ disabled={this.state.group === "username_section"}
113
+ />
114
+ </p>
115
+
116
+ <h3>OR</h3>
117
+
118
+ <p className="single-form-row">
119
+ <label className="single-radio-btn">
120
+ <input
121
+ type="radio"
122
+ value="username_section"
123
+ checked={this.state.group === "username_section"}
124
+ onChange={this.handleChange}
125
+ />
126
+ Seed Username
127
+ </label>
128
+
129
+ <input
130
+ type="text"
131
+ name="seedUser"
132
+ value={this.state.username}
133
+ onChange={this.handleChange}
134
+ placeholder="username"
135
+ disabled={this.state.group === "avatar_section"}
136
+ />
137
+ </p>
138
+
139
+ <p className="single-form-row">
140
+ <label>Amount</label>
141
+ <input
142
+ type="text"
143
+ name="amount"
144
+ value={this.state.amount}
145
+ onChange={this.handleChange}
146
+ disabled={this.state.group === "avatar_section"}
147
+ />
148
+ </p>
149
+
150
+ <p className="single-form-row mb-30">
151
+ <label>Note</label>
152
+ <input
153
+ type="text"
154
+ name="note"
155
+ value={this.state.note}
156
+ onChange={this.handleChange}
157
+ disabled={this.state.group === "avatar_section"}
158
+ />
159
+ </p>
160
+
161
+ <p className="single-form-row btn-right">
162
+ <button
163
+ className="sm-button"
164
+ type="submit"
165
+ >Pay</button>
166
+ </p>
167
+ </form>
168
+ </div>
169
+ </div>
170
+ </div>
171
+ </Modal.Body>
172
+ </Modal>
173
+ </>
174
+ );
175
+ }
176
+ }
177
+
178
+ export default DonateSeeds;
@@ -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 ManageSeeds 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('seeds', 'manageSeeds')}
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('seeds', 'manageSeeds')}>OK</button>
27
+ </Modal.Body>
28
+ </Modal>
29
+ </>
30
+ );
31
+ }
32
+ }
33
+
34
+ export default ManageSeeds;
@@ -0,0 +1,233 @@
1
+ import React from 'react';
2
+
3
+ import { Modal } from 'react-bootstrap';
4
+ import axios from "axios";
5
+ import { toast } from "react-toastify";
6
+ import API_BASE_URL from "../../../../config/api";
7
+
8
+ class PayWithSeeds extends React.Component {
9
+
10
+ constructor() {
11
+ console.log('Going to show Pay with Seeds');
12
+ super()
13
+ this.state = {
14
+ group: '',
15
+ seedUser: '',
16
+ amount: '',
17
+
18
+ avatar: {
19
+ enabled: true,
20
+ name: ''
21
+ },
22
+ seed: {
23
+ enabled: false,
24
+ username: '',
25
+ amount: 0
26
+ },
27
+ note: ''
28
+ }
29
+ }
30
+
31
+ componentDidMount = () => {
32
+ // this.loadAllAvatarData();
33
+ }
34
+
35
+ loadAllAvatarData = () => {
36
+ const jwtToken = localStorage.getItem('jwtToken');
37
+
38
+ const headers = {
39
+ 'Authorization': `Bearer ${jwtToken}`,
40
+ 'Content-Type': 'application/json'
41
+ };
42
+
43
+ console.log('going to load all avatars ')
44
+ axios.get(`${API_BASE_URL}/avatar/get-all-avatars`, { headers })
45
+ .then(response => {
46
+ console.log(response)
47
+ if(response.data.isError) {
48
+ toast.error(response.data.message)
49
+ } else {
50
+ toast.success(response.data.result.message)
51
+ }
52
+ // this.props.history.goBack()
53
+ // console.log(this.props)
54
+ })
55
+ .catch(error => {
56
+ console.log(error)
57
+ })
58
+ }
59
+
60
+ handleChange = (e) => {
61
+ console.log(e.target.value)
62
+
63
+ if(e.target.value === "avatar_section") {
64
+ this.setState({
65
+ avatar: {
66
+ enabled: true
67
+ },
68
+ seed: {
69
+ enabled: false
70
+ }
71
+ })
72
+ } else if(e.target.value === "seed_section") {
73
+ this.setState({
74
+ avatar: {
75
+ enabled: false
76
+ },
77
+ seed: {
78
+ enabled: true
79
+ }
80
+ })
81
+ }
82
+
83
+ // if(e.target.value === "avatar_section" || e.target.value === "seed_section") {
84
+ // this.setState({
85
+ // group: e.target.value
86
+ // })
87
+ // } else {
88
+ // this.setState({[e.target.name]: e.target.value})
89
+ // }
90
+ }
91
+
92
+ handleSubmit=(e) => {
93
+ e.preventDefault()
94
+ }
95
+
96
+ getApiData = () => {
97
+ this.setState({ loading: true })
98
+
99
+ axios({
100
+ method: 'post',
101
+ url: API_BASE_URL,
102
+ headers: {
103
+ 'Content-Type': 'application/json'
104
+ },
105
+ })
106
+ .then((response) => {
107
+ this.setState({loading: false})
108
+
109
+ if (response.data.result?.isError) {
110
+ toast.error(response.data.result.message);
111
+ return;
112
+ }
113
+
114
+ toast.success(response.data.result.message);
115
+ })
116
+ .catch((err) => {
117
+ toast.error('err');
118
+ this.setState({loading: false})
119
+ return { error: true, data: err };
120
+ });
121
+ }
122
+
123
+ render() {
124
+ const { show, hide } = this.props;
125
+ if(show) {
126
+ this.loadAllAvatarData();
127
+ }
128
+ return (
129
+ <>
130
+ <Modal
131
+ centered
132
+ className="custom-modal custom-popup-component"
133
+ show={show}
134
+ onHide={() => hide('seeds', 'payWithSeeds')}
135
+ >
136
+ <Modal.Body>
137
+ <span className="form-cross-icon" onClick={() => hide('seeds', 'payWithSeeds')}>
138
+ <i className="fa fa-times"></i>
139
+ </span>
140
+
141
+ <div className="popup-container default-popup">
142
+ <div className="seed-container paywith-seeds">
143
+ <h1 className="single-heading">
144
+ Pay with Seeds
145
+ </h1>
146
+
147
+ <div className="form-container">
148
+ <form onSubmit={this.handleSubmit}>
149
+ <p className="single-form-row">
150
+ <label className="single-radio-btn">
151
+ <input
152
+ type="radio"
153
+ value="avatar_section"
154
+ checked={this.state.avatar.enabled}
155
+ onChange={this.handleChange}
156
+ />
157
+ Avatar
158
+ </label>
159
+
160
+ <input
161
+ type="text"
162
+ placeholder="Avatar"
163
+ name="avatar"
164
+ value={this.state.avatar.name}
165
+ onChange={this.handleChange}
166
+ disabled={!this.state.avatar.enabled}
167
+ />
168
+ </p>
169
+
170
+ <h3>OR</h3>
171
+
172
+ <p className="single-form-row">
173
+ <label className="single-radio-btn">
174
+ <input
175
+ type="radio"
176
+ value="seed_section"
177
+ checked={this.state.seed.enabled}
178
+ onChange={this.handleChange}
179
+ />
180
+ Seed Username
181
+ </label>
182
+
183
+ <input
184
+ type="text"
185
+ name="username"
186
+ value={this.state.seed.username}
187
+ onChange={this.handleChange}
188
+ placeholder="Seed Username"
189
+ disabled={!this.state.seed.enabled}
190
+ />
191
+ </p>
192
+
193
+ <p className="single-form-row">
194
+ <label>Amount</label>
195
+ <input
196
+ type="number"
197
+ name="amount"
198
+ value={this.state.seed.amount}
199
+ onChange={this.handleChange}
200
+ placeholder="Amount"
201
+ disabled={!this.state.seed.enabled}
202
+ />
203
+ </p>
204
+
205
+ <p className="single-form-row mb-30">
206
+ <label>Note</label>
207
+ <input
208
+ type="text"
209
+ name="note"
210
+ value={this.state.note}
211
+ onChange={this.handleChange}
212
+ placeholder="Note"
213
+ />
214
+ </p>
215
+
216
+ <p className="single-form-row btn-right">
217
+ <button
218
+ className="sm-button"
219
+ type="submit"
220
+ >Pay</button>
221
+ </p>
222
+ </form>
223
+ </div>
224
+ </div>
225
+ </div>
226
+ </Modal.Body>
227
+ </Modal>
228
+ </>
229
+ );
230
+ }
231
+ }
232
+
233
+ export default PayWithSeeds;