sdy

update styling

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>
);
};
......
......@@ -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>
);
......