init
This commit is contained in:
+4
-11
@@ -1,6 +1,7 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from "react";
|
||||
import dayjs from "dayjs";
|
||||
import { Link } from "react-router-dom";
|
||||
import { getConfigValue } from "@ijl/cli";
|
||||
|
||||
import {
|
||||
ArrowImg,
|
||||
@@ -14,20 +15,12 @@ import {
|
||||
} from "./style";
|
||||
|
||||
import arrow from "../assets/36-arrow-right.svg";
|
||||
import { connect, getSocket } from "../socket";
|
||||
import { getConfigValue } from "@ijl/cli";
|
||||
import { keycloak } from "../__data__/const";
|
||||
import { keycloak } from "../__data__/kc";
|
||||
|
||||
export const Journal = () => {
|
||||
const [lessons, setLessons] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
connect();
|
||||
const socket = getSocket();
|
||||
socket.on("lessons", (data) => {
|
||||
setLessons(data);
|
||||
});
|
||||
|
||||
const check = async () => {
|
||||
if (keycloak.authenticated) {
|
||||
keycloak;
|
||||
@@ -79,8 +72,8 @@ export const Journal = () => {
|
||||
(event) => {
|
||||
event.preventDefault();
|
||||
|
||||
const socket = getSocket();
|
||||
socket.emit("create-lesson", { lessonName: value });
|
||||
// const socket = getSocket();
|
||||
// socket.emit("create-lesson", { lessonName: value });
|
||||
setValue("");
|
||||
},
|
||||
[value]
|
||||
|
||||
Reference in New Issue
Block a user