Добавлены новые зависимости для работы с эмодзи и улучшена структура базы данных. Реализована модель сообщений и обновлены компоненты для поддержки новых функций мессенджера. Обновлены запросы и мутации для работы с сообщениями и чатом.

This commit is contained in:
Bivekich
2025-07-16 22:07:38 +03:00
parent 823ef9a28c
commit 205c9eae98
33 changed files with 3288 additions and 229 deletions

View File

@ -10,7 +10,8 @@ import {
Settings,
LogOut,
Building2,
Store
Store,
MessageCircle
} from 'lucide-react'
export function Sidebar() {
@ -58,8 +59,13 @@ export function Sidebar() {
router.push('/market')
}
const handleMessengerClick = () => {
router.push('/messenger')
}
const isSettingsActive = pathname === '/settings'
const isMarketActive = pathname.startsWith('/market')
const isMessengerActive = pathname.startsWith('/messenger')
return (
<div className="fixed left-0 top-0 h-full w-56 bg-white/10 backdrop-blur-xl border-r border-white/20 p-3">
@ -67,30 +73,33 @@ export function Sidebar() {
{/* Информация о пользователе */}
<Card className="bg-white/10 backdrop-blur border-white/20 p-3 mb-4">
<div className="flex items-center space-x-2">
<Avatar className="h-10 w-10">
{user?.avatar ? (
<AvatarImage
src={user.avatar}
alt="Аватар пользователя"
className="w-full h-full object-cover"
/>
) : null}
<AvatarFallback className="bg-purple-500 text-white text-sm">
{getInitials()}
</AvatarFallback>
</Avatar>
<Card className="bg-gradient-to-br from-white/15 to-white/5 backdrop-blur border border-white/30 p-4 mb-4 shadow-lg">
<div className="flex items-center space-x-3">
<div className="relative">
<Avatar className="h-12 w-12 flex-shrink-0 ring-2 ring-white/20">
{user?.avatar ? (
<AvatarImage
src={user.avatar}
alt="Аватар пользователя"
className="w-full h-full object-cover"
/>
) : null}
<AvatarFallback className="bg-gradient-to-br from-purple-500 to-purple-600 text-white text-sm font-semibold">
{getInitials()}
</AvatarFallback>
</Avatar>
<div className="absolute -bottom-0.5 -right-0.5 w-3 h-3 bg-green-400 rounded-full border-2 border-white/20"></div>
</div>
<div className="flex-1 min-w-0">
<div className="flex items-center space-x-1 mb-1">
<Building2 className="h-3 w-3 text-white/60" />
<p className="text-white text-xs font-medium truncate">
{getOrganizationName()}
<p className="text-white text-sm font-semibold truncate mb-1" title={getOrganizationName()}>
{getOrganizationName()}
</p>
<div className="flex items-center space-x-1">
<div className="w-2 h-2 bg-purple-400 rounded-full flex-shrink-0"></div>
<p className="text-white/70 text-xs font-medium">
{getCabinetType()}
</p>
</div>
<p className="text-white/60 text-xs truncate">
{getCabinetType()}
</p>
</div>
</div>
</Card>
@ -109,6 +118,19 @@ export function Sidebar() {
<Store className="h-3 w-3 mr-2" />
Маркет
</Button>
<Button
variant={isMessengerActive ? "secondary" : "ghost"}
className={`w-full justify-start text-left transition-all duration-200 h-8 text-xs ${
isMessengerActive
? 'bg-white/20 text-white hover:bg-white/30'
: 'text-white/80 hover:bg-white/10 hover:text-white'
} cursor-pointer`}
onClick={handleMessengerClick}
>
<MessageCircle className="h-3 w-3 mr-2" />
Мессенджер
</Button>
<Button
variant={isSettingsActive ? "secondary" : "ghost"}