aboutsummaryrefslogtreecommitdiff
path: root/maps-frontend/src/components/Hub.js
diff options
context:
space:
mode:
authorMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-16 15:34:25 -0400
committerMichael Foiani <sotech117@michaels-mbp-3.lan>2021-04-16 15:34:25 -0400
commit579fa51b8b306fb201c799d33e633e58819463fb (patch)
treec2c56da25fc3e43836451df6d78f94d120ab75f1 /maps-frontend/src/components/Hub.js
parentf00ac29dff86169e5dee9d816961cc13979f9a50 (diff)
Basic way to show the hubs with their scores.
Diffstat (limited to 'maps-frontend/src/components/Hub.js')
-rw-r--r--maps-frontend/src/components/Hub.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/maps-frontend/src/components/Hub.js b/maps-frontend/src/components/Hub.js
new file mode 100644
index 0000000..cd160ea
--- /dev/null
+++ b/maps-frontend/src/components/Hub.js
@@ -0,0 +1,29 @@
+// React import
+import { useState } from "react";
+
+// CSS import
+import '../css/UserCheckin.css';
+
+/**
+ * Componenet for checkins. Has a toggle to show more info.
+ * @param {Object} props The props of the component.
+ * @returns {import('react').HtmlHTMLAttributes} A list element holding a checkin's info.
+ */
+function Hub(props) {
+ // State - toggled
+ const [isToggled, setIsToggled] = useState(false);
+
+ return (
+ <li className='Checkin'>
+ <div className="Img-flex">
+ <span><span className="Clickable-name" onClick= {(e) => props.getUserCheckins(props.value.id, props.value.name)}>{props.value.name}</span> just checked in!</span>
+ <img className="Img-btn" hidden={isToggled} onClick={() => setIsToggled((toggle) => !toggle)} src="/round_expand_more_white_18dp.png" alt="image"/>
+ <img className="Img-btn" hidden={!isToggled} onClick={() => setIsToggled((toggle) => !toggle)} src="/round_expand_less_white_18dp.png" alt="image"/>
+ </div>
+ <div hidden={!isToggled}>
+ Nothin....
+ </div>
+ </li>);
+}
+
+export default Hub; \ No newline at end of file