Skip to content
Snippets Groups Projects
Commit e9e14e3c authored by Chif Gergő's avatar Chif Gergő
Browse files

Remove unnecessary information from news, add some style

parent 73f16a54
Branches
Tags
No related merge requests found
import React, { Component } from 'react'; import React, { Component } from 'react';
import { Modal, Button, Form, Input, Icon } from 'semantic-ui-react'; import { Modal, Button, Form, Input, Icon } from 'semantic-ui-react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import moment from 'moment';
import { DateTimeInput } from 'semantic-ui-calendar-react'; import { DateTimeInput } from 'semantic-ui-calendar-react';
import { import {
writeEditEvent, writeEditEvent,
...@@ -72,7 +73,7 @@ class EditEventForm extends Component { ...@@ -72,7 +73,7 @@ class EditEventForm extends Component {
label="Dátum:" label="Dátum:"
dateFormat='YYYY-MM-DD' dateFormat='YYYY-MM-DD'
placeholder="Dátum" placeholder="Dátum"
value={date} value={moment(date).format('YYYY-MM-DD hh:mm')}
iconPosition="left" iconPosition="left"
onChange={this.handleChange} onChange={this.handleChange}
/> />
......
...@@ -20,11 +20,12 @@ class News extends Component { ...@@ -20,11 +20,12 @@ class News extends Component {
return this.props.news.map(item => ( return this.props.news.map(item => (
<Item key={item.id}> <Item key={item.id}>
<Item.Content> <Item.Content>
<Container text textAlign='left'>
<Item.Header <Item.Header
style={{ fontSize: '2em', width: '100%' }} style={{ fontSize: '2em', width: '100%' }}
> >
<Grid> <Grid>
<Grid.Column floated='center' width={12}> <Grid.Column floated='left' width={8}>
{item.title} {item.title}
</Grid.Column> </Grid.Column>
{ this.props.user.role === 'Staff' ? { this.props.user.role === 'Staff' ?
...@@ -49,24 +50,11 @@ class News extends Component { ...@@ -49,24 +50,11 @@ class News extends Component {
: null } : null }
</Grid> </Grid>
</Item.Header> </Item.Header>
<Item.Description className='news-text' style={{ fontSize: '1.33em' }}> <Item.Meta style={{ fontSize: '0.75em', fontStyle: 'italic' }}>Közzétéve: {moment(item.created_at).format('LLLL')}</Item.Meta>
<Item.Description className='news-text' style={{ fontSize: '1em' }}>
{this.renderMultiLine(item.text)} {this.renderMultiLine(item.text)}
</Item.Description> </Item.Description>
<Item.Extra> </Container>
<Grid>
<Grid.Row className='news-extra'>
<Grid.Column floated='left' width={10}>
<p> Készült: {moment(item.created_at).format('LLLL')} </p>
<p> Szerkesztve: {moment(item.updated_at).format('LLLL')}</p>
</Grid.Column>
<Grid.Column floated='right' width={5}>
<p> Írta: <strong>{item.author_name}</strong></p>
{/* TODO get the edited by name */}
<p> Szerkesztette: {item.author_name}</p>
</Grid.Column>
</Grid.Row>
</Grid>
</Item.Extra>
</Item.Content> </Item.Content>
</Item> </Item>
)); ));
......
...@@ -24,29 +24,31 @@ class Schedule extends Component { ...@@ -24,29 +24,31 @@ class Schedule extends Component {
const events = this.props.events; const events = this.props.events;
const panels = events.map(event => ( const panels = events.map(event => (
<> <div>
<Accordion.Title <Accordion.Title
active={activeIndex === event.id} active={activeIndex === event.id}
index={event.id} index={event.id}
onClick={this.handleClick} onClick={this.handleClick}
> >
<h2> <h3>
<Grid> <Grid>
<Grid.Column floated='left' width={5} textAlign='left'> <Grid.Column floated='left' width={5} textAlign='left'>
<Icon name='quidditch' color='blue' />{event.name} <Icon name='angle right' color='blue' />{event.name}
</Grid.Column> </Grid.Column>
<Grid.Column floated='right' width={8} textAlign='right'> <Grid.Column floated='right' width={8} textAlign='right'>
{moment(event.date).locale('hu').format('LLLL')} {moment(event.date).locale('hu').format('LLLL')}
</Grid.Column> </Grid.Column>
</Grid> </Grid>
</h2> </h3>
</Accordion.Title> </Accordion.Title>
<Accordion.Content active={activeIndex === event.id}> <Accordion.Content active={activeIndex === event.id}>
<Container text textAlign='left'>
<p> <p>
{event.description} {event.description}
</p> </p>
</Container>
</Accordion.Content> </Accordion.Content>
</> </div>
)); ));
return ( return (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment