From 320cbd7dce5907fcc47b3de92ec8352a893b994a Mon Sep 17 00:00:00 2001 From: Ken Lee Shu Ming Date: Wed, 25 Sep 2024 16:55:47 +0800 Subject: [PATCH] chore: add comments clarifying potentially confusing terms (#7694) * chore: add comments clarifying potentially confusing terms * feat: remove undocumented param and return --------- Co-authored-by: Kevin Foong --- .../admin-form/template/UseTemplateModal/UseTemplateModal.tsx | 4 ++++ .../template/UseTemplateModal/UseTemplateWizardProvider.tsx | 4 ++++ frontend/src/features/admin-form/template/mutation.ts | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateModal.tsx b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateModal.tsx index 91a58ddede..3d374e9b5a 100644 --- a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateModal.tsx +++ b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateModal.tsx @@ -16,6 +16,10 @@ export type UseTemplateModalProps = Pick< 'onClose' | 'isOpen' > & { formId: string } +/** + * Note: The word "Use" in "UseTemplateModal" is not referring to React's "use" convention for hooks. + * "UseTemplate" is a FormSG functionality referring to the FormSG feature of utilising another form as a starting template. + */ export const UseTemplateModal = ({ formId, isOpen, diff --git a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx index 3b876c58dd..8a0a9779da 100644 --- a/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx +++ b/frontend/src/features/admin-form/template/UseTemplateModal/UseTemplateWizardProvider.tsx @@ -116,6 +116,10 @@ interface UseTemplateWizardProviderProps { children: React.ReactNode } +/** + * Note: The word "Use" in "UseTemplateWizardProvider" is not referring to React's "use" convention for hooks. + * "UseTemplate" is a FormSG functionality referring to the FormSG feature of utilising another form as a starting template. + */ export const UseTemplateWizardProvider = ({ formId, children, diff --git a/frontend/src/features/admin-form/template/mutation.ts b/frontend/src/features/admin-form/template/mutation.ts index 2ba1cd5016..edfb4af283 100644 --- a/frontend/src/features/admin-form/template/mutation.ts +++ b/frontend/src/features/admin-form/template/mutation.ts @@ -53,6 +53,10 @@ const useCommonHooks = () => { } } +/** + * Note: The word "Use" in "useUseTemplateWizardProvider" is not referring to React's "use" convention for hooks. + * "UseTemplate" is a FormSG functionality referring to the FormSG feature of utilising another form as a starting template. + */ export const useUseTemplateMutations = () => { const { handleSuccess, handleError } = useCommonHooks()