Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Box, Grid, Typography } from "@mui/material";
import ChatMessageLeft from "./ChatMessageLeft";
import ChatMessageRight from "./ChatMessageRight";
import { myContext } from "../context/MyContext";

//TODO as a general message, it would be nicer to have user's messages on the leftside (if you are a righty :P ) and the rest of the messages on the right side. You probably tried already, so this would be a nice addition.
export default function Chat() {
const { messages, documentID } = useContext(myContext);

Expand Down
9 changes: 7 additions & 2 deletions src/components/Details.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import MapButton from "./MapButton";
import { doc, setDoc, deleteDoc, getDoc } from "firebase/firestore";
import { db } from "../config";

//TODO as a general comment, this component got pretty big, and there are some checks that are repeated , giving us the feeling that maybe splitting them into smaller components might be a good way to make it shorter and more readable.

export default function Details() {
const { status, user } = useContext(AuthContext);
const [checked, setChecked] = useState(false);
Expand All @@ -30,7 +32,7 @@ export default function Details() {
};

// * Loop over deSubject JSON object with nested arrays to catch all subject entries
let recordSubjects = [];
let recordSubjects = []; //TODO maybe move the array inside the function since you are not directly using it later. Or Turn it into a State Variable that you set inside getSubjects()
const getSubjects = (itemRecord) => {
let subjects = Object.entries(itemRecord.object.proxies[1].dcSubject);

Expand Down Expand Up @@ -64,7 +66,7 @@ export default function Details() {
return itemID;
};

let finalID = id();
let finalID = id(); //TODO instead of return itemID you could a) create a state variable, and b) set it in id()

const addBookmark = async () => {
try {
Expand Down Expand Up @@ -156,6 +158,9 @@ export default function Details() {
{typeof itemRecord.object.proxies[1].dcTitle == "undefined"
? location.state.element.title
: itemRecord.object.proxies[1].dcTitle.de}

{/*//TODO I (Raul) do not really understand that check with
typeof...but if it works... */}
</Typography>
<Typography
paragraph
Expand Down
1 change: 1 addition & 0 deletions src/components/FooterFilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import CheckIcon from "@mui/icons-material/Check";
import { useNavigate } from "react-router-dom";
import { myContext } from "../context/MyContext";
import { AuthContext } from "../context/AuthContext";
//TODO the filter function needs to be fixed

export default function Footer() {
const [show, setShow] = useState(false);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { myContext } from "../context/MyContext";
import Typography from "@mui/material/Typography";
import { Box } from "@mui/material";
import PersonIcon from "@mui/icons-material/Person";

//TODO why is this function anonymous?
export default function () {
const location = useLocation();
const { user } = useContext(myContext);
Expand Down
2 changes: 1 addition & 1 deletion src/context/BookmarkContext.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createContext, useState } from "react";

export const BookmarkContext = createContext();

//TODO are you really using it? If not, better remove it , unless you have something planned for it.
export const BookmarkContextProvider = (props) => {
return (
<>
Expand Down
3 changes: 3 additions & 0 deletions src/context/MyContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {

export const myContext = createContext();

//TODO as a general comment, this context might be splitted into two, one for the search and one for the comments, to make it shorter

export const MyContextProvider = (props) => {
const [test, setTest] = useState({ name: "John", password: "tomato" });

Expand Down Expand Up @@ -68,6 +70,7 @@ export const MyContextProvider = (props) => {
inputField.addEventListener("keyup", (event) => {
if (event.key === "Enter") {
let value = document.querySelector("#userInputValue").value;
//TODO the comparison below isn't working
if (value != "") {
setUserInput(value);
setLoading(true);
Expand Down