Skip to content

Commit

Permalink
Merge pull request #395 from dOrgTech/creator-fixes
Browse files Browse the repository at this point in the history
creator UI fixes
  • Loading branch information
fabiolalombardim authored Dec 20, 2022
2 parents d2948b2 + 75776f8 commit 67b2d8a
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 69 deletions.
3 changes: 2 additions & 1 deletion src/modules/creator/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const StepContentContainer = styled(Grid)({

const StyledStepper = styled(Stepper)({
"background": "inherit",
"paddingTop": 48,
"& .MuiStepLabel-label": {
fontSize: 14,
lineHeight: 14
Expand Down Expand Up @@ -176,7 +177,7 @@ export const DAOCreate: React.FC = () => {
</StepContentContainer>
</Grid>
</Grid>
{step < 5 && <NavigationBar back={back} next={next} />}
{step < 4 && <NavigationBar back={back} next={next} />}
</Grid>
</PageContent>
</PageContainer>
Expand Down
2 changes: 1 addition & 1 deletion src/modules/creator/state/context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const deploymentStatus = {
const LOCAL_STORAGE_KEY = "creatorParams"

export const INITIAL_MIGRATION_STATE: MigrationParams = {
template: "",
template: "lambda",
orgSettings: {
name: "",
symbol: "",
Expand Down
97 changes: 49 additions & 48 deletions src/modules/creator/steps/DaoSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,23 @@ const MetadataContainer = styled(Grid)({
})

const CustomTextarea = styled(withTheme(TextareaAutosize))(props => ({
minHeight: 152,
boxSizing: "border-box",
width: "100%",
marginTop: 14,
fontWeight: 300,
padding: "21px 20px",
fontFamily: "system-ui",
border: "none",
fontSize: 16,
color: props.theme.palette.text.secondary,
background: "#2F3438",
borderRadius: 8,
paddingRight: 40,
wordBreak: "break-word"
"minHeight": 152,
"boxSizing": "border-box",
"width": "100%",
"marginTop": 14,
"fontWeight": 300,
"padding": "21px 20px",
"fontFamily": "system-ui",
"border": "none",
"fontSize": 16,
"color": props.theme.palette.text.secondary,
"background": "#2F3438",
"borderRadius": 8,
"paddingRight": 40,
"wordBreak": "break-word",
"&:focus-visible": {
outline: "none"
}
}))

const ErrorText = styled(Typography)({
Expand All @@ -120,10 +123,12 @@ const DaoSettingsForm = withRouter(({ submitForm, values, setFieldValue, errors,
useEffect(() => {
if (tokenMetadata) {
setFieldValue("governanceToken.tokenMetadata", tokenMetadata)
setFieldValue("symbol", tokenMetadata.symbol)
}

if (error) {
setFieldValue("governanceToken.tokenMetadata", undefined)
setFieldValue("symbol", undefined)
}
}, [error, setFieldValue, tokenMetadata])

Expand All @@ -140,10 +145,6 @@ const DaoSettingsForm = withRouter(({ submitForm, values, setFieldValue, errors,
submitForm(values)
},
text: "Continue"
},
back: {
handler: () => history.push(`templates`),
text: "Back"
}
})
}
Expand All @@ -167,15 +168,15 @@ const DaoSettingsForm = withRouter(({ submitForm, values, setFieldValue, errors,
inputProps={{
maxLength: 36
}}
InputProps={{
endAdornment: (
<InputAdornment position="start">
<Tooltip placement="bottom" title="Token Address">
<InfoIconInput />
</Tooltip>
</InputAdornment>
)
}}
// InputProps={{
// endAdornment: (
// <InputAdornment position="start">
// <Tooltip placement="bottom" title="Token Address">
// <InfoIconInput />
// </Tooltip>
// </InputAdornment>
// )
// }}
/>
</CustomInputContainer>
{errors.governanceToken?.address && touched.governanceToken?.address ? (
Expand All @@ -193,15 +194,15 @@ const DaoSettingsForm = withRouter(({ submitForm, values, setFieldValue, errors,
placeholder="0"
name="governanceToken.tokenId"
component={CustomFormikTextField}
InputProps={{
endAdornment: (
<InputAdornment position="start">
<Tooltip placement="bottom" title="Token ID">
<InfoIconInput />
</Tooltip>
</InputAdornment>
)
}}
// InputProps={{
// endAdornment: (
// <InputAdornment position="start">
// <Tooltip placement="bottom" title="Token ID">
// <InfoIconInput />
// </Tooltip>
// </InputAdornment>
// )
// }}
/>
</CustomInputContainer>
{errors.governanceToken?.tokenId && touched.governanceToken?.tokenId ? (
Expand All @@ -216,7 +217,7 @@ const DaoSettingsForm = withRouter(({ submitForm, values, setFieldValue, errors,
</MetadataContainer>
)}

<Grid item xs={isMobile ? 12 : 9}>
<Grid item xs={isMobile ? 12 : 12}>
<Typography variant="subtitle1" color="textSecondary">
{" "}
DAO Name{" "}
Expand All @@ -228,21 +229,21 @@ const DaoSettingsForm = withRouter(({ submitForm, values, setFieldValue, errors,
type="text"
placeholder="My Group’s Token"
component={CustomFormikTextField}
InputProps={{
endAdornment: (
<InputAdornment position="start">
<Tooltip placement="bottom" title="DAO Name info">
<InfoIconInput />
</Tooltip>
</InputAdornment>
)
}}
// InputProps={{
// endAdornment: (
// <InputAdornment position="start">
// <Tooltip placement="bottom" title="DAO Name info">
// <InfoIconInput />
// </Tooltip>
// </InputAdornment>
// )
// }}
></Field>
</CustomInputContainer>
{errors.name && touched.name ? <ErrorText>{errors.name}</ErrorText> : null}
</Grid>

<Grid item xs={isMobile ? 12 : 3}>
{/* <Grid item xs={isMobile ? 12 : 3}>
<Typography variant="subtitle1" color="textSecondary">
{" "}
Token Symbol{" "}
Expand All @@ -269,7 +270,7 @@ const DaoSettingsForm = withRouter(({ submitForm, values, setFieldValue, errors,
></Field>
</CustomInputContainer>
{errors.symbol && touched.symbol ? <ErrorText>{errors.symbol}</ErrorText> : null}
</Grid>
</Grid> */}
</SecondContainer>
<SecondContainer container direction="row" alignItems="center">
<Grid item xs={12}>
Expand Down
36 changes: 17 additions & 19 deletions src/modules/creator/steps/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,18 @@ import mixpanel from "mixpanel-browser"
import { Template } from "./Template"

export const STEPS: StepInfo[] = [
{ title: "Select Template", index: 0 },
{ title: "Configure DAO settings", index: 1 },
{ title: "Configure Proposal & Voting", index: 2 },
{ title: "Adjust Quorum", index: 3 },
{ title: "Review information", index: 4 }
{ title: "Configure DAO settings", index: 0 },
{ title: "Configure Proposal & Voting", index: 1 },
{ title: "Adjust Quorum", index: 2 },
{ title: "Review information", index: 3 }
]

const urlToStepMap: Record<string, number> = {
template: 0,
dao: 1,
voting: 2,
quorum: 3,
summary: 4,
review: 5
dao: 0,
voting: 1,
quorum: 2,
summary: 3,
review: 4
}

const AnalyticsWrappedStep: React.FC<{ name: string; index: number }> = ({ name, index, children }) => {
Expand All @@ -44,37 +42,37 @@ export const StepRouter: React.FC = () => {
return (
<ProtectedRoute>
<Switch>
<Route path={`${match.url}/template`}>
{/* <Route path={`${match.url}/template`}>
<AnalyticsWrappedStep name="Select Template" index={0}>
<Template />
</AnalyticsWrappedStep>
</Route>
</Route> */}
<Route path={`${match.url}/dao`}>
<AnalyticsWrappedStep name="DAO Settings" index={1}>
<AnalyticsWrappedStep name="DAO Settings" index={0}>
<DaoSettings />
</AnalyticsWrappedStep>
</Route>
<Route path={`${match.url}/voting`}>
<AnalyticsWrappedStep name="Governance" index={2}>
<AnalyticsWrappedStep name="Governance" index={1}>
<Governance />
</AnalyticsWrappedStep>
</Route>
<Route path={`${match.url}/quorum`}>
<AnalyticsWrappedStep name="Quorum" index={3}>
<AnalyticsWrappedStep name="Quorum" index={2}>
<Quorum />
</AnalyticsWrappedStep>
</Route>
<Route path={`${match.url}/summary`}>
<AnalyticsWrappedStep name="Summary" index={4}>
<AnalyticsWrappedStep name="Summary" index={3}>
<Summary />
</AnalyticsWrappedStep>
</Route>
<Route path={`${match.url}/review`}>
<AnalyticsWrappedStep name="Deployment" index={5}>
<AnalyticsWrappedStep name="Deployment" index={4}>
<Review />
</AnalyticsWrappedStep>
</Route>
<Redirect to={`${match.url}/template`} />
<Redirect to={`${match.url}/dao`} />
</Switch>
</ProtectedRoute>
)
Expand Down

0 comments on commit 67b2d8a

Please sign in to comment.