From eb4f02238d021309ffa3641ae578e87c5e1dd5bb Mon Sep 17 00:00:00 2001 From: batuhancoskun Date: Fri, 13 Jun 2025 21:37:18 +0300 Subject: [PATCH] =?UTF-8?q?D=C3=BCzenlemeler=20ve=20hata=20giderme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.js | 1 + .../right/Profile/Follow/FollowRight.jsx | 13 +++++++---- .../middlewares/menus/ProfileMenuBox.jsx | 3 +-- .../notifications/partials/PostSave.jsx | 7 ++++-- src/components/middlewares/peoples/User.jsx | 2 +- src/components/middlewares/post/post.jsx | 5 ++++- src/components/navbar/Navbar.jsx | 6 +++-- .../notifications/Notifications.jsx | 4 ++-- src/components/profiles/follows/UserBox.jsx | 6 ++--- src/middlewares/general/Text.jsx | 6 +++++ src/middlewares/profiles/follow.jsx | 22 +++++++++++++++++++ src/middlewares/profiles/getProfile.jsx | 7 ++++++ 12 files changed, 65 insertions(+), 17 deletions(-) create mode 100644 src/middlewares/general/Text.jsx diff --git a/src/App.js b/src/App.js index f9f116a..2ec8c25 100644 --- a/src/App.js +++ b/src/App.js @@ -20,6 +20,7 @@ export default function App() { const [popup, setPopup] = useState(""); const globalState = { + title: "Arslanşah", states: { rightMenu, setRightMenu, leftMenu, setLeftMenu, popup, setPopup } diff --git a/src/components/menus/right/Profile/Follow/FollowRight.jsx b/src/components/menus/right/Profile/Follow/FollowRight.jsx index 1451a83..9f52891 100644 --- a/src/components/menus/right/Profile/Follow/FollowRight.jsx +++ b/src/components/menus/right/Profile/Follow/FollowRight.jsx @@ -2,17 +2,22 @@ import React, { useContext, useEffect, useState } from 'react' import { GSContext } from '../../../../../middlewares/GlobalStore'; import { Link } from 'react-router-dom'; import { I18nContext } from '../../../../../middlewares/Locale'; +import { getProfileDetails } from '../../../../../middlewares/profiles/getProfile'; -export default function FollowRight({profile}) { +export default function FollowRight({username}) { const { globalState } = useContext(GSContext); const { locale } = useContext(I18nContext); const [profileKeys, setProfileKeys] = useState(); + const [profile, setProfile] = useState(); useEffect(()=>{ - if(profile){ - setProfileKeys(Object.keys(profile)); + if(username){ + getProfileDetails(3001, username).then(res => { + setProfile(res); + setProfileKeys(Object.keys(res)); + }); }; - },[profile]); + },[username]); if(profile){ diff --git a/src/components/middlewares/menus/ProfileMenuBox.jsx b/src/components/middlewares/menus/ProfileMenuBox.jsx index f4ca9a2..16bca52 100644 --- a/src/components/middlewares/menus/ProfileMenuBox.jsx +++ b/src/components/middlewares/menus/ProfileMenuBox.jsx @@ -8,7 +8,6 @@ export default function ProfileMenuBox() { useEffect(()=>{ setLoading(false); - console.log(globalState, 567891); },[]); if(loading === true){ @@ -16,7 +15,7 @@ export default function ProfileMenuBox() { }else{ return ( - + {/* */}

{globalState.user.first_name} {globalState.user.second_name}

diff --git a/src/components/middlewares/notifications/partials/PostSave.jsx b/src/components/middlewares/notifications/partials/PostSave.jsx index 21afce9..9f67cbe 100644 --- a/src/components/middlewares/notifications/partials/PostSave.jsx +++ b/src/components/middlewares/notifications/partials/PostSave.jsx @@ -9,8 +9,11 @@ export default function PostSave({data, localeCode}) {
{/*
*/}
- {data.user.name} - {locale[localeCode]}. +

+ {data.user.name} +
+ {locale[localeCode]}. +

{data.datetime.createdAt.differance[data.datetime.createdAt.differance.current]} {locale[data.datetime.createdAt.differance.current]}

diff --git a/src/components/middlewares/peoples/User.jsx b/src/components/middlewares/peoples/User.jsx index 20fa40f..f6b6375 100644 --- a/src/components/middlewares/peoples/User.jsx +++ b/src/components/middlewares/peoples/User.jsx @@ -6,7 +6,7 @@ import FollowRight from '../../menus/right/Profile/Follow/FollowRight'; export default function User({people}) { const {globalState} = useContext(GSContext); return ( -
globalState.states.setRightMenu()} className='flex flex-col justify-center p-2 gap-1 cursor-pointer hover:bg-pc'> +
globalState.states.setRightMenu()} className='flex flex-col justify-center p-2 gap-1 cursor-pointer hover:bg-pc'>

{people.first_name} {people.second_name}

@{people.username}

diff --git a/src/components/middlewares/post/post.jsx b/src/components/middlewares/post/post.jsx index 42b6a63..7f21b7b 100644 --- a/src/components/middlewares/post/post.jsx +++ b/src/components/middlewares/post/post.jsx @@ -8,10 +8,13 @@ import PostComments from './PostComments'; import { openPopup, renderPopup } from '../../../middlewares/popups/popup'; import { GSContext } from '../../../middlewares/GlobalStore'; import Popup from '../../popup/Popup'; +import { convertHTML } from '../../../middlewares/general/Text'; export default function Post({data}) { const {globalState} = useContext(GSContext); + console.log(); + if(data.reblog === true){ return (
@@ -87,7 +90,7 @@ export default function Post({data}) {

{data.title}

-

{data.text}

+

{/*
diff --git a/src/components/navbar/Navbar.jsx b/src/components/navbar/Navbar.jsx index 9b15869..3de6796 100644 --- a/src/components/navbar/Navbar.jsx +++ b/src/components/navbar/Navbar.jsx @@ -1,11 +1,13 @@ -import React from 'react' +import React, { useContext } from 'react' import { Link } from 'react-router-dom' +import { GSContext } from '../../middlewares/GlobalStore'; export default function () { + const { globalState } = useContext(GSContext); return (