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-05-20 01:32:12 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
911c537ecc0e24cc786022e6d8db58c6fb472e3a
911c537e
1 parent
7dc9ee9a
update styling
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
13 deletions
front/src/Components/ChannelList.js
front/src/Components/Header.js
front/src/Components/ChannelList.js
View file @
911c537
import
React
from
"react"
;
import
styled
from
"styled-components"
;
import
{
Link
}
from
"react-router-dom"
;
import
{
FontAwesomeIcon
}
from
"@fortawesome/react-fontawesome"
;
import
{
faArrowRight
}
from
"@fortawesome/free-solid-svg-icons"
;
import
{
BrowserRouter
as
Router
,
Link
}
from
"react-router-dom"
;
const
Wrapper
=
styled
.
div
`
display: flex;
...
...
@@ -63,18 +63,52 @@ const CreateContainer = styled.div`
box-shadow: 0 -4px 4px rgba(0, 0, 0, 0.04);
`
;
const
StyledLink
=
styled
(
Link
)
`
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
text-decoration: none;
cursor: pointer;
color: #079992;
svg {
color: #079992;
&:hover {
border-bottom: 1px solid #079992;
}
}
li {
color: black;
&:hover {
color: #079992;
}
}
span {
&:hover {
border-bottom: 1px solid #079992;
}
}
`
;
export
default
()
=>
{
return
(
<
Wrapper
>
<
ChannelContainer
>
<
ChannelList
>
<
ChannelItem
>
First
Channel
<
/ChannelItem
>
<
FontAwesomeIcon
icon
=
{
faArrowRight
}
/
>
<
/ChannelList
>
<
/ChannelContainer
>
<
CreateContainer
>
<
Link
to
=
"/"
>
Create
New
Channel
<
/Link
>
<
/CreateContainer
>
<
/Wrapper
>
<
Router
>
<
Wrapper
>
<
ChannelContainer
>
<
ChannelList
>
<
StyledLink
to
=
"/"
>
<
ChannelItem
>
First
Channel
<
/ChannelItem
>
<
FontAwesomeIcon
icon
=
{
faArrowRight
}
/
>
<
/StyledLink
>
<
/ChannelList
>
<
/ChannelContainer
>
<
CreateContainer
>
<
StyledLink
to
=
"/"
>
<
span
>
Create
New
Channel
<
/span
>
<
/StyledLink
>
<
/CreateContainer
>
<
/Wrapper
>
<
/Router
>
);
};
...
...
front/src/Components/Header.js
View file @
911c537
...
...
@@ -2,6 +2,15 @@ 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"
;
const
LOG_OUT
=
gql
`
mutation logUserOut {
logUserOut @client
}
`
;
const
HeaderContainer
=
styled
.
div
`
display: flex;
...
...
@@ -33,7 +42,14 @@ const HeaderSpan = styled.span`
font-size: 30px;
`
;
const
StyledLink
=
styled
(
Link
)
`
text-decoration: none;
color: white;
cursor: pointer;
`
;
export
default
({
text
})
=>
{
const
[
logOut
]
=
useMutation
(
LOG_OUT
);
return
(
<
HeaderContainer
>
<
TitleBox
>
...
...
@@ -41,7 +57,11 @@ export default ({ text }) => {
<
HeaderSpan
>
{
text
}
<
/HeaderSpan
>
<
/TitleBox
>
<
TitleBox
>
<
FontAwesomeIcon
icon
=
{
faSignOutAlt
}
/
>
<
Router
>
<
StyledLink
to
=
"/"
onClick
=
{
logOut
}
>
<
FontAwesomeIcon
icon
=
{
faSignOutAlt
}
/
>
<
/StyledLink
>
<
/Router
>
<
/TitleBox
>
<
/HeaderContainer
>
);
...
...
Please
register
or
login
to post a comment