);
};
-export default App;
+export default App;
\ No newline at end of file
diff --git a/src/components/ChatEntry.jsx b/src/components/ChatEntry.jsx
index fe05efa0..6aa2484a 100644
--- a/src/components/ChatEntry.jsx
+++ b/src/components/ChatEntry.jsx
@@ -1,21 +1,32 @@
+import PropTypes from 'prop-types';
import './ChatEntry.css';
+import TimeStamp from './TimeStamp';
-const ChatEntry = () => {
+const ChatEntry = (props) => {
return (
- // Replace the outer tag name with a semantic element that fits our use case
-
-
Replace with name of sender
+
+
{props.sender}
-
Replace with body of ChatEntry
-
Replace with TimeStamp component
-
+
{props.body}
+
+
-
+
);
};
ChatEntry.propTypes = {
- // Fill with correct proptypes
+ id: PropTypes.number.isRequired,
+ sender: PropTypes.string.isRequired,
+ body: PropTypes.string.isRequired,
+ timeStamp: PropTypes.string.isRequired,
+ liked: PropTypes.bool.isRequired,
+ onLikeToggle: PropTypes.func.isRequired
};
-export default ChatEntry;
+export default ChatEntry;
\ No newline at end of file
diff --git a/src/components/ChatLog.jsx b/src/components/ChatLog.jsx
new file mode 100644
index 00000000..badedebd
--- /dev/null
+++ b/src/components/ChatLog.jsx
@@ -0,0 +1,35 @@
+import PropTypes from 'prop-types';
+import ChatEntry from './ChatEntry';
+
+const ChatLog = (props) => {
+ return (
+
+ {props.entries.map(message => (
+
+ ))}
+
+ );
+};
+
+ChatLog.propTypes = {
+ entries: PropTypes.arrayOf(
+ PropTypes.shape({
+ id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
+ sender: PropTypes.string.isRequired,
+ body: PropTypes.string.isRequired,
+ timeStamp: PropTypes.string.isRequired,
+ liked: PropTypes.bool.isRequired,
+ })
+ ).isRequired,
+ onLikeToggle: PropTypes.func.isRequired
+};
+
+export default ChatLog;
\ No newline at end of file