feat: реализация модуля "Биржа" с переносом функционала из Маркета
- Создан новый раздел "Биржа" во всех кабинетах с иконкой TrendingUp - Перенесены вкладки "Инвестиции" и "Бизнес" из /market в /exchange - Обновлена навигация сайдбара: кнопка "Биржа" между "Экономика" и "Настройки" - Маркет теперь содержит только "Товары" и "Заявки" (2 вкладки вместо 4) - Сохранена полная функциональность без потери данных - Безопасная реализация с резервными копиями оригинальных компонентов Структура Exchange модуля: - src/components/exchange/exchange-dashboard.tsx - src/components/exchange/tabs/investments-tab.tsx - src/components/exchange/tabs/business-tab.tsx - src/components/exchange/types/exchange.types.ts - src/app/exchange/page.tsx 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -12,6 +12,7 @@ import {
|
||||
MessageCircle,
|
||||
Settings,
|
||||
Store,
|
||||
TrendingUp,
|
||||
Truck,
|
||||
Users,
|
||||
Warehouse,
|
||||
@ -28,7 +29,7 @@ import { useSidebar } from '@/hooks/useSidebar'
|
||||
|
||||
// Компонент для отображения логистических заявок (только для логистики)
|
||||
function LogisticsOrdersNotification() {
|
||||
const { data: pendingData, refetch: refetchPending } = useQuery(GET_PENDING_SUPPLIES_COUNT, {
|
||||
const { data: pendingData, refetch: _refetchPending } = useQuery(GET_PENDING_SUPPLIES_COUNT, {
|
||||
fetchPolicy: 'cache-first',
|
||||
errorPolicy: 'ignore',
|
||||
})
|
||||
@ -46,7 +47,7 @@ function LogisticsOrdersNotification() {
|
||||
|
||||
// Компонент для отображения поставок фулфилмента (только поставки, не заявки на партнерство)
|
||||
function FulfillmentSuppliesNotification() {
|
||||
const { data: pendingData, refetch: refetchPending } = useQuery(GET_PENDING_SUPPLIES_COUNT, {
|
||||
const { data: pendingData, refetch: _refetchPending } = useQuery(GET_PENDING_SUPPLIES_COUNT, {
|
||||
fetchPolicy: 'cache-first',
|
||||
errorPolicy: 'ignore',
|
||||
})
|
||||
@ -64,7 +65,7 @@ function FulfillmentSuppliesNotification() {
|
||||
|
||||
// Компонент для отображения входящих заказов поставщика (только входящие заказы, не заявки на партнерство)
|
||||
function WholesaleOrdersNotification() {
|
||||
const { data: pendingData, refetch: refetchPending } = useQuery(GET_PENDING_SUPPLIES_COUNT, {
|
||||
const { data: pendingData, refetch: _refetchPending } = useQuery(GET_PENDING_SUPPLIES_COUNT, {
|
||||
fetchPolicy: 'cache-first',
|
||||
errorPolicy: 'ignore',
|
||||
})
|
||||
@ -185,6 +186,10 @@ export function Sidebar({ isRootInstance = false }: { isRootInstance?: boolean }
|
||||
router.push('/settings')
|
||||
}
|
||||
|
||||
const handleExchangeClick = () => {
|
||||
router.push('/exchange')
|
||||
}
|
||||
|
||||
const handleMarketClick = () => {
|
||||
router.push('/market')
|
||||
}
|
||||
@ -256,6 +261,7 @@ export function Sidebar({ isRootInstance = false }: { isRootInstance?: boolean }
|
||||
const isHomeActive = pathname === '/home'
|
||||
const isEconomicsActive = pathname === '/economics'
|
||||
const isSettingsActive = pathname === '/settings'
|
||||
const isExchangeActive = pathname.startsWith('/exchange')
|
||||
const isMarketActive = pathname.startsWith('/market')
|
||||
const isMessengerActive = pathname.startsWith('/messenger')
|
||||
const isServicesActive = pathname.startsWith('/services')
|
||||
@ -679,6 +685,22 @@ export function Sidebar({ isRootInstance = false }: { isRootInstance?: boolean }
|
||||
{!isCollapsed && <span className="ml-3">Экономика</span>}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant={isExchangeActive ? 'secondary' : 'ghost'}
|
||||
className={`w-full ${
|
||||
isCollapsed ? 'justify-center px-2 h-9' : 'justify-start h-10'
|
||||
} text-left transition-all duration-200 text-xs ${
|
||||
isExchangeActive
|
||||
? 'bg-white/20 text-white hover:bg-white/30'
|
||||
: 'text-white/80 hover:bg-white/10 hover:text-white'
|
||||
} cursor-pointer`}
|
||||
onClick={handleExchangeClick}
|
||||
title={isCollapsed ? 'Биржа' : ''}
|
||||
>
|
||||
<TrendingUp className={`${isCollapsed ? 'h-4 w-4' : 'h-4 w-4'} flex-shrink-0`} />
|
||||
{!isCollapsed && <span className="ml-3">Биржа</span>}
|
||||
</Button>
|
||||
|
||||
<Button
|
||||
variant={isSettingsActive ? 'secondary' : 'ghost'}
|
||||
className={`w-full ${
|
||||
|
Reference in New Issue
Block a user