Skip to content
Snippets Groups Projects
Commit e0c75007 authored by Rafael László's avatar Rafael László :speech_balloon:
Browse files

Responsive Mentors page

parent 7b14f0ea
No related branches found
No related tags found
No related merge requests found
import React, { Component } from 'react' import React, { Component } from 'react'
import { Container, Segment, Item, Divider, Header, Image, Card, Label, Icon } from 'semantic-ui-react' import { Container, Segment, Item, Header, Card, Label, Icon, Responsive, Image } from 'semantic-ui-react'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { getMentors } from '../../actions/mentors' import { getMentors } from '../../actions/mentors'
...@@ -8,7 +8,7 @@ class Mentors extends Component { ...@@ -8,7 +8,7 @@ class Mentors extends Component {
this.props.getMentors(); this.props.getMentors();
} }
renderMentors() { renderMentorsNormal() {
return this.props.mentors.map( (item, index) => ( return this.props.mentors.map( (item, index) => (
<Card style={{maxWidth: '100%', minWidth: '100%'}}> <Card style={{maxWidth: '100%', minWidth: '100%'}}>
<Card.Content style={{padding: '0'}}> <Card.Content style={{padding: '0'}}>
...@@ -36,32 +36,116 @@ class Mentors extends Component { ...@@ -36,32 +36,116 @@ class Mentors extends Component {
)); ));
} }
renderMultiLine(text) { renderMentorsMobile() {
const strings = text.split('\n'); return this.props.mentors.map( (item, index) => (
return strings.map(string => <p key={Math.random()}>{string}</p>); // <Card style={{maxWidth: '100%', minWidth: '100%'}}>
// <Card.Content style={{padding: '0'}}>
// <Item.Group>
// <Item>
// <Item.Image size='medium' src={item.image} />
// <Item.Content style={{padding: '1rem'}}>
// <Item.Header>{item.name}</Item.Header>
// <Item.Extra>
// <Label><Icon name='mail'></Icon>{item.email}</Label>
// </Item.Extra>
// </Item.Content>
// </Item>
// <Item>
// <Item.Content style={{padding: '1rem'}}>
// <Item.Description>
// <p>{item.text}</p>
// </Item.Description>
// <Item.Extra>
// <Label><Icon name='mail'></Icon>{item.email}</Label>
// </Item.Extra>
// </Item.Content>
// </Item>
// </Item.Group>
// </Card.Content>
// </Card>
<Card key={item.id}>
<Image src={item.image} wrapped ui={false}/>
<Card.Content>
<Card.Header>{item.name}</Card.Header>
<Card.Description>
{item.text}
</Card.Description>
</Card.Content>
<Card.Content extra>
<Label><Icon name='mail'></Icon>{item.email}</Label>
</Card.Content>
</Card>
));
} }
render() { render() {
return ( return (
<div> <div>
<Segment inverted textAlign='center' vertical> <Responsive minWidth={768}>
<Container> <Segment inverted textAlign='center' vertical>
<Header <Container>
as='h1' <Header
content='Mentorok' as='h1'
inverted content='Mentorok'
style={{ inverted
fontSize: '3em', style={{
fontWeight: 'normal', fontSize: '3em',
marginBottom: 0, fontWeight: 'normal',
marginTop: '0.5em', marginBottom: 0,
}} marginTop: '0.5em',
/> }}
/>
</Container>
</Segment>
<Container style={{paddingTop: '2em', paddingBottom: '5em'}}>
{this.renderMentorsNormal()}
</Container>
</Responsive>
<Responsive minWidth={551} maxWidth={767}>
<Segment inverted textAlign='center' vertical>
<Container>
<Header
as='h1'
content='Mentorok'
inverted
style={{
fontSize: '3em',
fontWeight: 'normal',
marginBottom: 0,
marginTop: '0.5em',
}}
/>
</Container>
</Segment>
<Container style={{paddingTop: '2em', paddingBottom: '5em'}}>
<Card.Group itemsPerRow={2}>
{this.renderMentorsMobile()}
</Card.Group>
</Container>
</Responsive>
<Responsive maxWidth={550}>
<Segment inverted textAlign='center' vertical>
<Container>
<Header
as='h1'
content='Mentorok'
inverted
style={{
fontSize: '3em',
fontWeight: 'normal',
marginBottom: 0,
marginTop: '0.5em',
}}
/>
</Container>
</Segment>
<Container style={{paddingTop: '2em', paddingBottom: '5em'}}>
<Card.Group itemsPerRow={1}>
{this.renderMentorsMobile()}
</Card.Group>
</Container> </Container>
</Segment> </Responsive>
<Container style={{paddingTop: '2em', paddingBottom: '5em'}}>
{this.renderMentors()}
</Container>
</div> </div>
); );
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment