@hhgtech/hhg-components
Version:
Hello Health Group common components
82 lines (81 loc) • 2.6 kB
TypeScript
import { Dispatch, ReactNode, SetStateAction } from 'react';
import { LOCALE, SubotMessage, SubotNodeItem, SubotNodeMessage, UserInfo } from "../../interfaces/types";
export type CommonProps = {
bgColor?: string;
primaryColor?: string;
textColor?: string;
textButtonColor?: string;
bgImgFullContainer?: string;
bgContentColor?: string;
};
export type TypeFormProp = {
id: string;
params: any;
};
export type ContextProps = {
subotId: number;
articleLink: string;
customUrl?: string;
isMobile?: boolean;
children?: ReactNode;
isFullContainer?: boolean;
isDisabledAnimationOnMobile?: boolean;
onCloseMobile?: () => void;
userInfo: UserInfo | undefined | null;
typeFormProps?: TypeFormProp;
locale?: LOCALE;
} & CommonProps;
export type ContextType = {
activeId: string;
params: SubotMessage;
listNodes: SubotNodeItem[];
loading: boolean;
setLoading: Dispatch<SetStateAction<boolean>>;
getParams: () => SubotMessage;
onNext: (params?: SubotMessage) => void;
onPrev: () => void;
onChange: (message?: SubotMessage) => void;
onSubmit: (nextNode?: SubotNodeMessage, message?: SubotMessage) => void;
onStartOver: () => void;
isShowFooter: boolean;
setIsShowFooter: Dispatch<SetStateAction<boolean>>;
isFullContainer?: boolean;
bgImgFullContainer?: string;
isDisabledAnimationOnMobile?: boolean;
onCloseMobile?: () => void;
userInfo: UserInfo | undefined | null;
typeFormProps?: TypeFormProp;
isMobile?: boolean;
locale?: LOCALE;
};
export type SubotInlineRevampContainerProps = {
id: string | number;
articleLink: string;
customUrl?: string;
isMobile?: boolean;
isFullContainer?: boolean;
isDisabledAnimationOnMobile?: boolean;
onCloseMobile?: () => void;
userInfo: UserInfo | undefined | null;
typeFormProps?: TypeFormProp;
locale?: LOCALE;
onLoadFirstNode?: (data: any) => void;
} & CommonProps;
export type SubotInlineRevampViewProps = {
loading: boolean;
backgroundImage?: string;
bgImgFullContainer?: string;
isShowFooter: boolean;
isFullContainer?: boolean;
isDisabledAnimationOnMobile?: boolean;
onCloseMobile?: () => void;
subotSettingData: {
inlineImage: string;
inilneHeadline: string;
reviewByAvatar: string;
reviewByName: string;
reviewBySpecialty: string;
reviewByHospital: string;
};
typeFormProps?: TypeFormProp;
};