2020-10-01 17:11:45 +03:00
|
|
|
import React from 'react';
|
2018-09-21 14:49:13 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { Button, Panel } from '@freecodecamp/react-bootstrap';
|
|
|
|
|
2019-02-22 18:58:38 +05:30
|
|
|
import { FullWidthRow } from '../helpers';
|
2018-09-21 14:49:13 +01:00
|
|
|
import SectionHeader from './SectionHeader';
|
2019-02-22 18:58:38 +05:30
|
|
|
import HonestyPolicy from '../../resources/honesty-policy';
|
2018-09-21 14:49:13 +01:00
|
|
|
|
|
|
|
import './honesty.css';
|
|
|
|
|
|
|
|
const propTypes = {
|
|
|
|
isHonest: PropTypes.bool,
|
|
|
|
updateIsHonest: PropTypes.func.isRequired
|
|
|
|
};
|
|
|
|
|
2020-10-01 17:11:45 +03:00
|
|
|
const Honesty = ({ isHonest, updateIsHonest }) => {
|
|
|
|
const button = isHonest ? (
|
2019-10-22 17:20:33 +05:30
|
|
|
<Button
|
|
|
|
block={true}
|
|
|
|
bsStyle='primary'
|
|
|
|
className='disabled-agreed'
|
|
|
|
disabled={true}
|
|
|
|
>
|
2018-09-21 14:49:13 +01:00
|
|
|
<p>You have accepted our Academic Honesty Policy.</p>
|
2019-10-22 17:20:33 +05:30
|
|
|
</Button>
|
2020-10-01 17:11:45 +03:00
|
|
|
) : (
|
|
|
|
<Button
|
|
|
|
block={true}
|
|
|
|
bsStyle='primary'
|
|
|
|
onClick={() => updateIsHonest({ isHonest: true })}
|
|
|
|
>
|
|
|
|
Agree
|
|
|
|
</Button>
|
2018-09-21 14:49:13 +01:00
|
|
|
);
|
2020-10-01 17:11:45 +03:00
|
|
|
return (
|
|
|
|
<section className='honesty-policy'>
|
|
|
|
<SectionHeader>Academic Honesty Policy</SectionHeader>
|
|
|
|
<FullWidthRow>
|
|
|
|
<Panel className='honesty-panel'>
|
|
|
|
<HonestyPolicy />
|
|
|
|
</Panel>
|
|
|
|
<br />
|
|
|
|
{button}
|
|
|
|
</FullWidthRow>
|
|
|
|
</section>
|
|
|
|
);
|
|
|
|
};
|
2018-09-21 14:49:13 +01:00
|
|
|
|
|
|
|
Honesty.displayName = 'Honesty';
|
|
|
|
Honesty.propTypes = propTypes;
|
|
|
|
|
|
|
|
export default Honesty;
|