refactor(representations): decompose representation flow shell into form stage and timetable panel (Slice R4, behaviour-preserving)
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
import RepresentationTimetablePanel from "./RepresentationTimetablePanel";
|
||||
|
||||
const RepresentationFlowFormStage = ({
|
||||
t,
|
||||
appealIsConsultation,
|
||||
currentReference,
|
||||
whichControl,
|
||||
appealIsLocalImpact,
|
||||
renderDueDate,
|
||||
renderStatementsDue,
|
||||
renderMarineImpact,
|
||||
renderConsultationClose,
|
||||
renderFinalCommentsDue,
|
||||
isQuestionnaire,
|
||||
whichProgress
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<h1 className="govuk-heading-l">
|
||||
{appealIsConsultation
|
||||
? t("myrepresentations:make-a-consultation-on-label")
|
||||
: t(
|
||||
"myrepresentations:make-a-representation-on-label"
|
||||
)}{" "}
|
||||
{currentReference}{" "}
|
||||
</h1>
|
||||
|
||||
<div id="rep-form">
|
||||
<div className="govuk-grid-column-three-quarters wgForm">
|
||||
{whichControl()}
|
||||
</div>
|
||||
|
||||
<RepresentationTimetablePanel
|
||||
t={t}
|
||||
appealIsConsultation={appealIsConsultation}
|
||||
appealIsLocalImpact={appealIsLocalImpact}
|
||||
renderDueDate={renderDueDate}
|
||||
renderStatementsDue={renderStatementsDue}
|
||||
renderMarineImpact={renderMarineImpact}
|
||||
renderConsultationClose={renderConsultationClose}
|
||||
renderFinalCommentsDue={renderFinalCommentsDue}
|
||||
isQuestionnaire={isQuestionnaire}
|
||||
whichProgress={whichProgress}
|
||||
/>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default RepresentationFlowFormStage;
|
||||
@@ -0,0 +1,49 @@
|
||||
const RepresentationTimetablePanel = ({
|
||||
t,
|
||||
appealIsConsultation,
|
||||
appealIsLocalImpact,
|
||||
renderDueDate,
|
||||
renderStatementsDue,
|
||||
renderMarineImpact,
|
||||
renderConsultationClose,
|
||||
renderFinalCommentsDue,
|
||||
isQuestionnaire,
|
||||
whichProgress
|
||||
}) => {
|
||||
return (
|
||||
<div className="govuk-grid-column-one-quarter">
|
||||
<div className="card">
|
||||
<div className="card-body">
|
||||
<h2 className="govuk-heading-s">
|
||||
{t("myrepresentations:timetable-title")}
|
||||
</h2>
|
||||
<div className="govuk-summary-list">
|
||||
<div className="govuk-body-s">
|
||||
{appealIsLocalImpact
|
||||
? t("myrepresentations:local-impact-report")
|
||||
: t(
|
||||
"myrepresentations:questionnaire-due-label"
|
||||
)}
|
||||
:{" "}
|
||||
<span className="govuk-body-s">
|
||||
{renderDueDate()}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{!appealIsConsultation && renderStatementsDue()}
|
||||
|
||||
{renderMarineImpact()}
|
||||
|
||||
{renderConsultationClose()}
|
||||
|
||||
{renderFinalCommentsDue()}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{isQuestionnaire && whichProgress()}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default RepresentationTimetablePanel;
|
||||
Reference in New Issue
Block a user