home page is done

This commit is contained in:
Nikolai Petukhov
2024-09-21 15:53:37 +03:00
parent 2ce5bb8d7a
commit 93ed4ce7fc
15 changed files with 478 additions and 4 deletions

View File

@@ -1,8 +1,20 @@
import React from 'react';
import React, {useEffect, useState} from 'react';
const Chat = () => {
const [interlocutorId, setInterlocutorId] = useState(0); // State to hold the interlocutorId
function getInterlocutorId() {
const id = localStorage.getItem('interlocutorId');
return id ? id : 0;
}
useEffect(() => {
const id = getInterlocutorId();
setInterlocutorId(id);
}, []);
return (
<h2>Chat with ...</h2>
<h2>Chat with ... (id = {interlocutorId})</h2>
);
};