misc changes and added method stub for encryption support

This commit is contained in:
Zhongheng Liu 2024-04-01 21:50:05 +03:00
commit 3ceee1db4f
No known key found for this signature in database
2 changed files with 5 additions and 2 deletions

View file

@ -13,6 +13,10 @@ import strings from "../Intl/strings.json";
import { LangContext } from "../context"; import { LangContext } from "../context";
import { connectionAddress, endpoints } from "../consts"; import { connectionAddress, endpoints } from "../consts";
const Chat = ({ user }: { user: string }): React.ReactElement => { const Chat = ({ user }: { user: string }): React.ReactElement => {
const encryptMessage = (plaintext: string) => {
const ciphertext = plaintext;
return ciphertext;
}
const lang = useContext(LangContext); const lang = useContext(LangContext);
const chatPage = strings[lang].chat; const chatPage = strings[lang].chat;
const [messages, setMessages] = useState<ReactElement[]>([]); const [messages, setMessages] = useState<ReactElement[]>([]);
@ -78,7 +82,7 @@ const Chat = ({ user }: { user: string }): React.ReactElement => {
type: MessageType.MESSAGE, type: MessageType.MESSAGE,
fromUserId: user, fromUserId: user,
toUserId: "everyone", toUserId: "everyone",
content: entryElement.value, content: encryptMessage(entryElement.value),
timeMillis: Date.now(), timeMillis: Date.now(),
}; };
console.log( console.log(

View file

@ -1,4 +1,3 @@
import { useState } from "react";
import "./Sidebar.css"; import "./Sidebar.css";
import { SidebarMenu } from "./Components/SidebarMenu"; import { SidebarMenu } from "./Components/SidebarMenu";
export const Sidebar = ({ export const Sidebar = ({