Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

Commit

Permalink
#33 styling chat
Browse files Browse the repository at this point in the history
  • Loading branch information
gkillick committed Mar 30, 2022
1 parent e2ede01 commit 43b5680
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
6 changes: 4 additions & 2 deletions src/components/chat/chatroom.css
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
outline: none;
}
.messages-container{
background: white;
border-radius: 20px;
border-bottom-right-radius: 0px;
border-bottom-left-radius: 0;
padding-left: 5px;
margin-right: -20px;
padding-right: 25px;
padding-top: 5px;
}
.send-message-button{
position:absolute;
Expand Down
10 changes: 6 additions & 4 deletions src/components/chat/chatroom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ function ChatRoom(props: PatientData) {
const [formValue, setFormValue] = useState('');
const [messages, setMessages] = useState<Message[]>([]);
const messageRef = useRef<HTMLInputElement>(null);
// ensure scrolls fast to bottom on load and smooth for new message
const [messagesLoaded, setMessagesLoaded] = useState(0);

// scroll messsages on send
Expand Down Expand Up @@ -138,11 +139,12 @@ function Chat(props: PatientData) {
sx={{ maxHeight: 'calc(100vh - 136px)',
overflowY: 'auto',
display: 'flex',
flexDirection: 'column' }}
flexDirection: 'column',
background: 'white',
borderRadius: '20px',

}}
>
<header>
<h3>Messages</h3>
</header>

<ChatRoom {...props} />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ const listHeaderStyle = {
backgroundColor: '#E6E6E6',
color: 'black',
fontWeight: 'bold',
marginTop: '16px',
};

const listStyle = {
Expand Down

0 comments on commit 43b5680

Please sign in to comment.