diff --git a/src/App.css b/src/App.css
index d97beb4e6..df3fe9118 100644
--- a/src/App.css
+++ b/src/App.css
@@ -1,3 +1,4 @@
+/* src/App.css */
#App {
background-color: #87cefa;
}
diff --git a/src/App.js b/src/App.js
index c10859093..979e1a821 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,19 +1,33 @@
-import React from 'react';
+import React, { useState } from 'react';
import './App.css';
import chatMessages from './data/messages.json';
+import ChatLog from './components/ChatLog';
const App = () => {
+
+ const [totalLikes, setTotalLikes] = useState(0);
+
+ const handleLikeChange = (isLiked) => {
+ // Increment or decrement based on the liked status
+ setTotalLikes(prevTotalLikes => isLiked ? prevTotalLikes + 1 : prevTotalLikes - 1);
+ }
+
return (
-
Replace with name of sender
-
- Replace with body of ChatEntry
- Replace with TimeStamp component
-
-
+
+
{props.sender}
+
{props.body}
+
+
);
};
ChatEntry.propTypes = {
- //Fill with correct proptypes
+ sender: PropTypes.string.isRequired,
+ body: PropTypes.string.isRequired,
+ timeStamp: PropTypes.string.isRequired,
+ liked: PropTypes.bool.isRequired,
+ // Make onLike prop optional
+ onLike: PropTypes.func
};
-export default ChatEntry;
+export default ChatEntry;
\ No newline at end of file
diff --git a/src/components/ChatLog.css b/src/components/ChatLog.css
index 378848d1f..f68c07ba6 100644
--- a/src/components/ChatLog.css
+++ b/src/components/ChatLog.css
@@ -1,3 +1,4 @@
+/* src/components/ChatLog.css */
.chat-log {
margin: auto;
max-width: 50rem;
diff --git a/src/components/ChatLog.js b/src/components/ChatLog.js
new file mode 100644
index 000000000..0118f992e
--- /dev/null
+++ b/src/components/ChatLog.js
@@ -0,0 +1,23 @@
+// src/components/ChatLog.js
+import React from 'react';
+import './ChatLog.css';
+import ChatEntry from './ChatEntry';
+
+const ChatLog = (props) => {
+
+const chatEntries = props.entries.map(entry => (
+
+));
+
+return (
+
+ {chatEntries}
+
+);
+}
+
+export default ChatLog;
diff --git a/src/components/TimeStamp.js b/src/components/TimeStamp.js
index e8892b4d4..6b19fc189 100644
--- a/src/components/TimeStamp.js
+++ b/src/components/TimeStamp.js
@@ -1,3 +1,4 @@
+// src/components/TimeStamp.js
import { DateTime } from 'luxon';
import PropTypes from 'prop-types';