Skip to content

Commit

Permalink
Revert "Merge pull request #92 from ECN/feature-conversational-ui"
Browse files Browse the repository at this point in the history
This reverts commit f1b6729, reversing
changes made to 7a8f5b7.
  • Loading branch information
Justin Campbell committed Oct 27, 2020
1 parent f1b6729 commit bf54a0a
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 120 deletions.
42 changes: 30 additions & 12 deletions src/components/ItemBodyView/ItemBodyView.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import React from "react";
import PropTypes from "prop-types";
import { Timeline, TimelineItem, TimelineSeparator, TimelineConnector, TimelineContent, TimelineDot } from '@material-ui/lab';
import { makeStyles } from "@material-ui/core";
import { Typography, makeStyles } from "@material-ui/core";
import DirectoryInformation from "../DirectoryInformation/";
import Assignment from "../Assignment/";
import TimelineActionCard from "../TimelineActionCard/";
import MessageView from "../MessageView/";
import ParseError from "../ParseError/";
import { objectIsEmpty } from "../../utilities";

export default function ItemBodyView({ item }) {
Expand All @@ -32,23 +31,42 @@ export default function ItemBodyView({ item }) {
const generateTimelineItem = (section) => {
switch (section.type) {
case "directory_information":
return <DirectoryInformation section={section} />
return (
<DirectoryInformation section={section} />
);
case "initial_message":
return <MessageView {...section} />
return (
<>
<MessageView {...section} />
</>
);
case "edit":
return <TimelineActionCard {...section} />
return (
<TimelineActionCard {...section} />
);
case "status":
return <TimelineActionCard {...section} />
return (
<>
<Typography variant="subtitle2">
{`${section.by} update the status to at ${Date(section.datetime)}`}
</Typography>
{section.content.map((line) => <Typography variant="body1">{line}</Typography>)}
</>
);
case "assignment":
return <Assignment {...section} />
return (
<Assignment {...section} />
);
case "reply_to_user":
return <TimelineActionCard {...section} />
return (
<TimelineActionCard {...section} />
);
case "reply_from_user":
return <MessageView {...section} />
case "parse_error":
return <ParseError {...section} />
return (
<MessageView {...section} />
);
default:
return `No match found for type: ${section.type}`;
return "No Match Found";
};
};

Expand Down
61 changes: 0 additions & 61 deletions src/components/ParseError/ParseError.js

This file was deleted.

36 changes: 0 additions & 36 deletions src/components/ParseError/ParseError.md

This file was deleted.

1 change: 0 additions & 1 deletion src/components/ParseError/index.js

This file was deleted.

8 changes: 2 additions & 6 deletions src/components/TimelineActionCard/TimelineActionCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ export default function TimelineActionCard({ type, datetime, by, content }){
"reply_to_user": {
"verbage": "replied",
"coloring": theme.palette.reply_to_user.main
},
"status": {
"verbage": "updated the status",
"coloring": theme.palette.status.main
}
}

Expand Down Expand Up @@ -58,9 +54,9 @@ TimelineActionCard.propTypes = {
]),
/** ISO 8601 formatted time string. */
"datetime": PropTypes.string.isRequired,
/** The name of the person who added the action. */
/** The name of the person who added the edit. */
"by": PropTypes.string.isRequired,
/** An array of strings containing the content of the action. */
/** An array of strings containing the content of the edit. */
"content": PropTypes.array.isRequired
};

Expand Down
5 changes: 1 addition & 4 deletions src/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,8 @@ export default function theme(darkMode = false) {
"reply_to_user": {
main: "rgba(99, 125, 255, 0.2)",
},
"status": {
"reply_from_user": {
main: "rgba(99, 255, 151, 0.2)",
},
"parse_error": {
main: "rgba(255, 99, 204, 0.2)",
}
},
})
Expand Down

0 comments on commit bf54a0a

Please sign in to comment.