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-15 04:08:17 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9e93a4f5962b7dbb9c114341df8e2d6b0cb917e4
9e93a4f5
1 parent
efd16a89
recreate header
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
47 deletions
front/src/Components/Header.js
front/src/Components/Header.js
View file @
9e93a4f
import
React
from
"react"
;
import
styled
from
"styled-components"
;
import
{
FontAwesomeIcon
}
from
"@fortawesome/react-fontawesome"
;
import
{
faComments
,
faSignOutAlt
}
from
"@fortawesome/free-solid-svg-icons"
;
import
{
gql
}
from
"apollo-boost"
;
import
{
useMutation
}
from
"@apollo/react-hooks"
;
import
{
BrowserRouter
as
Router
,
Link
}
from
"react-router-dom"
;
import
{
faComments
}
from
"@fortawesome/free-solid-svg-icons"
;
const
LOG_OUT
=
gql
`
mutation logUserOut {
logUserOut @client
}
const
HeaderBox
=
styled
.
div
`
display: flex;
justify-content: space-between;
align-items: center;
`
;
const
HeaderContainer
=
styled
.
div
`
const
HeaderTitleBox
=
styled
.
div
`
display: flex;
`
;
const
HeaderTitle
=
styled
.
span
`
font-size: 15px;
`
;
const
HeaderMenuBox
=
styled
.
div
`
display: flex;
flex-direction: row;
justify-content: space-between;
width: 100%;
svg {
font-size: 30px;
}
box-shadow: 1px 1px 20px #8395a7;
background-color: #667aff;
`
;
const
TitleBox
=
styled
.
div
`
const
HeaderMenuList
=
styled
.
ul
`
display: flex;
flex-direction: row;
padding: 20px 10px;
color: white;
svg {
margin-right: 5px;
opacity: 0.7;
}
`
;
const
HeaderSpan
=
styled
.
span
`
font-family: "Raleway", sans-serif;
font-size: 30px;
const
HeaderMenuItem
=
styled
.
li
`
content:
${(
props
)
=>
props
.
text
}
;
`
;
const
St
yledLink
=
styled
(
Link
)
`
text-decoration: none
;
color:
white
;
cursor: pointer
;
const
St
artBox
=
styled
.
div
`
background-color: #1b1464
;
color:
#f1f2f6
;
font-size: 20px
;
`
;
export
default
({
text
})
=>
{
const
[
logOut
]
=
useMutation
(
LOG_OUT
);
export
default
()
=>
{
return
(
<
HeaderContainer
className
=
"Header"
>
<
TitleBox
>
<
FontAwesomeIcon
icon
=
{
faComments
}
/
>
<
HeaderSpan
>
{
text
}
<
/HeaderSpan
>
<
/TitleBox
>
<
TitleBox
>
<
Router
>
<
StyledLink
to
=
"/"
onClick
=
{
logOut
}
>
<
FontAwesomeIcon
icon
=
{
faSignOutAlt
}
/
>
<
/StyledLink
>
<
/Router
>
<
/TitleBox
>
<
/HeaderContainer
>
<
HeaderBox
>
<
HeaderTitleBox
>
<
FontAwesomeIcon
>
<
faComments
/>
<
/FontAwesomeIcon
>
<
HeaderTitle
>
KhuChat
<
/HeaderTitle
>
<
/HeaderTitleBox
>
<
HeaderMenuBox
>
<
HeaderMenuList
>
<
HeaderMenuItem
text
=
{
"About This"
}
/
>
<
/HeaderMenuList
>
<
/HeaderMenuBox
>
<
StartBox
>
Start
<
/StartBox
>
<
/HeaderBox
>
);
};
...
...
Please
register
or
login
to post a comment