Skip to content

Commit

Permalink
Merge pull request #160 from decentraland/chore/disable-linked-wearab…
Browse files Browse the repository at this point in the history
…les-proposals

chore: disable linked wearables proposal submission
  • Loading branch information
1emu authored Dec 26, 2024
2 parents f7d304a + d0a5b00 commit a150755
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ export const TRANSPARENCY_API = config.get('DCL_DATA_API')
export const VESTING_DASHBOARD_URL = config.get('VESTING_DASHBOARD_URL')
export const GRANT_PROPOSAL_SUBMIT_ENABLED = false
export const PITCH_PROPOSAL_SUBMIT_ENABLED = false
export const LINKED_WEARABLES_PROPOSAL_SUBMIT_ENABLED = false
10 changes: 8 additions & 2 deletions src/pages/submit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import {
AddRemoveProposalModal,
AddRemoveProposalModalProps,
} from '../../components/Modal/AddRemoveProposalModal/AddRemoveProposalModal'
import { GRANT_PROPOSAL_SUBMIT_ENABLED, PITCH_PROPOSAL_SUBMIT_ENABLED } from '../../constants'
import {
GRANT_PROPOSAL_SUBMIT_ENABLED,
LINKED_WEARABLES_PROPOSAL_SUBMIT_ENABLED,
PITCH_PROPOSAL_SUBMIT_ENABLED,
} from '../../constants'
import useFormatMessage from '../../hooks/useFormatMessage'
import { CatalystType, HiringType, PoiType, ProposalType } from '../../types/proposals'
import { getCommitteesWithOpenSlots } from '../../utils/committee'
Expand Down Expand Up @@ -81,7 +85,9 @@ export default function SubmitPage() {
onClick={() => setProposalModalProps({ ...POI_MODAL_PROPS, open: true })}
/>
<CategoryBanner type={ProposalType.BanName} href={locations.submit(ProposalType.BanName)} />
<CategoryBanner type={ProposalType.LinkedWearables} href={locations.submit(ProposalType.LinkedWearables)} />
{LINKED_WEARABLES_PROPOSAL_SUBMIT_ENABLED && (
<CategoryBanner type={ProposalType.LinkedWearables} href={locations.submit(ProposalType.LinkedWearables)} />
)}
{GRANT_PROPOSAL_SUBMIT_ENABLED && (
<CategoryBanner
type={ProposalType.Grant}
Expand Down
8 changes: 7 additions & 1 deletion src/pages/submit/linked-wearables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import LoadingView from '../../components/Layout/LoadingView'
import LogIn from '../../components/Layout/LogIn'
import PostLabel from '../../components/PostLabel'
import CoAuthors from '../../components/Proposal/Submit/CoAuthor/CoAuthors'
import { LINKED_WEARABLES_PROPOSAL_SUBMIT_ENABLED } from '../../constants'
import { useAuthContext } from '../../context/AuthProvider'
import { disableOnWheelInput, isHttpsURL } from '../../helpers'
import useFormatMessage from '../../hooks/useFormatMessage'
Expand Down Expand Up @@ -108,6 +109,12 @@ const getImagesValidation = async (urls: Record<string, string>) => {
export default function SubmitLinkedWearables() {
const t = useFormatMessage()
const [account, accountState] = useAuthContext()
const navigate = useNavigate()

if (!LINKED_WEARABLES_PROPOSAL_SUBMIT_ENABLED) {
navigate('/submit')
}

const {
handleSubmit,
formState: { isDirty, isSubmitting, errors },
Expand All @@ -122,7 +129,6 @@ export default function SubmitLinkedWearables() {
const [error, setError] = useState('')
const preventNavigation = useRef(false)
const values = useWatch({ control })
const navigate = useNavigate()

const setCoAuthors = (addresses?: string[]) => setValue('coAuthors', addresses)

Expand Down

0 comments on commit a150755

Please sign in to comment.