reload fix , friends , navbarSocial change margin friends

This commit is contained in:
Lara REALI 2023-06-26 04:17:07 +02:00
parent 26b3c82790
commit 84cc25a5a1
7 changed files with 28 additions and 11 deletions

View File

@ -74,10 +74,13 @@ export class loginClass {
friends: null,
blocked: null,
photo: null,
sessionNumber: 1,
sessionNumber: 0,
};
await this.usersService.create(user);
}
// if (user.status !== 2 || user.status === 0) //super
// user.status = 1;
// user.sessionNumber++;
// console.log(`in login42 user= ${user}`)
const myJSON = JSON.stringify(user);
console.log(`in login42 user= ${myJSON}`)

View File

@ -27,8 +27,6 @@ function AnimatedRoute () {
useEffect(() => {
const handleBeforeUnload = async (event: { preventDefault: () => void; returnValue: string; }) => {
event.preventDefault(); // Cancel the default event behavior if needed
event.returnValue = ''; // Chrome requires a return value to display a custom message
if (!localStorage.getItem('token'))
return ;
try {
@ -36,9 +34,6 @@ function AnimatedRoute () {
} catch(err) {
console.log(err);
}
// Perform your desired actions before the user leaves the page
// For example, you can show a confirmation dialog or save user data
};
window.addEventListener('beforeunload', handleBeforeUnload);

View File

@ -26,7 +26,7 @@ export const SidebarData = [
cName: 'nav-text'
},
{
title: 'Friend',
title: 'Friends',
path: '/social',
icon: <IoIcons.IoMdPeople />,
cName: 'nav-text'

View File

@ -27,6 +27,7 @@ const UserChat = styled.div `
gap: 5px;
color: white;
cursor: pointer;
margin-top: 15px;
&:hover{
background-color: #3e3c61;
@ -93,7 +94,7 @@ export default function Friend({currentUser}: UserProps)
};
return (
<UserChat>
<UserChat className="centermargin">
{profilePicture ? (
<img className="pic-user" src={`data:image/jpeg;base64,${profilePicture}`} />
) : (

View File

@ -87,14 +87,14 @@ function Social (){
return (
<div>
<div className='navbar'>
<div className='navbarSocial'>
{/* <img src={DefaultPic} alt="profile" className="pic"/> */}
<IoMdPeople className="catchat"/>
<span>
{isLoading || !user ? (
<h4>Loading...</h4>
) : (
<h2>Social</h2>
<h2>Friends</h2>
)}
</span>

View File

@ -35,6 +35,11 @@ input.qr{
height: 40vmin;
pointer-events: none;
}
.centermargin
{
margin-left: 40px;
margin-right: 40px;
}
@media (prefers-reduced-motion: no-preference) {
.App-logo {

View File

@ -108,6 +108,19 @@ select{
margin-top: 0px;
}
.navbarSocial{
/* width: clamp(50%, 500px, 20%); */
/* height: min(50%, 100px); */
display: flex;
align-items: center;
/* background-color: yellow; */
margin: 10px;
background-image: linear-gradient(90deg, #5843e4, #5a0760);
color: white;
padding: 3px;
border-radius: 100px;
}
.pic{
height: 35px;
width: 35px;