Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vladislav Ovsyanko
Hackathon Dao Constructor
Commits
bed69344
Commit
bed69344
authored
2 years ago
by
Andrey Krylov
Browse files
Options
Download
Email Patches
Plain Diff
add-url-params
parent
fd628462
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/views/CreateDao/CreateDaoPage.tsx
+7
-2
frontend/src/views/CreateDao/CreateDaoPage.tsx
frontend/src/views/SmartContracts/components/CreateTokenDialog/index.tsx
+18
-2
...ews/SmartContracts/components/CreateTokenDialog/index.tsx
with
25 additions
and
4 deletions
+25
-4
frontend/src/views/CreateDao/CreateDaoPage.tsx
+
7
-
2
View file @
bed69344
...
...
@@ -14,12 +14,13 @@ import { createDaoFormValidation } from "@/views/CreateDao/schema";
import
{
useCreateTokenDialog
}
from
"
@/store
"
;
import
{
useContractApi
}
from
"
@/hooks
"
;
import
{
CreateDaoForm
}
from
"
@/hooks/useContractApi/types
"
;
import
{
Network
}
from
"
@cryptodo/contracts
"
;
import
Store
,
{
ActionsObject
as
LocalActionsObject
,
useLocalStore
,
}
from
'
./context
'
import
*
as
S
from
'
./style
'
;
const
Page
=
()
=>
{
const
{
push
}
=
useRouter
();
const
{
push
,
query
}
=
useRouter
();
const
[
postingToTestnet
,
setPostingToTestnet
]
=
useState
<
boolean
>
(
false
);
const
[
allFieldsDisabled
,
disableAllFields
]
=
useState
<
boolean
>
(
false
);
const
[
deployConfirmationOpen
,
toggleDeployConfirmationDialog
]
=
...
...
@@ -31,7 +32,7 @@ const Page = () => {
}
=
localActions
as
LocalActionsObject
;
const
{
data
:
{
selectedBlockchain
},
data
:
{
selectedBlockchain
},
actions
:
{
selectBlockchain
}
}
=
useCreateTokenDialog
();
const
{
register
,
reset
,
formState
:
{
errors
,
isValid
},
control
,
watch
,
getValues
,
setValue
}
=
useForm
({
...
...
@@ -183,6 +184,10 @@ const Page = () => {
setValue
(
'
quorum
'
,
localData
.
quorum
);
},
[
localData
.
quorum
]);
useEffect
(()
=>
{
selectBlockchain
(
query
?.
network
as
Network
)
},
[]);
return
(
<
S
.
Wrapper
>
<
S
.
Content
>
...
...
This diff is collapsed.
Click to expand it.
frontend/src/views/SmartContracts/components/CreateTokenDialog/index.tsx
+
18
-
2
View file @
bed69344
import
{
FC
}
from
'
react
'
;
import
{
FC
,
useEffect
}
from
'
react
'
;
import
useTranslation
from
'
next-translate/useTranslation
'
;
import
{
useRouter
}
from
'
next/router
'
;
...
...
@@ -10,7 +10,7 @@ import { Space, Text, Tooltip, Dialog, Button } from '@/components';
import
*
as
S
from
'
./style
'
;
export
const
CreateTokenDialog
:
FC
=
()
=>
{
const
{
push
}
=
useRouter
();
const
{
push
,
query
,
isReady
}
=
useRouter
();
const
{
t
}
=
useTranslation
(
'
SmartContracts
'
);
const
{
...
...
@@ -19,6 +19,13 @@ export const CreateTokenDialog: FC = () => {
}
=
useUI
();
const
{
toggleCreateTokenDialog
}
=
uiActions
as
ActionsObject
[
'
ui
'
];
const
toggleBlockchain
=
(
network
:
string
)
=>
{
push
({
query
:
{
'
network
'
:
network
}
});
};
const
{
data
:
{
selectedBlockchain
},
actions
:
createTokenActions
,
...
...
@@ -37,6 +44,13 @@ export const CreateTokenDialog: FC = () => {
toggleCreateTokenDialog
(
false
);
};
useEffect
(()
=>
{
if
(
!
query
?.
network
&&
isReady
)
{
toggleBlockchain
(
"
BSC
"
)
}
},
[]);
return
(
<
Dialog
open
=
{
createTokenDialogOpen
}
...
...
@@ -49,6 +63,7 @@ export const CreateTokenDialog: FC = () => {
onClick
=
{
()
=>
push
({
pathname
:
'
/createDao
'
,
query
:
{
'
network
'
:
query
?.
network
}
})
}
>
...
...
@@ -82,6 +97,7 @@ export const CreateTokenDialog: FC = () => {
type
=
"button"
disabled
=
{
item
.
disabled
}
onClick
=
{
()
=>
{
toggleBlockchain
(
network
)
selectBlockchain
(
network
);
}
}
>
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets