@armoyu/ui 1.0.0 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/api/proxy/[...path]/route.d.ts +22 -0
- package/dist/app/api/proxy/[...path]/route.d.ts.map +1 -0
- package/dist/app/api/proxy/[...path]/route.js +89 -0
- package/dist/app/api/proxy/[...path]/route.js.map +1 -0
- package/dist/app/layout.js +11 -11
- package/dist/components/Button.d.ts +7 -7
- package/dist/components/Button.js +15 -15
- package/dist/components/GenderStatsBar.d.ts +5 -5
- package/dist/components/GenderStatsBar.js +7 -7
- package/dist/components/RollingNumber.d.ts +6 -6
- package/dist/components/RollingNumber.js +23 -23
- package/dist/components/Slider.d.ts +10 -10
- package/dist/components/Slider.js +35 -35
- package/dist/components/StatsGrid.js +13 -13
- package/dist/components/ViewModeToggle.d.ts +7 -7
- package/dist/components/ViewModeToggle.js +9 -9
- package/dist/components/modules/auth/Dashboard.js +250 -250
- package/dist/components/modules/auth/MediaLightbox.d.ts +13 -13
- package/dist/components/modules/auth/MediaLightbox.js +46 -46
- package/dist/components/modules/auth/PostCard.js +112 -112
- package/dist/components/modules/auth/PostInteractionsModal.js +12 -12
- package/dist/components/modules/auth/RepostModal.js +75 -75
- package/dist/components/modules/auth/SidebarLeft.js +40 -40
- package/dist/components/modules/auth/Stories.js +15 -15
- package/dist/components/modules/auth/StoryViewer.js +47 -47
- package/dist/components/modules/chat/ChatContainer.js +196 -196
- package/dist/components/modules/chat/ChatInput.js +30 -30
- package/dist/components/modules/chat/ChatList.js +51 -51
- package/dist/components/modules/chat/ChatMessage.d.ts +11 -11
- package/dist/components/modules/chat/ChatMessage.js +6 -6
- package/dist/components/modules/chat/ChatNotes.js +11 -11
- package/dist/components/modules/community/GroupHeader.js +17 -17
- package/dist/components/modules/community/GroupMenu.js +16 -16
- package/dist/components/modules/community/SchoolCard.js +7 -7
- package/dist/components/modules/community/SurveyCard.js +35 -35
- package/dist/components/modules/forum/ForumBoard.d.ts +16 -16
- package/dist/components/modules/forum/ForumBoard.js +6 -6
- package/dist/components/modules/forum/ForumPost.d.ts +13 -13
- package/dist/components/modules/forum/ForumPost.js +5 -5
- package/dist/components/modules/forum/NewTopicModal.d.ts +7 -7
- package/dist/components/modules/forum/NewTopicModal.js +26 -26
- package/dist/components/modules/forum/TopicItem.d.ts +15 -15
- package/dist/components/modules/forum/TopicItem.js +6 -6
- package/dist/components/modules/galleries/GalleryCard.d.ts +9 -9
- package/dist/components/modules/galleries/GalleryCard.js +5 -5
- package/dist/components/modules/giveaways/GiveawayCard.d.ts +9 -9
- package/dist/components/modules/giveaways/GiveawayCard.js +6 -6
- package/dist/components/modules/groups/ApplicationModal.d.ts +7 -7
- package/dist/components/modules/groups/ApplicationModal.js +27 -27
- package/dist/components/modules/groups/GroupCard.d.ts +12 -12
- package/dist/components/modules/groups/GroupCard.js +6 -6
- package/dist/components/modules/guest/Introduction.js +13 -13
- package/dist/components/modules/magaza/BackToStore.js +10 -10
- package/dist/components/modules/magaza/StoreHeader.js +8 -8
- package/dist/components/modules/news/NewsCard.js +6 -6
- package/dist/components/modules/news/NewsComments.js +52 -52
- package/dist/components/modules/profile/CloudStorageModal.d.ts +8 -8
- package/dist/components/modules/profile/CloudStorageModal.js +31 -31
- package/dist/components/modules/profile/EditProfileModal.d.ts +8 -8
- package/dist/components/modules/profile/EditProfileModal.js +27 -27
- package/dist/components/modules/profile/ProfileContent.js +70 -70
- package/dist/components/modules/profile/ProfileHeader.js +19 -19
- package/dist/components/modules/profile/ProfileStats.d.ts +1 -1
- package/dist/components/modules/profile/ProfileStats.js +14 -14
- package/dist/components/modules/profile/TeamSelectorModal.js +16 -16
- package/dist/components/modules/stations/StationCard.js +25 -25
- package/dist/components/modules/stations/StationQRModal.js +12 -12
- package/dist/components/shared/FloatingChatButton.js +20 -20
- package/dist/components/shared/Footer.d.ts +1 -1
- package/dist/components/shared/Footer.js +9 -9
- package/dist/components/shared/Header.js +97 -97
- package/dist/components/shared/LoginModal.d.ts.map +1 -1
- package/dist/components/shared/LoginModal.js +12 -16
- package/dist/components/shared/LoginModal.js.map +1 -1
- package/dist/components/shared/MainLayoutWrapper.js +7 -7
- package/dist/components/shared/PageWidth.d.ts +5 -5
- package/dist/components/shared/PageWidth.js +13 -13
- package/dist/components/showcase/SocialTab.d.ts.map +1 -1
- package/dist/components/showcase/SocialTab.js +47 -2
- package/dist/components/showcase/SocialTab.js.map +1 -1
- package/dist/context/AuthContext.d.ts +1 -1
- package/dist/context/AuthContext.d.ts.map +1 -1
- package/dist/context/AuthContext.js +52 -33
- package/dist/context/AuthContext.js.map +1 -1
- package/dist/context/CartContext.js +63 -63
- package/dist/context/ChatContext.d.ts +12 -12
- package/dist/context/ChatContext.js +17 -17
- package/dist/context/LayoutContext.d.ts +10 -10
- package/dist/context/LayoutContext.js +16 -16
- package/dist/context/SocketContext.js +30 -30
- package/dist/context/ThemeContext.d.ts +10 -10
- package/dist/context/ThemeContext.js +39 -39
- package/dist/index.js +80 -80
- package/dist/lib/constants/educationData.js +117 -117
- package/dist/lib/constants/punishmentData.d.ts +29 -29
- package/dist/lib/constants/punishmentData.js +183 -183
- package/dist/lib/constants/seedData.js +694 -694
- package/dist/lib/constants/stationData.js +166 -166
- package/dist/lib/constants/surveyData.js +49 -49
- package/dist/lib/constants/teamData.js +65 -65
- package/dist/types/stats.d.ts +17 -17
- package/dist/types/stats.js +1 -1
- package/package.json +47 -46
- package/src/globals.css +187 -187
- package/next.config.ts +0 -13
- package/postcss.config.js +0 -6
- package/src/app/layout.tsx +0 -64
- package/src/app/page.tsx +0 -101
- package/src/components/Button.tsx +0 -41
- package/src/components/GenderStatsBar.tsx +0 -66
- package/src/components/RollingNumber.tsx +0 -50
- package/src/components/Slider.tsx +0 -114
- package/src/components/StatsGrid.tsx +0 -35
- package/src/components/ViewModeToggle.tsx +0 -39
- package/src/components/modules/auth/Dashboard.tsx +0 -649
- package/src/components/modules/auth/MediaLightbox.tsx +0 -112
- package/src/components/modules/auth/PostCard.tsx +0 -556
- package/src/components/modules/auth/PostInteractionsModal.tsx +0 -138
- package/src/components/modules/auth/RepostModal.tsx +0 -167
- package/src/components/modules/auth/SidebarLeft.tsx +0 -237
- package/src/components/modules/auth/Stories.tsx +0 -69
- package/src/components/modules/auth/StoryViewer.tsx +0 -146
- package/src/components/modules/chat/ChatContainer.tsx +0 -332
- package/src/components/modules/chat/ChatInput.tsx +0 -57
- package/src/components/modules/chat/ChatList.tsx +0 -179
- package/src/components/modules/chat/ChatMessage.tsx +0 -43
- package/src/components/modules/chat/ChatNotes.tsx +0 -58
- package/src/components/modules/community/GroupHeader.tsx +0 -111
- package/src/components/modules/community/GroupMenu.tsx +0 -82
- package/src/components/modules/community/SchoolCard.tsx +0 -104
- package/src/components/modules/community/SurveyCard.tsx +0 -149
- package/src/components/modules/forum/ForumBoard.tsx +0 -78
- package/src/components/modules/forum/ForumPost.tsx +0 -71
- package/src/components/modules/forum/NewTopicModal.tsx +0 -112
- package/src/components/modules/forum/TopicItem.tsx +0 -72
- package/src/components/modules/galleries/GalleryCard.tsx +0 -66
- package/src/components/modules/giveaways/GiveawayCard.tsx +0 -76
- package/src/components/modules/groups/ApplicationModal.tsx +0 -133
- package/src/components/modules/groups/GroupCard.tsx +0 -96
- package/src/components/modules/guest/Introduction.tsx +0 -60
- package/src/components/modules/magaza/BackToStore.tsx +0 -53
- package/src/components/modules/magaza/StoreHeader.tsx +0 -74
- package/src/components/modules/news/NewsCard.tsx +0 -66
- package/src/components/modules/news/NewsComments.tsx +0 -141
- package/src/components/modules/profile/CloudStorageModal.tsx +0 -200
- package/src/components/modules/profile/EditProfileModal.tsx +0 -191
- package/src/components/modules/profile/ProfileContent.tsx +0 -491
- package/src/components/modules/profile/ProfileHeader.tsx +0 -128
- package/src/components/modules/profile/ProfileStats.tsx +0 -72
- package/src/components/modules/profile/TeamSelectorModal.tsx +0 -129
- package/src/components/modules/stations/StationCard.tsx +0 -95
- package/src/components/modules/stations/StationQRModal.tsx +0 -102
- package/src/components/shared/FloatingChatButton.tsx +0 -57
- package/src/components/shared/Footer.tsx +0 -77
- package/src/components/shared/Header.tsx +0 -799
- package/src/components/shared/LoginModal.tsx +0 -208
- package/src/components/shared/MainLayoutWrapper.tsx +0 -15
- package/src/components/shared/PageWidth.tsx +0 -22
- package/src/components/showcase/CommunityTab.tsx +0 -22
- package/src/components/showcase/CorporateTab.tsx +0 -38
- package/src/components/showcase/GeneralTab.tsx +0 -41
- package/src/components/showcase/MessagesTab.tsx +0 -26
- package/src/components/showcase/ProfileTab.tsx +0 -20
- package/src/components/showcase/ShopTab.tsx +0 -24
- package/src/components/showcase/SocialTab.tsx +0 -28
- package/src/context/AuthContext.tsx +0 -104
- package/src/context/CartContext.tsx +0 -93
- package/src/context/ChatContext.tsx +0 -32
- package/src/context/LayoutContext.tsx +0 -29
- package/src/context/SocketContext.tsx +0 -50
- package/src/context/ThemeContext.tsx +0 -52
- package/src/index.ts +0 -96
- package/src/lib/constants/educationData.ts +0 -124
- package/src/lib/constants/punishmentData.ts +0 -201
- package/src/lib/constants/seedData.ts +0 -758
- package/src/lib/constants/stationData.ts +0 -170
- package/src/lib/constants/surveyData.ts +0 -53
- package/src/lib/constants/teamData.ts +0 -69
- package/src/lib/utils/numberFormat.ts +0 -16
- package/src/lib/utils/odpUtils.ts +0 -51
- package/src/types/index.ts +0 -1
- package/src/types/stats.ts +0 -17
|
@@ -1,556 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { useRouter } from 'next/navigation';
|
|
5
|
-
import { MediaLightbox, PostMedia } from './MediaLightbox';
|
|
6
|
-
import { RepostModal } from './RepostModal';
|
|
7
|
-
import { PostInteractionsModal } from './PostInteractionsModal';
|
|
8
|
-
import { useAuth } from '../../../context/AuthContext';
|
|
9
|
-
import { useSocket } from '../../../context/SocketContext';
|
|
10
|
-
import { RollingNumber } from '../../RollingNumber';
|
|
11
|
-
import { User } from '@armoyu/core';
|
|
12
|
-
|
|
13
|
-
// Yorumların Tipini (Type) Nested Destekleyecek Şekilde Güncelledik
|
|
14
|
-
interface CommentType {
|
|
15
|
-
id: string;
|
|
16
|
-
author: string | User;
|
|
17
|
-
text?: string;
|
|
18
|
-
content?: string;
|
|
19
|
-
date?: string;
|
|
20
|
-
createdAt?: string;
|
|
21
|
-
replies?: CommentType[];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export interface PostCardProps {
|
|
26
|
-
id: string;
|
|
27
|
-
author: User | null;
|
|
28
|
-
content: string;
|
|
29
|
-
imageUrl?: string; // Legacy support
|
|
30
|
-
media?: PostMedia[];
|
|
31
|
-
createdAt: string;
|
|
32
|
-
stats: {
|
|
33
|
-
likes: number;
|
|
34
|
-
comments: number;
|
|
35
|
-
reposts?: number;
|
|
36
|
-
shares: number;
|
|
37
|
-
};
|
|
38
|
-
hashtags?: string[];
|
|
39
|
-
onTagClick?: (tag: string) => void;
|
|
40
|
-
isPending?: boolean;
|
|
41
|
-
|
|
42
|
-
// social lists
|
|
43
|
-
likeList?: User[];
|
|
44
|
-
repostList?: User[];
|
|
45
|
-
commentList?: any[];
|
|
46
|
-
repostOf?: any; // The original post object
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export function PostCard({ id, author, content, imageUrl, media, createdAt, stats, hashtags, onTagClick, isPending, likeList, repostList, commentList, repostOf }: PostCardProps) {
|
|
50
|
-
const { user } = useAuth(); // Oturum bilgisini çek
|
|
51
|
-
const { emit } = useSocket();
|
|
52
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
53
|
-
const router = useRouter();
|
|
54
|
-
const [lightboxIndex, setLightboxIndex] = useState<number | null>(null);
|
|
55
|
-
|
|
56
|
-
if (!author) return null;
|
|
57
|
-
|
|
58
|
-
// Repost Edilen Gönderinin Medyası
|
|
59
|
-
const repostMedia = repostOf?.media || (repostOf?.imageUrl ? [{ type: 'image', url: repostOf.imageUrl }] : []);
|
|
60
|
-
|
|
61
|
-
const displayMedia: PostMedia[] = media
|
|
62
|
-
? media
|
|
63
|
-
: (imageUrl ? [{ type: 'image', url: imageUrl }] : []);
|
|
64
|
-
|
|
65
|
-
// Interaction States
|
|
66
|
-
const [isLiked, setIsLiked] = React.useState(false);
|
|
67
|
-
const [likeCount, setLikeCount] = React.useState(stats.likes);
|
|
68
|
-
|
|
69
|
-
// Props değiştikçe local state'i güncelle (Soket desteği için kritik)
|
|
70
|
-
React.useEffect(() => {
|
|
71
|
-
setLikeCount(stats.likes);
|
|
72
|
-
}, [stats.likes]);
|
|
73
|
-
|
|
74
|
-
const [isCommentOpen, setIsCommentOpen] = React.useState(false);
|
|
75
|
-
const [isRepostModalOpen, setIsRepostModalOpen] = useState(false);
|
|
76
|
-
const [isInteractionsModalOpen, setIsInteractionsModalOpen] = useState(false);
|
|
77
|
-
const [interactionsTab, setInteractionsTab] = useState<'likes' | 'reposts'>('likes');
|
|
78
|
-
const [commentText, setCommentText] = React.useState('');
|
|
79
|
-
const [commentsList, setCommentsList] = React.useState<CommentType[]>(commentList || []);
|
|
80
|
-
const [replyingTo, setReplyingTo] = useState<string | null>(null); // Hangi yoruma yanıt veriliyor
|
|
81
|
-
|
|
82
|
-
const handleLike = () => {
|
|
83
|
-
if (isPending) return;
|
|
84
|
-
const newLiked = !isLiked;
|
|
85
|
-
const newCount = newLiked ? likeCount + 1 : likeCount - 1;
|
|
86
|
-
|
|
87
|
-
setIsLiked(newLiked);
|
|
88
|
-
setLikeCount(newCount);
|
|
89
|
-
|
|
90
|
-
// Emit live update
|
|
91
|
-
emit('post_like', {
|
|
92
|
-
postId: id,
|
|
93
|
-
userId: user?.id,
|
|
94
|
-
isLiked: newLiked,
|
|
95
|
-
newCount: newCount
|
|
96
|
-
});
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
const handleCommentSubmit = () => {
|
|
100
|
-
if (!commentText.trim()) return;
|
|
101
|
-
|
|
102
|
-
const dynamicAuthorName = user?.displayName?.split(' ')[0] || 'Kullanıcı';
|
|
103
|
-
|
|
104
|
-
if (replyingTo) {
|
|
105
|
-
// Yanıtı Ana Yoruma Ekle
|
|
106
|
-
setCommentsList(prev => prev.map(c => {
|
|
107
|
-
if (c.id === replyingTo) {
|
|
108
|
-
return {
|
|
109
|
-
...c,
|
|
110
|
-
replies: [...(c.replies || []), {
|
|
111
|
-
id: Date.now().toString(),
|
|
112
|
-
author: dynamicAuthorName,
|
|
113
|
-
text: commentText,
|
|
114
|
-
date: 'Şimdi'
|
|
115
|
-
}]
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
return c;
|
|
119
|
-
}));
|
|
120
|
-
setReplyingTo(null);
|
|
121
|
-
} else {
|
|
122
|
-
// Normal Ana Yorum Ekle
|
|
123
|
-
setCommentsList(prev => [...prev, {
|
|
124
|
-
id: Date.now().toString(),
|
|
125
|
-
author: dynamicAuthorName,
|
|
126
|
-
text: commentText,
|
|
127
|
-
date: 'Şimdi',
|
|
128
|
-
replies: []
|
|
129
|
-
}]);
|
|
130
|
-
}
|
|
131
|
-
setCommentText('');
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
const goToProfile = () => {
|
|
135
|
-
router.push(author.getProfileUrl());
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
return (
|
|
139
|
-
<div className={`w-full bg-armoyu-card-bg border border-armoyu-card-border rounded-3xl overflow-hidden shadow-sm hover:shadow-md transition-all duration-300 relative ${isPending ? 'opacity-70 pointer-events-none' : ''}`}>
|
|
140
|
-
|
|
141
|
-
{/* Pending Overlay/Indicator */}
|
|
142
|
-
{isPending && (
|
|
143
|
-
<div className="absolute top-4 right-4 z-30 bg-blue-600/90 backdrop-blur-md px-4 py-1.5 rounded-full border border-white/20 shadow-xl flex items-center gap-2 animate-pulse">
|
|
144
|
-
<div className="w-2.5 h-2.5 border-2 border-white/20 border-t-white rounded-full animate-spin" />
|
|
145
|
-
<span className="text-[10px] font-black text-white uppercase tracking-widest">Gönderiliyor...</span>
|
|
146
|
-
</div>
|
|
147
|
-
)}
|
|
148
|
-
|
|
149
|
-
{/* Üst Kısım: Profil ve Zaman */}
|
|
150
|
-
<div className="p-5 flex items-start gap-4">
|
|
151
|
-
<img
|
|
152
|
-
src={author.avatar}
|
|
153
|
-
alt={author.displayName}
|
|
154
|
-
className="w-12 h-12 rounded-full border-2 border-transparent hover:border-blue-500 transition-colors shadow-sm bg-black/5 dark:bg-white/5 object-cover cursor-pointer"
|
|
155
|
-
onClick={goToProfile}
|
|
156
|
-
title="Profile Git"
|
|
157
|
-
/>
|
|
158
|
-
<div className="flex-1 min-w-0">
|
|
159
|
-
<div className="flex items-center justify-between">
|
|
160
|
-
<div className="flex items-center gap-1.5 flex-wrap">
|
|
161
|
-
<h3
|
|
162
|
-
className="font-bold text-armoyu-text truncate max-w-[200px] cursor-pointer hover:text-blue-500 transition-colors"
|
|
163
|
-
onClick={goToProfile}
|
|
164
|
-
title="Profile Git"
|
|
165
|
-
>
|
|
166
|
-
{author.displayName}
|
|
167
|
-
</h3>
|
|
168
|
-
{author.verified && (
|
|
169
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="currentColor" className="text-blue-500"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg>
|
|
170
|
-
)}
|
|
171
|
-
{author.role?.name && (
|
|
172
|
-
<span
|
|
173
|
-
style={{
|
|
174
|
-
backgroundColor: `${author.role.color}15`,
|
|
175
|
-
color: author.role.color,
|
|
176
|
-
borderColor: `${author.role.color}40`
|
|
177
|
-
}}
|
|
178
|
-
className="text-[10px] font-bold px-2 py-0.5 rounded-md uppercase tracking-wider border"
|
|
179
|
-
>
|
|
180
|
-
{author.role.name}
|
|
181
|
-
</span>
|
|
182
|
-
)}
|
|
183
|
-
</div>
|
|
184
|
-
<div className="relative flex items-center gap-1">
|
|
185
|
-
{/* Quick Edit (Only for Owner) */}
|
|
186
|
-
{user?.username === author.username && (
|
|
187
|
-
<button
|
|
188
|
-
className="text-armoyu-text-muted hover:text-blue-500 p-1.5 transition-colors bg-blue-500/5 rounded-lg border border-blue-500/10"
|
|
189
|
-
title="Düzenle"
|
|
190
|
-
>
|
|
191
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><path d="M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"></path></svg>
|
|
192
|
-
</button>
|
|
193
|
-
)}
|
|
194
|
-
|
|
195
|
-
<button
|
|
196
|
-
onClick={() => setIsMenuOpen(!isMenuOpen)}
|
|
197
|
-
className="text-armoyu-text-muted hover:text-blue-500 p-1 transition-colors"
|
|
198
|
-
title="Seçenekler"
|
|
199
|
-
>
|
|
200
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><circle cx="12" cy="12" r="1"></circle><circle cx="19" cy="12" r="1"></circle><circle cx="5" cy="12" r="1"></circle></svg>
|
|
201
|
-
</button>
|
|
202
|
-
|
|
203
|
-
{isMenuOpen && (
|
|
204
|
-
<>
|
|
205
|
-
<div className="fixed inset-0 z-40" onClick={() => setIsMenuOpen(false)} />
|
|
206
|
-
<div className="absolute right-0 mt-1 w-56 bg-armoyu-drawer-bg border border-gray-200 dark:border-white/10 rounded-xl shadow-xl z-50 py-1.5 animate-in fade-in zoom-in-95 duration-200">
|
|
207
|
-
{user?.username === author.username && (
|
|
208
|
-
<button onClick={() => setIsMenuOpen(false)} className="w-full text-left px-4 py-2.5 text-sm font-bold text-blue-500 hover:bg-blue-500/10 transition-colors flex items-center gap-3">
|
|
209
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>
|
|
210
|
-
Gönderiyi Düzenle
|
|
211
|
-
</button>
|
|
212
|
-
)}
|
|
213
|
-
<button onClick={() => setIsMenuOpen(false)} className="w-full text-left px-4 py-2.5 text-sm font-medium text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-colors flex items-center gap-3">
|
|
214
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path></svg>
|
|
215
|
-
Gönderiyi Kaydet
|
|
216
|
-
</button>
|
|
217
|
-
<button onClick={() => setIsMenuOpen(false)} className="w-full text-left px-4 py-2.5 text-sm font-bold text-red-600 dark:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors flex items-center gap-3 border-t border-gray-100 dark:border-white/5 mt-1 pt-2.5">
|
|
218
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z"></path><line x1="4" y1="22" x2="4" y2="15"></line></svg>
|
|
219
|
-
Gönderiyi Şikayet Et
|
|
220
|
-
</button>
|
|
221
|
-
</div>
|
|
222
|
-
</>
|
|
223
|
-
)}
|
|
224
|
-
</div>
|
|
225
|
-
</div>
|
|
226
|
-
<div className="flex items-center gap-2 text-xs font-medium text-armoyu-text-muted mt-0.5">
|
|
227
|
-
<span className="text-blue-600 dark:text-blue-400 font-bold cursor-pointer hover:underline" onClick={goToProfile}>@{author.username}</span>
|
|
228
|
-
<span>•</span>
|
|
229
|
-
<span>{createdAt}</span>
|
|
230
|
-
</div>
|
|
231
|
-
</div>
|
|
232
|
-
</div>
|
|
233
|
-
|
|
234
|
-
{/* İçerik (Metin) */}
|
|
235
|
-
<div className="px-5 pb-3">
|
|
236
|
-
<p className="text-sm md:text-base text-armoyu-text leading-relaxed whitespace-pre-wrap font-medium">
|
|
237
|
-
{content.split(/(\s+)/).map((part, i) => {
|
|
238
|
-
if (part.startsWith('#')) {
|
|
239
|
-
return (
|
|
240
|
-
<button
|
|
241
|
-
key={i}
|
|
242
|
-
onClick={(e) => {
|
|
243
|
-
e.stopPropagation();
|
|
244
|
-
onTagClick?.(part);
|
|
245
|
-
}}
|
|
246
|
-
className="text-blue-500 hover:underline inline-block font-bold"
|
|
247
|
-
>
|
|
248
|
-
{part}
|
|
249
|
-
</button>
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
return part;
|
|
253
|
-
})}
|
|
254
|
-
</p>
|
|
255
|
-
|
|
256
|
-
{/* REPOST OF (ORİJİNAL GÖNDERİ ÖNİZLEMESİ) */}
|
|
257
|
-
{repostOf && (
|
|
258
|
-
<div
|
|
259
|
-
className="mt-4 rounded-2xl border border-black/10 dark:border-white/10 overflow-hidden bg-black/5 dark:bg-black/20 hover:border-blue-500/30 transition-all cursor-pointer group/repost"
|
|
260
|
-
onClick={(e) => {
|
|
261
|
-
e.stopPropagation();
|
|
262
|
-
router.push(`/?post=${repostOf.id}`);
|
|
263
|
-
}}
|
|
264
|
-
>
|
|
265
|
-
{/* Orijinal Yazar Bilgisi */}
|
|
266
|
-
<div className="p-3 flex items-center gap-2 border-b border-black/5 dark:border-white/5">
|
|
267
|
-
<img src={repostOf.author?.avatar} className="w-5 h-5 rounded-full object-cover" alt="" />
|
|
268
|
-
<span className="text-[11px] font-black text-armoyu-text uppercase tracking-tight">{repostOf.author?.displayName}</span>
|
|
269
|
-
<span className="text-[10px] font-bold text-armoyu-text-muted opacity-60">@{repostOf.author?.username}</span>
|
|
270
|
-
<span className="text-[10px] text-armoyu-text-muted ml-auto">{repostOf.createdAt}</span>
|
|
271
|
-
</div>
|
|
272
|
-
|
|
273
|
-
{/* Orijinal İçerik Metni */}
|
|
274
|
-
<div className="p-4 pt-3">
|
|
275
|
-
<p className="text-xs text-armoyu-text-muted line-clamp-3 leading-relaxed">
|
|
276
|
-
{repostOf.content}
|
|
277
|
-
</p>
|
|
278
|
-
|
|
279
|
-
{/* Orijinal Medya Önizlemesi (Küçük) */}
|
|
280
|
-
{repostMedia.length > 0 && (
|
|
281
|
-
<div className="mt-3 rounded-xl overflow-hidden grid grid-cols-2 gap-1 aspect-[21/9]">
|
|
282
|
-
{repostMedia.slice(0, 4).map((m: any, i: number) => (
|
|
283
|
-
<div key={i} className={`relative ${repostMedia.length === 1 ? 'col-span-2' : ''}`}>
|
|
284
|
-
<img src={m.url} className="w-full h-full object-cover brightness-95 group-hover/repost:scale-105 transition-transform duration-700" alt="" />
|
|
285
|
-
{m.type === 'video' && (
|
|
286
|
-
<div className="absolute inset-0 flex items-center justify-center bg-black/20">
|
|
287
|
-
<div className="w-6 h-6 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center text-white">
|
|
288
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="currentColor"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>
|
|
289
|
-
</div>
|
|
290
|
-
</div>
|
|
291
|
-
)}
|
|
292
|
-
</div>
|
|
293
|
-
))}
|
|
294
|
-
</div>
|
|
295
|
-
)}
|
|
296
|
-
</div>
|
|
297
|
-
</div>
|
|
298
|
-
)}
|
|
299
|
-
</div>
|
|
300
|
-
|
|
301
|
-
{/* Görsel/Medya Grid Sistemi */}
|
|
302
|
-
{displayMedia.length > 0 && (
|
|
303
|
-
<div className="px-5 pb-5">
|
|
304
|
-
<div className={`grid gap-1.5 overflow-hidden rounded-2xl border border-black/5 dark:border-white/10 shadow-sm ${displayMedia.length === 1 ? 'grid-cols-1' : displayMedia.length === 2 ? 'grid-cols-2 aspect-[16/9]' : displayMedia.length === 3 ? 'grid-cols-2 aspect-[16/9]' : 'grid-cols-2 aspect-square md:aspect-[16/9]'}`}>
|
|
305
|
-
{displayMedia.slice(0, 4).map((m, idx) => (
|
|
306
|
-
<div
|
|
307
|
-
key={idx}
|
|
308
|
-
className={`relative cursor-pointer group bg-black/5 dark:bg-white/5 ${displayMedia.length === 3 && idx === 0 ? 'row-span-2' : ''}`}
|
|
309
|
-
onClick={() => setLightboxIndex(idx)}
|
|
310
|
-
>
|
|
311
|
-
{m.type === 'video' ? (
|
|
312
|
-
// eslint-disable-next-line jsx-a11y/media-has-caption
|
|
313
|
-
<video src={m.url} className="w-full h-full object-cover" />
|
|
314
|
-
) : (
|
|
315
|
-
<img src={m.url} alt="Medya" className="w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500" />
|
|
316
|
-
)}
|
|
317
|
-
|
|
318
|
-
{/* Oynat İkonu (Videolar İçin) */}
|
|
319
|
-
{m.type === 'video' && (
|
|
320
|
-
<div className="absolute inset-0 flex items-center justify-center bg-black/20 group-hover:bg-black/40 transition-colors z-10">
|
|
321
|
-
<div className="w-12 h-12 rounded-full bg-white/20 backdrop-blur-md flex items-center justify-center text-white border border-white/30 shadow-lg">
|
|
322
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="none"><polygon points="5 3 19 12 5 21 5 3"></polygon></svg>
|
|
323
|
-
</div>
|
|
324
|
-
</div>
|
|
325
|
-
)}
|
|
326
|
-
|
|
327
|
-
{/* +More Katmanı (4'ten fazla medya varsa) */}
|
|
328
|
-
{displayMedia.length > 4 && idx === 3 && (
|
|
329
|
-
<div className="absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center text-white font-black text-2xl md:text-3xl z-20">
|
|
330
|
-
+{displayMedia.length - 4}
|
|
331
|
-
</div>
|
|
332
|
-
)}
|
|
333
|
-
</div>
|
|
334
|
-
))}
|
|
335
|
-
</div>
|
|
336
|
-
</div>
|
|
337
|
-
)}
|
|
338
|
-
|
|
339
|
-
{/* Social Proof (Liked by...) */}
|
|
340
|
-
{likeList && likeList.length > 0 && (
|
|
341
|
-
<div
|
|
342
|
-
className="px-6 py-2 flex items-center gap-2.5 bg-black/5 dark:bg-white/2 border-y border-armoyu-card-border/50 transition-all hover:bg-black/10 dark:hover:bg-white/5 cursor-pointer"
|
|
343
|
-
onClick={() => { setInteractionsTab('likes'); setIsInteractionsModalOpen(true); }}
|
|
344
|
-
>
|
|
345
|
-
<div className="flex -space-x-2.5 overflow-hidden">
|
|
346
|
-
{likeList.slice(0, 3).map((l, i) => (
|
|
347
|
-
<img
|
|
348
|
-
key={i}
|
|
349
|
-
src={l.avatar}
|
|
350
|
-
alt={l.displayName}
|
|
351
|
-
className="inline-block h-6 w-6 rounded-full ring-2 ring-armoyu-card-bg bg-armoyu-card-bg object-cover shadow-sm transition-transform hover:scale-110 hover:z-10"
|
|
352
|
-
title={l.displayName}
|
|
353
|
-
/>
|
|
354
|
-
))}
|
|
355
|
-
</div>
|
|
356
|
-
<div className="text-[11px] font-bold text-armoyu-text-muted flex items-center gap-1">
|
|
357
|
-
{likeCount > 0 && (
|
|
358
|
-
<>
|
|
359
|
-
<span className="text-armoyu-text">{likeList[0].displayName}</span>
|
|
360
|
-
{likeCount > 1 && (
|
|
361
|
-
<>
|
|
362
|
-
<span>ve</span>
|
|
363
|
-
<span className="text-armoyu-text">{likeCount - 1} diğer kişi</span>
|
|
364
|
-
</>
|
|
365
|
-
)}
|
|
366
|
-
<span>beğendi</span>
|
|
367
|
-
</>
|
|
368
|
-
)}
|
|
369
|
-
</div>
|
|
370
|
-
</div>
|
|
371
|
-
)}
|
|
372
|
-
|
|
373
|
-
{/* Etkileşim Butonları (Beğeni, Yorum, Paylaş) */}
|
|
374
|
-
<div className="px-5 py-3.5 border-t border-armoyu-card-border flex justify-between items-center bg-black/5 dark:bg-white/5">
|
|
375
|
-
<div className="flex gap-6">
|
|
376
|
-
<div className="flex items-center">
|
|
377
|
-
<button
|
|
378
|
-
onClick={handleLike}
|
|
379
|
-
className={`flex items-center gap-2 text-sm font-bold transition-colors group ${isLiked ? 'text-blue-500' : 'text-armoyu-text-muted hover:text-blue-500'}`}
|
|
380
|
-
>
|
|
381
|
-
<div className={`p-1.5 rounded-full transition-colors ${isLiked ? 'bg-blue-500/10' : 'group-hover:bg-blue-500/10'}`}>
|
|
382
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill={isLiked ? "currentColor" : "none"} stroke="currentColor" strokeWidth="2" className="group-hover:-translate-y-0.5 transition-transform"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>
|
|
383
|
-
</div>
|
|
384
|
-
</button>
|
|
385
|
-
{likeCount > 0 && (
|
|
386
|
-
<button
|
|
387
|
-
onClick={() => { setInteractionsTab('likes'); setIsInteractionsModalOpen(true); }}
|
|
388
|
-
className="text-sm font-black text-armoyu-text-muted hover:text-blue-500 transition-colors ml-1 px-1"
|
|
389
|
-
>
|
|
390
|
-
<RollingNumber value={likeCount} />
|
|
391
|
-
</button>
|
|
392
|
-
)}
|
|
393
|
-
</div>
|
|
394
|
-
|
|
395
|
-
<button
|
|
396
|
-
onClick={() => setIsCommentOpen(!isCommentOpen)}
|
|
397
|
-
className={`flex items-center gap-2 text-sm font-bold transition-colors group ${isCommentOpen ? 'text-emerald-500' : 'text-armoyu-text-muted hover:text-emerald-500'}`}
|
|
398
|
-
title="Yorum Yap"
|
|
399
|
-
>
|
|
400
|
-
<div className={`p-1.5 rounded-full transition-colors ${isCommentOpen ? 'bg-emerald-500/10' : 'group-hover:bg-emerald-500/10'}`}>
|
|
401
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" className="group-hover:-translate-y-0.5 transition-transform"><path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"></path></svg>
|
|
402
|
-
</div>
|
|
403
|
-
{(stats.comments + commentsList.length + commentsList.reduce((acc, c) => acc + (c.replies?.length || 0), 0)) > 0 &&
|
|
404
|
-
(stats.comments + commentsList.length + commentsList.reduce((acc, c) => acc + (c.replies?.length || 0), 0))}
|
|
405
|
-
</button>
|
|
406
|
-
|
|
407
|
-
<div className="flex items-center">
|
|
408
|
-
<button
|
|
409
|
-
onClick={() => setIsRepostModalOpen(true)}
|
|
410
|
-
className="flex items-center gap-2 text-sm font-bold text-armoyu-text-muted hover:text-green-500 transition-colors group"
|
|
411
|
-
title="Yeniden Paylaş (Retweet)"
|
|
412
|
-
>
|
|
413
|
-
<div className="p-1.5 rounded-full group-hover:bg-green-500/10 transition-colors">
|
|
414
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" className="group-hover:-translate-y-0.5 transition-transform"><polyline points="17 1 21 5 17 9"></polyline><path d="M3 11V9a4 4 0 0 1 4-4h14"></path><polyline points="7 23 3 19 7 15"></polyline><path d="M21 13v2a4 4 0 0 1-4 4H3"></path></svg>
|
|
415
|
-
</div>
|
|
416
|
-
</button>
|
|
417
|
-
{stats.reposts && stats.reposts > 0 && (
|
|
418
|
-
<button
|
|
419
|
-
onClick={() => { setInteractionsTab('reposts'); setIsInteractionsModalOpen(true); }}
|
|
420
|
-
className="text-sm font-black text-armoyu-text-muted hover:text-green-500 transition-colors ml-1 px-1"
|
|
421
|
-
>
|
|
422
|
-
{stats.reposts}
|
|
423
|
-
</button>
|
|
424
|
-
)}
|
|
425
|
-
</div>
|
|
426
|
-
</div>
|
|
427
|
-
|
|
428
|
-
<button className="flex items-center gap-2 text-sm font-bold text-armoyu-text-muted hover:text-purple-500 transition-colors group">
|
|
429
|
-
<div className="p-1.5 rounded-full group-hover:bg-purple-500/10 transition-colors">
|
|
430
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" className="group-hover:-translate-y-0.5 transition-transform"><circle cx="18" cy="5" r="3"></circle><circle cx="6" cy="12" r="3"></circle><circle cx="18" cy="19" r="3"></circle><line x1="8.59" y1="13.51" x2="15.42" y2="17.49"></line><line x1="15.41" y1="6.51" x2="8.59" y2="10.49"></line></svg>
|
|
431
|
-
</div>
|
|
432
|
-
</button>
|
|
433
|
-
</div>
|
|
434
|
-
|
|
435
|
-
{/* Ekstrapole Edilmiş Yorum Alanı (Açılır/Kapanır) */}
|
|
436
|
-
{isCommentOpen && (
|
|
437
|
-
<div className="bg-black/5 dark:bg-white/5 border-t border-armoyu-card-border p-4 animate-in fade-in slide-in-from-top-2 duration-200">
|
|
438
|
-
|
|
439
|
-
{/* Aktif Yanıt (Reply) Durumu Geri Bildirimi */}
|
|
440
|
-
{replyingTo && (
|
|
441
|
-
<div className="flex justify-between items-center mb-2.5 px-2">
|
|
442
|
-
<span className="text-xs font-bold text-blue-500 flex items-center gap-1.5">
|
|
443
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"><polyline points="15 10 20 15 15 20"></polyline><path d="M4 4v7a4 4 0 0 0 4 4h12"></path></svg>
|
|
444
|
-
<span className="text-armoyu-text-muted">Yanıtlanıyor:</span> @{(() => {
|
|
445
|
-
const author = commentsList.find(c => c.id === replyingTo)?.author;
|
|
446
|
-
return typeof author === 'string' ? author : author?.displayName;
|
|
447
|
-
})()}
|
|
448
|
-
</span>
|
|
449
|
-
<button onClick={() => setReplyingTo(null)} className="text-[11px] font-black uppercase tracking-wider text-armoyu-text-muted hover:text-red-500 transition-colors bg-black/5 dark:bg-white/5 px-2 py-1 rounded-md">İptal Et</button>
|
|
450
|
-
</div>
|
|
451
|
-
)}
|
|
452
|
-
|
|
453
|
-
{/* Yorum Yapma Girdisi */}
|
|
454
|
-
<div className="flex gap-3 mb-2 animate-in fade-in zoom-in-95 duration-300">
|
|
455
|
-
<img src={user?.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Berkay"} alt="Sen" className="w-9 h-9 rounded-full bg-white/5 border border-white/10 shrink-0 shadow-sm object-cover" />
|
|
456
|
-
<div className="flex-1 flex items-center bg-black/5 dark:bg-white/5 border border-gray-200 dark:border-white/10 rounded-2xl px-3 py-1.5 shadow-sm focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 transition-all">
|
|
457
|
-
<input
|
|
458
|
-
type="text"
|
|
459
|
-
value={commentText}
|
|
460
|
-
onChange={(e) => setCommentText(e.target.value)}
|
|
461
|
-
onKeyDown={(e) => e.key === 'Enter' && handleCommentSubmit()}
|
|
462
|
-
placeholder={replyingTo ? "Yanıtını yaz..." : "Fikrini paylaş..."}
|
|
463
|
-
className="flex-1 bg-transparent border-none outline-none text-sm text-armoyu-text placeholder:text-armoyu-text-muted font-medium"
|
|
464
|
-
/>
|
|
465
|
-
<button
|
|
466
|
-
onClick={handleCommentSubmit}
|
|
467
|
-
disabled={!commentText.trim()}
|
|
468
|
-
className="p-2 ml-2 text-blue-500 disabled:text-gray-400 dark:disabled:text-gray-600 disabled:cursor-not-allowed hover:bg-blue-500/10 rounded-xl transition-colors shrink-0"
|
|
469
|
-
>
|
|
470
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.5" strokeLinecap="round" strokeLinejoin="round"><line x1="22" y1="2" x2="11" y2="13"></line><polygon points="22 2 15 22 11 13 2 9 22 2"></polygon></svg>
|
|
471
|
-
</button>
|
|
472
|
-
</div>
|
|
473
|
-
</div>
|
|
474
|
-
|
|
475
|
-
{/* Local State'e Eklenen Yorumlar ve Yanıtlar (Nested Comments Thread) */}
|
|
476
|
-
{commentsList.length > 0 && (
|
|
477
|
-
<div className="space-y-4 mt-5 px-1">
|
|
478
|
-
{commentsList.map((c) => (
|
|
479
|
-
<div key={c.id} className="animate-in fade-in slide-in-from-left-2 zoom-in-95 duration-500">
|
|
480
|
-
|
|
481
|
-
{/* Ana Yorum */}
|
|
482
|
-
<div className="flex gap-3">
|
|
483
|
-
<img src={`https://api.dicebear.com/7.x/avataaars/svg?seed=${typeof c.author === 'string' ? c.author : c.author?.displayName}`} alt={typeof c.author === 'string' ? c.author : c.author?.displayName} className="w-8 h-8 rounded-full bg-white/5 border border-black/10 dark:border-white/10 shrink-0 mt-1 shadow-sm" />
|
|
484
|
-
<div className="flex-1">
|
|
485
|
-
<div className="bg-armoyu-drawer-bg border border-gray-200 dark:border-white/5 rounded-2xl rounded-tl-sm px-4 py-2 shadow-sm inline-block min-w-[30%]">
|
|
486
|
-
<div className="text-xs font-black text-armoyu-text mb-0.5">{typeof c.author === 'string' ? c.author : c.author?.displayName}</div>
|
|
487
|
-
<div className="text-sm font-medium text-armoyu-text-muted">{c.text || c.content}</div>
|
|
488
|
-
</div>
|
|
489
|
-
<div className="flex items-center gap-4 mt-1.5 ml-2 text-[11px] font-bold text-armoyu-text-muted">
|
|
490
|
-
<span className="hover:text-blue-500 cursor-pointer transition-colors">Beğen</span>
|
|
491
|
-
<span onClick={() => { setReplyingTo(c.id); setCommentText(''); }} className="hover:text-blue-500 cursor-pointer transition-colors">Yanıtla</span>
|
|
492
|
-
<span className="opacity-50">{c.date || c.createdAt}</span>
|
|
493
|
-
</div>
|
|
494
|
-
</div>
|
|
495
|
-
</div>
|
|
496
|
-
|
|
497
|
-
{/* Alt Yorumlar (Replies Loop) */}
|
|
498
|
-
{c.replies && c.replies.length > 0 && (
|
|
499
|
-
<div className="mt-3 ml-11 space-y-3 border-l-2 border-black/10 dark:border-white/10 pl-4">
|
|
500
|
-
{c.replies.map(r => (
|
|
501
|
-
<div key={r.id} className="flex gap-2.5 animate-in fade-in slide-in-from-left-2 duration-300">
|
|
502
|
-
<img src={`https://api.dicebear.com/7.x/avataaars/svg?seed=${typeof r.author === 'string' ? r.author : r.author?.displayName}`} alt={typeof r.author === 'string' ? r.author : r.author?.displayName} className="w-6 h-6 rounded-full bg-white/5 border border-black/10 dark:border-white/10 shrink-0 mt-0.5 shadow-sm relative -left-[27px] ring-4 ring-black/5 dark:ring-[#0a0a0e]/60" />
|
|
503
|
-
<div className="flex-1 -ml-[18px]">
|
|
504
|
-
<div className="bg-armoyu-drawer-bg border border-gray-200 dark:border-white/5 rounded-2xl rounded-tl-sm px-3.5 py-1.5 shadow-sm inline-block">
|
|
505
|
-
<span className="text-xs font-black text-armoyu-text mr-2">{typeof r.author === 'string' ? r.author : r.author?.displayName}</span>
|
|
506
|
-
<span className="text-[13px] font-medium text-armoyu-text-muted">{r.text || r.content}</span>
|
|
507
|
-
</div>
|
|
508
|
-
<div className="flex items-center gap-4 mt-1 ml-2 text-[10px] font-bold text-armoyu-text-muted">
|
|
509
|
-
<span className="hover:text-blue-500 cursor-pointer transition-colors">Beğen</span>
|
|
510
|
-
<span onClick={() => { setReplyingTo(c.id); setCommentText(''); }} className="hover:text-blue-500 cursor-pointer transition-colors">Yanıtla</span>
|
|
511
|
-
<span className="opacity-50">{r.date || r.createdAt}</span>
|
|
512
|
-
</div>
|
|
513
|
-
</div>
|
|
514
|
-
</div>
|
|
515
|
-
))}
|
|
516
|
-
</div>
|
|
517
|
-
)}
|
|
518
|
-
|
|
519
|
-
</div>
|
|
520
|
-
))}
|
|
521
|
-
</div>
|
|
522
|
-
)}
|
|
523
|
-
</div>
|
|
524
|
-
)}
|
|
525
|
-
|
|
526
|
-
{/* Repost Modal Popup */}
|
|
527
|
-
<RepostModal
|
|
528
|
-
isOpen={isRepostModalOpen}
|
|
529
|
-
onClose={() => setIsRepostModalOpen(false)}
|
|
530
|
-
post={{ id, author, content, media, createdAt, stats }}
|
|
531
|
-
/>
|
|
532
|
-
|
|
533
|
-
{/* Interactions Modal Popup (Likes/Reposts List) */}
|
|
534
|
-
<PostInteractionsModal
|
|
535
|
-
isOpen={isInteractionsModalOpen}
|
|
536
|
-
onClose={() => setIsInteractionsModalOpen(false)}
|
|
537
|
-
title={interactionsTab === 'likes' ? 'Beğenenler' : 'Paylaşanlar'}
|
|
538
|
-
likes={likeList}
|
|
539
|
-
reposts={repostList}
|
|
540
|
-
defaultTab={interactionsTab}
|
|
541
|
-
/>
|
|
542
|
-
|
|
543
|
-
{/* Media Lightbox Popup */}
|
|
544
|
-
{lightboxIndex !== null && (
|
|
545
|
-
<MediaLightbox
|
|
546
|
-
isOpen={lightboxIndex !== null}
|
|
547
|
-
onClose={() => setLightboxIndex(null)}
|
|
548
|
-
media={displayMedia}
|
|
549
|
-
initialIndex={lightboxIndex}
|
|
550
|
-
/>
|
|
551
|
-
)}
|
|
552
|
-
|
|
553
|
-
</div>
|
|
554
|
-
);
|
|
555
|
-
}
|
|
556
|
-
|