-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9193 from hicommonwealth/malik.8705.tokenized-com…
…munity-step1 [ERC20 Launchpad] - UI for Launch token step
- Loading branch information
Showing
24 changed files
with
535 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
packages/commonwealth/client/scripts/helpers/formValidations/messages.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
export const VALIDATION_MESSAGES = { | ||
NO_INPUT: 'No input', | ||
MIN_CHAR_LIMIT_REQUIRED: (charLimit: number) => | ||
`Minimum ${charLimit} characters required`, | ||
MAX_CHAR_LIMIT_REACHED: 'Max character limit reached', | ||
INVALID_INPUT: 'Invalid input', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
packages/commonwealth/client/scripts/views/pages/LaunchToken/LaunchToken.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@import '../../../../styles/shared'; | ||
|
||
.LaunchToken { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 16px; | ||
} |
60 changes: 60 additions & 0 deletions
60
packages/commonwealth/client/scripts/views/pages/LaunchToken/LaunchToken.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { useCommonNavigate } from 'navigation/helpers'; | ||
import React from 'react'; | ||
import CWFormSteps from 'views/components/component_kit/new_designs/CWFormSteps'; | ||
import CWPageLayout from 'views/components/component_kit/new_designs/CWPageLayout'; | ||
import { MixpanelCommunityCreationEvent } from '../../../../../shared/analytics/types'; | ||
import useAppStatus from '../../../hooks/useAppStatus'; | ||
import { useBrowserAnalyticsTrack } from '../../../hooks/useBrowserAnalyticsTrack'; | ||
import './LaunchToken.scss'; | ||
import TokenInformationStep from './steps/TokenInformationStep'; | ||
import useCreateCommunity from './useCreateCommunity'; | ||
import { CreateTokenCommunityStep, getFormSteps } from './utils'; | ||
|
||
const LaunchToken = () => { | ||
const navigate = useCommonNavigate(); | ||
const { createTokenCommunityStep, onChangeStep } = useCreateCommunity(); | ||
|
||
const { isAddedToHomeScreen } = useAppStatus(); | ||
|
||
useBrowserAnalyticsTrack({ | ||
payload: { | ||
event: MixpanelCommunityCreationEvent.CREATE_TOKEN_COMMUNITY_VISITED, | ||
isPWA: isAddedToHomeScreen, | ||
}, | ||
}); | ||
|
||
const isSuccessStep = | ||
createTokenCommunityStep === CreateTokenCommunityStep.Success; | ||
|
||
const getCurrentStep = () => { | ||
switch (createTokenCommunityStep) { | ||
case CreateTokenCommunityStep.TokenInformation: | ||
return ( | ||
<TokenInformationStep | ||
handleGoBack={() => navigate('/')} // redirect to home | ||
handleContinue={() => onChangeStep(true)} | ||
/> | ||
); | ||
case CreateTokenCommunityStep.CommunityInformation: | ||
// TODO: https://github.com/hicommonwealth/commonwealth/issues/8706 | ||
return <>Not Implemented</>; | ||
case CreateTokenCommunityStep.SignatureLaunch: | ||
// TODO: https://github.com/hicommonwealth/commonwealth/issues/8707 | ||
return <>Not Implemented</>; | ||
} | ||
}; | ||
|
||
return ( | ||
<CWPageLayout> | ||
<div className="LaunchToken"> | ||
{!isSuccessStep && ( | ||
<CWFormSteps steps={getFormSteps(createTokenCommunityStep)} /> | ||
)} | ||
|
||
{getCurrentStep()} | ||
</div> | ||
</CWPageLayout> | ||
); | ||
}; | ||
|
||
export default LaunchToken; |
3 changes: 3 additions & 0 deletions
3
packages/commonwealth/client/scripts/views/pages/LaunchToken/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import LaunchToken from './LaunchToken'; | ||
|
||
export default LaunchToken; |
30 changes: 30 additions & 0 deletions
30
...ges/LaunchToken/steps/TokenInformationStep/TokenInformationForm/TokenInformationForm.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
@import '../../../../../../../styles/shared.scss'; | ||
|
||
.TokenInformationForm { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
width: 100%; | ||
max-width: 596px; | ||
|
||
.optional-label { | ||
font-family: $font-family-silka; | ||
color: $neutral-500; | ||
margin-left: 6px; | ||
margin-top: auto; | ||
} | ||
|
||
.action-buttons { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
margin-top: 24px; | ||
margin-bottom: 24px; | ||
gap: 10px; | ||
|
||
@include smallInclusive { | ||
justify-content: flex-end; | ||
} | ||
} | ||
} |
Oops, something went wrong.