docbrown/app/javascript/onboarding/components/Navigation.jsx
Vaidehi Joshi bbe0bf970f
Split up content of EmailListTermsConditionsForm within onboarding (#7294) [deploy]
* Move Terms & Conditions, CoC into Intro slide of onboarding

Closes https://github.com/thepracticaldev/dev.to/issues/6545.

* Rename ClosingSlide in Onboarding tests

* Rename EmailListTermsConditionsForm to EmailPreferencesForm

* Proper lint and prepend `v2:` to some onboarding components

* Move email preferences to last slide

Closes https://github.com/thepracticaldev/dev.to/issues/6550.

* Use crayons variables for padding

* Remove backToSlide function, rename buttonIsDisabled function
2020-04-15 15:16:53 -07:00

57 lines
1.1 KiB
JavaScript

import { h } from 'preact';
import PropTypes from 'prop-types';
const Navigation = ({
next,
prev,
hideNext,
hidePrev,
disabled,
className,
}) => (
<nav
className={`onboarding-navigation${
className && className.length > 0 ? ` ${className}` : ''
}`}
>
<div
className={`navigation-content${
className && className.length > 0 ? ` ${className}` : ''
}`}
>
{!hidePrev && (
<button onClick={prev} className="back-button" type="button">
Back
</button>
)}
{!hideNext && (
<button
disabled={disabled}
onClick={next}
className="next-button"
type="button"
>
Continue
</button>
)}
</div>
</nav>
);
Navigation.propTypes = {
disabled: PropTypes.bool,
className: PropTypes.string,
prev: PropTypes.func.isRequired,
next: PropTypes.string.isRequired,
hideNext: PropTypes.bool,
hidePrev: PropTypes.bool,
};
Navigation.defaultProps = {
disabled: false,
hideNext: false,
hidePrev: false,
className: '',
};
export default Navigation;