Skip to content

Commit

Permalink
fix: multiple issues (#1064)
Browse files Browse the repository at this point in the history
* fix: missing css import in success modal

* fix: add missing preventDefault in preview update button

* fix: cursor behavior in CategoryBanner

* fix: optional relevant link validation

* fix: add budget breakdown relevant link validation

* fix: pagination in proposals voted on

* chore: update submission threshold for draft/governance proposals
  • Loading branch information
andyesp committed Jul 3, 2023
1 parent 75ad432 commit e32503c
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 22 deletions.
4 changes: 1 addition & 3 deletions src/components/Category/CategoryBanner.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
position: relative;
padding: 16px 20px;
margin-bottom: 8px;
cursor: default;
border-radius: 8px;
background-color: var(--background-disabled);
}
Expand Down Expand Up @@ -59,8 +58,7 @@
font-style: italic !important;
}

.CategoryBanner--poi,
.CategoryBanner--hiring {
.CategoryBanner--clickable {
cursor: pointer;
}

Expand Down
10 changes: 8 additions & 2 deletions src/components/Category/CategoryBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,20 @@ export default function CategoryBanner({ active = true, isNew, type, onClick, hr
}
}

const Component = active && href ? Link : Box
const isLink = active && href
const Component = isLink ? Link : Box
const Icon = categoryIcons[type]

return (
<Component
href={href}
onClick={handleClick}
className={classNames('CategoryBanner', `CategoryBanner--${type}`, active && 'CategoryBanner--active')}
className={classNames(
'CategoryBanner',
`CategoryBanner--${type}`,
active && 'CategoryBanner--active',
!isLink && !!onClick && 'CategoryBanner--clickable'
)}
>
<div className={classNames('CategoryBanner__Icon', !active && 'CategoryBanner__Icon--inactive')}>
<Icon />
Expand Down
11 changes: 11 additions & 0 deletions src/components/GrantRequest/AddBudgetBreakdownModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,17 @@ export default function AddBudgetBreakdownModal({
limit: schema.relevantLink.maxLength,
})
}
rules={{
maxLength: {
value: schema.relevantLink.maxLength,
message: t('error.grant.due_diligence.relevant_link_invalid'),
},
validate: (value: string) => {
if (value && value !== '' && !isHttpsURL(value)) {
return t('error.grant.due_diligence.relevant_link_invalid')
}
},
}}
/>
</ContentSection>
</AddModal>
Expand Down
2 changes: 1 addition & 1 deletion src/components/GrantRequest/AddTeamMemberModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export default function AddTeamMemberModal({ isOpen, onClose, onSubmit, selected
message: t('error.grant.team.relevant_link_invalid'),
},
validate: (value: string) => {
if (!isHttpsURL(value)) {
if (value && value !== '' && !isHttpsURL(value)) {
return t('error.grant.team.relevant_link_invalid')
}
},
Expand Down
1 change: 1 addition & 0 deletions src/components/Modal/SuccessModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import Time from '../../utils/date/Time'
import Text from '../Common/Typography/Text'

import './ProposalModal.css'
import './SuccessModal.css'

export type SuccessModalProps = Omit<ModalProps, 'children'> & {
onDismiss: (e: React.MouseEvent<unknown>) => void
Expand Down
4 changes: 2 additions & 2 deletions src/config/env/dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"GATSBY_SNAPSHOT_SPACE": "lemu.dcl.eth",
"GATSBY_SNAPSHOT_URL": "https://snapshot.org/",
"GATSBY_SNAPSHOT_QUERY_ENDPOINT": "https://api.thegraph.com/subgraphs/name/snapshot-labs/snapshot",
"GATSBY_SUBMISSION_THRESHOLD_DRAFT": "1000",
"GATSBY_SUBMISSION_THRESHOLD_GOVERNANCE": "2500",
"GATSBY_SUBMISSION_THRESHOLD_DRAFT": "100",
"GATSBY_SUBMISSION_THRESHOLD_GOVERNANCE": "100",
"GATSBY_SUBMISSION_THRESHOLD_POLL": "100",
"GATSBY_SUBMISSION_THRESHOLD_PITCH": "100",
"GATSBY_SUBMISSION_THRESHOLD_TENDER": "100",
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useVotedProposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function useVotedProposals(address: string, first?: number) {
const [skip, setSkip] = useState(0)

const { data: responseVotes, isLoading } = useQuery({
queryKey: [`votedProposals#${address}#${first}`],
queryKey: [`votedProposals#${address}#${first}#${skip}`],
queryFn: async () => {
if (!isEthereumAddress(address)) {
return []
Expand Down
12 changes: 0 additions & 12 deletions src/intl/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1138,18 +1138,6 @@
"empty_update": "When the team publishes their first update, it will appear here.",
"cliff_notice": "No funds vested until"
},
"proposal_activity": {
"title": "Decentraland DAO",
"description": "The governance hub for Decentraland. Create and vote on proposals that help shape the future of the metaverse.",
"list_proposals": "my proposals",
"list_watchlist": "watchlist",
"current_result": "current result",
"no_proposals_subscriptions": "You haven't subscribed to any proposal yet.",
"no_proposals_subscriptions_action": "Browse proposals",
"no_proposals_submitted": "You haven't submitted any proposal yet.",
"no_proposals_submitted_action": "Create a proposal",
"no_proposals_coauthoring": "You don’t have active co-authoring requests currently."
},
"proposal_comments": {
"title": "{count} {count, plural, one {Comment} other {Comments}}",
"join_discussion_label": "Join the discussion",
Expand Down
9 changes: 8 additions & 1 deletion src/pages/submit/update.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,14 @@ export default function Update({ isEdit }: Props) {
<Button type="submit" primary disabled={formDisabled} loading={isSubmitting}>
{t('page.proposal_update.publish_update')}
</Button>
<Button basic disabled={isSubmitting} onClick={() => setPreviewMode((prev) => !prev)}>
<Button
basic
disabled={isSubmitting}
onClick={(e) => {
e.preventDefault()
setPreviewMode((prev) => !prev)
}}
>
{isPreviewMode ? t('page.proposal_update.edit_update') : t('page.proposal_update.preview_update')}
</Button>
</ContentSection>
Expand Down

0 comments on commit e32503c

Please sign in to comment.