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
c6f6df0e
Commit
c6f6df0e
authored
4 years ago
by
Rafael László
Browse files
Options
Downloads
Plain Diff
Merge branch 'add-header' into Feature/profile
parents
fd9957ad
78125397
No related branches found
No related tags found
2 merge requests
!7
update master to dev
,
!4
Feature/profile
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/components/Header.tsx
+102
-2
102 additions, 2 deletions
src/core/components/Header.tsx
src/core/components/MainRouting.tsx
+2
-2
2 additions, 2 deletions
src/core/components/MainRouting.tsx
src/index.css
+1
-0
1 addition, 0 deletions
src/index.css
with
105 additions
and
4 deletions
src/core/components/Header.tsx
+
102
−
2
View file @
c6f6df0e
import
React
from
'
react
'
;
import
{
AppBar
,
Button
,
Grid
,
makeStyles
,
Tab
,
Tabs
,
Toolbar
,
Typography
,
}
from
'
@material-ui/core
'
;
import
React
,
{
useState
}
from
'
react
'
;
import
{
useHistory
}
from
'
react-router
'
;
const
Header
=
()
=>
<
div
>
Header
</
div
>;
interface
AppBarMenuItem
{
id
:
number
;
title
:
string
;
redirectTo
:
string
;
}
const
MENU_ITEMS
:
AppBarMenuItem
[]
=
[
{
id
:
0
,
title
:
'
News
'
,
redirectTo
:
'
/news
'
,
},
{
id
:
1
,
title
:
'
About
'
,
redirectTo
:
'
/about
'
,
},
{
id
:
2
,
title
:
'
FAQ
'
,
redirectTo
:
'
/faq
'
,
},
];
const
useStyles
=
makeStyles
((
theme
)
=>
({
appBar
:
{
backgroundColor
:
'
#E5BD2F
'
,
padding
:
theme
.
spacing
(
1
),
},
tab
:
{
fontWeight
:
600
,
padding
:
'
0px
'
,
},
indicator
:
{
backgroundColor
:
'
white
'
,
},
navItem
:
{
flex
:
1
,
alignItems
:
'
center
'
,
'
&:first-child
'
:
{
marginRight
:
'
auto;
'
,
},
'
&:last-child
'
:
{
marginRight
:
'
auto;
'
,
},
},
}));
const
Header
:
React
.
FC
=
()
=>
{
const
classes
=
useStyles
();
const
history
=
useHistory
();
const
[
value
,
setValue
]
=
useState
(
MENU_ITEMS
.
find
((
item
)
=>
history
.
location
.
pathname
===
item
.
redirectTo
)?.
id
??
0
,
);
return
(
<
AppBar
className
=
{
classes
.
appBar
}
position
=
"static"
>
<
Toolbar
>
<
Grid
container
>
<
Grid
className
=
{
classes
.
navItem
}
item
container
justify
=
"flex-start"
>
<
Tabs
value
=
{
value
}
onChange
=
{
(
event
,
val
)
=>
{
setValue
(
val
);
}
}
TabIndicatorProps
=
{
{
className
:
classes
.
indicator
}
}
>
{
MENU_ITEMS
.
map
((
item
)
=>
(
<
Tab
key
=
{
item
.
id
}
className
=
{
classes
.
tab
}
label
=
{
item
.
title
}
onClick
=
{
()
=>
{
history
.
push
(
item
.
redirectTo
);
}
}
/>
))
}
</
Tabs
>
</
Grid
>
<
Grid
className
=
{
classes
.
navItem
}
item
container
justify
=
"center"
>
<
Typography
variant
=
"h4"
>
SCH-BODY
</
Typography
>
</
Grid
>
<
Grid
className
=
{
classes
.
navItem
}
item
container
justify
=
"flex-end"
>
<
Button
>
Login
</
Button
>
</
Grid
>
</
Grid
>
</
Toolbar
>
</
AppBar
>
);
};
export
default
Header
;
export
default
Header
;
This diff is collapsed.
Click to expand it.
src/core/components/MainRouting.tsx
+
2
−
2
View file @
c6f6df0e
...
@@ -2,7 +2,7 @@ import React from 'react';
...
@@ -2,7 +2,7 @@ import React from 'react';
import
{
Route
,
Switch
}
from
'
react-router
'
;
import
{
Route
,
Switch
}
from
'
react-router
'
;
import
{
ProfileButton
}
from
'
./ProfileButton
'
;
import
{
ProfileButton
}
from
'
./ProfileButton
'
;
const
Main
=
()
=>
(
const
Main
Routing
:
React
.
FC
=
()
=>
(
<
Switch
>
<
Switch
>
<
Route
path
=
"/"
exact
>
<
Route
path
=
"/"
exact
>
<
ProfileButton
/>
<
ProfileButton
/>
...
@@ -11,4 +11,4 @@ const Main = () => (
...
@@ -11,4 +11,4 @@ const Main = () => (
</
Switch
>
</
Switch
>
);
);
export
default
Main
;
export
default
Main
Routing
;
This diff is collapsed.
Click to expand it.
src/index.css
+
1
−
0
View file @
c6f6df0e
html
,
html
,
body
,
body
,
#root
{
#root
{
margin
:
0
;
height
:
100%
;
height
:
100%
;
margin
:
0
;
margin
:
0
;
}
}
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