shinkan-jinkendo/frontend/src/components/PageFormEditorChrome.jsx
Lars 8afdd811db
Some checks failed
Deploy Development / deploy (push) Failing after 23s
Test Suite / pytest-backend (push) Successful in 34s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Failing after 7s
Test Suite / k6 /health Baseline (push) Successful in 33s
Test Suite / playwright-tests (push) Successful in 1m19s
Refactor full-page editor navigation and update return context handling
- Adjusted `PageFormEditorChrome` to set `showReturn` to false by default, making the back button optional.
- Removed `PageReturnButton` from `TrainingFrameworkProgramEditPage`, `TrainingModuleEditPage`, and `TrainingPlanTemplateEditPage` to streamline navigation.
- Updated documentation to reflect changes in editor actions and return context behavior for improved clarity.
2026-05-20 07:56:22 +02:00

36 lines
1.1 KiB
JavaScript

import React from 'react'
import { useFormEditorActions } from '../context/FormEditorActionsContext'
import PageReturnButton from './PageReturnButton'
/**
* Vollseiten-Editor: optional Zurück oben; FormActionBar fix unten (FormEditorBottomSlot).
* Mit actionConfig ist showReturn standardmäßig aus — Rücksprung über Abbrechen / Speichern & Schließen.
*/
export default function PageFormEditorChrome({
title,
fallbackPath,
fallbackLabel,
actionConfig,
children,
testId,
showReturn = false,
}) {
useFormEditorActions(actionConfig)
return (
<div className="page-form-editor" data-testid={testId}>
<header className="page-form-editor__header">
{showReturn && fallbackPath && fallbackLabel ? (
<PageReturnButton
fallbackPath={fallbackPath}
fallbackLabel={fallbackLabel}
className="page-return-btn page-form-editor__back btn btn-secondary btn-small"
/>
) : null}
<h1 className="page-form-editor__title">{title}</h1>
</header>
<div className="page-form-editor__body">{children}</div>
</div>
)
}