summaryrefslogtreecommitdiffstats
path: root/front/odiparpack/app/components/SocialMedia/SideSection.js
blob: 1fe8d9c24a61a4f27c5b59a408b3725e8e53d5e4 (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { withStyles } from '@material-ui/core/styles';
import KeyboardArrowLeft from '@material-ui/icons/KeyboardArrowLeft';
import KeyboardArrowRight from '@material-ui/icons/KeyboardArrowRight';
import SwipeableViews from 'react-swipeable-views';
import imgApi from 'ba-api/images';
import avatarApi from 'ba-api/avatars';
import {
  Grid,
  Typography,
  MobileStepper,
  Paper,
  Avatar,
  Button,
  Divider,
  List,
  ListItem,
  ListItemText,
} from '@material-ui/core';
import PapperBlock from '../PapperBlock/PapperBlock';
import NewsCard from '../CardPaper/NewsCard';
import ProfileCard from '../CardPaper/ProfileCard';
import styles from './jss/socialMedia-jss';


const slideData = [
  {
    label: 'How to be happy :)',
    imgPath: imgApi[49],
  },
  {
    label: '1. Work with something that you like, like…',
    imgPath: imgApi[17],
  },
  {
    label: '2. Keep your friends close to you and hangout with them',
    imgPath: imgApi[34],
  },
  {
    label: '3. Travel everytime that you have a chance',
    imgPath: imgApi[10],
  },
  {
    label: '4. And contribute to Material-UI :D',
    imgPath: imgApi[40]
  },
];

class SideSection extends React.Component {
  state = {
    activeStepSwipe: 0,
  };

  handleNextSwipe = () => {
    this.setState(prevState => ({
      activeStepSwipe: prevState.activeStepSwipe + 1,
    }));
  };

  handleBackSwipe = () => {
    this.setState(prevState => ({
      activeStepSwipe: prevState.activeStepSwipe - 1,
    }));
  };

  handleStepChangeSwipe = activeStepSwipe => {
    this.setState({ activeStepSwipe });
  };

  render() {
    const { classes, theme } = this.props;
    const { activeStepSwipe } = this.state;

    const maxStepsSwipe = slideData.length;
    return (
      <div>
        {/* Profile */}
        <ProfileCard
          cover={imgApi[43]}
          avatar={avatarApi[6]}
          name="John Doe"
          title="UX designer"
          connection={10}
          btnText="My Profile"
          isVerified
        />
        <Divider className={classes.divider} />
        {/* ----------------------------------------------------------------------*/}
        {/* News Or Ads Block */}
        <Paper>
          <SwipeableViews
            axis={theme.direction === 'rtl' ? 'x-reverse' : 'x'}
            index={this.state.activeStepSwipe}
            onChangeIndex={this.handleStepChangeSwipe}
            enableMouseEvents
            className={classes.sliderWrap}
          >
            {slideData.map((slide, index) => (
              <div className={classes.figure} key={index.toString()}>
                <NewsCard
                  image={slide.imgPath}
                  title="slide.label"
                >
                  <Typography gutterBottom className={classes.title} variant="h5" component="h2">
                    {slide.label}
                  </Typography>
                </NewsCard>
              </div>
            ))}
          </SwipeableViews>
          <MobileStepper
            variant="dots"
            steps={maxStepsSwipe}
            position="static"
            activeStep={activeStepSwipe}
            className={classes.mobileStepper}
            nextButton={(
              <Button size="small" onClick={this.handleNextSwipe} disabled={activeStepSwipe === maxStepsSwipe - 1}>
                Next
                {theme.direction === 'rtl' ? <KeyboardArrowLeft /> : <KeyboardArrowRight />}
              </Button>
            )}
            backButton={(
              <Button size="small" onClick={this.handleBackSwipe} disabled={activeStepSwipe === 0}>
                {theme.direction === 'rtl' ? <KeyboardArrowRight /> : <KeyboardArrowLeft />}
                Back
              </Button>
            )}
          />
        </Paper>
        {/* ----------------------------------------------------------------------*/}
        {/* People */}
        <PapperBlock title="People You May Know" whiteBg noMargin desc="">
          <List component="nav" dense className={classes.profileList}>
            <ListItem button className={classes.noPadding}>
              <Avatar className={classNames(classes.avatar, classes.orangeAvatar)}>H</Avatar>
              <ListItemText primary="Harry Wells" secondary="2 Mutual Connection" />
              <Button color="secondary" size="small">Connect</Button>
            </ListItem>
            <ListItem button className={classes.noPadding}>
              <Avatar className={classNames(classes.avatar, classes.purpleAvatar)}>J</Avatar>
              <ListItemText primary="John Doe" secondary="8 Mutual Connection" />
              <Button color="secondary" size="small">Connect</Button>
            </ListItem>
            <ListItem button className={classes.noPadding}>
              <Avatar className={classNames(classes.avatar, classes.pinkAvatar)}>V</Avatar>
              <ListItemText primary="Victor Wanggai" secondary="12 Mutual Connection" />
              <Button color="secondary" size="small">Connect</Button>
            </ListItem>
            <ListItem button className={classes.noPadding}>
              <Avatar className={classNames(classes.avatar, classes.greenAvatar)}>H</Avatar>
              <ListItemText primary="Baron Phoenix" secondary="10 Mutual Connection" />
              <Button color="secondary" size="small">Connect</Button>
            </ListItem>
          </List>
          <Divider className={classes.divider} />
          <Grid container justify="center">
            <Button color="secondary" className={classes.button}>
              See All
            </Button>
          </Grid>
        </PapperBlock>
        {/* ----------------------------------------------------------------------*/}
        {/* Trending */}
        <PapperBlock title="Trends For You" whiteBg desc="">
          <List dense className={classes.trendingList}>
            <ListItem className={classes.noPadding}>
              <a href="#" className={classes.link}>#Lorem ipsum dolor</a>
              <ListItemText secondary="2987 Posts" />
            </ListItem>
            <ListItem className={classes.noPadding}>
              <a href="#" className={classes.link}>#Aliquam venenatis</a>
              <ListItemText secondary="2345 Posts" />
            </ListItem>
            <ListItem className={classes.noPadding}>
              <a href="#" className={classes.link}>#Nam sollicitudin</a>
              <ListItemText secondary="1234 Posts" />
            </ListItem>
            <ListItem className={classes.noPadding}>
              <a href="#" className={classes.link}>#Cras convallis</a>
              <ListItemText secondary="6789 Connection" />
            </ListItem>
            <ListItem className={classes.noPadding}>
              <a href="#" className={classes.link}>#Aenean sit amet</a>
              <ListItemText secondary="2987 Connection" />
            </ListItem>
            <ListItem className={classes.noPadding}>
              <a href="#" className={classes.link}>#Quisque</a>
              <ListItemText secondary="1456 Connection" />
            </ListItem>
            <ListItem className={classes.noPadding}>
              <a href="#" className={classes.link}>#Lorem ipusm dolor</a>
              <ListItemText secondary="2987 Connection" />
            </ListItem>
          </List>
        </PapperBlock>
      </div>
    );
  }
}

SideSection.propTypes = {
  classes: PropTypes.object.isRequired,
  theme: PropTypes.object.isRequired,
};

export default withStyles(styles, { withTheme: true })(SideSection);