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
9e83d309
Commit
9e83d309
authored
4 years ago
by
Chif Gergő
Browse files
Options
Downloads
Patches
Plain Diff
Create Page componenet whicjh holds the main layout
parent
3907249d
No related branches found
No related tags found
2 merge requests
!19
fix type imports
,
!8
Refactor structure
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/App.tsx
+2
-35
2 additions, 35 deletions
src/App.tsx
src/pages/NewsPage.tsx
+6
-3
6 additions, 3 deletions
src/pages/NewsPage.tsx
src/pages/Page.tsx
+27
-0
27 additions, 0 deletions
src/pages/Page.tsx
with
35 additions
and
38 deletions
src/App.tsx
+
2
−
35
View file @
9e83d309
import
React
,
{
useEffect
}
from
'
react
'
;
import
React
from
'
react
'
;
import
{
BrowserRouter
as
Router
}
from
'
react-router-dom
'
;
import
styled
from
'
styled-components
'
;
import
Footer
from
'
./components/Footer
'
;
import
Header
from
'
./components/Header
'
;
import
{
UserStateProvider
}
from
'
./context/UserContext
'
;
import
useAddNews
from
'
./hooks/useAddNews
'
;
import
Routes
from
'
./Routes
'
;
const
Container
=
styled
.
div
`
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
`
;
const
MainContent
=
styled
.
div
`
height: 100%;
`
;
function
App
():
React
.
ReactElement
{
const
[
response
,
addNews
]
=
useAddNews
();
useEffect
(()
=>
{
addNews
({
body
:
{
title
:
'
Testing
'
,
text
:
'
Test Test TEST
'
}
});
},
[
addNews
]);
useEffect
(()
=>
{
if
(
response
.
data
)
{
console
.
log
(
response
.
data
.
text
);
}
},
[
response
.
data
]);
return
(
<
UserStateProvider
>
<
Router
>
<
Container
>
<
Header
/>
<
MainContent
>
<
Routes
/>
</
MainContent
>
<
Footer
/>
</
Container
>
</
Router
>
</
UserStateProvider
>
);
...
...
This diff is collapsed.
Click to expand it.
src/pages/NewsPage.tsx
+
6
−
3
View file @
9e83d309
import
{
Container
}
from
'
@material-ui/core
'
;
import
React
from
'
react
'
;
import
NewsContainer
from
'
../components/NewsContainer
'
;
import
Page
from
'
./Page
'
;
const
NewsPage
:
React
.
FC
=
()
=>
(
<
Page
>
<
Container
>
<
NewsContainer
/>
</
Container
>
</
Page
>
);
export
default
NewsPage
;
This diff is collapsed.
Click to expand it.
src/pages/Page.tsx
0 → 100644
+
27
−
0
View file @
9e83d309
import
React
from
'
react
'
;
import
styled
from
'
styled-components
'
;
import
Footer
from
'
../components/Footer
'
;
import
Header
from
'
../components/Header
'
;
const
Container
=
styled
.
div
`
height: 100%;
display: flex;
flex-direction: column;
justify-content: space-between;
`
;
const
MainContent
=
styled
.
div
`
height: 100%;
`
;
const
Page
:
React
.
FC
=
({
children
})
=>
{
return
(
<
Container
>
<
Header
/>
<
MainContent
>
{
children
}
</
MainContent
>
<
Footer
/>
</
Container
>
);
};
export
default
Page
;
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