Skip to content

Commit 80fcfc9

Browse files
authored
Update self create flow to remove creation of application account (#733)
- Removed the mention of 3N for widget account - Directly added use of sputnik-dao for creation of treasury - Updated links to navigate to react version instead of web4
1 parent 74bc961 commit 80fcfc9

File tree

8 files changed

+190
-261
lines changed

8 files changed

+190
-261
lines changed

instances/treasury-factory.near/widget/components/SuccessPage.jsx

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,6 @@ return (
9292
</div>
9393
<div className="card w-100 d-flex flex-column gap-4 border-0">
9494
<div className="border border-1 rounded-3 p-0">
95-
<AccountDisplay
96-
label={"NEAR"}
97-
prefix=".near"
98-
tooltipInfo="This NEAR account name will be used for the application's URL and other management purposes, not the actual account where the funds will be held."
99-
/>
10095
<AccountDisplay
10196
label={"Sputnik DAO"}
10297
prefix=".sputnik-dao.near"
@@ -107,7 +102,7 @@ return (
107102
<div className="d-flex gap-3 align-items-center">
108103
<a
109104
className="btn btn-primary w-100"
110-
href={`https://${accountName}.near.page`}
105+
href={`https://app.neartreasury.com/${accountName}.sputnik-dao.near`}
111106
target="_blank"
112107
rel="noopener noreferrer"
113108
>

instances/treasury-factory.near/widget/components/create-treasury/ConfirmWalletStep.jsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const { getNearBalances } = VM.require(
44
if (!getNearBalances) return <></>;
55

66
const { setCurrentPage } = props;
7-
const REQUIRED_BALANCE = 9;
7+
const REQUIRED_BALANCE = 6;
88

99
let balance = getNearBalances(context.accountId);
1010
balance = balance ? parseFloat(balance.availableParsed) : 0;
@@ -76,14 +76,6 @@ return (
7676
value={6}
7777
info="Estimated one-time costs to store info in SputnikDAO"
7878
/>
79-
<SummaryListItem
80-
title="Frontend BOS Widget Hosting"
81-
value={3}
82-
info="Estimated one-time costs to store info in BOS"
83-
/>
84-
<b>
85-
<SummaryListItem title="Total" value={REQUIRED_BALANCE} />
86-
</b>
8779
</ul>
8880
</div>
8981
{balance < REQUIRED_BALANCE && (

instances/treasury-factory.near/widget/components/create-treasury/CreateAppAccountStep.jsx

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -51,21 +51,20 @@ const checkAccountAvailability = async (accountId, postfix) => {
5151
};
5252

5353
const validateInput = () => {
54-
setAlertMsg({ ".near": null });
54+
setAlertMsg({ ".sputnik-dao.near": null });
5555

5656
const validation = nearAccountValidation(
5757
formFields.accountName,
5858
"Name",
5959
true
6060
);
6161
if (!validation.isValid) {
62-
setAlertMsg({ ".near": validation.error });
62+
setAlertMsg({ ".sputnik-dao.near": validation.error });
6363
return Promise.resolve(false);
6464
}
6565

6666
// Check account availability
6767
return Promise.all([
68-
checkAccountAvailability(formFields.accountName, ".near"),
6968
checkAccountAvailability(formFields.accountName, ".sputnik-dao.near"),
7069
])
7170
.then((isValid) => {
@@ -122,7 +121,7 @@ const AccountDisplay = ({ label, prefix, tooltipInfo, noBorder }) => {
122121
return (
123122
<>
124123
<div>
125-
<h3>Create Treasury Accounts</h3>
124+
<h3>Create Treasury Account</h3>
126125
<p>
127126
Enter a name for your treasury. This will be used for both the
128127
application's URL and your treasury's Sputnik DAO account.
@@ -164,11 +163,6 @@ return (
164163
/>
165164

166165
<div className="d-flex flex-column gap-1 border border-1 rounded-3">
167-
<AccountDisplay
168-
label={"NEAR"}
169-
prefix=".near"
170-
tooltipInfo="This NEAR account name will be used for the application's URL and other management purposes, not the actual account where the funds will be held."
171-
/>
172166
<AccountDisplay
173167
label={"Sputnik DAO"}
174168
prefix=".sputnik-dao.near"
@@ -177,13 +171,13 @@ return (
177171
/>
178172
</div>
179173

180-
{(alertMsg?.[".near"] || alertMsg?.[".sputnik-dao.near"]) && (
174+
{alertMsg?.[".sputnik-dao.near"] && (
181175
<Widget
182176
loading=""
183177
src={`${REPL_BASE_DEPLOYMENT_ACCOUNT}/widget/components.Info`}
184178
props={{
185179
type: "alert",
186-
text: alertMsg[".near"] || alertMsg[".sputnik-dao.near"],
180+
text: alertMsg[".sputnik-dao.near"],
187181
}}
188182
/>
189183
)}
@@ -209,10 +203,7 @@ return (
209203
classNames: {
210204
root: `btn btn-primary w-100`,
211205
},
212-
disabled:
213-
alertMsg?.[".near"] ||
214-
alertMsg?.[".sputnik-dao.near"] ||
215-
isValidating,
206+
disabled: alertMsg?.[".sputnik-dao.near"] || isValidating,
216207
label: "Continue",
217208
onClick: handleContinue,
218209
loading: isValidating,

0 commit comments

Comments
 (0)