Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
sdy
2020-07-25 17:23:45 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e9299fc7321d9cbbfa88ab39a5cc243d759cb3ed
e9299fc7
1 parent
68a4365c
add state, change link button style
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
17 deletions
front/src/Components/Header.js
front/src/Components/Header.js
View file @
e9299fc
import
React
from
"react"
;
import
React
,
{
useState
}
from
"react"
;
import
styled
from
"styled-components"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
FontAwesomeIcon
}
from
"@fortawesome/react-fontawesome"
;
...
...
@@ -67,18 +67,22 @@ const StartBox = styled.div`
`
;
const
StartLink
=
styled
(
Link
)
`
background-color: #3dc1d3;
color: #f1f2f6;
text-align: center;
font-size: 18px;
font-weight: 500;
width: 150px;
border: none;
border-radius: 10px;
cursor: pointer;
background-color: white;
color: black;
border: 2px solid #3dc1d3;
padding: 16px 32px;
margin: 4px 2px;
transition-duration: 0.4s;
border-radius: 8px;
&:hover {
background-color: #3dc1d3;
color: white;
}
`
;
export
default
()
=>
{
export
default
({
btnStateProp
})
=>
{
const
[
btnState
]
=
useState
(
btnStateProp
?
btnStateProp
:
"main"
);
return
(
<
Header
>
<
Nav
>
...
...
@@ -100,13 +104,20 @@ export default () => {
<
HeaderMenuItem
>
<
Link
to
=
"/news"
>
News
<
/Link
>
<
/HeaderMenuItem
>
<
HeaderMenuItem
>
<
Link
to
=
"/support"
>
Support
US
<
/Link
>
<
/HeaderMenuItem
>
<
/HeaderMenuList
>
<
StartBox
>
<
StartLink
to
=
"/auth"
>
Start
<
/StartLink
>
<
/StartBox
>
{
btnState
===
"main"
?
(
<>
<
StartBox
>
<
StartLink
to
=
"/auth"
>
Start
<
/StartLink
>
<
/StartBox
>
<
/
>
)
:
(
<>
<
StartBox
>
<
StartLink
to
=
"/roomlist"
>
RoomList
<
/StartLink
>
<
/StartBox
>
<
/
>
)}
<
/HeaderMenuNav
>
<
/HeaderBox
>
<
/Nav
>
...
...
Please
register
or
login
to post a comment