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
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Köpeczi-Bócz Gergely
kszkepzes-frontend
Commits
b1032352
Commit
b1032352
authored
6 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Started sidebar on news page, added modal Add news form
parent
a96f442a
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/components/Footer.js
+1
-1
1 addition, 1 deletion
src/components/Footer.js
src/components/pages/News.js
+58
-7
58 additions, 7 deletions
src/components/pages/News.js
with
59 additions
and
8 deletions
src/components/Footer.js
+
1
−
1
View file @
b1032352
...
@@ -2,7 +2,7 @@ import React from 'react';
...
@@ -2,7 +2,7 @@ import React from 'react';
import
{
Container
,
Segment
}
from
'
semantic-ui-react
'
;
import
{
Container
,
Segment
}
from
'
semantic-ui-react
'
;
const
Footer
=
()
=>
(
const
Footer
=
()
=>
(
<
Segment
inverted
vertical
textAlign
=
'
center
'
>
<
Segment
inverted
attached
=
{
'
bottom
'
}
vertical
style
=
{{
clear
:
'
both
'
}}
textAlign
=
'
center
'
>
<
Container
>
<
Container
>
<
p
textalign
=
'
center
'
>
Created
by
DevTeam
&
copy
;
2017
-
2018
.
<
/p
>
<
p
textalign
=
'
center
'
>
Created
by
DevTeam
&
copy
;
2017
-
2018
.
<
/p
>
<
/Container
>
<
/Container
>
...
...
This diff is collapsed.
Click to expand it.
src/components/pages/News.js
+
58
−
7
View file @
b1032352
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
{
Container
,
Header
,
Segment
,
Divider
}
from
'
semantic-ui-react
'
;
import
{
Container
,
Header
,
Segment
,
Divider
,
List
,
Modal
,
Button
,
Image
,
Form
,
Input
,
TextArea
,
Checkbox
,
Icon
}
from
'
semantic-ui-react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
getNews
}
from
'
../../actions
'
;
import
{
getNews
}
from
'
../../actions
'
;
...
@@ -10,11 +11,36 @@ class News extends Component {
...
@@ -10,11 +11,36 @@ class News extends Component {
this
.
props
.
getNews
();
this
.
props
.
getNews
();
}
}
render_add_news
(){
return
(
<
Modal
trigger
=
{
<
Button
>
Add
news
<
/Button>}
>
<
Modal
.
Header
>
Select
a
Photo
<
/Modal.Header
>
<
Modal
.
Content
image
>
<
Form
>
<
Form
.
Field
control
=
{
Input
}
label
=
'
Title
'
placeholder
=
'
Title
'
/>
<
Form
.
Field
control
=
{
TextArea
}
label
=
'
Text
'
placeholder
=
'
Tell us what you wanr...
'
/>
<
Form
.
Field
control
=
{
Checkbox
}
label
=
'
I agree to the Terms and Conditions
'
/>
<
/Form
>
<
/Modal.Content
>
<
Modal
.
Actions
>
<
Button
basic
color
=
'
red
'
>
<
Icon
name
=
'
remove
'
/>
Cancel
<
/Button
>
<
Button
color
=
'
green
'
>
<
Icon
name
=
'
checkmark
'
/>
Add
<
/Button
>
<
/Modal.Actions
>
<
/Modal
>
);
}
render_news
()
{
render_news
()
{
const
news
=
this
.
props
.
news
;
const
news
=
this
.
props
.
news
;
return
news
.
map
(
(
item
,
index
)
=>
(
return
news
.
map
(
(
item
,
index
)
=>
(
<
div
key
=
{
index
}
>
<
div
key
=
{
index
}
id
=
{
index
}
>
{
index
>
0
?
<
Divider
/>
:
''
}
{
index
>
0
?
<
Divider
/>
:
''
}
<
Header
as
=
'
h3
'
style
=
{{
fontSize
:
'
2em
'
}}
>
{
item
.
title
}
<
/Header
>
<
Header
as
=
'
h3
'
style
=
{{
fontSize
:
'
2em
'
}}
>
{
item
.
title
}
<
/Header
>
<
p
style
=
{{
fontSize
:
'
1.33em
'
}}
>
{
item
.
text
}
<
/p
>
<
p
style
=
{{
fontSize
:
'
1.33em
'
}}
>
{
item
.
text
}
<
/p
>
...
@@ -23,30 +49,55 @@ class News extends Component {
...
@@ -23,30 +49,55 @@ class News extends Component {
}
}
render_sidebar
()
{
const
news
=
this
.
props
.
news
;
return
news
.
map
(
(
item
,
index
)
=>
(
<
List
.
Item
as
=
'
a
'
href
=
{
`#
${
index
}
`
}
>
<
List
.
Icon
name
=
'
align justify
'
verticalAlign
=
{
"
middle
"
}
/
>
<
List
.
Content
>
<
List
.
Header
>
{
item
.
title
}
<
/List.Header
>
<
/List.Content
>
<
/List.Item
>
));
}
render
()
{
render
()
{
return
(
return
(
<
div
>
<
div
>
<
Segment
inverted
textAlign
=
'
center
'
vertical
>
{
/*
<Segment inverted textAlign='center' vertical>
<Container>
<Container>
<Header
<Header
as='h1'
as='h1'
content='Hírek'
content='Hírek'
inverted
inverted
style={{
style={{
fontSize
:
'
3
em
'
,
fontSize: '
2
em',
fontWeight: 'normal',
fontWeight: 'normal',
marginBottom: 0,
marginBottom: 0,
marginTop
:
'
0.5em
'
,
marginTop: '0.2em',
padding: 0
}}
}}
/>
/>
</Container>
</Container>
</Segment>
</Segment>
*/
}
<
Segment
style
=
{{
padding
:
'
8em 0em
'
}}
vertical
>
<
Segment
floated
=
{
'
left
'
}
style
=
{{
padding
:
'
3em 3em
'
}}
vertical
>
<
Container
text
>
{
this
.
render_add_news
()}
<
Container
text
textAlign
=
{
'
center
'
}
>
{
this
.
render_news
()}
{
this
.
render_news
()}
<
/Container
>
<
/Container
>
<
/Segment
>
<
/Segment
>
<
Segment
floated
=
{
'
right
'
}
style
=
{{
padding
:
'
1em 1em
'
}}
vertical
>
<
List
size
=
{
'
big
'
}
link
divided
>
{
this
.
render_sidebar
()}
<
/List
>
<
/Segment
>
<
/div
>
<
/div
>
);
);
}
}
...
...
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