Skip to content

Commit

Permalink
fix: vercel errors
Browse files Browse the repository at this point in the history
  • Loading branch information
niloofar sadeghi committed May 7, 2023
1 parent f2e1a35 commit b0d65c0
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export type TGeneralContractCardBodyProps = {
addToast: (toast_config: TToastConfig) => void;
contract_info: TContractInfo;
contract_update: ContractUpdate;
connectWithContractUpdate: (contract_update_form: React.ElementType) => React.ElementType;
connectWithContractUpdate?: (contract_update_form: React.ElementType) => React.ElementType;
currency: string;
current_focus?: string;
error_message_alignment: string;
error_message_alignment?: string;
getCardLabels: TGetCardLables;
getContractById: (contract_id?: number) => TContractStore;
should_show_cancellation_warning: boolean;
Expand All @@ -36,7 +36,7 @@ export type TGeneralContractCardBodyProps = {
setCurrentFocus: (name: string) => void;
status: string;
toggleCancellationWarning: () => void;
progress_slider: React.ReactNode;
progress_slider?: React.ReactNode;
is_accumulator?: boolean;
is_positions?: boolean;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ export type TContractCardHeaderProps = {
has_progress_slider: boolean;
is_mobile: boolean;
is_sell_requested: boolean;
is_valid_to_sell: boolean;
is_valid_to_sell?: boolean;
onClickSell: (contract_id?: number) => void;
server_time: moment.Moment;
id: number;
id?: number;
is_sold?: boolean;
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ type TContractCardProps = {
is_multiplier: boolean;
is_positions: boolean;
is_unsupported: boolean;
onClickRemove: () => void;
onClickRemove: (contract_id?: number) => void;
profit_loss: number;
result: string;
should_show_result_overlay: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,8 @@ import {
getEndTime,
isVanillaContract,
} from '@deriv/shared';
import { TContractInfo } from '@deriv/shared/src/utils/contract/contract-types';

type TToastConfig = {
key?: number;
content: string;
timeout?: number;
is_bottom?: boolean;
type?: string;
};
import { TContractInfo, TContractStore } from '@deriv/shared/src/utils/contract/contract-types';
import { TToastConfig } from '../types/contract.types';

type TGetEndTime = Pick<
TContractInfo,
Expand All @@ -37,26 +30,26 @@ type TPositionsDrawerCardProps = {
currency: string;
current_focus: string;
display_name: string;
getContractById: (contract_id: string) => Record<string, any>;
getContractById: (contract_id?: number) => TContractStore;
is_mobile: boolean;
is_sell_requested: boolean;
is_unsupported: boolean;
is_link_disabled: boolean;
profit_loss: number;
onClickCancel: (contract_id: string) => void;
onClickSell: (contract_id: string) => void;
onClickRemove?: () => void;
onClickCancel: (contract_id?: number) => void;
onClickSell: (contract_id?: number) => void;
onClickRemove: (contract_id?: number) => void;
onFooterEntered: () => void;
onMouseEnter?: () => void;
onMouseLeave?: () => void;
removeToast: (key: number) => void;
removeToast: (key: string) => void;
result: string;
setCurrentFocus: (value: string) => void;
server_time: moment.Moment;
should_show_transition: boolean;
should_show_cancellation_warning: boolean;
status: string;
toggleCancellationWarning: (value: boolean) => void;
toggleCancellationWarning: () => void;
toggleUnsupportedContractModal: (value: boolean) => void;
measure?: () => void;
};
Expand Down Expand Up @@ -158,7 +151,6 @@ const PositionsDrawerCard = ({
is_multiplier={is_multiplier}
is_positions
is_sell_requested={is_sell_requested}
measure={measure}
onClickCancel={onClickCancel}
onClickSell={onClickSell}
onFooterEntered={onFooterEntered}
Expand Down
7 changes: 5 additions & 2 deletions packages/components/src/components/types/common.types.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import React from 'react';
import { getCardLabels, getContractTypeDisplay } from '@deriv/shared';
import { getCardLabels, getContractTypeDisplay, TGetSupportedContracts } from '@deriv/shared';

export type TGenericObjectType = {
[key: string]: React.ReactNode;
};
export type TGetCardLables = () => ReturnType<typeof getCardLabels>;

export type TGetContractTypeDisplay = (type: string, is_high_low: boolean) => ReturnType<typeof getContractTypeDisplay>;
export type TGetContractTypeDisplay = (
type: TGetSupportedContracts,
is_high_low: boolean
) => ReturnType<typeof getContractTypeDisplay>;

export type TItem = {
id: string;
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/utils/constants/contract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ type TContractConfig = {
position: string;
};

type TGetSupportedContracts = keyof ReturnType<typeof getSupportedContracts>;
export type TGetSupportedContracts = keyof ReturnType<typeof getSupportedContracts>;

export const getContractTypesConfig: TGetContractTypesConfig = symbol => ({
rise_fall: {
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/src/utils/url/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const getPath = (route_path: string, parameters = {}) =>
route_path
);

export const getContractPath = (contract_id: number) => getPath(routes.contract, { contract_id });
export const getContractPath = (contract_id?: number) => getPath(routes.contract, { contract_id });

/**
* Filters query string. Returns filtered query (without '/?')
Expand Down

0 comments on commit b0d65c0

Please sign in to comment.