-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from InseeFr/fix_develop
Fix develop
- Loading branch information
Showing
12 changed files
with
65 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,34 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import ReactLoading from 'react-loading'; | ||
import { | ||
getIsSurveyOnlineById, | ||
getSurveyOfflineMessageById, | ||
getSurveyOfflineMessageInfoById, | ||
} from '../../utils/read-content'; | ||
|
||
const ResponseButton = ({ id, isSurveyOnLine, messageSurveyOffline,messageInfoSurveyOffline}) => { | ||
|
||
if(isSurveyOnLine === undefined) { | ||
return ( | ||
<div className="center-block text-center"> | ||
<section style={{display: "flex", flexDirection: "column", alignItems: "center" }}> | ||
<h3>{`Veuillez patienter`}</h3> | ||
<ReactLoading type="spin" color={`#0f417a`} width="50px" /> | ||
</section> | ||
</div> | ||
) | ||
} | ||
|
||
return ( | ||
<div className="center-block text-center"> | ||
<section> | ||
<h2>{`Répondre à l'enquête`}</h2> | ||
<Link to={`/${id}/login`} tabIndex="-1"> | ||
<button type="button" className="btn btn-lg" id="accessButton" disabled={!isSurveyOnLine}> | ||
{'Accéder au questionnaire'} | ||
</button> | ||
</Link> | ||
<p /> | ||
{!isSurveyOnLine && ( | ||
<> | ||
{messageSurveyOffline && <div className="surveyOver">{messageSurveyOffline}</div>} | ||
{messageInfoSurveyOffline && <p>{messageInfoSurveyOffline}</p>} | ||
</> | ||
)} | ||
</section> | ||
</div> | ||
); | ||
}; | ||
const ResponseButton = ({ id }) => ( | ||
<div className="center-block text-center"> | ||
<section> | ||
<h2>{`Répondre à l'enquête`}</h2> | ||
<Link to={`/${id}/login`} tabIndex="-1"> | ||
<button | ||
type="button" | ||
className="btn btn-lg" | ||
id="boutonRepondre" | ||
disabled={!getIsSurveyOnlineById(id)} | ||
> | ||
{'Accéder au questionnaire'} | ||
</button> | ||
</Link> | ||
<p /> | ||
{!getIsSurveyOnlineById(id) && ( | ||
<> | ||
<div className="surveyOver">{getSurveyOfflineMessageById(id)}</div> | ||
<p>{getSurveyOfflineMessageInfoById(id)}</p> | ||
</> | ||
)} | ||
</section> | ||
</div> | ||
); | ||
|
||
export default ResponseButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.