mirror of
https://github.com/documenso/documenso.git
synced 2025-11-14 00:32:43 +10:00
Update label render condition
This commit is contained in:
@ -244,6 +244,7 @@ export const SinglePlayerClient = () => {
|
|||||||
recipients={uploadedFile ? [placeholderRecipient] : []}
|
recipients={uploadedFile ? [placeholderRecipient] : []}
|
||||||
fields={fields}
|
fields={fields}
|
||||||
onSubmit={onFieldsSubmit}
|
onSubmit={onFieldsSubmit}
|
||||||
|
isSinglePlayerMode={true}
|
||||||
/>
|
/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
|
|||||||
@ -53,6 +53,7 @@ export type AddFieldsFormProps = {
|
|||||||
recipients: Recipient[];
|
recipients: Recipient[];
|
||||||
fields: Field[];
|
fields: Field[];
|
||||||
onSubmit: (_data: TAddFieldsFormSchema) => void;
|
onSubmit: (_data: TAddFieldsFormSchema) => void;
|
||||||
|
isSinglePlayerMode?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AddFieldsFormPartial = ({
|
export const AddFieldsFormPartial = ({
|
||||||
@ -61,10 +62,12 @@ export const AddFieldsFormPartial = ({
|
|||||||
recipients,
|
recipients,
|
||||||
fields,
|
fields,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
|
isSinglePlayerMode = false,
|
||||||
}: AddFieldsFormProps) => {
|
}: AddFieldsFormProps) => {
|
||||||
const { isWithinPageBounds, getFieldPosition, getPage } = useDocumentElement();
|
const { isWithinPageBounds, getFieldPosition, getPage } = useDocumentElement();
|
||||||
const { currentStep, totalSteps, previousStep } = useStep();
|
const { currentStep, totalSteps, previousStep } = useStep();
|
||||||
|
const canRenderBackButtonAsRemove =
|
||||||
|
currentStep === 1 && typeof documentFlow.onBackStep === 'function' && isSinglePlayerMode;
|
||||||
const {
|
const {
|
||||||
control,
|
control,
|
||||||
handleSubmit,
|
handleSubmit,
|
||||||
@ -568,11 +571,7 @@ export const AddFieldsFormPartial = ({
|
|||||||
remove();
|
remove();
|
||||||
documentFlow.onBackStep?.();
|
documentFlow.onBackStep?.();
|
||||||
}}
|
}}
|
||||||
goBackLabel={
|
goBackLabel={canRenderBackButtonAsRemove ? 'Remove' : undefined}
|
||||||
currentStep === 1 && typeof documentFlow.onBackStep === 'function'
|
|
||||||
? 'Remove'
|
|
||||||
: undefined
|
|
||||||
}
|
|
||||||
onGoNextClick={() => void onFormSubmit()}
|
onGoNextClick={() => void onFormSubmit()}
|
||||||
/>
|
/>
|
||||||
</DocumentFlowFormContainerFooter>
|
</DocumentFlowFormContainerFooter>
|
||||||
|
|||||||
Reference in New Issue
Block a user