From 324d58ce415bd59f5431f9c58a955e9b83cc9299 Mon Sep 17 00:00:00 2001 From: phonktown Date: Fri, 23 Aug 2024 19:45:19 +0300 Subject: [PATCH] fixup! feat(voting): adjust voting UI --- .../providers/DelegationFormContext.tsx | 5 +- .../DelegationAddressPop.tsx | 5 +- .../ui/DelegationAddressPop/PopStyle.tsx | 4 +- modules/modal/ModalProvider.tsx | 6 - modules/votes/hooks/useVoteActionsModals.ts | 4 +- .../VoteFormActionsContext.tsx | 65 ++++++----- .../VoteActionsDelegatorsList.tsx | 19 +++- .../SubmitModal/VoteSubmitModal.tsx | 8 +- .../SuccessModal/VoteSuccessModal.tsx | 7 +- modules/votes/ui/VoteDetails/VoteDetails.tsx | 4 +- modules/votes/ui/VoteForm/useFormVoteInfo.ts | 2 +- .../ui/VoteFormActions/VoteFormActions.tsx | 4 +- .../VoteFormVoterState/VoteFormVoterState.tsx | 104 ------------------ .../VoteFormVoterStateStyle.ts | 25 ----- modules/votes/ui/VoteFormVoterState/index.ts | 1 - .../votes/ui/VotePowerInfo/VotePowerInfo.tsx | 6 +- .../VoteStatusBannerNew/VoteStatusBanner.tsx | 3 +- .../ui/VoteVotersList/VoteVotersList.tsx | 8 +- next.config.mjs | 4 +- 19 files changed, 90 insertions(+), 194 deletions(-) delete mode 100644 modules/votes/ui/VoteFormVoterState/VoteFormVoterState.tsx delete mode 100644 modules/votes/ui/VoteFormVoterState/VoteFormVoterStateStyle.ts delete mode 100644 modules/votes/ui/VoteFormVoterState/index.ts diff --git a/modules/delegation/providers/DelegationFormContext.tsx b/modules/delegation/providers/DelegationFormContext.tsx index fd670130..087c4486 100644 --- a/modules/delegation/providers/DelegationFormContext.tsx +++ b/modules/delegation/providers/DelegationFormContext.tsx @@ -23,8 +23,9 @@ import { ToastSuccess } from '@lidofinance/lido-ui' // // Data context // -const DelegationFormDataContext = - createContext(null) +const DelegationFormDataContext = createContext< + DelegationFormDataContextValue | undefined +>(undefined) export const useDelegationFormData = () => { const value = useContext(DelegationFormDataContext) diff --git a/modules/delegation/ui/DelegationAddressPop/DelegationAddressPop.tsx b/modules/delegation/ui/DelegationAddressPop/DelegationAddressPop.tsx index cc950409..02fcdc9f 100644 --- a/modules/delegation/ui/DelegationAddressPop/DelegationAddressPop.tsx +++ b/modules/delegation/ui/DelegationAddressPop/DelegationAddressPop.tsx @@ -17,8 +17,11 @@ import { import { calcPopoverPosition } from './calcPopoverPosition' -type Props = React.ComponentProps & { +type IdenticonBadgeProps = React.ComponentProps + +type Props = IdenticonBadgeProps & { delegateAddress: string | null + children: React.ReactNode } export function DelegationAddressPop({ children, ...badgeProps }: Props) { diff --git a/modules/delegation/ui/DelegationAddressPop/PopStyle.tsx b/modules/delegation/ui/DelegationAddressPop/PopStyle.tsx index 21bc1f35..9b08d52f 100644 --- a/modules/delegation/ui/DelegationAddressPop/PopStyle.tsx +++ b/modules/delegation/ui/DelegationAddressPop/PopStyle.tsx @@ -18,6 +18,8 @@ const popIn = keyframes` ` type PopProps = { isVisible: boolean } +type IdenticonBadgeProps = React.ComponentProps + export const Pop = styled.div` cursor: default; padding: ${({ theme }) => theme.spaceMap.sm}px; @@ -60,7 +62,7 @@ export const VotedBy = styled.div` margin-top: 24px; ` -export const IdenticonBadgeWrap = styled(IdenticonBadge)` +export const IdenticonBadgeWrap = styled(IdenticonBadge)` margin: 0; width: 100%; display: flex; diff --git a/modules/modal/ModalProvider.tsx b/modules/modal/ModalProvider.tsx index b1a46d53..201db4eb 100644 --- a/modules/modal/ModalProvider.tsx +++ b/modules/modal/ModalProvider.tsx @@ -15,7 +15,6 @@ export type Data = Record type ModalContextValue = { openModal: (modal: Modal, initialData?: Data) => void closeModal: () => void - updateModal: (newData?: Partial) => void } // https://github.com/CharlesStover/use-force-update @@ -53,15 +52,10 @@ function ModalProviderRaw({ children }: Props) { }, 0) }, [setData]) - // const updateModal = useCallback((newData: Partial) => { - // setData(prevData => ({ ...prevData, ...newData })) - // }, []) - const context = useMemo( () => ({ openModal, closeModal, - // updateModal, }), [openModal, closeModal], ) diff --git a/modules/votes/hooks/useVoteActionsModals.ts b/modules/votes/hooks/useVoteActionsModals.ts index dceb34cd..d6ae5280 100644 --- a/modules/votes/hooks/useVoteActionsModals.ts +++ b/modules/votes/hooks/useVoteActionsModals.ts @@ -3,15 +3,15 @@ import { useVoteActionModal } from 'modules/votes/hooks/useVoteActionModal' import { VoteSubmitModal } from 'modules/votes/ui/VoteActionsModals/SubmitModal/VoteSubmitModal' import { VoteSuccessModal } from 'modules/votes/ui/VoteActionsModals/SuccessModal/VoteSuccessModal' import { useVoteFormActionsContext } from 'modules/votes/providers/VoteFormActions/VoteFormActionsContext' -import { PopulatedTransaction } from '@ethersproject/contracts' import { VoteMode } from 'modules/votes/types' +import { ResultTx } from 'modules/blockChain/types' type ModalKey = 'submit' | 'success' type ModalData = { mode?: VoteMode - successTx?: PopulatedTransaction + successTx?: ResultTx } export function useVoteActionsModals() { diff --git a/modules/votes/providers/VoteFormActions/VoteFormActionsContext.tsx b/modules/votes/providers/VoteFormActions/VoteFormActionsContext.tsx index a7805e10..608ef173 100644 --- a/modules/votes/providers/VoteFormActions/VoteFormActionsContext.tsx +++ b/modules/votes/providers/VoteFormActions/VoteFormActionsContext.tsx @@ -6,7 +6,6 @@ import React, { useState, } from 'react' import { - EligibleDelegator, EligibleDelegatorsData, useEligibleDelegators, } from 'modules/delegation/hooks/useEligibleDelegators' @@ -15,18 +14,33 @@ import { useFormVoteInfo } from 'modules/votes/ui/VoteForm/useFormVoteInfo' import { formatBalance } from 'modules/blockChain/utils/formatBalance' import { useGovernanceSymbol } from 'modules/tokens/hooks/useGovernanceSymbol' -import { PopulatedTransaction } from '@ethersproject/contracts' +import { ResultTx } from 'modules/blockChain/types' import { VoteMode } from 'modules/votes/types' -import { BigNumber } from '@ethersproject/bignumber' + +import invariant from 'tiny-invariant' + import { AttemptCastVoteAsDelegateEventObject, CastVoteEventObject, } from 'generated/AragonVotingAbi' +import { BigNumber } from '@ethersproject/bignumber' +import { + FinishHandler, + TransactionSender, +} from 'modules/blockChain/hooks/useTransactionSender' -interface VoteFormActionsContextType { +export enum VotedAs { + delegate = 'delegate', + owner = 'owner', +} + +export type VoteFormActionsContextValue = { voteId: string - successTx: PopulatedTransaction | null - ownVotePower: BigNumber + successTx: ResultTx | null + setSuccessTx: React.Dispatch> + formVoteSubmitData: ReturnType + setVoteId: React.Dispatch> + ownVotePower: Number handleVote: (mode: VoteMode) => Promise handleDelegatesVote: ( mode: VoteMode, @@ -34,35 +48,34 @@ interface VoteFormActionsContextType { ) => Promise votedAs: VotedAs | null mode: VoteMode | null - txVote: PopulatedTransaction | null - txDelegatesVote: PopulatedTransaction | null - eventsVoted: CastVoteEventObject[] - eventsDelegatesVoted: AttemptCastVoteAsDelegateEventObject[] + txVote: TransactionSender + txDelegatesVote: TransactionSender + eventsVoted: CastVoteEventObject[] | undefined + eventsDelegatesVoted: AttemptCastVoteAsDelegateEventObject[] | undefined eligibleDelegatedVotingPower: BigNumber delegatedVotersAddresses: string[] eligibleDelegatedVoters: EligibleDelegatorsData['eligibleDelegatedVoters'] eligibleDelegatedVotersAddresses: string[] - delegatorsVotedThemselves: EligibleDelegator[] + delegatorsVotedThemselves: CastVoteEventObject[] | undefined governanceSymbol: string | undefined votedByDelegate: EligibleDelegatorsData['eligibleDelegatedVoters'] } -export enum VotedAs { - delegate = 'delegate', - owner = 'owner', -} - -const VoteFormActionsContext = createContext< - VoteFormActionsContextType | undefined ->(undefined) +const VoteFormActionsContext = + createContext(null) export const useVoteFormActionsContext = () => { - return useContext(VoteFormActionsContext) + const value = useContext(VoteFormActionsContext) + invariant( + value, + 'useVoteFormActionsContext was used outside the VoteFormActionsContext provider', + ) + return value } export const VoteFormActionsProvider: React.FC = ({ children }) => { const [voteId, setVoteId] = useState('') - const [successTx, setSuccessTx] = useState(null) + const [successTx, setSuccessTx] = useState(null) const [votedAs, setVotedAs] = useState(null) const [mode, setMode] = useState(null) @@ -75,9 +88,9 @@ export const VoteFormActionsProvider: React.FC = ({ children }) => { const { eventsVoted, eventsDelegatesVoted } = formVoteInfoData - const handleFinish = async ({ tx }) => { + const handleFinish: FinishHandler = async ({ tx }) => { await mutate() - setSuccessTx(tx) + setSuccessTx(tx as unknown as ResultTx) } const formVoteSubmitData = useFormVoteSubmit({ @@ -106,7 +119,7 @@ export const VoteFormActionsProvider: React.FC = ({ children }) => { ) const delegatedVotersAddresses = useMemo( - () => eligibleDelegatorsData.eligibleDelegatedVoters, + () => eligibleDelegatorsData.delegatedVotersAddresses, [eligibleDelegatorsData], ) @@ -124,7 +137,7 @@ export const VoteFormActionsProvider: React.FC = ({ children }) => { ) }, [delegatedVotersAddresses, eventsVoted, eventsDelegatesVoted]) - const ownVotePower = formatBalance(formVoteInfoData.votePowerWei || 0) + const ownVotePower = Number(formatBalance(formVoteInfoData.votePowerWei || 0)) const eligibleDelegatedVoters = useMemo( () => eligibleDelegatorsData.eligibleDelegatedVoters, @@ -159,7 +172,7 @@ export const VoteFormActionsProvider: React.FC = ({ children }) => { delegatedVotersAddresses, eligibleDelegatedVoters, eligibleDelegatedVotersAddresses: - eligibleDelegatorsData.eligibleDelegatedVoters, + eligibleDelegatorsData.eligibleDelegatedVotersAddresses, delegatorsVotedThemselves, governanceSymbol, votedByDelegate, diff --git a/modules/votes/ui/VoteActionsModals/DelegatorsList/VoteActionsDelegatorsList.tsx b/modules/votes/ui/VoteActionsModals/DelegatorsList/VoteActionsDelegatorsList.tsx index 08ff35f2..0f9d4fcb 100644 --- a/modules/votes/ui/VoteActionsModals/DelegatorsList/VoteActionsDelegatorsList.tsx +++ b/modules/votes/ui/VoteActionsModals/DelegatorsList/VoteActionsDelegatorsList.tsx @@ -14,6 +14,17 @@ import { AddressPop } from 'modules/shared/ui/Common/AddressPop' import { formatBalance } from 'modules/blockChain/utils/formatBalance' import { useSimpleReducer } from 'modules/shared/hooks/useSimpleReducer' import { BigNumber } from 'ethers' +import { EligibleDelegator } from 'modules/delegation/hooks/useEligibleDelegators' +import { CastVoteEventObject } from 'generated/AragonVotingAbi' + +interface Props { + delegatorsVotedThemselves: CastVoteEventObject[] | undefined + governanceSymbol: string | undefined + onSelectedAddressesChange: (address: string[]) => void + eventsVoted: CastVoteEventObject[] | undefined + eligibleDelegatedVoters: EligibleDelegator[] + eligibleDelegatedVotingPower: BigNumber +} const pluralize = (count: number, noun: string, suffix = 's') => `${count} ${noun}${count !== 1 ? suffix : ''}` @@ -25,7 +36,7 @@ export function DelegatorsList({ eligibleDelegatedVotingPower, onSelectedAddressesChange, eventsVoted, -}) { +}: Props) { const initialCheckedItems = Object.fromEntries( eligibleDelegatedVoters .filter(delegator => !delegator.votedByDelegate) @@ -40,7 +51,7 @@ export function DelegatorsList({ ) const _eventsVoted = useMemo(() => { - return eventsVoted?.reduce((acc, event) => { + return eventsVoted?.reduce>((acc, event) => { acc[event.voter] = event.supports return acc }, {}) @@ -119,7 +130,7 @@ export function DelegatorsList({ ))} - {delegatorsVotedThemselves?.length > 0 && ( + {delegatorsVotedThemselves && delegatorsVotedThemselves.length > 0 && ( <> @@ -127,7 +138,7 @@ export function DelegatorsList({ - {delegatorsVotedThemselves?.map(voteEvent => ( + {delegatorsVotedThemselves.map(voteEvent => ( diff --git a/modules/votes/ui/VoteActionsModals/SubmitModal/VoteSubmitModal.tsx b/modules/votes/ui/VoteActionsModals/SubmitModal/VoteSubmitModal.tsx index 5f2ecd04..3438b206 100644 --- a/modules/votes/ui/VoteActionsModals/SubmitModal/VoteSubmitModal.tsx +++ b/modules/votes/ui/VoteActionsModals/SubmitModal/VoteSubmitModal.tsx @@ -22,9 +22,9 @@ export function VoteSubmitModal({ data: { mode }, ...modalProps }: ModalProps) { governanceSymbol, } = useVoteFormActionsContext() - const [selectedDelegatedAddresses, setSelectedDelegatedAddresses] = useState( - [], - ) + const [selectedDelegatedAddresses, setSelectedDelegatedAddresses] = useState< + string[] + >([]) const handleSelectedAddressesChange = useCallback(addresses => { setSelectedDelegatedAddresses(addresses) @@ -68,7 +68,7 @@ export function VoteSubmitModal({ data: { mode }, ...modalProps }: ModalProps) { )} - {txDelegatesVote && !txDelegatesVote.isEmpty && ( + {!txDelegatesVote.isEmpty && ( <>
diff --git a/modules/votes/ui/VoteActionsModals/SuccessModal/VoteSuccessModal.tsx b/modules/votes/ui/VoteActionsModals/SuccessModal/VoteSuccessModal.tsx index 2eec5d8e..3c946368 100644 --- a/modules/votes/ui/VoteActionsModals/SuccessModal/VoteSuccessModal.tsx +++ b/modules/votes/ui/VoteActionsModals/SuccessModal/VoteSuccessModal.tsx @@ -40,9 +40,9 @@ export function VoteSuccessModal({ ownVotePower, } = useVoteFormActionsContext() - const [selectedDelegatedAddresses, setSelectedDelegatedAddresses] = useState( - [], - ) + const [selectedDelegatedAddresses, setSelectedDelegatedAddresses] = useState< + string[] + >([]) const handleSelectedAddressesChange = useCallback(addresses => { setSelectedDelegatedAddresses(addresses) @@ -64,6 +64,7 @@ export function VoteSuccessModal({ const handleVoteClick = useCallback( power => { + if (!mode) return if (power === 'own') { return handleVote(mode) } diff --git a/modules/votes/ui/VoteDetails/VoteDetails.tsx b/modules/votes/ui/VoteDetails/VoteDetails.tsx index bd1a7cb1..18e8dacb 100644 --- a/modules/votes/ui/VoteDetails/VoteDetails.tsx +++ b/modules/votes/ui/VoteDetails/VoteDetails.tsx @@ -33,8 +33,8 @@ type Props = { metadata?: string isEnded: boolean eventsVoted: CastVoteEventObject[] | undefined - eventsDelegatesVoted: AttemptCastVoteAsDelegateEventObject[] - votePhase: VotePhase + eventsDelegatesVoted: AttemptCastVoteAsDelegateEventObject[] | undefined + votePhase: VotePhase | undefined } export function VoteDetails({ diff --git a/modules/votes/ui/VoteForm/useFormVoteInfo.ts b/modules/votes/ui/VoteForm/useFormVoteInfo.ts index c6674d4f..86823eda 100644 --- a/modules/votes/ui/VoteForm/useFormVoteInfo.ts +++ b/modules/votes/ui/VoteForm/useFormVoteInfo.ts @@ -28,7 +28,7 @@ export function useFormVoteInfo({ voteId }: Args) { const rpcUrl = getRpcUrl(chainId) const contractVoting = ContractVoting.useRpc() - const { delegatorsData, loading: isDelegatorsLoading } = useDelegators() + const { data: delegatorsData, loading: isDelegatorsLoading } = useDelegators() const delegatorsAddresses = useMemo( () => delegatorsData?.list.map(d => d.address) || [], diff --git a/modules/votes/ui/VoteFormActions/VoteFormActions.tsx b/modules/votes/ui/VoteFormActions/VoteFormActions.tsx index af27401d..afe22ccb 100644 --- a/modules/votes/ui/VoteFormActions/VoteFormActions.tsx +++ b/modules/votes/ui/VoteFormActions/VoteFormActions.tsx @@ -16,11 +16,11 @@ import { BigNumber } from '@ethersproject/bignumber' type Props = { canEnact: boolean voterState: VoterState - votePhase: VotePhase + votePhase: VotePhase | undefined isSubmitting: false | VoteMode onEnact: () => void voteId: string - votePowerWei: BigNumber | undefined + votePowerWei: BigNumber | null | undefined } export function VoteFormActions({ diff --git a/modules/votes/ui/VoteFormVoterState/VoteFormVoterState.tsx b/modules/votes/ui/VoteFormVoterState/VoteFormVoterState.tsx deleted file mode 100644 index 3117cb5e..00000000 --- a/modules/votes/ui/VoteFormVoterState/VoteFormVoterState.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { useGovernanceSymbol } from 'modules/tokens/hooks/useGovernanceSymbol' - -import { Wrap } from './VoteFormVoterStateStyle' -import { FormattedDate } from 'modules/shared/ui/Utils/FormattedDate' - -import { VoterState, VoteStatus } from 'modules/votes/types' - -type Props = { - status: VoteStatus - canVote: boolean - canEnact: boolean - votePower: number - voterState: VoterState - snapshotBlock: number - startDate: number - isEnded: boolean -} - -export function VoteFormVoterState({ - status, - canVote, - canEnact, - votePower, - voterState, - snapshotBlock, - startDate, - isEnded, -}: Props) { - const { data: symbol } = useGovernanceSymbol() - - const isMainPhase = status === VoteStatus.ActiveMain - const isObjPhase = status === VoteStatus.ActiveObjection - const isNotVoted = voterState === VoterState.NotVoted - const isVotedYay = voterState === VoterState.VotedYay - const isVotedNay = voterState === VoterState.VotedNay - - const elStartBlockDate = ( - <> - (block {snapshotBlock} minted at{' '} - - ). - - ) - - const elThisWasYourBalance = ( - <>This was your balance when the vote started {elStartBlockDate} - ) - - const elChange = ( -

- You can change your vote while the voting period is open but you - can only vote “No” in the objection phase. -

- ) - - const elNotVotedYet = ( - <> -

- Voting with{' '} - - {votePower} {symbol} - - . {elThisWasYourBalance} -

- - ) - - const elAlreadyVoted = ( - <> -

- You have voted “{isVotedNay ? 'No' : 'Yes'}” with{' '} - - {votePower} {symbol} - - . {elThisWasYourBalance} -

- - ) - - const elCantVote = ( -

- You can not do vote because you had no {symbol} when the vote - started {elStartBlockDate}. -

- ) - - const elEnactText = ( -

- The voting period is closed and the vote has passed. -
- Anyone can now enact this vote to execute its action. -

- ) - - return ( - - {isEnded === false && !canVote && Number(votePower) === 0 && elCantVote} - {isEnded === false && canVote && isNotVoted && elNotVotedYet} - {(isVotedYay || isVotedNay) && elAlreadyVoted} - {canVote && (isMainPhase || (isObjPhase && isVotedYay)) && elChange} - {canEnact && isEnded && elEnactText} - - ) -} diff --git a/modules/votes/ui/VoteFormVoterState/VoteFormVoterStateStyle.ts b/modules/votes/ui/VoteFormVoterState/VoteFormVoterStateStyle.ts deleted file mode 100644 index 7dc0a327..00000000 --- a/modules/votes/ui/VoteFormVoterState/VoteFormVoterStateStyle.ts +++ /dev/null @@ -1,25 +0,0 @@ -import styled from 'styled-components' - -export const Wrap = styled.div` - padding: ${({ theme }) => theme.spaceMap.lg}px; - font-size: ${({ theme }) => theme.fontSizesMap.xxs}px; - font-weight: 400; - line-height: ${({ theme }) => theme.fontSizesMap.lg}px; - color: var(--lido-color-textDark); - background-color: var(--lido-color-warningBackground); - border-radius: ${({ theme }) => theme.borderRadiusesMap.lg}px; - - b { - font-weight: 700; - } - - p { - &:not(:last-child) { - margin-bottom: ${({ theme }) => theme.spaceMap.xs}px; - } - } - - &:empty { - display: none; - } -` diff --git a/modules/votes/ui/VoteFormVoterState/index.ts b/modules/votes/ui/VoteFormVoterState/index.ts deleted file mode 100644 index ee0b5135..00000000 --- a/modules/votes/ui/VoteFormVoterState/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './VoteFormVoterState' diff --git a/modules/votes/ui/VotePowerInfo/VotePowerInfo.tsx b/modules/votes/ui/VotePowerInfo/VotePowerInfo.tsx index e91c3ba2..0371d123 100644 --- a/modules/votes/ui/VotePowerInfo/VotePowerInfo.tsx +++ b/modules/votes/ui/VotePowerInfo/VotePowerInfo.tsx @@ -3,10 +3,10 @@ import { InfoWrap, VotingPower, Amount } from './VotePowerInfoStyle' import { useGovernanceSymbol } from '../../../tokens/hooks/useGovernanceSymbol' import { formatBalance } from 'modules/blockChain/utils/formatBalance' import { useDelegatorsInfo } from '../../../delegation/hooks/useDelegatorsInfo' -import { BigNumberish } from 'ethers' +import { BigNumber } from 'ethers' interface Props { - ownVotePower: BigNumberish + ownVotePower: BigNumber | null | undefined } export function VotePowerInfo({ ownVotePower }: Props) { @@ -22,7 +22,7 @@ export function VotePowerInfo({ ownVotePower }: Props) { My voting power - {formatBalance(ownVotePower)} {govSymbol} + {formatBalance(ownVotePower || BigNumber.from(0))} {govSymbol} {totalCount > 0 && ( diff --git a/modules/votes/ui/VoteStatusBannerNew/VoteStatusBanner.tsx b/modules/votes/ui/VoteStatusBannerNew/VoteStatusBanner.tsx index ba0df358..d34b2990 100644 --- a/modules/votes/ui/VoteStatusBannerNew/VoteStatusBanner.tsx +++ b/modules/votes/ui/VoteStatusBannerNew/VoteStatusBanner.tsx @@ -7,7 +7,7 @@ interface Props { voteTime: number objectionPhaseTime: number isEnded: boolean - votePhase: VotePhase + votePhase: VotePhase | undefined } export function VoteStatusBanner({ @@ -18,6 +18,7 @@ export function VoteStatusBanner({ isEnded, votePhase, }: Props) { + if (!votePhase) return null return ( => { const map = new Map() - delegateEvents.forEach( - ([, delegate, voters]: AttemptCastVoteAsDelegateEventObject) => { + delegateEvents?.forEach( + ({ delegate, voters }: AttemptCastVoteAsDelegateEventObject) => { voters.forEach(voter => { map.set(voter, delegate) }) diff --git a/next.config.mjs b/next.config.mjs index 0cc2ee3d..dd8855ca 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -107,14 +107,14 @@ export default { // devServer(configFunction) { // return function (proxy, allowedHost) { // const config = configFunction(proxy, allowedHost) - + // // config.headers = { // 'Access-Control-Allow-Origin': '*', // 'Access-Control-Allow-Methods': 'GET', // 'Access-Control-Allow-Headers': // 'X-Requested-With, content-type, Authorization', // } - + // // return config // } // },