Skip to content
Snippets Groups Projects
Commit a7a02363 authored by Bjarke Madsen's avatar Bjarke Madsen
Browse files

Put navigation above and below survey/survey navigation

parent a25fe40c
No related branches found
No related tags found
1 merge request!56Feature/comp 233 survey navigation
import React, { useEffect, useState } from "react";
import ProgressBar from './ProgressBar';
import { Container, Row } from "react-bootstrap";
function SurveyNavigationComponent({ surveyModel, endSurvey, saveSurvey, validatePage, children }) {
......@@ -30,11 +31,11 @@ function SurveyNavigationComponent({ surveyModel, endSurvey, saveSurvey, validat
<div className="navigation-block">
<div className="navigation-progress-container">
<div className="navigation-buttons-container">
{(pageNo === surveyModel.visiblePages.length - 1) && renderButton('Complete', endSurvey)}
{renderButton('Save', saveSurvey)}
{(pageNo !== surveyModel.visiblePages.length - 1) && renderButton('Next Page', incrementPageNo)}
{renderButton('Validate Page', validatePage)}
{pageNo !== 0 && renderButton('Previous Page', decrementPageNo)}
{(pageNo === surveyModel.visiblePages.length - 1) && renderButton('Complete Survey', endSurvey)}
{renderButton('Save progress', saveSurvey)}
{/* {(pageNo !== surveyModel.visiblePages.length - 1) && renderButton('Next Page', incrementPageNo)} */}
{/* {renderButton('Validate Page', validatePage)} */}
{/* {pageNo !== 0 && renderButton('Previous Page', decrementPageNo)} */}
</div>
</div>
</div>
......@@ -42,12 +43,19 @@ function SurveyNavigationComponent({ surveyModel, endSurvey, saveSurvey, validat
};
return (
<div>
<ProgressBar surveyModel={surveyModel} pageNoSetter={pageNoSetter} />
{renderExternalNavigation()}
{children}
{renderExternalNavigation()}
</div>
<Container>
<Row>
{renderExternalNavigation()}
</Row>
<Row>
<ProgressBar surveyModel={surveyModel} pageNoSetter={pageNoSetter} />
{children}
</Row>
<Row>
{renderExternalNavigation()}
</Row>
</Container>
);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment