Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bodysch-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
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
org
BodySCH
bodysch-frontend
Commits
8bc3780d
Commit
8bc3780d
authored
4 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Style News card and fix layout in container
parent
97e44284
No related branches found
No related tags found
1 merge request
!19
fix type imports
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/News.tsx
+11
-16
11 additions, 16 deletions
src/components/News.tsx
src/components/NewsContainer.tsx
+35
-17
35 additions, 17 deletions
src/components/NewsContainer.tsx
src/pages/Page.tsx
+2
-1
2 additions, 1 deletion
src/pages/Page.tsx
with
48 additions
and
34 deletions
src/components/News.tsx
+
11
−
16
View file @
8bc3780d
import
{
Grid
,
makeStyles
,
Typography
}
from
'
@material-ui/core
'
;
import
{
Box
,
Grid
,
makeStyles
,
Typography
}
from
'
@material-ui/core
'
;
import
React
from
'
react
'
;
interface
NewsProps
{
...
...
@@ -11,32 +11,27 @@ interface NewsProps {
const
useStyles
=
makeStyles
((
theme
)
=>
({
container
:
{
color
:
'
white
'
,
borderRadius
:
'
8px
'
,
backgroundColor
:
theme
.
palette
.
background
.
paper
,
margin
:
theme
.
spacing
(
2
),
padding
:
theme
.
spacing
(
1
),
padding
:
theme
.
spacing
(
2
),
},
}));
const
News
:
React
.
FC
<
NewsProps
>
=
({
title
,
content
,
author
,
createDate
})
=>
{
const
News
:
React
.
FC
<
NewsProps
>
=
({
title
,
content
,
createDate
})
=>
{
const
classes
=
useStyles
();
return
(
<
Grid
className
=
{
classes
.
container
}
container
direction
=
"column"
>
<
Grid
item
>
<
Typography
variant
=
"h6"
>
{
title
}
</
Typography
>
<
Typography
variant
=
"subtitle2"
color
=
"secondary"
>
{
createDate
}
</
Typography
>
</
Grid
>
<
Grid
item
>
<
Typography
variant
=
"body1"
>
{
content
}
</
Typography
>
<
Box
marginY
=
{
2
}
>
<
Typography
variant
=
"h4"
>
{
title
}
</
Typography
>
</
Box
>
</
Grid
>
<
Grid
item
container
justify
=
"flex-end"
>
<
Grid
item
>
<
Typography
variant
=
"subtitle2"
>
<
i
>
{
author
}
</
i
>
</
Typography
>
<
Typography
variant
=
"subtitle2"
>
<
i
>
{
createDate
}
</
i
>
</
Typography
>
</
Grid
>
<
Typography
variant
=
"body1"
>
{
content
}
</
Typography
>
</
Grid
>
</
Grid
>
);
...
...
This diff is collapsed.
Click to expand it.
src/components/NewsContainer.tsx
+
35
−
17
View file @
8bc3780d
...
...
@@ -10,9 +10,10 @@ const NewsContainer: React.FC = () => {
return
isLoading
?
(
<
CircularProgress
/>
)
:
(
<
Box
paddingY
=
{
2
}
>
<
Grid
container
>
<
Grid
item
xs
=
{
12
}
sm
=
{
3
}
>
<
Box
p
=
{
2
}
alignContent
=
"center"
>
<
Box
p
addingX
=
{
2
}
>
<
img
src
=
"https://i.pinimg.com/474x/13/84/34/138434e6400eb73823192c74ea40bfc2.jpg"
height
=
"auto"
...
...
@@ -21,13 +22,30 @@ const NewsContainer: React.FC = () => {
/>
</
Box
>
</
Grid
>
<
Grid
container
item
xs
=
{
12
}
sm
=
{
6
}
direction
=
"column"
>
<
Grid
item
xs
=
{
12
}
sm
=
{
6
}
>
<
Grid
container
direction
=
"column"
>
<
Grid
item
xs
=
{
12
}
>
<
Box
p
=
{
2
}
>
<
News
title
=
"ASd"
author
=
"Anonymus"
content
=
"ASDADDD"
createDate
=
"2021.01.01"
/>
</
Box
>
</
Grid
>
<
Grid
item
xs
=
{
12
}
sm
=
{
3
}
>
<
Grid
item
xs
=
{
12
}
>
<
Box
p
=
{
2
}
>
<
News
title
=
"ASd"
author
=
"Anonymus"
content
=
"ASDADDD"
createDate
=
"2021.01.01"
/>
</
Box
>
</
Grid
>
<
Grid
item
xs
=
{
12
}
>
<
Box
p
=
{
2
}
>
<
News
title
=
"ASd"
author
=
"Anonymus"
content
=
"ASDADDD"
createDate
=
"2021.01.01"
/>
</
Box
>
</
Grid
>
</
Grid
>
</
Grid
>
<
Grid
container
item
xs
=
{
12
}
sm
=
{
3
}
justify
=
"flex-end"
>
<
Typography
>
Naptár (?)
</
Typography
>
</
Grid
>
</
Grid
>
</
Box
>
);
};
...
...
This diff is collapsed.
Click to expand it.
src/pages/Page.tsx
+
2
−
1
View file @
8bc3780d
...
...
@@ -9,7 +9,7 @@ import { useToggle } from '../hooks/useToggle';
const
Container
=
styled
.
div
(
(
props
)
=>
`
height: 100%;
min-
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
...
...
@@ -20,6 +20,7 @@ const Container = styled.div(
const
MainContent
=
styled
.
div
`
height: 100%;
flex-grow: 1;
`
;
const
Page
:
React
.
FC
=
({
children
})
=>
{
...
...
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