Skip to content

Commit 210a0b0

Browse files
committed
feat: streamline DAO creator flow - Auto-advance from template selection to DAO Basics step - Remove caption text from token type radio buttons
1 parent ed4bcae commit 210a0b0

File tree

2 files changed

+36
-139
lines changed

2 files changed

+36
-139
lines changed

src/modules/etherlink/creator/EvmDaoBasics.tsx

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -213,20 +213,15 @@ export const EvmDaoBasics: React.FC<EvmDaoBasicsProps> = () => {
213213
value="new"
214214
control={<StyledRadio checked={values.tokenDeploymentMechanism === "new"} disableRipple />}
215215
label={
216-
<Box>
217-
<Typography
218-
style={{
219-
color:
220-
values.tokenDeploymentMechanism === "new" ? theme.palette.secondary.main : "#fff",
221-
fontWeight: values.tokenDeploymentMechanism === "new" ? 700 : 400
222-
}}
223-
>
224-
Deploy new standard token
225-
</Typography>
226-
<Typography variant="caption" style={{ color: "#fff" }}>
227-
Create a new ERC20 governance token
228-
</Typography>
229-
</Box>
216+
<Typography
217+
style={{
218+
color:
219+
values.tokenDeploymentMechanism === "new" ? theme.palette.secondary.main : "#fff",
220+
fontWeight: values.tokenDeploymentMechanism === "new" ? 700 : 400
221+
}}
222+
>
223+
Deploy new standard token
224+
</Typography>
230225
}
231226
/>
232227
<FormControlLabel
@@ -235,22 +230,15 @@ export const EvmDaoBasics: React.FC<EvmDaoBasicsProps> = () => {
235230
<StyledRadio checked={values.tokenDeploymentMechanism === "wrapped"} disableRipple />
236231
}
237232
label={
238-
<Box>
239-
<Typography
240-
style={{
241-
color:
242-
values.tokenDeploymentMechanism === "wrapped"
243-
? theme.palette.secondary.main
244-
: "#fff",
245-
fontWeight: values.tokenDeploymentMechanism === "wrapped" ? 700 : 400
246-
}}
247-
>
248-
Wrap existing ERC20 token
249-
</Typography>
250-
<Typography variant="caption" style={{ color: "#fff" }}>
251-
Use an existing token for governance
252-
</Typography>
253-
</Box>
233+
<Typography
234+
style={{
235+
color:
236+
values.tokenDeploymentMechanism === "wrapped" ? theme.palette.secondary.main : "#fff",
237+
fontWeight: values.tokenDeploymentMechanism === "wrapped" ? 700 : 400
238+
}}
239+
>
240+
Wrap existing ERC20 token
241+
</Typography>
254242
}
255243
/>
256244
</RadioGroup>
Lines changed: 18 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -1,120 +1,29 @@
1-
import React, { useState } from "react"
2-
import { Grid, Typography, Box, useMediaQuery, useTheme } from "components/ui"
3-
4-
import { ReactComponent as LiteIcon } from "assets/img/lite-dao.svg"
5-
import { ReactComponent as FullIcon } from "assets/img/full-dao.svg"
1+
import React, { useEffect } from "react"
2+
import { Grid, Box, CircularProgress } from "components/ui"
63

74
import { TitleBlock } from "modules/common/TitleBlock"
85
import useEvmDaoCreateStore from "services/contracts/etherlinkDAO/hooks/useEvmDaoCreateStore"
96

10-
// Styled components replaced with inline styles
11-
12-
type DaoTemplate = "full" | "lite"
13-
147
export const EvmDaoTemplate = (): JSX.Element => {
15-
const theme = useTheme()
16-
const { data: daoData, setFieldValue } = useEvmDaoCreateStore()
17-
const selectedTemplate = daoData.template
18-
const isMobileSmall = useMediaQuery(theme.breakpoints.down("xs"))
19-
const [error, setError] = useState<boolean>(false)
20-
21-
const handleTemplateSelect = (template: DaoTemplate) => {
22-
setError(false)
23-
setFieldValue("template", template)
24-
}
25-
8+
const { setFieldValue, next } = useEvmDaoCreateStore()
9+
10+
// Auto-select "full" template and advance to next step
11+
useEffect(() => {
12+
setFieldValue("template", "full")
13+
// Small delay to ensure state is set before navigating
14+
const timer = setTimeout(() => {
15+
next.handler()
16+
}, 100)
17+
return () => clearTimeout(timer)
18+
}, [])
19+
20+
// Show loading state while auto-advancing
2621
return (
2722
<Box>
28-
<TitleBlock title={"DAO Creator"} description={"Create an organization by picking a template below."} />
29-
<Grid
30-
container
31-
justifyContent={isMobileSmall ? "center" : "space-between"}
32-
direction="row"
33-
spacing={isMobileSmall ? 2 : 0}
34-
>
35-
<Grid
36-
item
37-
container
38-
direction="column"
39-
justifyContent="flex-start"
40-
alignItems="center"
41-
xs={12}
42-
sm={12}
43-
md={5}
44-
onClick={() => handleTemplateSelect("full")}
45-
style={{
46-
height: 273,
47-
marginTop: 30,
48-
background: theme.palette.primary.main,
49-
borderRadius: 8,
50-
maxWidth: isMobileSmall ? "100%" : 342,
51-
width: isMobileSmall ? "100%" : "-webkit-fill-available",
52-
textAlign: "start",
53-
cursor: "pointer",
54-
paddingBottom: 0,
55-
padding: "33px 38px 0px",
56-
border: selectedTemplate === "full" ? "3px solid rgba(129, 254, 183, 0.4)" : undefined
57-
}}
58-
>
59-
<FullIcon style={{ marginBottom: 16 }} />
60-
<Typography
61-
color="textSecondary"
62-
style={{ fontSize: 18, fontWeight: 600, fontFamily: "Roboto Flex", marginBottom: 10 }}
63-
>
64-
Full DAO
65-
</Typography>
66-
<Typography
67-
color="textSecondary"
68-
style={{ fontWeight: 300, fontSize: 18, lineHeight: "160%", alignSelf: "stretch" }}
69-
>
70-
Contract interaction. Transfer assets based on vote outcomes.
71-
</Typography>
72-
</Grid>
73-
74-
<Grid
75-
item
76-
container
77-
direction="column"
78-
justifyContent="flex-start"
79-
alignItems="center"
80-
xs={12}
81-
sm={12}
82-
md={5}
83-
onClick={() => handleTemplateSelect("lite")}
84-
style={{
85-
height: 273,
86-
marginTop: 30,
87-
background: theme.palette.primary.main,
88-
borderRadius: 8,
89-
maxWidth: isMobileSmall ? "100%" : 342,
90-
width: isMobileSmall ? "100%" : "-webkit-fill-available",
91-
textAlign: "start",
92-
cursor: "pointer",
93-
paddingBottom: 0,
94-
padding: "33px 38px 0px",
95-
border: selectedTemplate === "lite" ? "3px solid rgba(129, 254, 183, 0.4)" : undefined
96-
}}
97-
>
98-
<LiteIcon style={{ marginBottom: 16 }} />
99-
<Typography
100-
color="textSecondary"
101-
style={{ fontSize: 18, fontWeight: 600, fontFamily: "Roboto Flex", marginBottom: 10 }}
102-
>
103-
Lite DAO
104-
</Typography>
105-
<Typography
106-
color="textSecondary"
107-
style={{ fontWeight: 300, fontSize: 18, lineHeight: "160%", alignSelf: "stretch" }}
108-
>
109-
Off-chain weighted voting. Multiple voting strategies. No treasury.
110-
</Typography>
111-
</Grid>
23+
<TitleBlock title={"DAO Creator"} description={"Loading..."} />
24+
<Grid container justifyContent="center" alignItems="center" style={{ minHeight: 200 }}>
25+
<CircularProgress color="secondary" />
11226
</Grid>
113-
{error && (
114-
<Typography style={{ display: "block", fontSize: 14, color: "red", marginTop: 8 }}>
115-
Must select a template in order to continue
116-
</Typography>
117-
)}
11827
</Box>
11928
)
12029
}

0 commit comments

Comments
 (0)