summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/containers/Pages/HelpSupport/index.js
blob: 68df97be0735a8f1266d3b602ba9f2355026b2b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import React from 'react';
import { PropTypes } from 'prop-types';
import { Helmet } from 'react-helmet';
import brand from 'ba-api/brand';
import LiveHelp from '@material-ui/icons/LiveHelp';
import { isWidthUp } from '@material-ui/core/withWidth';
import { withStyles } from '@material-ui/core/styles';
import { Typography, withWidth, Grid } from '@material-ui/core';
import styles from './helpSupport-jss';
import Qna from './Qna';
import ContactForm from './ContactForm';


class Settings extends React.Component {
  showResult(values) {
    setTimeout(() => {
      this.setState({ valueForm: values });
      window.alert(`You submitted:\n\n${this.state.valueForm}`);
    }, 500); // simulate server latency
  }

  render() {
    const title = brand.name;
    const description = brand.desc;
    const { classes, width } = this.props;
    return (
      <div>
        <Helmet>
          <title>{title}</title>
          <meta name="description" content={description} />
          <meta property="og:title" content={title} />
          <meta property="og:description" content={description} />
          <meta property="twitter:title" content={title} />
          <meta property="twitter:description" content={description} />
        </Helmet>
        <Typography variant="h5" className={classes.title}>
          <LiveHelp className={classes.iconTitle} />
          Help &amp; Support
        </Typography>
        <Grid container spacing={2} direction={isWidthUp('md', width) ? 'row' : 'column-reverse'}>
          <Grid item md={6} xs={12}>
            <Qna />
          </Grid>
          <Grid item md={6} xs={12}>
            <ContactForm onSubmit={(values) => this.showResult(values)} />
          </Grid>
        </Grid>
      </div>
    );
  }
}

Settings.propTypes = {
  classes: PropTypes.object.isRequired,
  width: PropTypes.string.isRequired,
};

export default withStyles(styles)(withWidth()(Settings));