Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kszkepzes-frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
DevTeam
kszkepzes
old
kszkepzes-frontend
Commits
33e0fc06
Commit
33e0fc06
authored
6 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Get student events in the Schedule page, align the event name and date
parent
b80f869c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/actions/statistics.js
+14
-0
14 additions, 0 deletions
src/actions/statistics.js
src/components/pages/Schedule.js
+13
-8
13 additions, 8 deletions
src/components/pages/Schedule.js
with
27 additions
and
8 deletions
src/actions/statistics.js
+
14
−
0
View file @
33e0fc06
...
...
@@ -24,6 +24,20 @@ export const getEvents = () => (
}
);
export
const
getStudentEvents
=
()
=>
(
async
(
dispatch
)
=>
{
try
{
const
response
=
await
axios
.
get
(
'
/api/v1/student_events/
'
);
dispatch
({
type
:
GET_EVENTS
,
payload
:
response
.
data
,
});
}
catch
(
e
)
{
console
.
log
(
e
);
}
}
);
export
const
getEventById
=
id
=>
(
async
(
dispatch
)
=>
{
try
{
...
...
This diff is collapsed.
Click to expand it.
src/components/pages/Schedule.js
+
13
−
8
View file @
33e0fc06
import
React
,
{
Component
}
from
'
react
'
;
import
{
Container
,
Accordion
,
Icon
}
from
'
semantic-ui-react
'
;
import
{
Container
,
Accordion
,
Icon
,
Grid
}
from
'
semantic-ui-react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
moment
from
'
moment
'
;
import
{
getEvents
}
from
'
../../actions/statistics
'
;
import
{
get
Student
Events
}
from
'
../../actions/statistics
'
;
class
Schedule
extends
Component
{
state
=
{
activeIndex
:
0
}
componentWillMount
()
{
this
.
props
.
getEvents
();
this
.
props
.
get
Student
Events
();
}
handleClick
=
(
e
,
titleProps
)
=>
{
...
...
@@ -31,14 +31,19 @@ class Schedule extends Component {
onClick
=
{
this
.
handleClick
}
>
<
h2
>
<
Icon
name
=
'
transgender
'
color
=
'
blue
'
/>
{
event
.
name
}
{
moment
(
event
.
date
).
format
(
'
LLL
'
)}
<
Grid
>
<
Grid
.
Column
floated
=
'
left
'
width
=
{
5
}
textAlign
=
'
left
'
>
<
Icon
name
=
'
quidditch
'
color
=
'
blue
'
/>
{
event
.
name
}
<
/Grid.Column
>
<
Grid
.
Column
floated
=
'
right
'
width
=
{
8
}
textAlign
=
'
right
'
>
{
moment
(
event
.
date
).
format
(
'
LLL
'
)}
<
/Grid.Column
>
<
/Grid
>
<
/h2
>
<
/Accordion.Title
>
<
Accordion
.
Content
active
=
{
activeIndex
===
event
.
id
}
>
<
p
>
A
dog
is
a
type
of
domesticated
animal
.
Known
for
its
loyalty
and
faithfulness
,
it
can
be
found
as
a
welcome
guest
in
many
households
across
the
world
.
{
event
.
description
}
<
/p
>
<
/Accordion.Content
>
<
/
>
...
...
@@ -69,4 +74,4 @@ class Schedule extends Component {
const
mapStateToProps
=
({
events
:
{
events
},
user
})
=>
({
events
,
user
});
export
default
connect
(
mapStateToProps
,
{
getEvents
})(
Schedule
);
export
default
connect
(
mapStateToProps
,
{
get
Student
Events
})(
Schedule
);
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment