Skip to content

Commit

Permalink
fix: added way to disable checkmark by setting ending icon to none
Browse files Browse the repository at this point in the history
  • Loading branch information
pksorensen committed Sep 12, 2024
1 parent 30e8de8 commit 78974da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/core/src/components/ending/Ending.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ const useEndingStyles = makeStyles({
});

export const Ending: React.FC<EndingProps> = ({ model, className }) => {
const { state } = useQuickForm();
const { state } = useQuickForm();


const { text, paragraph } = model;
const submitStatus = state.submitStatus;
const styles = useEndingStyles();
Expand All @@ -36,7 +38,7 @@ export const Ending: React.FC<EndingProps> = ({ model, className }) => {
}
{submitStatus.isSubmitSuccess &&
<>
<Checkmark color={quickformtokens.onSurface} />
{state.defaultEndingSlideIcon !== "none" && <Checkmark color={quickformtokens.onSurface} />}
{text &&
<Heading style={{ marginTop: '10px' }}>
{text}
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/model/json-definitions/Layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export type LayoutDefinition = {
* The default text of next button on slides
*/
defaultNextButtonText?: string;

defaultEndingSlideIcon?: string;
classes?: Partial<QuickformClassNames>,
style?: React.CSSProperties;
tokens?: Partial<QuickFormTokens>;
Expand Down
2 changes: 2 additions & 0 deletions packages/core/src/state/QuickformState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type QuickformClassNames = {
ending: string
};
export type QuickformState = {
defaultEndingSlideIcon?: string;
autoAdvanceSlides?: boolean;
enableQuestionNumbers?: boolean;
showPressEnter?: boolean;
Expand All @@ -38,6 +39,7 @@ export type QuickformState = {

export const defaultState = (data: QuickFormModel = defaultData, layout?: LayoutDefinition): QuickformState => {
const defState = {
defaultEndingSlideIcon: layout?.defaultEndingSlideIcon ?? "checkmark",
autoAdvanceSlides: layout?.autoAdvanceSlides ?? false,
enableQuestionNumbers: layout?.enableQuestionNumbers ?? false,
showPressEnter: layout?.showPressEnter ?? undefined,
Expand Down

0 comments on commit 78974da

Please sign in to comment.