docbrown/app/javascript/onboarding/components/IntroSlide.jsx
Vaidehi Joshi dbbeaf2422
Onboarding intro slide tweaks (#7162) [deploy]
* Render the user's name on intro slide of onboarding

* Refactor terms + conditions form in onboarding view

* Style the back button using crayons design system.
* Remove redundant scroll styles (only need `overflow-y: scroll` here).
* Ensure that content is readable, and back button doesn't conflict with content.
* Ensure size of content is same size as "intro slide".
* Remove unnecesary inline styles, use CSS class instead.

* Fix missing userData issue

* Onboarding test cleanup, inline greeting instead of in a variable
2020-04-09 08:57:50 -07:00

57 lines
1.3 KiB
JavaScript

import { h, Component } from 'preact';
import PropTypes from 'prop-types';
import Navigation from './Navigation';
import { userData, updateOnboarding } from '../utilities';
class IntroSlide extends Component {
constructor(props) {
super(props);
this.onSubmit = this.onSubmit.bind(this);
this.user = userData();
}
componentDidMount() {
updateOnboarding('intro slide');
}
onSubmit() {
const { next } = this.props;
next();
}
render() {
const { prev } = this.props;
return (
<div className="onboarding-main introduction">
<div className="onboarding-content">
<figure>
<img
src="/assets/purple-dev-logo.png"
className="sticker-logo"
alt="DEV"
/>
</figure>
<h1 className="introduction-title">
{this.user.name}
{' '}
&mdash; welcome to DEV!
</h1>
<h2 className="introduction-subtitle">
DEV is where programmers share ideas and help each other grow.
</h2>
</div>
<Navigation prev={prev} next={this.onSubmit} hidePrev />
</div>
);
}
}
IntroSlide.propTypes = {
prev: PropTypes.func.isRequired,
next: PropTypes.string.isRequired,
};
export default IntroSlide;