Skip to content

Commit

Permalink
Merge pull request #56 from CudoVentures/cudos-dev
Browse files Browse the repository at this point in the history
Cudos dev
  • Loading branch information
mlukanova authored Jun 15, 2023
2 parents fdae222 + f21abd6 commit dde57b5
Show file tree
Hide file tree
Showing 6 changed files with 637 additions and 123 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const AllowListGrid = ({
{`${displayData.length} Allowlists`}
</Typography> : null}
</Box>
{withSearchBar ? <SearchBar displayDataLength={displayData.length} networks={defaultData.map((allowlist) => { return allowlist.cosmos_chain_id })} /> : null}
{withSearchBar ? <SearchBar displayDataLength={displayData.length} networks={[...new Set(defaultData.map((allowlist) => allowlist.cosmos_chain_id))]} /> : null}
</Box>
<GridList
data={displayData}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ export const SummaryView = ({
setLogoLoaded(true)
}, [])

const StyledTypography = ({ text, color }: { text: string, color?: string }): JSX.Element => {
const StyledTypography = ({ text, color, prewrap }: { text: string, color?: string, prewrap?: boolean }): JSX.Element => {
return (
<Typography
variant='subtitle1'
whiteSpace={prewrap ? 'pre-wrap' : undefined}
color={color ? color : COLORS.STEEL_GRAY[20]}
>
{text}
Expand Down Expand Up @@ -125,8 +126,7 @@ export const SummaryView = ({
<Typography variant='h6' fontWeight={700}>
Description
</Typography>
<StyledTypography text={props.description} />

<StyledTypography text={props.description} prewrap={true} />
</Box>
: null}
{props.website || props.twitter_account || props.discord_url ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export type SocialMediaUserActions = {

export enum FormFieldErrors {
connectWalletToSetChainId = 'Connect your Wallet to set a Chain ID',
description = 'Have to be between 20 and 500 characters',
description = 'Have to be between 20 and 1000 characters',
minimumFiveChars = 'Have to be minimum 5 characters',
invalidCustomUrl = 'Invalid format. Have to be 5 to 20 letters with no special characters and spaces',
invalidCustomUrl = 'Invalid format. Have to be 5 to 50 letters with no special characters and spaces',
url = 'Invalid URL format',
twitterAcc = 'Invalid Twitter Account',
discordServer = 'Invalid Discord Server',
Expand Down
4 changes: 2 additions & 2 deletions apps/frontend/src/features/allowlists/validation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const isValidAllowlistName = (name: string): boolean => {
}

export const isValidAllowlistUrl = (url: string): boolean => {
return isZeroLength(url) || url.match(/^[_]?[a-zA-Z]+([-_][a-zA-Z]+)*[_]?$/g) !== null && isValidLength(url, { min: 4, max: 20 })
return isZeroLength(url) || url.match(/^[_]?[a-zA-Z]+([-_][a-zA-Z]+)*[_]?$/g) !== null && isValidLength(url, { min: 4, max: 50 })
}

export const isValidUrl = (url: string): boolean => {
Expand All @@ -52,7 +52,7 @@ export const isValidTweetUrl = (tweet: string): boolean => {
}

export const isValidDescription = (description: string): boolean => {
return isZeroLength(description) || isValidLength(description, { min: 19, max: 500 })
return isZeroLength(description) || isValidLength(description, { min: 19, max: 1000 })
}

export const isValidEndPeriod = (end_period: Date): boolean => {
Expand Down
Loading

0 comments on commit dde57b5

Please sign in to comment.