From 8f3dc6f6ac2678604f6e862ff6ca4db919b780e6 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Mon, 12 Oct 2020 13:50:35 -0400 Subject: [PATCH] Update section names to match new API --- src/components/ItemBodyView/ItemBodyView.js | 62 ++++++++++----------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/components/ItemBodyView/ItemBodyView.js b/src/components/ItemBodyView/ItemBodyView.js index bed15c1..83f76ad 100644 --- a/src/components/ItemBodyView/ItemBodyView.js +++ b/src/components/ItemBodyView/ItemBodyView.js @@ -8,35 +8,33 @@ import { objectIsEmpty } from "../../utilities"; export default function ItemBodyView({ item }) { - const theme = webqueue2Theme(false); - const useStyles = makeStyles((theme) => ({ + const useStyles = makeStyles(() => ({ missingOppositeContent: { '&:before': { content: '""', flex: 0, padding: '0', }, - }, - })); - const classes = useStyles(theme); + }})); + const classes = useStyles(); const generateTimelineItem = (section) => { - switch(section.type) { - case "directoryInformation": - if (section.content.length === 0){ + switch (section.type) { + case "directory_information": + if (Object.entries(section) === 0) { return "No Directory Information"; } else { return "Directory Information Present" } - case "initialMessage": - return( + case "initial_message": + return ( <> {section.content.map((line, index) => {line})} ); case "edit": - return( + return ( <> {`${section.by} assigned thisat ${Date(section.datetime)}`} @@ -45,7 +43,7 @@ export default function ItemBodyView({ item }) { ); case "status": - return( + return ( <> {`${section.by} update the status to at ${Date(section.datetime)}`} @@ -53,14 +51,14 @@ export default function ItemBodyView({ item }) { {section.content.map((line) => {line})} ); - case "assign": + case "assignment": return ( {`${section.by} assigned this to ${section.to} at ${Date(section.datetime)}`} ); - case "replyToUser": - return( + case "reply_to_user": + return ( <> {`${section.by} replied ${Date(section.datetime)}`} @@ -68,8 +66,8 @@ export default function ItemBodyView({ item }) { {section.content.map((line) => {line})} ); - case "replyFromUser": - return( + case "reply_from_user": + return ( <> {section.content.map((line, index) => {line})} @@ -81,20 +79,22 @@ export default function ItemBodyView({ item }) { }; return ( - - {objectIsEmpty(item) ? "" : item.content.map((section, index) => { - return ( - - - - - - - {generateTimelineItem(section)} - - - ); - })} + + {objectIsEmpty(item) ? "" : item.content.map((section) => ( + + + + + + + {generateTimelineItem(section)} + + + ))} ); };