sdy

update ChannelList component

1 import React from "react"; 1 import React from "react";
2 import styled from "styled-components"; 2 import styled from "styled-components";
3 import { Link } from "react-router-dom"; 3 import { Link } from "react-router-dom";
4 +import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
5 +import { faArrowRight } from "@fortawesome/free-solid-svg-icons";
4 6
5 -const ChannelContainer = styled.div``; 7 +const Wrapper = styled.div`
8 + display: flex;
9 + flex-direction: column;
10 + justify-content: center;
11 + align-items: center;
12 + background-color: #a5b1c2;
13 + border-radius: 10px;
14 + box-shadow: 1px 1px 10px #8395a7;
15 + min-width: 23.75rem;
16 + width: auto;
17 + max-height: none;
18 + padding: 0.5rem 0.7rem 0 1rem;
19 +`;
6 20
7 -const ChannelList = styled.ul``; 21 +const ChannelContainer = styled.div`
22 + display: flex;
23 + flex-direction: column;
24 + width: 100%;
25 + overflow-y: scroll;
26 + min-height: 70px;
27 + justify-content: center;
28 + align-items: center;
29 + &::-webkit-scrollbar {
30 + width: 10px;
31 + }
32 + &::-webkit-scrollbar-track {
33 + background-color: transparent;
34 + }
35 + &::-webkit-scrollbar-thumb {
36 + border-radius: 3px;
37 + background-color: gray;
38 + }
39 + &::-webkit-scrollbar-button {
40 + width: 0;
41 + height: 0;
42 + }
43 +`;
8 44
9 -const ChannelItem = styled.li``; 45 +const ChannelList = styled.ul`
46 + width: 100%;
47 + display: flex;
48 + flex-direction: row;
49 + justify-content: space-between;
50 + svg {
51 + color: white;
52 + opacity: 0.7;
53 + }
54 +`;
10 55
11 -const CreateContainer = styled.div``; 56 +const ChannelItem = styled.li`
57 + font-family: "Ubuntu", sans-serif;
58 +`;
59 +
60 +const CreateContainer = styled.div`
61 + padding-top: 1.9rem;
62 + padding-bottom: 1.7rem;
63 + box-shadow: 0 -4px 4px rgba(0, 0, 0, 0.04);
64 +`;
12 65
13 export default () => { 66 export default () => {
14 return ( 67 return (
15 - <> 68 + <Wrapper>
16 <ChannelContainer> 69 <ChannelContainer>
17 <ChannelList> 70 <ChannelList>
18 <ChannelItem>First Channel</ChannelItem> 71 <ChannelItem>First Channel</ChannelItem>
72 + <FontAwesomeIcon icon={faArrowRight} />
19 </ChannelList> 73 </ChannelList>
20 </ChannelContainer> 74 </ChannelContainer>
21 <CreateContainer> 75 <CreateContainer>
22 <Link to="/">Create New Channel</Link> 76 <Link to="/">Create New Channel</Link>
23 </CreateContainer> 77 </CreateContainer>
24 - </> 78 + </Wrapper>
25 ); 79 );
26 }; 80 };
......