1- import { Avatar , Button , IconButton } from '@material-ui/core' ;
1+ import { Avatar , IconButton } from '@material-ui/core' ;
22import styled from 'styled-components' ;
33import ChatIcon from '@material-ui/icons/Chat' ;
44import MoreVertIcon from '@material-ui/icons/MoreVert' ;
@@ -8,6 +8,7 @@ import { useAuthState } from 'react-firebase-hooks/auth';
88import { useCollection } from 'react-firebase-hooks/firestore' ;
99import { auth , db } from '../firebase' ;
1010import Chat from './Chat' ;
11+ import AddCircleRoundedIcon from '@material-ui/icons/AddCircleRounded' ;
1112
1213function Sidebar ( ) {
1314 const [ user ] = useAuthState ( auth ) ;
@@ -46,20 +47,28 @@ function Sidebar() {
4647
4748 < IconsContainer >
4849 < IconButton >
49- < ChatIcon />
50+ < ChatIcon style = { { fontSize : 22 } } />
5051 </ IconButton >
5152 < IconButton >
52- < MoreVertIcon />
53+ < MoreVertIcon style = { { fontSize : 22 } } />
5354 </ IconButton >
5455 </ IconsContainer >
5556 </ Header >
5657
5758 < Search >
58- < SearchIcon />
59- < SearchInput placeholder = "Search in chats" />
59+ < SearchIcon style = { { fontSize : 22 , marginRight : '1rem' } } />
60+ < SearchInput placeholder = "Search for chats..." />
61+ { /* or Add Chat (s) by Gmail */ }
6062 </ Search >
6163
62- < SidebarButton onClick = { createChat } > Start a new chat</ SidebarButton >
64+ < SidebarButton >
65+ { /* <IconButton> */ }
66+ < AddCircleRoundedIcon
67+ style = { { fontSize : 58 , color : '#25D366' } }
68+ onClick = { createChat }
69+ />
70+ { /* </IconButton> */ }
71+ </ SidebarButton >
6372
6473 { /* List of Chats */ }
6574 { chatsSnapshot ?. docs . map ( ( chat ) => (
@@ -78,6 +87,7 @@ const Container = styled.div`
7887 min-width: 30rem;
7988 max-width: 35rem;
8089 overflow-y: scroll;
90+ position: relative;
8191
8292 ::-webkit-scrollbar {
8393 display: none;
@@ -94,18 +104,28 @@ const Search = styled.div`
94104 border-radius: 0.2rem;
95105` ;
96106
97- const SidebarButton = styled ( Button ) `
98- width: 100%;
99- &&& {
100- border-top: 1px solid whitesmoke;
101- border-bottom: 1px solid whitesmoke;
102- }
107+ const SidebarButton = styled . button `
108+ position: absolute;
109+ bottom: 1.85rem;
110+ right: 2rem;
111+ border-radius: 50%;
112+ width: 3rem;
113+ height: 3rem;
114+ border: none;
115+ outline: none;
116+ padding: 2.5rem;
117+ display: flex;
118+ align-items: center;
119+ justify-content: center;
120+ cursor: pointer;
121+ z-index: 100;
103122` ;
104123
105124const SearchInput = styled . input `
106125 outline: none;
107126 border: none;
108127 flex: 1;
128+ font-size: 1.5rem;
109129` ;
110130
111131const Header = styled . div `
@@ -117,7 +137,7 @@ const Header = styled.div`
117137 justify-content: space-between;
118138 align-items: center;
119139 padding: 1.5rem;
120- height: 8rem ;
140+ height: 7rem ;
121141 border-bottom: 1px solid whitesmoke;
122142` ;
123143
0 commit comments