Skip to content

Commit

Permalink
fixed types
Browse files Browse the repository at this point in the history
  • Loading branch information
agnieszkajarosikloj committed Mar 7, 2023
1 parent 9dfab26 commit 1f5f6a1
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 130 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ interface Props {
React.SetStateAction<ValuesType | IncorporationValuesType | undefined>
>;
colony: Colony;
handleCancelExpenditure: () => void;
handleCancel: () => void;
}

const FormStages = ({
Expand All @@ -52,7 +52,7 @@ const FormStages = ({
setActiveStageId,
setFormValues,
colony,
handleCancelExpenditure,
handleCancel,
}: Props) => {
const {
values,
Expand Down Expand Up @@ -195,7 +195,7 @@ const FormStages = ({
handleButtonClick,
handleDeleteDraft,
handleSaveDraft,
handleCancelExpenditure,
handleCancel,
colony,
}}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface Props {
activeStageId?: string;
motion?: Motion;
status?: Status;
handleCancelExpenditure?: () => void;
handleCancel?: () => void;
colony: Colony;
expenditureType?: ExpenditureTypes;
formValues?: ValuesType;
Expand All @@ -47,7 +47,7 @@ const LockedStages = ({
setActiveStageId,
motion,
status,
handleCancelExpenditure,
handleCancel,
formValues,
colony,
expenditureType,
Expand Down Expand Up @@ -100,7 +100,7 @@ const LockedStages = ({
motion={motion}
colony={colony}
activeStageId={activeStageId}
handleCancelExpenditure={handleCancelExpenditure}
handleCancel={handleCancel}
fundingSources={formValues?.streaming?.fundingSources}
/>
) : (
Expand All @@ -112,7 +112,7 @@ const LockedStages = ({
handleButtonClick,
motion,
status,
handleCancelExpenditure,
handleCancel,
formValues,
colony,
expenditureType,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export interface Props {
handleButtonClick: () => void;
status?: Status;
motion?: Motion;
handleCancelExpenditure?: () => void;
handleCancel?: () => void;
colony: Colony;
buttonDisabled?: boolean;
formValues?: ValuesType;
Expand All @@ -108,7 +108,7 @@ const Stages = ({
handleButtonClick,
status,
motion,
handleCancelExpenditure,
handleCancel,
colony,
buttonDisabled,
formValues,
Expand Down Expand Up @@ -301,7 +301,7 @@ const Stages = ({
[styles.iconButtonDisabled]:
motion?.status === MotionStatus.Pending,
})}
onClick={handleCancelExpenditure}
onClick={handleCancel}
disabled={
isCancelled || motion?.status === MotionStatus.Pending
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export interface Props {
motion?: Motion;
colony?: Colony;
activeStageId?: string;
handleCancelExpenditure?: () => void;
handleCancel?: () => void;
fundingSources?: FundingSource[];
}

Expand All @@ -111,7 +111,7 @@ const StreamingStagesLocked = ({
motion,
colony,
activeStageId,
handleCancelExpenditure,
handleCancel,
fundingSources,
}: Props) => {
const [valueIsCopied, setValueIsCopied] = useState(false);
Expand Down Expand Up @@ -290,7 +290,7 @@ const StreamingStagesLocked = ({
[styles.iconButtonDisabled]:
motion?.status === MotionStatus.Pending || isCancelled,
})}
onClick={handleCancelExpenditure}
onClick={handleCancel}
disabled={isCancelled || motion?.status === MotionStatus.Pending}
>
{motion?.status === MotionStatus.Pending || isCancelled ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Button from '~core/Button';
import Link from '~core/Link';

import SingleUserPicker from '../SingleUserPicker';
import { SignOption } from '../constants';

import styles from './Protectors.css';

Expand Down
107 changes: 0 additions & 107 deletions src/modules/dashboard/components/Incorporation/Stages/FormStages.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,7 @@ const ExpenditurePage = ({ match }: Props) => {
activeStageId={activeStageId}
setActiveStageId={setActiveStageId}
setFormValues={setFormValues}
handleCancelExpenditure={handleCancelExpenditure}
handleCancel={handleCancelExpenditure}
colony={colonyData.processedColony}
/>
)
Expand Down Expand Up @@ -638,7 +638,7 @@ const ExpenditurePage = ({ match }: Props) => {
stages={stages}
activeStageId={activeStageId}
setActiveStageId={setActiveStageId}
handleCancelExpenditure={handleCancelExpenditure}
handleCancel={handleCancelExpenditure}
colony={colonyData.processedColony}
expenditureType={formValues?.expenditure}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ import IncorporationForm from '~dashboard/Incorporation/IncorporationForm';
import Stages, { FormStages } from '~dashboard/ExpenditurePage/Stages';
import LockedIncorporationForm from '~dashboard/Incorporation/IncorporationForm/LockedIncorporationForm';
import VerificationBanner from '~dashboard/Incorporation/VerificationBanner';
import IncorporationPaymentDialog from '~dashboard/Dialogs/IncorporationPaymentDialog';
import { useDialog } from '~core/Dialog';
import {
Motion,
MotionStatus,
MotionType,
Status,
} from '~dashboard/ExpenditurePage/Stages/constants';
import { useDialog } from '~core/Dialog';
import CancelIncorporationDialog from '~dashboard/Dialogs/CancelIncorporationDialog';
import IncorporationPaymentDialog from '~dashboard/Dialogs/IncorporationPaymentDialog';

import {
initialValues,
Expand All @@ -29,9 +30,6 @@ import {
} from './constants';
import { ValuesType } from './types';
import styles from './IncorporationPage.css';
import { useDialog } from '~core/Dialog';
import CancelIncorporationDialog from '~dashboard/Dialogs/CancelIncorporationDialog';
import IncorporationPaymentDialog from '~dashboard/Dialogs/IncorporationPaymentDialog';

const displayName = 'pages.IncorporationPage';

Expand All @@ -51,8 +49,8 @@ const IncorporationPage = () => {
const [activeStageId, setActiveStageId] = useState(StagesEnum.Payment);
const sidebarRef = useRef<HTMLElement>(null);
const openCancelIncorporationDialog = useDialog(CancelIncorporationDialog);
const [motion, setMotion] = useState<Motion>();
const [status, setStatus] = useState<Status>();
const [, setMotion] = useState<Motion>();
const [, setStatus] = useState<Status>();

const notVerified = true; // temporary valule

Expand Down Expand Up @@ -179,7 +177,7 @@ const IncorporationPage = () => {
setActiveStageId={setActiveStageId}
colony={colonyData.processedColony}
setFormValues={setFormValues}
handleCancelExpenditure={() => {}}
handleCancel={handleCancelIncorporation}
/>
)}
</main>
Expand Down Expand Up @@ -226,6 +224,7 @@ const IncorporationPage = () => {
handleButtonClick={buttonAction || (() => {})}
colony={colonyData?.processedColony}
viewFor="incorporation"
handleCancel={handleCancelIncorporation}
/>
)}
</main>
Expand Down

0 comments on commit 1f5f6a1

Please sign in to comment.