Skip to content

Commit

Permalink
clean up new edit cycle page feature flag (#4076)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomquirk authored Sep 19, 2023
1 parent 76c1db6 commit 70a1035
Show file tree
Hide file tree
Showing 74 changed files with 23 additions and 486 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Form } from 'antd'
import PayoutsTable from 'components/v2v3/V2V3Project/V2V3ProjectSettings/pages/NewEditCyclePage/PayoutsSection/PayoutsTable'
import PayoutsTable from 'components/v2v3/V2V3Project/V2V3ProjectSettings/pages/EditCyclePage/PayoutsSection/PayoutsTable'
import { CURRENCY_METADATA, CurrencyName } from 'constants/currency'
import { BigNumber } from 'ethers'
import { Split } from 'models/splits'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
import * as constants from '@ethersproject/constants'
import { ChevronRightIcon } from '@heroicons/react/20/solid'
import { ArrowLeftIcon } from '@heroicons/react/24/outline'
import { Trans, t } from '@lingui/macro'
import { Button, Layout } from 'antd'
import { V2V3SettingsPageKey } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/ProjectSettingsDashboard'
import { FEATURE_FLAGS } from 'constants/featureFlags'
import { V2V3ProjectContext } from 'contexts/v2v3/Project/V2V3ProjectContext'
import Link from 'next/link'
import { useContext, useMemo } from 'react'
import { twJoin } from 'tailwind-merge'
import { featureFlagEnabled } from 'utils/featureFlags'
import { isZeroAddress } from 'utils/address'
import { ProjectSettingsLayout } from './ProjectSettingsLayout'
import { useSettingsPagePath } from './hooks/useSettingsPagePath'
import { ArchiveProjectSettingsPage } from './pages/ArchiveProjectSettingsPage'
import { EditCyclePage } from './pages/EditCyclePage/EditCyclePage'
import { EditNftsPage } from './pages/EditNftsPage/EditNftsPage'
import { GovernanceSettingsPage } from './pages/GovernanceSettingsPage'
import { EditCyclePage } from './pages/NewEditCyclePage/EditCyclePage'
import { PayoutsSettingsPage } from './pages/PayoutsSettingsPage'
import { ProjectDetailsSettingsPage } from './pages/ProjectDetailsSettingsPage/ProjectDetailsSettingsPage'
import { ProjectHandleSettingsPage } from './pages/ProjectHandleSettingsPage'
import { ProjectNftSettingsPage } from './pages/ProjectNftSettingsPage'
import { ProjectUpgradesPage } from './pages/ProjectUpgradesPage'
import { ReconfigureFundingCycleSettingsPage } from './pages/ReconfigureFundingCycleSettingsPage'
import { ReservedTokensSettingsPage } from './pages/ReservedTokensSettingsPage'
import { TransferOwnershipSettingsPage } from './pages/TransferOwnershipSettingsPage'
import { V1V2TokenMigrationSettingsPage } from './pages/V1V2TokenMigrationSettingsPage'
Expand All @@ -31,9 +28,7 @@ const SettingsPageComponents: {
} = {
general: ProjectDetailsSettingsPage,
handle: ProjectHandleSettingsPage,
cycle: featureFlagEnabled(FEATURE_FLAGS.NEW_CYCLE_CONFIG_PAGE)
? EditCyclePage
: ReconfigureFundingCycleSettingsPage,
cycle: EditCyclePage,
nfts: EditNftsPage,
payouts: PayoutsSettingsPage,
reservedtokens: ReservedTokensSettingsPage,
Expand Down Expand Up @@ -104,8 +99,7 @@ export function ProjectSettingsContent({
settingsPageKey: V2V3SettingsPageKey
}) {
const { fundingCycleMetadata } = useContext(V2V3ProjectContext)
const hasExistingNfts =
fundingCycleMetadata?.dataSource !== constants.AddressZero
const hasExistingNfts = !isZeroAddress(fundingCycleMetadata?.dataSource)

const ActiveSettingsPage = useMemo(
() => SettingsPageComponents[settingsPageKey],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { V2V3ProjectPageProvider } from 'contexts/v2v3/V2V3ProjectPageProvider'
import { useRouter } from 'next/router'
import { Provider } from 'react-redux'
import store from 'redux/store'
import { EditCycleFormProvider } from './pages/NewEditCyclePage/EditCycleFormContext'
import { EditCycleFormProvider } from './pages/EditCyclePage/EditCycleFormContext'

export const V2V3SettingsProvider: React.FC<React.PropsWithChildren> = ({
children,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ export function EditCyclePage() {
ref={tokensRef}
title={<Trans>Tokens</Trans>}
description={
<Trans>Manage how your projects tokens should work.</Trans>
<Trans>Manage how your project's tokens should work.</Trans>
}
className="border-b-0"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { JuiceTextArea } from 'components/inputs/JuiceTextArea'
import TransactionModal from 'components/modals/TransactionModal'
import { useState } from 'react'
import { TransactionSuccessModal } from '../../../TransactionSuccessModal'
import { useReconfigureFundingCycle } from '../../ReconfigureFundingCycleSettingsPage/hooks/useReconfigureFundingCycle'
import { useReconfigureFundingCycle } from '../../../hooks/useReconfigureFundingCycle'
import { useEditCycleFormContext } from '../EditCycleFormContext'
import { usePrepareSaveEditCycleData } from '../hooks/usePrepareSaveEditCycleData'
import { DetailsSectionDiff } from './DetailsSectionDiff'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
formatReservedRate,
} from 'utils/v2v3/math'
import { deserializeV2V3FundingCycleData } from 'utils/v2v3/serializers'
import { useInitialEditingData } from '../../ReconfigureFundingCycleSettingsPage/hooks/useInitialEditingData'
import { useInitialEditingData } from '../../../hooks/useInitialEditingData'
import { EditCycleFormFields } from '../EditCycleFormFields'

/** Loads project FC data from redux into an Ant D form instance */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import {
import {
EditingFundingCycleConfig,
useEditingFundingCycleConfig,
} from '../../ReconfigureFundingCycleSettingsPage/hooks/useEditingFundingCycleConfig'
} from '../../../hooks/useEditingFundingCycleConfig'
import { useEditCycleFormContext } from '../EditCycleFormContext'
import { EditCycleFormFields } from '../EditCycleFormFields'
import { useTokensSectionValues } from '../ReviewConfirmModal/hooks/useTokensSectionValues'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import {
import {
EditingFundingCycleConfig,
useEditingFundingCycleConfig,
} from '../../../ReconfigureFundingCycleSettingsPage/hooks/useEditingFundingCycleConfig'
import { useReconfigureFundingCycle } from '../../../ReconfigureFundingCycleSettingsPage/hooks/useReconfigureFundingCycle'
} from '../../../../hooks/useEditingFundingCycleConfig'
import { useReconfigureFundingCycle } from '../../../../hooks/useReconfigureFundingCycle'

export const useLaunchNftsForm = () => {
const [form] = useForm<NftRewardsFormProps>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ import { useContext, useState } from 'react'
import { useDispatch } from 'react-redux'
import { editingV2ProjectActions } from 'redux/slices/editingV2Project'
import { formatDate } from 'utils/format/formatDate'
import { useEditingFundingCycleConfig } from '../../../../../ReconfigureFundingCycleSettingsPage/hooks/useEditingFundingCycleConfig'
import { ReconfigurePreview } from '../../../../../ReconfigureFundingCycleSettingsPage/ReconfigurePreview'
import { SetNftOperatorPermissionsButton } from '../../../../../ReconfigureFundingCycleSettingsPage/SetNftOperatorPermissionsButton'
import { useEditingFundingCycleConfig } from '../../../../../../hooks/useEditingFundingCycleConfig'
import { useLaunchFundingCycles } from './hooks/useLaunchFundingCycles'
import { ReconfigurePreview } from './ReconfigurePreview'
import { SetNftOperatorPermissionsButton } from './SetNftOperatorPermissionsButton'

export function LaunchFundingCycleForm() {
const { projectOwnerAddress, fundingCycle } = useContext(V2V3ProjectContext)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { V2V3ContractsProvider } from 'contexts/v2v3/Contracts/V2V3ContractsProv
import { useRef } from 'react'
import { Provider } from 'react-redux'
import store, { createStore } from 'redux/store'
import { useInitialEditingData } from '../../../../../ReconfigureFundingCycleSettingsPage/hooks/useInitialEditingData'
import { useInitialEditingData } from '../../../../../../hooks/useInitialEditingData'
import { LaunchFundingCycleForm } from './LaunchFundingCycleForm'

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useIsNftProject } from 'components/Create/hooks/DeployProject/hooks'
import { EditingFundingCycleConfig } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/pages/ReconfigureFundingCycleSettingsPage/hooks/useEditingFundingCycleConfig'
import { EditingFundingCycleConfig } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig'
import { ProjectMetadataContext } from 'contexts/shared/ProjectMetadataContext'
import { revalidateProject } from 'lib/api/nextjs'
import { PV2 } from 'models/pv'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EditingFundingCycleConfig } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/pages/ReconfigureFundingCycleSettingsPage/hooks/useEditingFundingCycleConfig'
import { EditingFundingCycleConfig } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig'
import { ProjectMetadataContext } from 'contexts/shared/ProjectMetadataContext'
import { V2V3ProjectContext } from 'contexts/v2v3/Project/V2V3ProjectContext'
import { BigNumber } from 'ethers'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EditingFundingCycleConfig } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/pages/ReconfigureFundingCycleSettingsPage/hooks/useEditingFundingCycleConfig'
import { EditingFundingCycleConfig } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig'
import { ProjectMetadataContext } from 'contexts/shared/ProjectMetadataContext'
import { useLaunchFundingCyclesWithNftsTx } from 'hooks/JB721Delegate/transactor/useLaunchFundingCyclesWithNftsTx'
import { LaunchFundingCyclesData } from 'hooks/v2v3/transactor/useLaunchFundingCyclesTx'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { EditingFundingCycleConfig } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/pages/ReconfigureFundingCycleSettingsPage/hooks/useEditingFundingCycleConfig'
import { EditingFundingCycleConfig } from 'components/v2v3/V2V3Project/V2V3ProjectSettings/hooks/useEditingFundingCycleConfig'
import { ProjectMetadataContext } from 'contexts/shared/ProjectMetadataContext'
import { useLaunchFundingCyclesTx } from 'hooks/v2v3/transactor/useLaunchFundingCyclesTx'
import { TransactionCallbacks } from 'models/transaction'
Expand Down

This file was deleted.

Loading

1 comment on commit 70a1035

@vercel
Copy link

@vercel vercel bot commented on 70a1035 Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.