HyeonJun Jeon

[Modify] Names, debug logic

...@@ -7,21 +7,21 @@ import GridItem from "./GridItem.js"; ...@@ -7,21 +7,21 @@ import GridItem from "./GridItem.js";
7 const Grid = () => { 7 const Grid = () => {
8 const { state } = useContext(CalendarStateContext); 8 const { state } = useContext(CalendarStateContext);
9 9
10 - const renderRows = () => { 10 + const renderItems = () => {
11 - const rows = []; 11 + const items = [];
12 const ndate = new Date(state.date); 12 const ndate = new Date(state.date);
13 ndate.setDate(1); 13 ndate.setDate(1);
14 toSunday(ndate); 14 toSunday(ndate);
15 15
16 for (let i = 0; i < 35; i++) { 16 for (let i = 0; i < 35; i++) {
17 - rows.push(<GridItem key={i} targetDate={new Date(ndate)} />); 17 + items.push(<GridItem key={i} targetDate={new Date(ndate)} />);
18 moveDate(ndate, "day", 1); 18 moveDate(ndate, "day", 1);
19 } 19 }
20 20
21 - return rows; 21 + return items;
22 }; 22 };
23 23
24 - return <div className="Grid">{renderRows()}</div>; 24 + return <div className="Grid">{renderItems()}</div>;
25 }; 25 };
26 26
27 export default Grid; 27 export default Grid;
......
...@@ -6,6 +6,8 @@ import "../styles/Debug.css"; ...@@ -6,6 +6,8 @@ import "../styles/Debug.css";
6 import { initTempSubjects } from "../utils/Test"; 6 import { initTempSubjects } from "../utils/Test";
7 7
8 const Debug = () => { 8 const Debug = () => {
9 + console.log("visit Debug");
10 +
9 const [state, setState] = useState({ 11 const [state, setState] = useState({
10 type: "login", 12 type: "login",
11 input1: "", 13 input1: "",
......
...@@ -3,6 +3,8 @@ import { Navigate, useNavigate } from "react-router-dom"; ...@@ -3,6 +3,8 @@ import { Navigate, useNavigate } from "react-router-dom";
3 import "../styles/Settings.css"; 3 import "../styles/Settings.css";
4 4
5 const Settings = () => { 5 const Settings = () => {
6 + console.log("visit Settings");
7 +
6 const session = localStorage.getItem("session"); 8 const session = localStorage.getItem("session");
7 9
8 const navigate = useNavigate(); 10 const navigate = useNavigate();
......
1 -class Subject {
2 - constructor(name, color, selected) {
3 - this.name = name;
4 - this.color = color;
5 - this.selected = selected;
6 - }
7 -}
8 -
9 -export default Subject;