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

Commit

Permalink
#33 styling and refactor of chat
Browse files Browse the repository at this point in the history
  • Loading branch information
gkillick committed Mar 30, 2022
1 parent f748c1f commit 2621efb
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/components/chat/chatroom.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
.sent p{
background: #434ce6;
color:white;
margin:5px;
}

.sent{
Expand Down
6 changes: 3 additions & 3 deletions src/components/chat/chatroom.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function ChatRoom(props: PatientData) {
}, [messages]);

// define reference to chat
const chatRef = firestore.collection('chats').doc(state.id);
const chatRef = firestore.collection('chats').doc(props.PID);

// save message to firestore
const sendMessage = async (e: any) => {
Expand Down Expand Up @@ -136,7 +136,7 @@ function Chat(props: PatientData) {
return (
<Box
className="Chat"
sx={{ maxHeight: 'calc(100vh - 136px)',
sx={{ height: 'calc(100vh - 136px)',
overflowY: 'auto',
display: 'flex',
flexDirection: 'column',
Expand All @@ -145,7 +145,7 @@ function Chat(props: PatientData) {

}}
>
<Box sx={{ padding: '20px', borderBottom: '1px solid #e7e7e7' }}>
<Box sx={{ padding: '15px 20px 15px 20px', borderBottom: '1px solid #e7e7e7' }}>
<Grid
container
spacing={24}
Expand Down
33 changes: 16 additions & 17 deletions src/components/dashboard/MedicalView/PatientInfo/PatientInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,23 +91,6 @@ export type PatientData = {
initHelpFormData: HelpFormData[],
}

const initPatientData: PatientData = {
PID: '',
name: '',
age: 0,
sex: '',
healthCardNumber: '',
status: '',
latestTestResult: undefined,
latestSymptoms: undefined,
history: undefined,
medicalConditions: undefined,
phone: undefined,
bmi: 0,
score: undefined,
initHelpFormData: [],
};

export function caseSeverity(score: number | undefined): string {
if (score !== undefined) {
if (score > 2.5) return ('Severe');
Expand All @@ -118,6 +101,22 @@ export function caseSeverity(score: number | undefined): string {
}

function PatientInfo({ PID }: Props) {
const initPatientData: PatientData = {
PID,
name: '',
age: 0,
sex: '',
healthCardNumber: '',
status: '',
latestTestResult: undefined,
latestSymptoms: undefined,
history: undefined,
medicalConditions: undefined,
phone: undefined,
bmi: 0,
score: undefined,
initHelpFormData: [],
};
const [modalOpen, setModalOpen] = React.useState(false);
const handleOpen = () => setModalOpen(true);
const handleClose = () => setModalOpen(false);
Expand Down

0 comments on commit 2621efb

Please sign in to comment.