@armoyu/ui 1.0.0 → 1.0.1
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/layout.d.ts.map +1 -1
- package/dist/app/layout.js +16 -13
- package/dist/app/layout.js.map +1 -1
- 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.js +3 -3
- package/dist/components/RollingNumber.js.map +1 -1
- package/dist/components/Slider.d.ts +10 -10
- package/dist/components/Slider.js +35 -35
- package/dist/components/StatsGrid.d.ts +5 -5
- 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.d.ts +1 -1
- 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.d.ts +24 -24
- package/dist/components/modules/auth/PostCard.js +112 -112
- package/dist/components/modules/auth/PostInteractionsModal.d.ts +11 -11
- package/dist/components/modules/auth/PostInteractionsModal.js +12 -12
- package/dist/components/modules/auth/RepostModal.d.ts +21 -21
- package/dist/components/modules/auth/RepostModal.js +75 -75
- package/dist/components/modules/auth/SidebarLeft.d.ts +1 -1
- package/dist/components/modules/auth/SidebarLeft.js +40 -40
- package/dist/components/modules/auth/Stories.d.ts +1 -1
- package/dist/components/modules/auth/Stories.js +15 -15
- package/dist/components/modules/auth/StoryViewer.d.ts +9 -9
- package/dist/components/modules/auth/StoryViewer.js +47 -47
- package/dist/components/modules/chat/ChatContainer.d.ts +1 -1
- package/dist/components/modules/chat/ChatContainer.js +196 -196
- package/dist/components/modules/chat/ChatInput.d.ts +4 -4
- package/dist/components/modules/chat/ChatInput.js +30 -30
- package/dist/components/modules/chat/ChatList.d.ts +6 -6
- 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.d.ts +1 -1
- package/dist/components/modules/chat/ChatNotes.js +11 -11
- package/dist/components/modules/community/GroupHeader.d.ts +10 -10
- package/dist/components/modules/community/GroupHeader.js +17 -17
- package/dist/components/modules/community/GroupMenu.d.ts +9 -9
- package/dist/components/modules/community/GroupMenu.js +16 -16
- package/dist/components/modules/community/SchoolCard.d.ts +6 -6
- package/dist/components/modules/community/SchoolCard.js +7 -7
- package/dist/components/modules/community/SurveyCard.d.ts +6 -6
- 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.d.ts +1 -1
- package/dist/components/modules/guest/Introduction.js +13 -13
- package/dist/components/modules/magaza/BackToStore.d.ts +1 -1
- package/dist/components/modules/magaza/BackToStore.js +10 -10
- package/dist/components/modules/magaza/StoreHeader.d.ts +5 -5
- package/dist/components/modules/magaza/StoreHeader.js +8 -8
- package/dist/components/modules/news/NewsCard.d.ts +11 -11
- package/dist/components/modules/news/NewsCard.js +6 -6
- package/dist/components/modules/news/NewsComments.d.ts +1 -1
- 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.d.ts +4 -4
- package/dist/components/modules/profile/ProfileContent.js +70 -70
- package/dist/components/modules/profile/ProfileHeader.d.ts +7 -7
- package/dist/components/modules/profile/ProfileHeader.js +19 -19
- package/dist/components/modules/profile/ProfileStats.js +1 -1
- package/dist/components/modules/profile/ProfileStats.js.map +1 -1
- package/dist/components/modules/profile/TeamSelectorModal.d.ts +10 -10
- package/dist/components/modules/profile/TeamSelectorModal.js +16 -16
- package/dist/components/modules/stations/StationCard.d.ts +2 -2
- package/dist/components/modules/stations/StationCard.js +25 -25
- package/dist/components/modules/stations/StationQRModal.d.ts +9 -9
- package/dist/components/modules/stations/StationQRModal.js +12 -12
- package/dist/components/shared/FloatingChatButton.d.ts +4 -4
- 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.d.ts +1 -1
- package/dist/components/shared/Header.js +97 -97
- package/dist/components/shared/LoginModal.d.ts +4 -4
- package/dist/components/shared/LoginModal.js +69 -69
- package/dist/components/shared/MainLayoutWrapper.d.ts +3 -3
- 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/context/AuthContext.d.ts +18 -18
- package/dist/context/AuthContext.js +74 -74
- package/dist/context/CartContext.d.ts +16 -16
- 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.d.ts +12 -12
- 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.d.ts +65 -65
- package/dist/index.js +80 -80
- package/dist/lib/constants/educationData.d.ts +7 -7
- 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.d.ts +164 -164
- package/dist/lib/constants/seedData.js +694 -694
- package/dist/lib/constants/stationData.d.ts +13 -13
- package/dist/lib/constants/stationData.js +166 -166
- package/dist/lib/constants/surveyData.d.ts +2 -2
- package/dist/lib/constants/surveyData.js +49 -49
- package/dist/lib/constants/teamData.d.ts +12 -12
- package/dist/lib/constants/teamData.js +65 -65
- package/dist/types/stats.d.ts +17 -17
- package/dist/types/stats.js +1 -1
- package/next.config.ts +13 -13
- package/package.json +45 -46
- package/postcss.config.js +6 -6
- package/src/app/layout.tsx +67 -64
- package/src/app/page.tsx +101 -101
- package/src/components/RollingNumber.tsx +3 -3
- package/src/components/modules/profile/ProfileStats.tsx +4 -4
- package/src/components/showcase/CommunityTab.tsx +22 -22
- package/src/components/showcase/CorporateTab.tsx +38 -38
- package/src/components/showcase/GeneralTab.tsx +41 -41
- package/src/components/showcase/MessagesTab.tsx +26 -26
- package/src/components/showcase/ProfileTab.tsx +20 -20
- package/src/components/showcase/ShopTab.tsx +24 -24
- package/src/components/showcase/SocialTab.tsx +28 -28
- package/src/globals.css +187 -187
- package/src/lib/utils/numberFormat.ts +16 -16
- package/src/lib/utils/odpUtils.ts +51 -51
- package/src/types/index.ts +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { X } from 'lucide-react';
|
|
4
|
-
export function StationQRModal({ isOpen, onClose, stationName, item }) {
|
|
5
|
-
if (!isOpen || !item)
|
|
6
|
-
return null;
|
|
7
|
-
// Mock username - normally would come from auth context
|
|
8
|
-
const username = 'berkaytikeno';
|
|
9
|
-
const qrData = encodeURIComponent(`${stationName} | ${item.name} | ${item.discountRate || 'No Discount'} | User: ${username}`);
|
|
10
|
-
const qrUrl = `https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${qrData}&bgcolor=ffffff&color=000000&margin=10`;
|
|
11
|
-
return (_jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-6 animate-in fade-in duration-300", children: [_jsx("div", { className: "absolute inset-0 bg-black/80 backdrop-blur-md", onClick: onClose }), _jsxs("div", { className: "relative w-full max-w-md bg-white dark:bg-zinc-900 rounded-[48px] overflow-hidden shadow-[0_0_100px_rgba(0,0,0,0.5)] border border-white/10 animate-in zoom-in slide-in-from-bottom-12 duration-500", children: [_jsx("div", { className: "p-8 pb-0 flex justify-end", children: _jsx("button", { onClick: onClose, className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center hover:bg-red-500 hover:text-white transition-all active:scale-90", children: _jsx(X, { size: 20 }) }) }), _jsxs("div", { className: "p-10 pt-4 text-center", children: [_jsxs("div", { className: "mb-6", children: [_jsx("span", { className: "px-4 py-1.5 bg-blue-500/10 text-blue-500 rounded-full text-[10px] font-black uppercase tracking-[0.2em] mb-4 inline-block", children: "ARMOYU AVANTAJ KODU" }), _jsx("h3", { className: "text-2xl font-black text-armoyu-text uppercase tracking-tighter italic leading-tight", children: item.name }), _jsx("p", { className: "text-armoyu-text-muted text-xs font-bold uppercase tracking-widest mt-1 opacity-60", children: stationName })] }), _jsxs("div", { className: "relative p-6 bg-white rounded-[40px] shadow-inner mb-8 inline-block mx-auto group", children: [_jsx("div", { className: "absolute inset-0 bg-blue-500/5 blur-3xl rounded-full scale-150 group-hover:bg-blue-500/10 transition-colors" }), _jsx("img", { src: qrUrl, alt: "QR Code", className: "relative z-10 w-48 h-48 md:w-56 md:h-56 object-contain mix-blend-multiply dark:mix-blend-normal" }), _jsx("div", { className: "absolute top-0 left-0 w-8 h-8 border-t-4 border-l-4 border-blue-600 rounded-tl-2xl" }), _jsx("div", { className: "absolute top-0 right-0 w-8 h-8 border-t-4 border-r-4 border-blue-600 rounded-tr-2xl" }), _jsx("div", { className: "absolute bottom-0 left-0 w-8 h-8 border-b-4 border-l-4 border-blue-600 rounded-bl-2xl" }), _jsx("div", { className: "absolute bottom-0 right-0 w-8 h-8 border-b-4 border-r-4 border-blue-600 rounded-br-2xl" })] }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "p-5 bg-black/5 dark:bg-white/5 rounded-3xl border border-black/5 dark:border-white/5", children: [_jsxs("div", { className: "flex justify-between items-center mb-1", children: [_jsx("span", { className: "text-[10px] font-black text-armoyu-text-muted uppercase tracking-widest leading-none", children: "\u0130ND\u0130R\u0130M ORANI" }), _jsx("span", { className: "text-xl font-black text-emerald-500 italic", children: item.discountRate || 'Özel Fiyat' })] }), _jsxs("div", { className: "flex justify-between items-center", children: [_jsx("span", { className: "text-[10px] font-black text-armoyu-text-muted uppercase tracking-widest leading-none", children: "\u00DCCRET" }), _jsxs("span", { className: "text-xl font-black text-armoyu-text", children: [item.price, " \u20BA"] })] })] }), _jsx("p", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest leading-relaxed opacity-60 max-w-[280px] mx-auto", children: "BU KODU KASADAK\u0130 G\u00D6REVL\u0130YE OKUTARAK \u0130ND\u0130R\u0130M\u0130N\u0130Z\u0130 ANINDA UYGALAYAB\u0130L\u0130RS\u0130N\u0130Z." })] })] }), _jsx("div", { className: "p-8 bg-blue-600 text-white text-center", children: _jsx("button", { onClick: onClose, className: "w-full py-4 bg-white text-blue-600 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl active:scale-95 transition-all", children: "KAPAT" }) })] })] }));
|
|
12
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { X } from 'lucide-react';
|
|
4
|
+
export function StationQRModal({ isOpen, onClose, stationName, item }) {
|
|
5
|
+
if (!isOpen || !item)
|
|
6
|
+
return null;
|
|
7
|
+
// Mock username - normally would come from auth context
|
|
8
|
+
const username = 'berkaytikeno';
|
|
9
|
+
const qrData = encodeURIComponent(`${stationName} | ${item.name} | ${item.discountRate || 'No Discount'} | User: ${username}`);
|
|
10
|
+
const qrUrl = `https://api.qrserver.com/v1/create-qr-code/?size=250x250&data=${qrData}&bgcolor=ffffff&color=000000&margin=10`;
|
|
11
|
+
return (_jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-6 animate-in fade-in duration-300", children: [_jsx("div", { className: "absolute inset-0 bg-black/80 backdrop-blur-md", onClick: onClose }), _jsxs("div", { className: "relative w-full max-w-md bg-white dark:bg-zinc-900 rounded-[48px] overflow-hidden shadow-[0_0_100px_rgba(0,0,0,0.5)] border border-white/10 animate-in zoom-in slide-in-from-bottom-12 duration-500", children: [_jsx("div", { className: "p-8 pb-0 flex justify-end", children: _jsx("button", { onClick: onClose, className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center hover:bg-red-500 hover:text-white transition-all active:scale-90", children: _jsx(X, { size: 20 }) }) }), _jsxs("div", { className: "p-10 pt-4 text-center", children: [_jsxs("div", { className: "mb-6", children: [_jsx("span", { className: "px-4 py-1.5 bg-blue-500/10 text-blue-500 rounded-full text-[10px] font-black uppercase tracking-[0.2em] mb-4 inline-block", children: "ARMOYU AVANTAJ KODU" }), _jsx("h3", { className: "text-2xl font-black text-armoyu-text uppercase tracking-tighter italic leading-tight", children: item.name }), _jsx("p", { className: "text-armoyu-text-muted text-xs font-bold uppercase tracking-widest mt-1 opacity-60", children: stationName })] }), _jsxs("div", { className: "relative p-6 bg-white rounded-[40px] shadow-inner mb-8 inline-block mx-auto group", children: [_jsx("div", { className: "absolute inset-0 bg-blue-500/5 blur-3xl rounded-full scale-150 group-hover:bg-blue-500/10 transition-colors" }), _jsx("img", { src: qrUrl, alt: "QR Code", className: "relative z-10 w-48 h-48 md:w-56 md:h-56 object-contain mix-blend-multiply dark:mix-blend-normal" }), _jsx("div", { className: "absolute top-0 left-0 w-8 h-8 border-t-4 border-l-4 border-blue-600 rounded-tl-2xl" }), _jsx("div", { className: "absolute top-0 right-0 w-8 h-8 border-t-4 border-r-4 border-blue-600 rounded-tr-2xl" }), _jsx("div", { className: "absolute bottom-0 left-0 w-8 h-8 border-b-4 border-l-4 border-blue-600 rounded-bl-2xl" }), _jsx("div", { className: "absolute bottom-0 right-0 w-8 h-8 border-b-4 border-r-4 border-blue-600 rounded-br-2xl" })] }), _jsxs("div", { className: "space-y-4", children: [_jsxs("div", { className: "p-5 bg-black/5 dark:bg-white/5 rounded-3xl border border-black/5 dark:border-white/5", children: [_jsxs("div", { className: "flex justify-between items-center mb-1", children: [_jsx("span", { className: "text-[10px] font-black text-armoyu-text-muted uppercase tracking-widest leading-none", children: "\u0130ND\u0130R\u0130M ORANI" }), _jsx("span", { className: "text-xl font-black text-emerald-500 italic", children: item.discountRate || 'Özel Fiyat' })] }), _jsxs("div", { className: "flex justify-between items-center", children: [_jsx("span", { className: "text-[10px] font-black text-armoyu-text-muted uppercase tracking-widest leading-none", children: "\u00DCCRET" }), _jsxs("span", { className: "text-xl font-black text-armoyu-text", children: [item.price, " \u20BA"] })] })] }), _jsx("p", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest leading-relaxed opacity-60 max-w-[280px] mx-auto", children: "BU KODU KASADAK\u0130 G\u00D6REVL\u0130YE OKUTARAK \u0130ND\u0130R\u0130M\u0130N\u0130Z\u0130 ANINDA UYGALAYAB\u0130L\u0130RS\u0130N\u0130Z." })] })] }), _jsx("div", { className: "p-8 bg-blue-600 text-white text-center", children: _jsx("button", { onClick: onClose, className: "w-full py-4 bg-white text-blue-600 rounded-2xl font-black text-xs uppercase tracking-widest shadow-xl active:scale-95 transition-all", children: "KAPAT" }) })] })] }));
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=StationQRModal.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface FloatingChatButtonProps {
|
|
2
|
-
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
3
|
-
}
|
|
4
|
-
export declare function FloatingChatButton({ position }: FloatingChatButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
1
|
+
export interface FloatingChatButtonProps {
|
|
2
|
+
position?: 'bottom-right' | 'bottom-left' | 'top-right' | 'top-left';
|
|
3
|
+
}
|
|
4
|
+
export declare function FloatingChatButton({ position }: FloatingChatButtonProps): import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
//# sourceMappingURL=FloatingChatButton.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useAuth } from '../../context/AuthContext';
|
|
4
|
-
import { useChat } from '../../context/ChatContext';
|
|
5
|
-
import { ChatContainer } from '../../components/modules/chat/ChatContainer';
|
|
6
|
-
export function FloatingChatButton({ position = 'bottom-right' }) {
|
|
7
|
-
const { user } = useAuth();
|
|
8
|
-
const { isChatOpen, toggleChat } = useChat();
|
|
9
|
-
if (!user)
|
|
10
|
-
return null;
|
|
11
|
-
const positionClasses = {
|
|
12
|
-
'bottom-right': 'bottom-6 right-6 md:bottom-10 md:right-10',
|
|
13
|
-
'bottom-left': 'bottom-6 left-6 md:bottom-10 md:left-10',
|
|
14
|
-
'top-right': 'top-24 right-6 md:top-24 md:right-10',
|
|
15
|
-
'top-left': 'top-24 left-6 md:top-24 md:left-10',
|
|
16
|
-
};
|
|
17
|
-
return (_jsxs("div", { children: [!isChatOpen && (_jsx("div", { className: `fixed z-[80] animate-in fade-in zoom-in duration-500 ${positionClasses[position]}`, children: _jsxs("button", { onClick: toggleChat, className: "w-14 h-14 md:w-16 md:h-16 rounded-full bg-gradient-to-r from-blue-600 to-blue-500 text-white shadow-[0_0_20px_rgba(37,99,235,0.4)] hover:shadow-[0_0_30px_rgba(37,99,235,0.6)] hover:scale-105 active:scale-95 transition-all flex items-center justify-center border border-blue-400/50 group focus:outline-none", title: "Sohbeti A\u00E7", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "group-hover:-translate-y-0.5 transition-transform md:w-7 md:h-7 animate-in spin-in-[-90deg] duration-300", children: _jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) }), _jsx("span", { className: "absolute top-0 right-0 md:top-0.5 md:right-0.5 w-3.5 h-3.5 md:w-4 md:h-4 bg-red-500 rounded-full border-2 border-white dark:border-[#0a0a0e] shadow-sm animate-pulse" })] }) }, "floating-trigger")), _jsx("div", { className: `fixed bottom-0 right-0 md:bottom-6 md:right-6 z-[70] w-full sm:w-[400px] h-[100dvh] sm:h-[calc(100vh-100px)] md:h-[650px] shadow-[0_0_40px_rgba(0,0,0,0.3)] origin-bottom-right transition-all duration-500 sm:rounded-3xl overflow-hidden border border-black/5 dark:border-white/10 flex flex-col bg-armoyu-card-bg backdrop-blur-xl ${isChatOpen
|
|
18
|
-
? 'translate-y-0 scale-100 opacity-100 pointer-events-auto'
|
|
19
|
-
: 'translate-y-10 scale-95 opacity-0 pointer-events-none'}`, children: _jsx(ChatContainer, {}) }, "floating-container")] }, "floating-chat-wrapper"));
|
|
20
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useAuth } from '../../context/AuthContext';
|
|
4
|
+
import { useChat } from '../../context/ChatContext';
|
|
5
|
+
import { ChatContainer } from '../../components/modules/chat/ChatContainer';
|
|
6
|
+
export function FloatingChatButton({ position = 'bottom-right' }) {
|
|
7
|
+
const { user } = useAuth();
|
|
8
|
+
const { isChatOpen, toggleChat } = useChat();
|
|
9
|
+
if (!user)
|
|
10
|
+
return null;
|
|
11
|
+
const positionClasses = {
|
|
12
|
+
'bottom-right': 'bottom-6 right-6 md:bottom-10 md:right-10',
|
|
13
|
+
'bottom-left': 'bottom-6 left-6 md:bottom-10 md:left-10',
|
|
14
|
+
'top-right': 'top-24 right-6 md:top-24 md:right-10',
|
|
15
|
+
'top-left': 'top-24 left-6 md:top-24 md:left-10',
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs("div", { children: [!isChatOpen && (_jsx("div", { className: `fixed z-[80] animate-in fade-in zoom-in duration-500 ${positionClasses[position]}`, children: _jsxs("button", { onClick: toggleChat, className: "w-14 h-14 md:w-16 md:h-16 rounded-full bg-gradient-to-r from-blue-600 to-blue-500 text-white shadow-[0_0_20px_rgba(37,99,235,0.4)] hover:shadow-[0_0_30px_rgba(37,99,235,0.6)] hover:scale-105 active:scale-95 transition-all flex items-center justify-center border border-blue-400/50 group focus:outline-none", title: "Sohbeti A\u00E7", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", className: "group-hover:-translate-y-0.5 transition-transform md:w-7 md:h-7 animate-in spin-in-[-90deg] duration-300", children: _jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) }), _jsx("span", { className: "absolute top-0 right-0 md:top-0.5 md:right-0.5 w-3.5 h-3.5 md:w-4 md:h-4 bg-red-500 rounded-full border-2 border-white dark:border-[#0a0a0e] shadow-sm animate-pulse" })] }) }, "floating-trigger")), _jsx("div", { className: `fixed bottom-0 right-0 md:bottom-6 md:right-6 z-[70] w-full sm:w-[400px] h-[100dvh] sm:h-[calc(100vh-100px)] md:h-[650px] shadow-[0_0_40px_rgba(0,0,0,0.3)] origin-bottom-right transition-all duration-500 sm:rounded-3xl overflow-hidden border border-black/5 dark:border-white/10 flex flex-col bg-armoyu-card-bg backdrop-blur-xl ${isChatOpen
|
|
18
|
+
? 'translate-y-0 scale-100 opacity-100 pointer-events-auto'
|
|
19
|
+
: 'translate-y-10 scale-95 opacity-0 pointer-events-none'}`, children: _jsx(ChatContainer, {}) }, "floating-container")] }, "floating-chat-wrapper"));
|
|
20
|
+
}
|
|
21
21
|
//# sourceMappingURL=FloatingChatButton.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function Footer(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=Footer.d.ts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
export function Footer() {
|
|
3
|
-
const latestPosts = [
|
|
4
|
-
{ title: "Yeni Minecraft Sunucu Altyapımız Yayında!", date: "18 Mart 2026", link: "#" },
|
|
5
|
-
{ title: "Valorant Kış Turnuvası Kayıtları Başladı, Yerini Ayırt", date: "15 Mart 2026", link: "#" },
|
|
6
|
-
{ title: "ARMOYU Çekiliş Sonuçları Açıklandı", date: "10 Mart 2026", link: "#" },
|
|
7
|
-
];
|
|
8
|
-
return (_jsxs("footer", { className: "w-full mt-24 border-t border-armoyu-card-border bg-armoyu-bg py-12 px-6 md:px-8 relative z-20 text-center md:text-left", children: [_jsxs("div", { className: "max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12", children: [_jsxs("div", { className: "space-y-4 flex flex-col items-center md:items-start", children: [_jsx("h2", { className: "text-2xl font-black bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-indigo-600 dark:from-white dark:to-gray-300 tracking-tight", children: "ARMOYU" }), _jsx("p", { className: "text-armoyu-text-muted text-sm leading-relaxed max-w-sm font-medium", children: "T\u00FCrkiye'nin en aktif ve yenilik\u00E7i oyuncu toplulu\u011Fu. Oyun d\u00FCnyas\u0131ndaki geli\u015Fmeleri takip et, arkada\u015Flar\u0131nla ekipler kur ve rekabete kat\u0131l." }), _jsxs("div", { className: "flex gap-3 pt-4 justify-center md:justify-start", children: [_jsx("a", { href: "#", className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center text-armoyu-text-muted hover:text-indigo-500 hover:bg-black/10 dark:hover:bg-white/10 transition-colors border border-black/5 dark:border-white/5", title: "Discord", children: _jsxs("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", children: [_jsx("path", { d: "M9 12h.01" }), _jsx("path", { d: "M15 12h.01" }), _jsx("path", { d: "M8 8a9 9 0 0 0-4 3c-1.3 4-1.5 6-.5 8 1 2 4 1 6-1h4c2 2 5 3 6 1 1-2 .8-4-.5-8a9 9 0 0 0-4-3 7 7 0 0 0-6 0z" })] }) }), _jsx("a", { href: "#", className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center text-armoyu-text-muted hover:text-pink-500 hover:bg-black/10 dark:hover:bg-white/10 transition-colors border border-black/5 dark:border-white/5", title: "Instagram", children: _jsxs("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", children: [_jsx("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", ry: "5" }), _jsx("path", { d: "M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z" }), _jsx("line", { x1: "17.5", y1: "6.5", x2: "17.51", y2: "6.5" })] }) }), _jsx("a", { href: "#", className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center text-armoyu-text-muted hover:text-red-500 hover:bg-black/10 dark:hover:bg-white/10 transition-colors border border-black/5 dark:border-white/5", title: "YouTube", children: _jsxs("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", children: [_jsx("path", { d: "M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z" }), _jsx("polygon", { points: "9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02" })] }) }), _jsx("a", { href: "#", className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center text-armoyu-text-muted hover:text-blue-500 hover:bg-black/10 dark:hover:bg-white/10 transition-colors border border-black/5 dark:border-white/5", title: "X (Twitter)", children: _jsxs("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", children: [_jsx("path", { d: "M4 4l11.733 16h4.267l-11.733 -16z" }), _jsx("path", { d: "M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" })] }) })] })] }), _jsxs("div", { className: "space-y-4 lg:pl-8 flex flex-col items-center md:items-start", children: [_jsx("h3", { className: "text-lg font-bold text-armoyu-text tracking-wide", children: "H\u0131zl\u0131 Ba\u011Flant\u0131lar" }), _jsxs("ul", { className: "space-y-3 text-sm text-armoyu-text-muted font-bold w-full md:w-auto flex flex-col items-center md:items-start", children: [_jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Ana Sayfa"] }) }), _jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Gruplar"] }) }), _jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Forum"] }) }), _jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Ma\u011Faza"] }) }), _jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Destek Talebi"] }) })] })] }), _jsxs("div", { className: "space-y-4 lg:col-span-2", children: [_jsx("h3", { className: "text-lg font-bold text-armoyu-text tracking-wide", children: "Son Payla\u015F\u0131mlar" }), _jsx("div", { className: "space-y-3", children: latestPosts.map((post, idx) => (_jsx("a", { href: post.link, className: "block group text-left", children: _jsxs("div", { className: "bg-black/5 dark:bg-white/5 p-4 rounded-xl border border-black/5 dark:border-white/5 group-hover:bg-black/10 dark:group-hover:bg-white/10 group-hover:border-blue-500/30 transition-all cursor-pointer flex flex-col sm:flex-row justify-between sm:items-center gap-2 sm:gap-4 shadow-sm", children: [_jsx("h4", { className: "text-armoyu-text text-sm font-bold group-hover:text-blue-500 transition-colors line-clamp-2 md:line-clamp-1 flex-1", children: post.title }), _jsx("span", { className: "text-xs text-blue-600 dark:text-blue-400 font-extrabold whitespace-nowrap sm:bg-blue-500/10 sm:px-2.5 sm:py-1 rounded-md", children: post.date })] }) }, idx))) })] })] }), _jsxs("div", { className: "max-w-7xl mx-auto mt-12 pt-8 border-t border-armoyu-card-border flex flex-col md:flex-row items-center justify-between gap-6 text-xs font-bold text-armoyu-text-muted", children: [_jsx("p", { children: "\u00A9 2026 Aram\u0131zdaki Oyuncu. T\u00FCm haklar\u0131 sakl\u0131d\u0131r." }), _jsxs("div", { className: "flex flex-wrap justify-center gap-4 md:gap-6", children: [_jsx("a", { href: "#", className: "hover:text-armoyu-text transition-colors", children: "Gizlilik Politikas\u0131" }), _jsx("a", { href: "#", className: "hover:text-armoyu-text transition-colors", children: "Hizmet \u015Eartlar\u0131" }), _jsx("a", { href: "#", className: "hover:text-armoyu-text transition-colors", children: "Kurallar" })] })] })] }));
|
|
9
|
-
}
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function Footer() {
|
|
3
|
+
const latestPosts = [
|
|
4
|
+
{ title: "Yeni Minecraft Sunucu Altyapımız Yayında!", date: "18 Mart 2026", link: "#" },
|
|
5
|
+
{ title: "Valorant Kış Turnuvası Kayıtları Başladı, Yerini Ayırt", date: "15 Mart 2026", link: "#" },
|
|
6
|
+
{ title: "ARMOYU Çekiliş Sonuçları Açıklandı", date: "10 Mart 2026", link: "#" },
|
|
7
|
+
];
|
|
8
|
+
return (_jsxs("footer", { className: "w-full mt-24 border-t border-armoyu-card-border bg-armoyu-bg py-12 px-6 md:px-8 relative z-20 text-center md:text-left", children: [_jsxs("div", { className: "max-w-7xl mx-auto grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-12", children: [_jsxs("div", { className: "space-y-4 flex flex-col items-center md:items-start", children: [_jsx("h2", { className: "text-2xl font-black bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-indigo-600 dark:from-white dark:to-gray-300 tracking-tight", children: "ARMOYU" }), _jsx("p", { className: "text-armoyu-text-muted text-sm leading-relaxed max-w-sm font-medium", children: "T\u00FCrkiye'nin en aktif ve yenilik\u00E7i oyuncu toplulu\u011Fu. Oyun d\u00FCnyas\u0131ndaki geli\u015Fmeleri takip et, arkada\u015Flar\u0131nla ekipler kur ve rekabete kat\u0131l." }), _jsxs("div", { className: "flex gap-3 pt-4 justify-center md:justify-start", children: [_jsx("a", { href: "#", className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center text-armoyu-text-muted hover:text-indigo-500 hover:bg-black/10 dark:hover:bg-white/10 transition-colors border border-black/5 dark:border-white/5", title: "Discord", children: _jsxs("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", children: [_jsx("path", { d: "M9 12h.01" }), _jsx("path", { d: "M15 12h.01" }), _jsx("path", { d: "M8 8a9 9 0 0 0-4 3c-1.3 4-1.5 6-.5 8 1 2 4 1 6-1h4c2 2 5 3 6 1 1-2 .8-4-.5-8a9 9 0 0 0-4-3 7 7 0 0 0-6 0z" })] }) }), _jsx("a", { href: "#", className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center text-armoyu-text-muted hover:text-pink-500 hover:bg-black/10 dark:hover:bg-white/10 transition-colors border border-black/5 dark:border-white/5", title: "Instagram", children: _jsxs("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", children: [_jsx("rect", { x: "2", y: "2", width: "20", height: "20", rx: "5", ry: "5" }), _jsx("path", { d: "M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z" }), _jsx("line", { x1: "17.5", y1: "6.5", x2: "17.51", y2: "6.5" })] }) }), _jsx("a", { href: "#", className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center text-armoyu-text-muted hover:text-red-500 hover:bg-black/10 dark:hover:bg-white/10 transition-colors border border-black/5 dark:border-white/5", title: "YouTube", children: _jsxs("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", children: [_jsx("path", { d: "M22.54 6.42a2.78 2.78 0 0 0-1.94-2C18.88 4 12 4 12 4s-6.88 0-8.6.46a2.78 2.78 0 0 0-1.94 2A29 29 0 0 0 1 11.75a29 29 0 0 0 .46 5.33A2.78 2.78 0 0 0 3.4 19c1.72.46 8.6.46 8.6.46s6.88 0 8.6-.46a2.78 2.78 0 0 0 1.94-2 29 29 0 0 0 .46-5.25 29 29 0 0 0-.46-5.33z" }), _jsx("polygon", { points: "9.75 15.02 15.5 11.75 9.75 8.48 9.75 15.02" })] }) }), _jsx("a", { href: "#", className: "w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 flex items-center justify-center text-armoyu-text-muted hover:text-blue-500 hover:bg-black/10 dark:hover:bg-white/10 transition-colors border border-black/5 dark:border-white/5", title: "X (Twitter)", children: _jsxs("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", children: [_jsx("path", { d: "M4 4l11.733 16h4.267l-11.733 -16z" }), _jsx("path", { d: "M4 20l6.768 -6.768m2.46 -2.46l6.772 -6.772" })] }) })] })] }), _jsxs("div", { className: "space-y-4 lg:pl-8 flex flex-col items-center md:items-start", children: [_jsx("h3", { className: "text-lg font-bold text-armoyu-text tracking-wide", children: "H\u0131zl\u0131 Ba\u011Flant\u0131lar" }), _jsxs("ul", { className: "space-y-3 text-sm text-armoyu-text-muted font-bold w-full md:w-auto flex flex-col items-center md:items-start", children: [_jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Ana Sayfa"] }) }), _jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Gruplar"] }) }), _jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Forum"] }) }), _jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Ma\u011Faza"] }) }), _jsx("li", { children: _jsxs("a", { href: "#", className: "hover:text-blue-500 transition-colors flex items-center gap-2", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/50 hidden md:block" }), " Destek Talebi"] }) })] })] }), _jsxs("div", { className: "space-y-4 lg:col-span-2", children: [_jsx("h3", { className: "text-lg font-bold text-armoyu-text tracking-wide", children: "Son Payla\u015F\u0131mlar" }), _jsx("div", { className: "space-y-3", children: latestPosts.map((post, idx) => (_jsx("a", { href: post.link, className: "block group text-left", children: _jsxs("div", { className: "bg-black/5 dark:bg-white/5 p-4 rounded-xl border border-black/5 dark:border-white/5 group-hover:bg-black/10 dark:group-hover:bg-white/10 group-hover:border-blue-500/30 transition-all cursor-pointer flex flex-col sm:flex-row justify-between sm:items-center gap-2 sm:gap-4 shadow-sm", children: [_jsx("h4", { className: "text-armoyu-text text-sm font-bold group-hover:text-blue-500 transition-colors line-clamp-2 md:line-clamp-1 flex-1", children: post.title }), _jsx("span", { className: "text-xs text-blue-600 dark:text-blue-400 font-extrabold whitespace-nowrap sm:bg-blue-500/10 sm:px-2.5 sm:py-1 rounded-md", children: post.date })] }) }, idx))) })] })] }), _jsxs("div", { className: "max-w-7xl mx-auto mt-12 pt-8 border-t border-armoyu-card-border flex flex-col md:flex-row items-center justify-between gap-6 text-xs font-bold text-armoyu-text-muted", children: [_jsx("p", { children: "\u00A9 2026 Aram\u0131zdaki Oyuncu. T\u00FCm haklar\u0131 sakl\u0131d\u0131r." }), _jsxs("div", { className: "flex flex-wrap justify-center gap-4 md:gap-6", children: [_jsx("a", { href: "#", className: "hover:text-armoyu-text transition-colors", children: "Gizlilik Politikas\u0131" }), _jsx("a", { href: "#", className: "hover:text-armoyu-text transition-colors", children: "Hizmet \u015Eartlar\u0131" }), _jsx("a", { href: "#", className: "hover:text-armoyu-text transition-colors", children: "Kurallar" })] })] })] }));
|
|
9
|
+
}
|
|
10
10
|
//# sourceMappingURL=Footer.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function Header(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function Header(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=Header.d.ts.map
|
|
@@ -1,98 +1,98 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
|
-
import { LoginModal } from './LoginModal';
|
|
5
|
-
import { useAuth } from '../../context/AuthContext';
|
|
6
|
-
import { useChat } from '../../context/ChatContext';
|
|
7
|
-
import { useTheme } from '../../context/ThemeContext';
|
|
8
|
-
import { useRouter } from 'next/navigation';
|
|
9
|
-
import Link from 'next/link';
|
|
10
|
-
import { userList, groupList, schoolList } from '../../lib/constants/seedData';
|
|
11
|
-
import { Search, X, Users, MessageSquare, Bell, User, Flag, ShieldAlert, ShieldCheck, Crown, ArrowRight, Menu, ArrowLeft, GraduationCap } from 'lucide-react';
|
|
12
|
-
const navItems = [
|
|
13
|
-
{
|
|
14
|
-
name: 'Gruplar',
|
|
15
|
-
href: '/gruplar',
|
|
16
|
-
},
|
|
17
|
-
{ name: 'Galeriler', href: '/galeriler' },
|
|
18
|
-
{ name: 'Haberler', href: '/haberler' },
|
|
19
|
-
{ name: 'Çekilişler', href: '/cekilisler' },
|
|
20
|
-
{ name: 'Projeler', href: '/projeler' },
|
|
21
|
-
{
|
|
22
|
-
name: 'Ekibimiz',
|
|
23
|
-
href: '#',
|
|
24
|
-
submenu: [
|
|
25
|
-
{ name: 'Çalışma Ekibi', href: '/ekibimiz/ekip' },
|
|
26
|
-
{ name: 'İnsan Kaynakları', href: '/ekibimiz/ik' },
|
|
27
|
-
{ name: 'Topluluk Kuralları', href: '/kurallar' },
|
|
28
|
-
{ name: 'Hakkımızda', href: '/ekibimiz/hakkimizda' },
|
|
29
|
-
{ name: 'Gizlilik Politikası', href: '/ekibimiz/gizlilik' }
|
|
30
|
-
]
|
|
31
|
-
},
|
|
32
|
-
{ name: 'Forum', href: '/forum' },
|
|
33
|
-
{ name: 'Modlar', href: '/modlar' },
|
|
34
|
-
{ name: 'Etkinlikler', href: '/etkinlikler' },
|
|
35
|
-
{ name: 'Mağaza', href: '/magaza' },
|
|
36
|
-
];
|
|
37
|
-
export function Header() {
|
|
38
|
-
const { user, session, login, logout, isLoading, isLoginModalOpen, setIsLoginModalOpen } = useAuth();
|
|
39
|
-
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
40
|
-
const [isUserMenuOpen, setIsUserMenuOpen] = useState(false);
|
|
41
|
-
const [isNotificationOpen, setIsNotificationOpen] = useState(false);
|
|
42
|
-
const [isGroupsSubmenuOpen, setIsGroupsSubmenuOpen] = useState(false);
|
|
43
|
-
// Search States
|
|
44
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
45
|
-
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
46
|
-
const [searchResults, setSearchResults] = useState({ users: [], groups: [], schools: [] });
|
|
47
|
-
const { theme, toggleTheme } = useTheme();
|
|
48
|
-
const { openChat } = useChat();
|
|
49
|
-
const router = useRouter();
|
|
50
|
-
// Search Logic
|
|
51
|
-
useEffect(() => {
|
|
52
|
-
if (searchQuery.trim().length < 2) {
|
|
53
|
-
setSearchResults({ users: [], groups: [], schools: [] });
|
|
54
|
-
return;
|
|
55
|
-
}
|
|
56
|
-
const query = searchQuery.toLocaleLowerCase('tr-TR');
|
|
57
|
-
const filteredUsers = userList.filter((u) => u.displayName.toLocaleLowerCase('tr-TR').includes(query) ||
|
|
58
|
-
u.username.toLocaleLowerCase('tr-TR').includes(query)).slice(0, 5);
|
|
59
|
-
const filteredGroups = groupList.filter((g) => g.name.toLocaleLowerCase('tr-TR').includes(query)).slice(0, 5);
|
|
60
|
-
const filteredSchools = schoolList.filter((s) => s.name.toLocaleLowerCase('tr-TR').includes(query)).slice(0, 5);
|
|
61
|
-
setSearchResults({ users: filteredUsers, groups: filteredGroups, schools: filteredSchools });
|
|
62
|
-
}, [searchQuery]);
|
|
63
|
-
const unreadCount = session?.notifications?.filter((n) => !n.isRead).length || 0;
|
|
64
|
-
const markAllAsRead = () => {
|
|
65
|
-
if (session?.notifications) {
|
|
66
|
-
session.notifications.forEach((n) => n.isRead = true);
|
|
67
|
-
setIsNotificationOpen(false);
|
|
68
|
-
setTimeout(() => setIsNotificationOpen(true), 10);
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
const closeSearch = () => {
|
|
72
|
-
setSearchQuery('');
|
|
73
|
-
setIsSearchOpen(false);
|
|
74
|
-
};
|
|
75
|
-
const goToMyProfile = () => {
|
|
76
|
-
if (user?.username) {
|
|
77
|
-
router.push(`/oyuncular/${user.username}`);
|
|
78
|
-
setIsUserMenuOpen(false);
|
|
79
|
-
setIsMobileMenuOpen(false);
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
const handleNotificationClick = (notif) => {
|
|
83
|
-
notif.isRead = true;
|
|
84
|
-
if (notif.isClickable && notif.link) {
|
|
85
|
-
router.push(notif.link);
|
|
86
|
-
setIsNotificationOpen(false);
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
setIsNotificationOpen(false);
|
|
90
|
-
setTimeout(() => setIsNotificationOpen(true), 10);
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
return (_jsxs(_Fragment, { children: [_jsx("header", { className: "sticky top-0 z-40 w-full border-b border-armoyu-header-border bg-armoyu-header-bg transition-all duration-500 backdrop-blur-md", children: _jsxs("div", { className: "flex items-center justify-between px-4 md:px-8 h-16 w-full max-w-[100vw]", children: [_jsx("button", { className: "md:hidden flex items-center justify-center w-10 h-10 text-armoyu-text hover:text-blue-500 transition-colors border border-transparent hover:border-armoyu-header-border rounded-lg bg-transparent hover:bg-black/5 dark:hover:bg-white/5", onClick: () => setIsMobileMenuOpen(true), title: "Men\u00FC", children: _jsx(Menu, { size: 24 }) }), _jsx("div", { className: "flex-shrink-0 flex items-center pr-4 md:pr-8 md:border-r border-armoyu-header-border ml-2 md:ml-0", children: _jsx(Link, { href: "/", className: "text-xl font-black tracking-tighter bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-indigo-600 dark:from-white dark:to-gray-400 hover:opacity-80 transition-opacity uppercase italic", children: "ARMOYU" }) }), _jsx("nav", { className: "hidden md:flex items-center gap-1 xl:gap-2 mx-4", children: navItems.map((item) => (_jsxs("div", { className: "relative group", children: [_jsxs(Link, { href: item.href, className: "px-3 xl:px-4 py-2 rounded-xl text-sm font-bold text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-all flex items-center gap-1.5 whitespace-nowrap", children: [item.name, item.submenu && (_jsx(Menu, { size: 14, className: "opacity-50 group-hover:rotate-90 transition-transform" }))] }), item.submenu && (_jsx("div", { className: "absolute top-full left-0 pt-3 opacity-0 translate-y-4 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto transition-all duration-300 z-50", children: _jsx("div", { className: "bg-white/95 dark:bg-[#12121a]/95 backdrop-blur-xl border border-gray-200 dark:border-white/10 rounded-[28px] shadow-2xl p-2 w-56 overflow-hidden animate-in fade-in slide-in-from-top-2 duration-200", children: item.submenu.map((sub) => (_jsxs(Link, { href: sub.href, className: "flex items-center gap-2.5 px-4 py-3 rounded-xl text-xs font-black uppercase tracking-widest text-armoyu-text-muted hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-500/5 transition-all decoration-0 group/sub", children: [_jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/40 group-hover/sub:bg-blue-500 transition-colors" }), sub.name] }, sub.name))) }) }))] }, item.name))) }), _jsx("div", { className: "hidden lg:flex items-center flex-1 max-w-[280px] ml-auto relative", children: _jsxs("div", { className: "relative w-full group", children: [_jsx("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none", children: _jsx(Search, { size: 16, className: "text-armoyu-text-muted group-focus-within:text-blue-500 transition-colors" }) }), _jsx("input", { type: "text", className: "block w-full pl-11 pr-4 py-2.5 bg-black/5 dark:bg-white/5 border border-transparent focus:border-blue-500/50 rounded-2xl text-sm font-bold text-armoyu-text placeholder:text-armoyu-text-muted/50 focus:outline-none focus:ring-4 focus:ring-blue-500/10 transition-all", placeholder: "Ara...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), onFocus: () => setIsSearchOpen(true) }), isSearchOpen && (searchQuery.length > 0) && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setIsSearchOpen(false) }), _jsxs("div", { className: "absolute top-full right-0 mt-3 bg-white/95 dark:bg-[#12121a]/95 backdrop-blur-xl border border-gray-200 dark:border-white/10 rounded-[28px] shadow-2xl z-50 overflow-hidden animate-in fade-in zoom-in-95 duration-200 w-[350px]", children: [searchResults.users.length === 0 && searchResults.groups.length === 0 && searchResults.schools.length === 0 ? (_jsxs("div", { className: "p-8 text-center", children: [_jsx("div", { className: "w-12 h-12 bg-black/5 dark:bg-white/5 rounded-full flex items-center justify-center mx-auto mb-3", children: _jsx(Search, { size: 20, className: "text-armoyu-text-muted opacity-50" }) }), _jsx("p", { className: "text-xs font-black text-armoyu-text uppercase tracking-widest", children: "Sonu\u00E7 Bulunamad\u0131" }), _jsx("p", { className: "text-[10px] text-armoyu-text-muted mt-1", children: "Farkl\u0131 bir anahtar kelime dene." })] })) : (_jsxs("div", { className: "max-h-[70vh] overflow-y-auto p-2 space-y-4 py-4", children: [searchResults.users.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "px-4 mb-2 text-[10px] font-black text-armoyu-text-muted uppercase tracking-[0.2em] flex items-center gap-2", children: [_jsx(User, { size: 12 }), " Oyuncular"] }), _jsx("div", { className: "space-y-1", children: searchResults.users.map((u) => (_jsxs(Link, { href: `/oyuncular/${u.username}`, onClick: closeSearch, className: "flex items-center gap-3 p-3 rounded-2xl hover:bg-blue-500/10 transition-colors group", children: [_jsx("img", { src: u.avatar, className: "w-10 h-10 rounded-xl object-cover ring-2 ring-transparent group-hover:ring-blue-500/30 transition-all", alt: u.displayName }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-black text-armoyu-text group-hover:text-blue-500 transition-colors", children: u.displayName }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: ["@", u.username] })] }), _jsx(ArrowRight, { size: 14, className: "ml-auto opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all text-blue-500" })] }, u.username))) })] })), searchResults.groups.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "px-4 mb-2 text-[10px] font-black text-armoyu-text-muted uppercase tracking-[0.2em] flex items-center gap-2", children: [_jsx(Users, { size: 12 }), " Gruplar"] }), _jsx("div", { className: "space-y-1", children: searchResults.groups.map((g) => (_jsxs(Link, { href: `/gruplar/${g.id}`, onClick: closeSearch, className: "flex items-center gap-3 p-3 rounded-2xl hover:bg-emerald-500/10 transition-colors group", children: [_jsx("img", { src: g.logo, className: "w-10 h-10 rounded-xl object-cover ring-2 ring-transparent group-hover:ring-emerald-500/30 transition-all", alt: g.name }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-black text-armoyu-text group-hover:text-emerald-500 transition-colors", children: g.name }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: [g.memberCount || 0, " \u00DCye"] })] }), _jsx(ArrowRight, { size: 14, className: "ml-auto opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all text-emerald-500" })] }, g.id))) })] })), searchResults.schools.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "px-4 mb-2 text-[10px] font-black text-armoyu-text-muted uppercase tracking-[0.2em] flex items-center gap-2", children: [_jsx(GraduationCap, { size: 12 }), " Okullar"] }), _jsx("div", { className: "space-y-1", children: searchResults.schools.map((s) => (_jsxs(Link, { href: `/egitim/${s.slug}`, onClick: closeSearch, className: "flex items-center gap-3 p-3 rounded-2xl hover:bg-blue-500/10 transition-colors group", children: [_jsx("img", { src: s.logo, className: "w-10 h-10 rounded-xl object-contain bg-white p-1 ring-2 ring-transparent group-hover:ring-blue-500/30 transition-all", alt: s.name }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-black text-armoyu-text group-hover:text-blue-500 transition-colors", children: s.name }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: [s.memberCount || 0, " \u00DCye"] })] }), _jsx(ArrowRight, { size: 14, className: "ml-auto opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all text-blue-500" })] }, s.id))) })] }))] })), _jsx("div", { className: "p-3 bg-black/5 dark:bg-white/5 border-t border-gray-200 dark:border-white/10 text-center", children: _jsx("span", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: "Arama modunu kapatmak i\u00E7in d\u0131\u015Far\u0131 t\u0131kla" }) })] })] }))] }) }), _jsxs("div", { className: "flex-shrink-0 pl-4 md:pl-8 border-l border-armoyu-header-border flex items-center gap-2 md:gap-4 h-full ml-auto md:ml-0", children: [_jsx("button", { className: "lg:hidden p-2 rounded-xl text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-all", onClick: () => setIsSearchOpen(true), children: _jsx(Search, { size: 22 }) }), user && (_jsxs("div", { className: "relative", children: [_jsxs("button", { onClick: () => setIsNotificationOpen(!isNotificationOpen), className: `relative p-2 rounded-xl transition-all ${isNotificationOpen ? 'bg-blue-500 text-white shadow-lg shadow-blue-500/30' : 'text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5'}`, title: "Bildirimler", children: [_jsx(Bell, { size: 22 }), unreadCount > 0 && (_jsx("span", { className: "absolute -top-0.5 -right-0.5 w-5 h-5 bg-red-500 text-white text-[10px] font-black flex items-center justify-center rounded-full border-2 border-armoyu-header-bg animate-bounce", children: unreadCount }))] }), isNotificationOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setIsNotificationOpen(false) }), _jsxs("div", { className: "absolute right-0 mt-3 w-80 md:w-96 bg-white/95 dark:bg-[#12121a]/95 backdrop-blur-xl border border-gray-200 dark:border-white/10 rounded-[32px] shadow-2xl z-50 overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [_jsxs("div", { className: "p-5 border-b border-gray-200 dark:border-white/10 flex justify-between items-center bg-gray-50/50 dark:bg-white/5", children: [_jsx("h4", { className: "text-[11px] font-black text-armoyu-text uppercase tracking-[0.2em]", children: "B\u0130LD\u0130R\u0130MLER" }), _jsx("button", { onClick: markAllAsRead, className: "text-[10px] font-bold text-blue-500 hover:text-blue-400 transition-colors uppercase tracking-widest", children: "Hepsini Oku" })] }), _jsx("div", { className: "max-h-[450px] overflow-y-auto p-1.5", children: (session?.notifications || []).length > 0 ? ((session?.notifications || []).map((notif) => (_jsxs("div", { onClick: () => handleNotificationClick(notif), className: `p-4 rounded-2xl hover:bg-black/5 dark:hover:bg-white/5 transition-all group flex gap-4 ${!notif.isRead ? 'bg-blue-500/5' : ''}`, children: [_jsxs("div", { className: "relative shrink-0", children: [_jsx("img", { src: notif.sender?.avatar, className: "w-11 h-11 rounded-2xl object-cover ring-2 ring-black/5 dark:ring-white/5 shadow-sm", alt: "Sender" }), _jsxs("div", { className: "absolute -bottom-1 -right-1 w-5 h-5 rounded-lg bg-blue-500 border-2 border-white dark:border-[#12121a] flex items-center justify-center text-white shadow-sm", children: [(notif.type === 'POST_LIKE') && _jsx(Flag, { size: 10, fill: "currentColor" }), (notif.type === 'POST_COMMENT') && _jsx(MessageSquare, { size: 10, fill: "currentColor" }), (notif.type === 'GROUP_INVITE') && _jsx(Users, { size: 10, fill: "currentColor" }), (notif.category === 'SYSTEM') && _jsx(ShieldAlert, { size: 10, fill: "currentColor" })] })] }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex justify-between items-start mb-0.5", children: [_jsx("p", { className: "text-sm font-black text-armoyu-text truncate", children: notif.title }), _jsx("span", { className: "text-[9px] font-bold text-armoyu-text-muted uppercase tracking-tighter", children: notif.createdAt })] }), _jsx("p", { className: "text-[11px] font-medium text-armoyu-text-muted leading-relaxed line-clamp-2", children: notif.message })] }), !notif.isRead && _jsx("div", { className: "w-2.5 h-2.5 rounded-full bg-blue-500 mt-2 shadow-[0_0_10px_rgba(59,130,246,0.6)]" })] }, notif.id)))) : (_jsxs("div", { className: "py-16 text-center", children: [_jsx(Bell, { size: 40, className: "mx-auto text-armoyu-text-muted/20 mb-4" }), _jsx("p", { className: "text-xs font-black text-armoyu-text uppercase tracking-widest", children: "Bildirim Bulunmuyor" })] })) })] })] }))] })), !isLoading && (user ? (_jsxs("button", { onClick: () => setIsUserMenuOpen(true), className: "flex items-center gap-3 p-1 rounded-full hover:bg-black/5 dark:hover:bg-white/5 transition-colors border border-transparent hover:border-armoyu-header-border focus:outline-none", title: "Profilim", children: [_jsx("img", { src: user.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Armoyu", alt: "Avatar", className: "w-8 h-8 rounded-full border border-blue-500/50 shadow-[0_0_10px_rgba(59,130,246,0.5)] object-cover bg-white/5" }), _jsx("span", { className: "text-sm font-bold text-armoyu-text hidden md:inline-block pr-2", children: user.displayName.split(' ')[0] })] })) : (_jsx("button", { onClick: () => setIsLoginModalOpen(true), className: "flex items-center justify-center w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 hover:bg-black/10 dark:hover:bg-white/10 text-armoyu-text-muted hover:text-blue-600 dark:hover:text-blue-400 transition-all border border-armoyu-header-border shadow-sm", title: "Giri\u015F Yap", children: _jsxs("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", children: [_jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), _jsx("circle", { cx: "12", cy: "7", r: "4" })] }) }))), isLoading && (_jsx("div", { className: "w-8 h-8 rounded-full bg-black/5 dark:bg-white/5 animate-pulse border border-armoyu-header-border" }))] })] }) }), isSearchOpen && (_jsxs("div", { className: "fixed inset-0 z-[100] bg-white dark:bg-[#0a0a0b] flex flex-col lg:hidden animate-in fade-in slide-in-from-top duration-300", children: [_jsxs("div", { className: "flex items-center gap-4 p-4 border-b border-gray-200 dark:border-white/10", children: [_jsx("button", { onClick: closeSearch, className: "p-2 text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-colors", children: _jsx(ArrowLeft, { size: 24 }) }), _jsx("input", { autoFocus: true, type: "text", className: "flex-1 bg-transparent border-none text-lg font-bold text-armoyu-text focus:outline-none placeholder:text-armoyu-text-muted/30", placeholder: "Kimi aram\u0131\u015Ft\u0131n?", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value) }), searchQuery.length > 0 && (_jsx("button", { onClick: () => setSearchQuery(''), className: "p-2 text-armoyu-text-muted hover:text-red-500 transition-colors", children: _jsx(X, { size: 20 }) }))] }), _jsx("div", { className: "flex-1 overflow-y-auto p-4 hide-scrollbar", children: searchQuery.length > 0 ? (searchResults.users.length === 0 && searchResults.groups.length === 0 && searchResults.schools.length === 0 ? (_jsxs("div", { className: "py-20 text-center", children: [_jsx(Search, { size: 48, className: "mx-auto text-armoyu-text-muted/10 mb-4" }), _jsx("p", { className: "text-sm font-black text-armoyu-text uppercase tracking-widest", children: "Sonu\u00E7 Bulunamad\u0131" })] })) : (_jsxs("div", { className: "space-y-8", children: [searchResults.users.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "mb-4 text-[11px] font-black text-armoyu-text-muted uppercase tracking-[0.3em] flex items-center gap-2", children: [_jsx(User, { size: 14 }), " Oyuncular (", searchResults.users.length, ")"] }), _jsx("div", { className: "space-y-2", children: searchResults.users.map((u) => (_jsxs(Link, { href: `/oyuncular/${u.username}`, onClick: closeSearch, className: "flex items-center gap-4 p-3 rounded-[24px] bg-black/5 dark:bg-white/5 border border-transparent active:scale-95 transition-all", children: [_jsx("img", { src: u.avatar, className: "w-12 h-12 rounded-2xl object-cover shadow-lg", alt: u.displayName }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-black text-armoyu-text truncate", children: u.displayName }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: ["@", u.username] })] }), _jsx(ArrowRight, { size: 18, className: "text-blue-500" })] }, u.username))) })] })), searchResults.groups.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "mb-4 text-[11px] font-black text-armoyu-text-muted uppercase tracking-[0.3em] flex items-center gap-2", children: [_jsx(Users, { size: 14 }), " Gruplar (", searchResults.groups.length, ")"] }), _jsx("div", { className: "space-y-2", children: searchResults.groups.map((g) => (_jsxs(Link, { href: `/gruplar/${g.id}`, onClick: closeSearch, className: "flex items-center gap-4 p-3 rounded-[24px] bg-black/5 dark:bg-white/5 border border-transparent active:scale-95 transition-all", children: [_jsx("img", { src: g.logo, className: "w-12 h-12 rounded-2xl object-cover shadow-lg", alt: g.name }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-black text-armoyu-text truncate", children: g.name }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: [g.memberCount || 0, " \u00DCye"] })] }), _jsx(ArrowRight, { size: 18, className: "text-emerald-500" })] }, g.id))) })] })), searchResults.schools.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "mb-4 text-[11px] font-black text-armoyu-text-muted uppercase tracking-[0.3em] flex items-center gap-2", children: [_jsx(GraduationCap, { size: 14 }), " Okullar (", searchResults.schools.length, ")"] }), _jsx("div", { className: "space-y-2", children: searchResults.schools.map((s) => (_jsxs(Link, { href: `/egitim/${s.slug}`, onClick: closeSearch, className: "flex items-center gap-4 p-3 rounded-[32px] bg-black/5 dark:bg-white/5 border border-transparent active:scale-95 transition-all", children: [_jsx("img", { src: s.logo, className: "w-14 h-14 rounded-2xl object-contain bg-white p-2 shadow-lg", alt: s.name }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-black text-armoyu-text truncate italic", children: s.name }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: [s.memberCount || 0, " \u00DCye"] })] }), _jsx(ArrowRight, { size: 20, className: "text-blue-500" })] }, s.id))) })] }))] }))) : (_jsx("div", { className: "py-12 text-center text-armoyu-text-muted", children: _jsx("p", { className: "text-xs font-bold uppercase tracking-widest", children: "Aramak i\u00E7in yazmaya ba\u015Fla..." }) })) })] })), isMobileMenuOpen && (_jsxs("div", { className: "fixed inset-0 z-50 flex animate-in fade-in duration-200", children: [_jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-sm", onClick: () => setIsMobileMenuOpen(false) }), _jsxs("div", { className: "relative w-[280px] max-w-[80vw] h-full glass-panel bg-armoyu-drawer-bg border-r border-armoyu-drawer-border shadow-2xl flex flex-col pt-6 pb-8 px-6 animate-in slide-in-from-left duration-300", children: [_jsxs("div", { className: "flex items-center justify-between mb-8 border-b border-armoyu-drawer-border pb-4", children: [_jsx(Link, { href: "/", onClick: () => setIsMobileMenuOpen(false), className: "text-xl font-extrabold tracking-wider text-armoyu-text hover:text-blue-500 transition-colors", children: "ARMOYU" }), _jsx("button", { onClick: () => setIsMobileMenuOpen(false), className: "text-armoyu-text-muted hover:text-armoyu-text transition-colors bg-black/5 dark:bg-white/5 p-2 rounded-lg hover:bg-black/10 dark:hover:bg-white/10 border border-armoyu-drawer-border", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), _jsxs("nav", { className: "flex-1 overflow-y-auto hide-scrollbar space-y-1 pr-2", children: [user && (_jsxs("button", { onClick: goToMyProfile, className: "w-full flex items-center gap-3 py-3.5 px-4 rounded-xl text-blue-600 dark:text-blue-400 bg-blue-500/5 hover:bg-blue-500/10 transition-all text-sm font-black border border-blue-500/10 mb-2 group/mobprof", children: [_jsx(User, { size: 20, className: "group-hover/mobprof:scale-110 transition-transform" }), "Profilim", _jsx(ArrowRight, { size: 16, className: "ml-auto opacity-40 group-hover/mobprof:opacity-100 group-hover/mobprof:translate-x-1 transition-all" })] })), navItems.map((item, idx) => (_jsx("div", { children: item.submenu ? (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "w-full flex items-center justify-between px-4 py-3.5 rounded-xl text-sm font-bold text-armoyu-text-muted", children: _jsx("span", { children: item.name }) }), _jsx("div", { className: "pl-3 space-y-1 border-l border-black/5 dark:border-white/10 ml-4", children: item.submenu.map((sub, sidx) => (_jsx(Link, { href: sub.href, onClick: () => setIsMobileMenuOpen(false), className: "w-full text-left px-4 py-2.5 rounded-xl text-sm font-bold text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-all block", children: sub.name }, sidx))) })] })) : (_jsx(Link, { href: item.href, onClick: () => setIsMobileMenuOpen(false), className: "block py-3.5 px-4 rounded-xl text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-all text-sm font-bold border border-transparent", children: item.name })) }, idx)))] }), _jsxs("div", { className: "mt-6 pt-6 border-t border-armoyu-drawer-border space-y-3", children: [_jsxs("button", { onClick: toggleTheme, className: "w-full py-3 px-4 rounded-xl bg-black/5 dark:bg-white/5 border border-armoyu-drawer-border text-armoyu-text-muted hover:text-armoyu-text flex items-center justify-between transition-colors font-bold text-sm", children: [_jsx("span", { children: "Tema De\u011Fi\u015Ftir" }), theme === 'dark' ? (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("circle", { cx: "12", cy: "12", r: "5" }), _jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), _jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), _jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), _jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), _jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), _jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), _jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), _jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] })) : (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }))] }), user ? (_jsx("button", { onClick: () => { setIsMobileMenuOpen(false); setIsUserMenuOpen(true); }, className: "w-full py-4 px-4 rounded-xl font-bold bg-black/5 dark:bg-white/5 border border-armoyu-drawer-border text-armoyu-text flex justify-center items-center gap-2 hover:bg-black/10 dark:hover:bg-white/10 transition-colors", children: "Profil Men\u00FCs\u00FC" })) : (_jsx("button", { onClick: () => { setIsMobileMenuOpen(false); setIsLoginModalOpen(true); }, className: "w-full py-4 px-4 rounded-xl bg-gradient-to-r from-blue-600 to-blue-500 text-white transition-all text-md font-bold shadow-[0_0_15px_rgba(37,99,235,0.4)]", children: "Giri\u015F Yap / Kay\u0131t Ol" }))] })] })] })), isUserMenuOpen && user && (_jsxs("div", { className: "fixed inset-0 z-[60] flex justify-end animate-in fade-in duration-200", children: [_jsx("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm", onClick: () => setIsUserMenuOpen(false) }), _jsxs("div", { className: "relative w-[340px] max-w-[85vw] h-full glass-panel bg-armoyu-drawer-bg border-l border-armoyu-drawer-border shadow-2xl flex flex-col animate-in slide-in-from-right duration-300", children: [_jsxs("div", { className: "p-6 border-b border-armoyu-drawer-border flex justify-between items-start relative overflow-hidden group", children: [_jsx("div", { className: "absolute top-0 right-0 w-32 h-32 bg-blue-500/20 blur-[50px] -z-10 rounded-full" }), _jsxs("div", { className: "flex gap-4 items-center", children: [_jsx("img", { src: user.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Armoyu", alt: "Avatar", className: "w-14 h-14 rounded-full border-2 border-blue-500 shadow-[0_0_15px_rgba(59,130,246,0.4)] object-cover bg-white/5" }), _jsxs("div", { children: [_jsx("h3", { className: "text-armoyu-text font-bold text-lg leading-tight truncate max-w-[150px]", children: user.displayName }), _jsxs("span", { className: "text-blue-600 dark:text-blue-400 text-sm font-medium", children: ["@", user.username] })] })] }), _jsx("button", { onClick: () => setIsUserMenuOpen(false), className: "text-armoyu-text-muted hover:text-armoyu-text transition-colors bg-black/5 dark:bg-white/5 p-1.5 rounded-lg hover:bg-black/10 dark:hover:bg-white/10 border border-armoyu-drawer-border", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), _jsxs("nav", { className: "flex-1 overflow-y-auto p-4 space-y-1.5 mt-2 hide-scrollbar", children: [_jsxs("button", { onClick: goToMyProfile, className: "w-full flex items-center gap-3 p-3 text-blue-600 dark:text-blue-400 bg-blue-500/5 hover:bg-blue-500/10 rounded-xl transition-all font-black border border-blue-500/20 text-left focus:outline-none group/prof mb-1", children: [_jsx(User, { size: 18, className: "group-hover/prof:scale-110 transition-transform" }), "Profilime Git", _jsx(ArrowRight, { size: 14, className: "ml-auto opacity-40 group-hover/prof:opacity-100 group-hover/prof:translate-x-1 transition-all" })] }), ['admin', 'member_mgmt', 'discipline', 'event_mgmt'].includes(user.role?.id || '') && (_jsxs(Link, { href: "/yonetim", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 bg-blue-500/10 dark:bg-blue-500/20 text-blue-600 dark:text-blue-400 border border-blue-500/30 rounded-xl transition-all font-black shadow-[0_0_15px_rgba(59,130,246,0.15)] mb-2 group animate-in slide-in-from-right-4 duration-500", children: [_jsx(ShieldCheck, { size: 18, className: "group-hover:scale-110 transition-transform" }), "Y\u00F6netim Paneli", _jsx(Crown, { size: 14, className: "ml-auto opacity-50" })] })), _jsxs(Link, { href: "/yazilarim", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M12 20h9" }), _jsx("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })] }), "Yaz\u0131lar\u0131m"] }), _jsxs(Link, { href: "/yazilarim", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: _jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) }), "Yorumlar\u0131m"] }), _jsxs(Link, { href: "/anketler", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "16" }), _jsx("line", { x1: "8", y1: "12", x2: "12", y2: "16" }), _jsx("line", { x1: "16", y1: "10", x2: "16", y2: "16" })] }), "Anketler"] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("button", { onClick: () => setIsGroupsSubmenuOpen(!isGroupsSubmenuOpen), className: `w-full flex items-center gap-3 p-3 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border text-left focus:outline-none ${isGroupsSubmenuOpen ? 'text-blue-500 bg-blue-500/5' : 'text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5'}`, children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }), _jsx("circle", { cx: "9", cy: "7", r: "4" }), _jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }), _jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })] }), "Gruplar\u0131m", _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", className: `ml-auto transition-transform duration-300 ${isGroupsSubmenuOpen ? 'rotate-180' : ''}`, children: _jsx("polyline", { points: "6 9 12 15 18 9" }) })] }), isGroupsSubmenuOpen && (_jsxs("div", { className: "pl-4 space-y-1 mt-1 animate-in slide-in-from-top-2 duration-200", children: [(user.groups || []).length > 0 ? ((user.groups || []).map((group, gidx) => (_jsxs(Link, { href: `/gruplar/${group.name.toLowerCase().replace(/\s+/g, '-')}`, onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-2.5 rounded-xl text-xs font-bold text-armoyu-text-muted hover:text-blue-500 hover:bg-black/5 dark:hover:bg-white/5 transition-all", children: [_jsx("img", { src: group.logo, className: "w-7 h-7 rounded-lg bg-white dark:bg-zinc-800 border border-armoyu-drawer-border" }), _jsx("span", { className: "truncate", children: group.name })] }, gidx)))) : (_jsx("div", { className: "py-3 px-4 text-center bg-black/5 dark:bg-white/5 rounded-xl border border-dashed border-armoyu-drawer-border mx-2", children: _jsxs("span", { className: "text-[10px] font-bold text-armoyu-text-muted opacity-60 block leading-tight", children: ["Hen\u00FCz bir gruba", _jsx("br", {}), "dahil de\u011Filsin"] }) })), _jsx(Link, { href: "/gruplar", onClick: () => setIsUserMenuOpen(false), className: "flex items-center justify-center p-2.5 rounded-xl text-[10px] font-black text-blue-500/60 hover:text-blue-500 hover:bg-blue-500/5 transition-all uppercase tracking-widest", children: "T\u00FCm Gruplar\u0131 G\u00F6r" })] }))] }), _jsxs(Link, { href: "/cekilisler", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("polyline", { points: "20 12 20 22 4 22 4 12" }), _jsx("rect", { x: "2", y: "7", width: "20", height: "5" }), _jsx("line", { x1: "12", y1: "22", x2: "12", y2: "7" }), _jsx("path", { d: "M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z" }), _jsx("path", { d: "M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z" })] }), "\u00C7ekili\u015F"] }), _jsxs(Link, { href: "/egitim", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" }), _jsx("path", { d: "M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" })] }), "E\u011Fitim"] }), _jsxs(Link, { href: "/destek", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/10 rounded-xl transition-all font-bold border border-transparent hover:border-emerald-500/20 mt-2", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }), _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })] }), "Destek Bildirimleri"] })] }), _jsxs("div", { className: "p-4 border-t border-armoyu-drawer-border space-y-3", children: [_jsxs("button", { onClick: toggleTheme, className: "w-full py-3 px-4 rounded-xl bg-black/5 dark:bg-white/5 border border-armoyu-drawer-border text-armoyu-text-muted hover:text-armoyu-text flex items-center justify-between transition-colors font-bold text-sm", children: [_jsx("span", { children: "Koyu / A\u00E7\u0131k Tema De\u011Fi\u015Ftir" }), theme === 'dark' ? (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("circle", { cx: "12", cy: "12", r: "5" }), _jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), _jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), _jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), _jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), _jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), _jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), _jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), _jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] })) : (_jsx("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", children: _jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }))] }), _jsxs("button", { onClick: () => {
|
|
94
|
-
logout();
|
|
95
|
-
setIsUserMenuOpen(false);
|
|
96
|
-
}, className: "flex items-center gap-3 w-full p-4 text-white hover:text-white bg-red-600 hover:bg-red-500 hover:shadow-[0_0_15px_rgba(239,68,68,0.5)] border border-transparent rounded-xl transition-all font-bold", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }), _jsx("polyline", { points: "16 17 21 12 16 7" }), _jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12" })] }), "Sistemden \u00C7\u0131k\u0131\u015F Yap"] })] })] })] })), _jsx(LoginModal, { isOpen: !user && isLoginModalOpen, onClose: () => setIsLoginModalOpen(false) })] }));
|
|
97
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from 'react';
|
|
4
|
+
import { LoginModal } from './LoginModal';
|
|
5
|
+
import { useAuth } from '../../context/AuthContext';
|
|
6
|
+
import { useChat } from '../../context/ChatContext';
|
|
7
|
+
import { useTheme } from '../../context/ThemeContext';
|
|
8
|
+
import { useRouter } from 'next/navigation';
|
|
9
|
+
import Link from 'next/link';
|
|
10
|
+
import { userList, groupList, schoolList } from '../../lib/constants/seedData';
|
|
11
|
+
import { Search, X, Users, MessageSquare, Bell, User, Flag, ShieldAlert, ShieldCheck, Crown, ArrowRight, Menu, ArrowLeft, GraduationCap } from 'lucide-react';
|
|
12
|
+
const navItems = [
|
|
13
|
+
{
|
|
14
|
+
name: 'Gruplar',
|
|
15
|
+
href: '/gruplar',
|
|
16
|
+
},
|
|
17
|
+
{ name: 'Galeriler', href: '/galeriler' },
|
|
18
|
+
{ name: 'Haberler', href: '/haberler' },
|
|
19
|
+
{ name: 'Çekilişler', href: '/cekilisler' },
|
|
20
|
+
{ name: 'Projeler', href: '/projeler' },
|
|
21
|
+
{
|
|
22
|
+
name: 'Ekibimiz',
|
|
23
|
+
href: '#',
|
|
24
|
+
submenu: [
|
|
25
|
+
{ name: 'Çalışma Ekibi', href: '/ekibimiz/ekip' },
|
|
26
|
+
{ name: 'İnsan Kaynakları', href: '/ekibimiz/ik' },
|
|
27
|
+
{ name: 'Topluluk Kuralları', href: '/kurallar' },
|
|
28
|
+
{ name: 'Hakkımızda', href: '/ekibimiz/hakkimizda' },
|
|
29
|
+
{ name: 'Gizlilik Politikası', href: '/ekibimiz/gizlilik' }
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
{ name: 'Forum', href: '/forum' },
|
|
33
|
+
{ name: 'Modlar', href: '/modlar' },
|
|
34
|
+
{ name: 'Etkinlikler', href: '/etkinlikler' },
|
|
35
|
+
{ name: 'Mağaza', href: '/magaza' },
|
|
36
|
+
];
|
|
37
|
+
export function Header() {
|
|
38
|
+
const { user, session, login, logout, isLoading, isLoginModalOpen, setIsLoginModalOpen } = useAuth();
|
|
39
|
+
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
40
|
+
const [isUserMenuOpen, setIsUserMenuOpen] = useState(false);
|
|
41
|
+
const [isNotificationOpen, setIsNotificationOpen] = useState(false);
|
|
42
|
+
const [isGroupsSubmenuOpen, setIsGroupsSubmenuOpen] = useState(false);
|
|
43
|
+
// Search States
|
|
44
|
+
const [searchQuery, setSearchQuery] = useState('');
|
|
45
|
+
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
46
|
+
const [searchResults, setSearchResults] = useState({ users: [], groups: [], schools: [] });
|
|
47
|
+
const { theme, toggleTheme } = useTheme();
|
|
48
|
+
const { openChat } = useChat();
|
|
49
|
+
const router = useRouter();
|
|
50
|
+
// Search Logic
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (searchQuery.trim().length < 2) {
|
|
53
|
+
setSearchResults({ users: [], groups: [], schools: [] });
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const query = searchQuery.toLocaleLowerCase('tr-TR');
|
|
57
|
+
const filteredUsers = userList.filter((u) => u.displayName.toLocaleLowerCase('tr-TR').includes(query) ||
|
|
58
|
+
u.username.toLocaleLowerCase('tr-TR').includes(query)).slice(0, 5);
|
|
59
|
+
const filteredGroups = groupList.filter((g) => g.name.toLocaleLowerCase('tr-TR').includes(query)).slice(0, 5);
|
|
60
|
+
const filteredSchools = schoolList.filter((s) => s.name.toLocaleLowerCase('tr-TR').includes(query)).slice(0, 5);
|
|
61
|
+
setSearchResults({ users: filteredUsers, groups: filteredGroups, schools: filteredSchools });
|
|
62
|
+
}, [searchQuery]);
|
|
63
|
+
const unreadCount = session?.notifications?.filter((n) => !n.isRead).length || 0;
|
|
64
|
+
const markAllAsRead = () => {
|
|
65
|
+
if (session?.notifications) {
|
|
66
|
+
session.notifications.forEach((n) => n.isRead = true);
|
|
67
|
+
setIsNotificationOpen(false);
|
|
68
|
+
setTimeout(() => setIsNotificationOpen(true), 10);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const closeSearch = () => {
|
|
72
|
+
setSearchQuery('');
|
|
73
|
+
setIsSearchOpen(false);
|
|
74
|
+
};
|
|
75
|
+
const goToMyProfile = () => {
|
|
76
|
+
if (user?.username) {
|
|
77
|
+
router.push(`/oyuncular/${user.username}`);
|
|
78
|
+
setIsUserMenuOpen(false);
|
|
79
|
+
setIsMobileMenuOpen(false);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const handleNotificationClick = (notif) => {
|
|
83
|
+
notif.isRead = true;
|
|
84
|
+
if (notif.isClickable && notif.link) {
|
|
85
|
+
router.push(notif.link);
|
|
86
|
+
setIsNotificationOpen(false);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
setIsNotificationOpen(false);
|
|
90
|
+
setTimeout(() => setIsNotificationOpen(true), 10);
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
return (_jsxs(_Fragment, { children: [_jsx("header", { className: "sticky top-0 z-40 w-full border-b border-armoyu-header-border bg-armoyu-header-bg transition-all duration-500 backdrop-blur-md", children: _jsxs("div", { className: "flex items-center justify-between px-4 md:px-8 h-16 w-full max-w-[100vw]", children: [_jsx("button", { className: "md:hidden flex items-center justify-center w-10 h-10 text-armoyu-text hover:text-blue-500 transition-colors border border-transparent hover:border-armoyu-header-border rounded-lg bg-transparent hover:bg-black/5 dark:hover:bg-white/5", onClick: () => setIsMobileMenuOpen(true), title: "Men\u00FC", children: _jsx(Menu, { size: 24 }) }), _jsx("div", { className: "flex-shrink-0 flex items-center pr-4 md:pr-8 md:border-r border-armoyu-header-border ml-2 md:ml-0", children: _jsx(Link, { href: "/", className: "text-xl font-black tracking-tighter bg-clip-text text-transparent bg-gradient-to-r from-blue-500 to-indigo-600 dark:from-white dark:to-gray-400 hover:opacity-80 transition-opacity uppercase italic", children: "ARMOYU" }) }), _jsx("nav", { className: "hidden md:flex items-center gap-1 xl:gap-2 mx-4", children: navItems.map((item) => (_jsxs("div", { className: "relative group", children: [_jsxs(Link, { href: item.href, className: "px-3 xl:px-4 py-2 rounded-xl text-sm font-bold text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-all flex items-center gap-1.5 whitespace-nowrap", children: [item.name, item.submenu && (_jsx(Menu, { size: 14, className: "opacity-50 group-hover:rotate-90 transition-transform" }))] }), item.submenu && (_jsx("div", { className: "absolute top-full left-0 pt-3 opacity-0 translate-y-4 pointer-events-none group-hover:opacity-100 group-hover:translate-y-0 group-hover:pointer-events-auto transition-all duration-300 z-50", children: _jsx("div", { className: "bg-white/95 dark:bg-[#12121a]/95 backdrop-blur-xl border border-gray-200 dark:border-white/10 rounded-[28px] shadow-2xl p-2 w-56 overflow-hidden animate-in fade-in slide-in-from-top-2 duration-200", children: item.submenu.map((sub) => (_jsxs(Link, { href: sub.href, className: "flex items-center gap-2.5 px-4 py-3 rounded-xl text-xs font-black uppercase tracking-widest text-armoyu-text-muted hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-500/5 transition-all decoration-0 group/sub", children: [_jsx("div", { className: "w-1.5 h-1.5 rounded-full bg-blue-500/40 group-hover/sub:bg-blue-500 transition-colors" }), sub.name] }, sub.name))) }) }))] }, item.name))) }), _jsx("div", { className: "hidden lg:flex items-center flex-1 max-w-[280px] ml-auto relative", children: _jsxs("div", { className: "relative w-full group", children: [_jsx("div", { className: "absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none", children: _jsx(Search, { size: 16, className: "text-armoyu-text-muted group-focus-within:text-blue-500 transition-colors" }) }), _jsx("input", { type: "text", className: "block w-full pl-11 pr-4 py-2.5 bg-black/5 dark:bg-white/5 border border-transparent focus:border-blue-500/50 rounded-2xl text-sm font-bold text-armoyu-text placeholder:text-armoyu-text-muted/50 focus:outline-none focus:ring-4 focus:ring-blue-500/10 transition-all", placeholder: "Ara...", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value), onFocus: () => setIsSearchOpen(true) }), isSearchOpen && (searchQuery.length > 0) && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setIsSearchOpen(false) }), _jsxs("div", { className: "absolute top-full right-0 mt-3 bg-white/95 dark:bg-[#12121a]/95 backdrop-blur-xl border border-gray-200 dark:border-white/10 rounded-[28px] shadow-2xl z-50 overflow-hidden animate-in fade-in zoom-in-95 duration-200 w-[350px]", children: [searchResults.users.length === 0 && searchResults.groups.length === 0 && searchResults.schools.length === 0 ? (_jsxs("div", { className: "p-8 text-center", children: [_jsx("div", { className: "w-12 h-12 bg-black/5 dark:bg-white/5 rounded-full flex items-center justify-center mx-auto mb-3", children: _jsx(Search, { size: 20, className: "text-armoyu-text-muted opacity-50" }) }), _jsx("p", { className: "text-xs font-black text-armoyu-text uppercase tracking-widest", children: "Sonu\u00E7 Bulunamad\u0131" }), _jsx("p", { className: "text-[10px] text-armoyu-text-muted mt-1", children: "Farkl\u0131 bir anahtar kelime dene." })] })) : (_jsxs("div", { className: "max-h-[70vh] overflow-y-auto p-2 space-y-4 py-4", children: [searchResults.users.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "px-4 mb-2 text-[10px] font-black text-armoyu-text-muted uppercase tracking-[0.2em] flex items-center gap-2", children: [_jsx(User, { size: 12 }), " Oyuncular"] }), _jsx("div", { className: "space-y-1", children: searchResults.users.map((u) => (_jsxs(Link, { href: `/oyuncular/${u.username}`, onClick: closeSearch, className: "flex items-center gap-3 p-3 rounded-2xl hover:bg-blue-500/10 transition-colors group", children: [_jsx("img", { src: u.avatar, className: "w-10 h-10 rounded-xl object-cover ring-2 ring-transparent group-hover:ring-blue-500/30 transition-all", alt: u.displayName }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-black text-armoyu-text group-hover:text-blue-500 transition-colors", children: u.displayName }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: ["@", u.username] })] }), _jsx(ArrowRight, { size: 14, className: "ml-auto opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all text-blue-500" })] }, u.username))) })] })), searchResults.groups.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "px-4 mb-2 text-[10px] font-black text-armoyu-text-muted uppercase tracking-[0.2em] flex items-center gap-2", children: [_jsx(Users, { size: 12 }), " Gruplar"] }), _jsx("div", { className: "space-y-1", children: searchResults.groups.map((g) => (_jsxs(Link, { href: `/gruplar/${g.id}`, onClick: closeSearch, className: "flex items-center gap-3 p-3 rounded-2xl hover:bg-emerald-500/10 transition-colors group", children: [_jsx("img", { src: g.logo, className: "w-10 h-10 rounded-xl object-cover ring-2 ring-transparent group-hover:ring-emerald-500/30 transition-all", alt: g.name }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-black text-armoyu-text group-hover:text-emerald-500 transition-colors", children: g.name }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: [g.memberCount || 0, " \u00DCye"] })] }), _jsx(ArrowRight, { size: 14, className: "ml-auto opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all text-emerald-500" })] }, g.id))) })] })), searchResults.schools.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "px-4 mb-2 text-[10px] font-black text-armoyu-text-muted uppercase tracking-[0.2em] flex items-center gap-2", children: [_jsx(GraduationCap, { size: 12 }), " Okullar"] }), _jsx("div", { className: "space-y-1", children: searchResults.schools.map((s) => (_jsxs(Link, { href: `/egitim/${s.slug}`, onClick: closeSearch, className: "flex items-center gap-3 p-3 rounded-2xl hover:bg-blue-500/10 transition-colors group", children: [_jsx("img", { src: s.logo, className: "w-10 h-10 rounded-xl object-contain bg-white p-1 ring-2 ring-transparent group-hover:ring-blue-500/30 transition-all", alt: s.name }), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-black text-armoyu-text group-hover:text-blue-500 transition-colors", children: s.name }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: [s.memberCount || 0, " \u00DCye"] })] }), _jsx(ArrowRight, { size: 14, className: "ml-auto opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all text-blue-500" })] }, s.id))) })] }))] })), _jsx("div", { className: "p-3 bg-black/5 dark:bg-white/5 border-t border-gray-200 dark:border-white/10 text-center", children: _jsx("span", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: "Arama modunu kapatmak i\u00E7in d\u0131\u015Far\u0131 t\u0131kla" }) })] })] }))] }) }), _jsxs("div", { className: "flex-shrink-0 pl-4 md:pl-8 border-l border-armoyu-header-border flex items-center gap-2 md:gap-4 h-full ml-auto md:ml-0", children: [_jsx("button", { className: "lg:hidden p-2 rounded-xl text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-all", onClick: () => setIsSearchOpen(true), children: _jsx(Search, { size: 22 }) }), user && (_jsxs("div", { className: "relative", children: [_jsxs("button", { onClick: () => setIsNotificationOpen(!isNotificationOpen), className: `relative p-2 rounded-xl transition-all ${isNotificationOpen ? 'bg-blue-500 text-white shadow-lg shadow-blue-500/30' : 'text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5'}`, title: "Bildirimler", children: [_jsx(Bell, { size: 22 }), unreadCount > 0 && (_jsx("span", { className: "absolute -top-0.5 -right-0.5 w-5 h-5 bg-red-500 text-white text-[10px] font-black flex items-center justify-center rounded-full border-2 border-armoyu-header-bg animate-bounce", children: unreadCount }))] }), isNotificationOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setIsNotificationOpen(false) }), _jsxs("div", { className: "absolute right-0 mt-3 w-80 md:w-96 bg-white/95 dark:bg-[#12121a]/95 backdrop-blur-xl border border-gray-200 dark:border-white/10 rounded-[32px] shadow-2xl z-50 overflow-hidden animate-in fade-in zoom-in-95 duration-200", children: [_jsxs("div", { className: "p-5 border-b border-gray-200 dark:border-white/10 flex justify-between items-center bg-gray-50/50 dark:bg-white/5", children: [_jsx("h4", { className: "text-[11px] font-black text-armoyu-text uppercase tracking-[0.2em]", children: "B\u0130LD\u0130R\u0130MLER" }), _jsx("button", { onClick: markAllAsRead, className: "text-[10px] font-bold text-blue-500 hover:text-blue-400 transition-colors uppercase tracking-widest", children: "Hepsini Oku" })] }), _jsx("div", { className: "max-h-[450px] overflow-y-auto p-1.5", children: (session?.notifications || []).length > 0 ? ((session?.notifications || []).map((notif) => (_jsxs("div", { onClick: () => handleNotificationClick(notif), className: `p-4 rounded-2xl hover:bg-black/5 dark:hover:bg-white/5 transition-all group flex gap-4 ${!notif.isRead ? 'bg-blue-500/5' : ''}`, children: [_jsxs("div", { className: "relative shrink-0", children: [_jsx("img", { src: notif.sender?.avatar, className: "w-11 h-11 rounded-2xl object-cover ring-2 ring-black/5 dark:ring-white/5 shadow-sm", alt: "Sender" }), _jsxs("div", { className: "absolute -bottom-1 -right-1 w-5 h-5 rounded-lg bg-blue-500 border-2 border-white dark:border-[#12121a] flex items-center justify-center text-white shadow-sm", children: [(notif.type === 'POST_LIKE') && _jsx(Flag, { size: 10, fill: "currentColor" }), (notif.type === 'POST_COMMENT') && _jsx(MessageSquare, { size: 10, fill: "currentColor" }), (notif.type === 'GROUP_INVITE') && _jsx(Users, { size: 10, fill: "currentColor" }), (notif.category === 'SYSTEM') && _jsx(ShieldAlert, { size: 10, fill: "currentColor" })] })] }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex justify-between items-start mb-0.5", children: [_jsx("p", { className: "text-sm font-black text-armoyu-text truncate", children: notif.title }), _jsx("span", { className: "text-[9px] font-bold text-armoyu-text-muted uppercase tracking-tighter", children: notif.createdAt })] }), _jsx("p", { className: "text-[11px] font-medium text-armoyu-text-muted leading-relaxed line-clamp-2", children: notif.message })] }), !notif.isRead && _jsx("div", { className: "w-2.5 h-2.5 rounded-full bg-blue-500 mt-2 shadow-[0_0_10px_rgba(59,130,246,0.6)]" })] }, notif.id)))) : (_jsxs("div", { className: "py-16 text-center", children: [_jsx(Bell, { size: 40, className: "mx-auto text-armoyu-text-muted/20 mb-4" }), _jsx("p", { className: "text-xs font-black text-armoyu-text uppercase tracking-widest", children: "Bildirim Bulunmuyor" })] })) })] })] }))] })), !isLoading && (user ? (_jsxs("button", { onClick: () => setIsUserMenuOpen(true), className: "flex items-center gap-3 p-1 rounded-full hover:bg-black/5 dark:hover:bg-white/5 transition-colors border border-transparent hover:border-armoyu-header-border focus:outline-none", title: "Profilim", children: [_jsx("img", { src: user.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Armoyu", alt: "Avatar", className: "w-8 h-8 rounded-full border border-blue-500/50 shadow-[0_0_10px_rgba(59,130,246,0.5)] object-cover bg-white/5" }), _jsx("span", { className: "text-sm font-bold text-armoyu-text hidden md:inline-block pr-2", children: user.displayName.split(' ')[0] })] })) : (_jsx("button", { onClick: () => setIsLoginModalOpen(true), className: "flex items-center justify-center w-10 h-10 rounded-full bg-black/5 dark:bg-white/5 hover:bg-black/10 dark:hover:bg-white/10 text-armoyu-text-muted hover:text-blue-600 dark:hover:text-blue-400 transition-all border border-armoyu-header-border shadow-sm", title: "Giri\u015F Yap", children: _jsxs("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", children: [_jsx("path", { d: "M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2" }), _jsx("circle", { cx: "12", cy: "7", r: "4" })] }) }))), isLoading && (_jsx("div", { className: "w-8 h-8 rounded-full bg-black/5 dark:bg-white/5 animate-pulse border border-armoyu-header-border" }))] })] }) }), isSearchOpen && (_jsxs("div", { className: "fixed inset-0 z-[100] bg-white dark:bg-[#0a0a0b] flex flex-col lg:hidden animate-in fade-in slide-in-from-top duration-300", children: [_jsxs("div", { className: "flex items-center gap-4 p-4 border-b border-gray-200 dark:border-white/10", children: [_jsx("button", { onClick: closeSearch, className: "p-2 text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-colors", children: _jsx(ArrowLeft, { size: 24 }) }), _jsx("input", { autoFocus: true, type: "text", className: "flex-1 bg-transparent border-none text-lg font-bold text-armoyu-text focus:outline-none placeholder:text-armoyu-text-muted/30", placeholder: "Kimi aram\u0131\u015Ft\u0131n?", value: searchQuery, onChange: (e) => setSearchQuery(e.target.value) }), searchQuery.length > 0 && (_jsx("button", { onClick: () => setSearchQuery(''), className: "p-2 text-armoyu-text-muted hover:text-red-500 transition-colors", children: _jsx(X, { size: 20 }) }))] }), _jsx("div", { className: "flex-1 overflow-y-auto p-4 hide-scrollbar", children: searchQuery.length > 0 ? (searchResults.users.length === 0 && searchResults.groups.length === 0 && searchResults.schools.length === 0 ? (_jsxs("div", { className: "py-20 text-center", children: [_jsx(Search, { size: 48, className: "mx-auto text-armoyu-text-muted/10 mb-4" }), _jsx("p", { className: "text-sm font-black text-armoyu-text uppercase tracking-widest", children: "Sonu\u00E7 Bulunamad\u0131" })] })) : (_jsxs("div", { className: "space-y-8", children: [searchResults.users.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "mb-4 text-[11px] font-black text-armoyu-text-muted uppercase tracking-[0.3em] flex items-center gap-2", children: [_jsx(User, { size: 14 }), " Oyuncular (", searchResults.users.length, ")"] }), _jsx("div", { className: "space-y-2", children: searchResults.users.map((u) => (_jsxs(Link, { href: `/oyuncular/${u.username}`, onClick: closeSearch, className: "flex items-center gap-4 p-3 rounded-[24px] bg-black/5 dark:bg-white/5 border border-transparent active:scale-95 transition-all", children: [_jsx("img", { src: u.avatar, className: "w-12 h-12 rounded-2xl object-cover shadow-lg", alt: u.displayName }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-black text-armoyu-text truncate", children: u.displayName }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: ["@", u.username] })] }), _jsx(ArrowRight, { size: 18, className: "text-blue-500" })] }, u.username))) })] })), searchResults.groups.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "mb-4 text-[11px] font-black text-armoyu-text-muted uppercase tracking-[0.3em] flex items-center gap-2", children: [_jsx(Users, { size: 14 }), " Gruplar (", searchResults.groups.length, ")"] }), _jsx("div", { className: "space-y-2", children: searchResults.groups.map((g) => (_jsxs(Link, { href: `/gruplar/${g.id}`, onClick: closeSearch, className: "flex items-center gap-4 p-3 rounded-[24px] bg-black/5 dark:bg-white/5 border border-transparent active:scale-95 transition-all", children: [_jsx("img", { src: g.logo, className: "w-12 h-12 rounded-2xl object-cover shadow-lg", alt: g.name }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-black text-armoyu-text truncate", children: g.name }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: [g.memberCount || 0, " \u00DCye"] })] }), _jsx(ArrowRight, { size: 18, className: "text-emerald-500" })] }, g.id))) })] })), searchResults.schools.length > 0 && (_jsxs("div", { children: [_jsxs("h5", { className: "mb-4 text-[11px] font-black text-armoyu-text-muted uppercase tracking-[0.3em] flex items-center gap-2", children: [_jsx(GraduationCap, { size: 14 }), " Okullar (", searchResults.schools.length, ")"] }), _jsx("div", { className: "space-y-2", children: searchResults.schools.map((s) => (_jsxs(Link, { href: `/egitim/${s.slug}`, onClick: closeSearch, className: "flex items-center gap-4 p-3 rounded-[32px] bg-black/5 dark:bg-white/5 border border-transparent active:scale-95 transition-all", children: [_jsx("img", { src: s.logo, className: "w-14 h-14 rounded-2xl object-contain bg-white p-2 shadow-lg", alt: s.name }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "font-black text-armoyu-text truncate italic", children: s.name }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest", children: [s.memberCount || 0, " \u00DCye"] })] }), _jsx(ArrowRight, { size: 20, className: "text-blue-500" })] }, s.id))) })] }))] }))) : (_jsx("div", { className: "py-12 text-center text-armoyu-text-muted", children: _jsx("p", { className: "text-xs font-bold uppercase tracking-widest", children: "Aramak i\u00E7in yazmaya ba\u015Fla..." }) })) })] })), isMobileMenuOpen && (_jsxs("div", { className: "fixed inset-0 z-50 flex animate-in fade-in duration-200", children: [_jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-sm", onClick: () => setIsMobileMenuOpen(false) }), _jsxs("div", { className: "relative w-[280px] max-w-[80vw] h-full glass-panel bg-armoyu-drawer-bg border-r border-armoyu-drawer-border shadow-2xl flex flex-col pt-6 pb-8 px-6 animate-in slide-in-from-left duration-300", children: [_jsxs("div", { className: "flex items-center justify-between mb-8 border-b border-armoyu-drawer-border pb-4", children: [_jsx(Link, { href: "/", onClick: () => setIsMobileMenuOpen(false), className: "text-xl font-extrabold tracking-wider text-armoyu-text hover:text-blue-500 transition-colors", children: "ARMOYU" }), _jsx("button", { onClick: () => setIsMobileMenuOpen(false), className: "text-armoyu-text-muted hover:text-armoyu-text transition-colors bg-black/5 dark:bg-white/5 p-2 rounded-lg hover:bg-black/10 dark:hover:bg-white/10 border border-armoyu-drawer-border", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), _jsxs("nav", { className: "flex-1 overflow-y-auto hide-scrollbar space-y-1 pr-2", children: [user && (_jsxs("button", { onClick: goToMyProfile, className: "w-full flex items-center gap-3 py-3.5 px-4 rounded-xl text-blue-600 dark:text-blue-400 bg-blue-500/5 hover:bg-blue-500/10 transition-all text-sm font-black border border-blue-500/10 mb-2 group/mobprof", children: [_jsx(User, { size: 20, className: "group-hover/mobprof:scale-110 transition-transform" }), "Profilim", _jsx(ArrowRight, { size: 16, className: "ml-auto opacity-40 group-hover/mobprof:opacity-100 group-hover/mobprof:translate-x-1 transition-all" })] })), navItems.map((item, idx) => (_jsx("div", { children: item.submenu ? (_jsxs("div", { className: "space-y-1", children: [_jsx("div", { className: "w-full flex items-center justify-between px-4 py-3.5 rounded-xl text-sm font-bold text-armoyu-text-muted", children: _jsx("span", { children: item.name }) }), _jsx("div", { className: "pl-3 space-y-1 border-l border-black/5 dark:border-white/10 ml-4", children: item.submenu.map((sub, sidx) => (_jsx(Link, { href: sub.href, onClick: () => setIsMobileMenuOpen(false), className: "w-full text-left px-4 py-2.5 rounded-xl text-sm font-bold text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-all block", children: sub.name }, sidx))) })] })) : (_jsx(Link, { href: item.href, onClick: () => setIsMobileMenuOpen(false), className: "block py-3.5 px-4 rounded-xl text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-all text-sm font-bold border border-transparent", children: item.name })) }, idx)))] }), _jsxs("div", { className: "mt-6 pt-6 border-t border-armoyu-drawer-border space-y-3", children: [_jsxs("button", { onClick: toggleTheme, className: "w-full py-3 px-4 rounded-xl bg-black/5 dark:bg-white/5 border border-armoyu-drawer-border text-armoyu-text-muted hover:text-armoyu-text flex items-center justify-between transition-colors font-bold text-sm", children: [_jsx("span", { children: "Tema De\u011Fi\u015Ftir" }), theme === 'dark' ? (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("circle", { cx: "12", cy: "12", r: "5" }), _jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), _jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), _jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), _jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), _jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), _jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), _jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), _jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] })) : (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }))] }), user ? (_jsx("button", { onClick: () => { setIsMobileMenuOpen(false); setIsUserMenuOpen(true); }, className: "w-full py-4 px-4 rounded-xl font-bold bg-black/5 dark:bg-white/5 border border-armoyu-drawer-border text-armoyu-text flex justify-center items-center gap-2 hover:bg-black/10 dark:hover:bg-white/10 transition-colors", children: "Profil Men\u00FCs\u00FC" })) : (_jsx("button", { onClick: () => { setIsMobileMenuOpen(false); setIsLoginModalOpen(true); }, className: "w-full py-4 px-4 rounded-xl bg-gradient-to-r from-blue-600 to-blue-500 text-white transition-all text-md font-bold shadow-[0_0_15px_rgba(37,99,235,0.4)]", children: "Giri\u015F Yap / Kay\u0131t Ol" }))] })] })] })), isUserMenuOpen && user && (_jsxs("div", { className: "fixed inset-0 z-[60] flex justify-end animate-in fade-in duration-200", children: [_jsx("div", { className: "absolute inset-0 bg-black/40 backdrop-blur-sm", onClick: () => setIsUserMenuOpen(false) }), _jsxs("div", { className: "relative w-[340px] max-w-[85vw] h-full glass-panel bg-armoyu-drawer-bg border-l border-armoyu-drawer-border shadow-2xl flex flex-col animate-in slide-in-from-right duration-300", children: [_jsxs("div", { className: "p-6 border-b border-armoyu-drawer-border flex justify-between items-start relative overflow-hidden group", children: [_jsx("div", { className: "absolute top-0 right-0 w-32 h-32 bg-blue-500/20 blur-[50px] -z-10 rounded-full" }), _jsxs("div", { className: "flex gap-4 items-center", children: [_jsx("img", { src: user.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Armoyu", alt: "Avatar", className: "w-14 h-14 rounded-full border-2 border-blue-500 shadow-[0_0_15px_rgba(59,130,246,0.4)] object-cover bg-white/5" }), _jsxs("div", { children: [_jsx("h3", { className: "text-armoyu-text font-bold text-lg leading-tight truncate max-w-[150px]", children: user.displayName }), _jsxs("span", { className: "text-blue-600 dark:text-blue-400 text-sm font-medium", children: ["@", user.username] })] })] }), _jsx("button", { onClick: () => setIsUserMenuOpen(false), className: "text-armoyu-text-muted hover:text-armoyu-text transition-colors bg-black/5 dark:bg-white/5 p-1.5 rounded-lg hover:bg-black/10 dark:hover:bg-white/10 border border-armoyu-drawer-border", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), _jsxs("nav", { className: "flex-1 overflow-y-auto p-4 space-y-1.5 mt-2 hide-scrollbar", children: [_jsxs("button", { onClick: goToMyProfile, className: "w-full flex items-center gap-3 p-3 text-blue-600 dark:text-blue-400 bg-blue-500/5 hover:bg-blue-500/10 rounded-xl transition-all font-black border border-blue-500/20 text-left focus:outline-none group/prof mb-1", children: [_jsx(User, { size: 18, className: "group-hover/prof:scale-110 transition-transform" }), "Profilime Git", _jsx(ArrowRight, { size: 14, className: "ml-auto opacity-40 group-hover/prof:opacity-100 group-hover/prof:translate-x-1 transition-all" })] }), ['admin', 'member_mgmt', 'discipline', 'event_mgmt'].includes(user.role?.id || '') && (_jsxs(Link, { href: "/yonetim", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 bg-blue-500/10 dark:bg-blue-500/20 text-blue-600 dark:text-blue-400 border border-blue-500/30 rounded-xl transition-all font-black shadow-[0_0_15px_rgba(59,130,246,0.15)] mb-2 group animate-in slide-in-from-right-4 duration-500", children: [_jsx(ShieldCheck, { size: 18, className: "group-hover:scale-110 transition-transform" }), "Y\u00F6netim Paneli", _jsx(Crown, { size: 14, className: "ml-auto opacity-50" })] })), _jsxs(Link, { href: "/yazilarim", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M12 20h9" }), _jsx("path", { d: "M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4L16.5 3.5z" })] }), "Yaz\u0131lar\u0131m"] }), _jsxs(Link, { href: "/yazilarim", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: _jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) }), "Yorumlar\u0131m"] }), _jsxs(Link, { href: "/anketler", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), _jsx("line", { x1: "12", y1: "8", x2: "12", y2: "16" }), _jsx("line", { x1: "8", y1: "12", x2: "12", y2: "16" }), _jsx("line", { x1: "16", y1: "10", x2: "16", y2: "16" })] }), "Anketler"] }), _jsxs("div", { className: "space-y-1", children: [_jsxs("button", { onClick: () => setIsGroupsSubmenuOpen(!isGroupsSubmenuOpen), className: `w-full flex items-center gap-3 p-3 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border text-left focus:outline-none ${isGroupsSubmenuOpen ? 'text-blue-500 bg-blue-500/5' : 'text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5'}`, children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2" }), _jsx("circle", { cx: "9", cy: "7", r: "4" }), _jsx("path", { d: "M23 21v-2a4 4 0 0 0-3-3.87" }), _jsx("path", { d: "M16 3.13a4 4 0 0 1 0 7.75" })] }), "Gruplar\u0131m", _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", className: `ml-auto transition-transform duration-300 ${isGroupsSubmenuOpen ? 'rotate-180' : ''}`, children: _jsx("polyline", { points: "6 9 12 15 18 9" }) })] }), isGroupsSubmenuOpen && (_jsxs("div", { className: "pl-4 space-y-1 mt-1 animate-in slide-in-from-top-2 duration-200", children: [(user.groups || []).length > 0 ? ((user.groups || []).map((group, gidx) => (_jsxs(Link, { href: `/gruplar/${group.name.toLowerCase().replace(/\s+/g, '-')}`, onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-2.5 rounded-xl text-xs font-bold text-armoyu-text-muted hover:text-blue-500 hover:bg-black/5 dark:hover:bg-white/5 transition-all", children: [_jsx("img", { src: group.logo, className: "w-7 h-7 rounded-lg bg-white dark:bg-zinc-800 border border-armoyu-drawer-border" }), _jsx("span", { className: "truncate", children: group.name })] }, gidx)))) : (_jsx("div", { className: "py-3 px-4 text-center bg-black/5 dark:bg-white/5 rounded-xl border border-dashed border-armoyu-drawer-border mx-2", children: _jsxs("span", { className: "text-[10px] font-bold text-armoyu-text-muted opacity-60 block leading-tight", children: ["Hen\u00FCz bir gruba", _jsx("br", {}), "dahil de\u011Filsin"] }) })), _jsx(Link, { href: "/gruplar", onClick: () => setIsUserMenuOpen(false), className: "flex items-center justify-center p-2.5 rounded-xl text-[10px] font-black text-blue-500/60 hover:text-blue-500 hover:bg-blue-500/5 transition-all uppercase tracking-widest", children: "T\u00FCm Gruplar\u0131 G\u00F6r" })] }))] }), _jsxs(Link, { href: "/cekilisler", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("polyline", { points: "20 12 20 22 4 22 4 12" }), _jsx("rect", { x: "2", y: "7", width: "20", height: "5" }), _jsx("line", { x1: "12", y1: "22", x2: "12", y2: "7" }), _jsx("path", { d: "M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z" }), _jsx("path", { d: "M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z" })] }), "\u00C7ekili\u015F"] }), _jsxs(Link, { href: "/egitim", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-armoyu-text-muted hover:text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 rounded-xl transition-all font-medium border border-transparent hover:border-armoyu-drawer-border", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("path", { d: "M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z" }), _jsx("path", { d: "M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z" })] }), "E\u011Fitim"] }), _jsxs(Link, { href: "/destek", onClick: () => setIsUserMenuOpen(false), className: "flex items-center gap-3 p-3 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/10 rounded-xl transition-all font-bold border border-transparent hover:border-emerald-500/20 mt-2", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }), _jsx("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })] }), "Destek Bildirimleri"] })] }), _jsxs("div", { className: "p-4 border-t border-armoyu-drawer-border space-y-3", children: [_jsxs("button", { onClick: toggleTheme, className: "w-full py-3 px-4 rounded-xl bg-black/5 dark:bg-white/5 border border-armoyu-drawer-border text-armoyu-text-muted hover:text-armoyu-text flex items-center justify-between transition-colors font-bold text-sm", children: [_jsx("span", { children: "Koyu / A\u00E7\u0131k Tema De\u011Fi\u015Ftir" }), theme === 'dark' ? (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [_jsx("circle", { cx: "12", cy: "12", r: "5" }), _jsx("line", { x1: "12", y1: "1", x2: "12", y2: "3" }), _jsx("line", { x1: "12", y1: "21", x2: "12", y2: "23" }), _jsx("line", { x1: "4.22", y1: "4.22", x2: "5.64", y2: "5.64" }), _jsx("line", { x1: "18.36", y1: "18.36", x2: "19.78", y2: "19.78" }), _jsx("line", { x1: "1", y1: "12", x2: "3", y2: "12" }), _jsx("line", { x1: "21", y1: "12", x2: "23", y2: "12" }), _jsx("line", { x1: "4.22", y1: "19.78", x2: "5.64", y2: "18.36" }), _jsx("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })] })) : (_jsx("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", children: _jsx("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) }))] }), _jsxs("button", { onClick: () => {
|
|
94
|
+
logout();
|
|
95
|
+
setIsUserMenuOpen(false);
|
|
96
|
+
}, className: "flex items-center gap-3 w-full p-4 text-white hover:text-white bg-red-600 hover:bg-red-500 hover:shadow-[0_0_15px_rgba(239,68,68,0.5)] border border-transparent rounded-xl transition-all font-bold", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4" }), _jsx("polyline", { points: "16 17 21 12 16 7" }), _jsx("line", { x1: "21", y1: "12", x2: "9", y2: "12" })] }), "Sistemden \u00C7\u0131k\u0131\u015F Yap"] })] })] })] })), _jsx(LoginModal, { isOpen: !user && isLoginModalOpen, onClose: () => setIsLoginModalOpen(false) })] }));
|
|
97
|
+
}
|
|
98
98
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare function LoginModal({ isOpen, onClose }: {
|
|
2
|
-
isOpen: boolean;
|
|
3
|
-
onClose: () => void;
|
|
4
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
1
|
+
export declare function LoginModal({ isOpen, onClose }: {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
5
5
|
//# sourceMappingURL=LoginModal.d.ts.map
|