refactor: use custom toast from @ciphera-net/ui
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
import { ThemeProviders } from '@ciphera-net/ui'
|
import { ThemeProviders, Toaster } from '@ciphera-net/ui'
|
||||||
import { AuthProvider } from '@/lib/auth/context'
|
import { AuthProvider } from '@/lib/auth/context'
|
||||||
import { Toaster } from 'sonner'
|
|
||||||
import type { Metadata, Viewport } from 'next'
|
import type { Metadata, Viewport } from 'next'
|
||||||
import { Plus_Jakarta_Sans } from 'next/font/google'
|
import { Plus_Jakarta_Sans } from 'next/font/google'
|
||||||
import LayoutContent from './layout-content'
|
import LayoutContent from './layout-content'
|
||||||
@@ -49,24 +48,7 @@ export default function RootLayout({
|
|||||||
<ThemeProviders>
|
<ThemeProviders>
|
||||||
<AuthProvider>
|
<AuthProvider>
|
||||||
<LayoutContent>{children}</LayoutContent>
|
<LayoutContent>{children}</LayoutContent>
|
||||||
<Toaster
|
<Toaster />
|
||||||
position="top-center"
|
|
||||||
closeButton
|
|
||||||
theme="system"
|
|
||||||
className="toaster group"
|
|
||||||
toastOptions={{
|
|
||||||
classNames: {
|
|
||||||
toast: 'group toast group-[.toaster]:bg-white group-[.toaster]:dark:bg-neutral-900 group-[.toaster]:text-neutral-950 group-[.toaster]:dark:text-neutral-50 group-[.toaster]:border-neutral-200 group-[.toaster]:dark:border-neutral-800 group-[.toaster]:shadow-lg group-[.toaster]:rounded-xl font-medium',
|
|
||||||
description: 'group-[.toast]:text-neutral-500 group-[.toast]:dark:text-neutral-400',
|
|
||||||
actionButton: 'group-[.toast]:bg-neutral-900 group-[.toast]:dark:bg-neutral-50 group-[.toast]:text-neutral-50 group-[.toast]:dark:text-neutral-900',
|
|
||||||
cancelButton: 'group-[.toast]:bg-neutral-100 group-[.toast]:dark:bg-neutral-800 group-[.toast]:text-neutral-500 group-[.toast]:dark:text-neutral-400',
|
|
||||||
success: 'group-[.toast]:!text-green-600 group-[.toast]:dark:!text-green-400',
|
|
||||||
error: 'group-[.toast]:!text-red-600 group-[.toast]:dark:!text-red-400',
|
|
||||||
warning: 'group-[.toast]:!text-amber-600 group-[.toast]:dark:!text-amber-400',
|
|
||||||
info: 'group-[.toast]:!text-brand-orange group-[.toast]:dark:!text-brand-orange',
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</AuthProvider>
|
</AuthProvider>
|
||||||
</ThemeProviders>
|
</ThemeProviders>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { LoadingOverlay } from '@ciphera-net/ui'
|
|||||||
import SiteList from '@/components/sites/SiteList'
|
import SiteList from '@/components/sites/SiteList'
|
||||||
import { Button } from '@ciphera-net/ui'
|
import { Button } from '@ciphera-net/ui'
|
||||||
import { BarChartIcon, LockIcon, ZapIcon } from '@ciphera-net/ui'
|
import { BarChartIcon, LockIcon, ZapIcon } from '@ciphera-net/ui'
|
||||||
import { toast } from 'sonner'
|
import { toast } from '@ciphera-net/ui'
|
||||||
|
|
||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
const { user, loading: authLoading } = useAuth()
|
const { user, loading: authLoading } = useAuth()
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useParams, useSearchParams, useRouter } from 'next/navigation'
|
import { useParams, useSearchParams, useRouter } from 'next/navigation'
|
||||||
import { getPublicDashboard, getPublicStats, getPublicDailyStats, getPublicRealtime, getPublicPerformanceByPage, type DashboardData, type Stats, type DailyStat, type PerformanceByPageStat } from '@/lib/api/stats'
|
import { getPublicDashboard, getPublicStats, getPublicDailyStats, getPublicRealtime, getPublicPerformanceByPage, type DashboardData, type Stats, type DailyStat, type PerformanceByPageStat } from '@/lib/api/stats'
|
||||||
import { toast } from 'sonner'
|
import { toast } from '@ciphera-net/ui'
|
||||||
import { LoadingOverlay } from '@ciphera-net/ui'
|
import { LoadingOverlay } from '@ciphera-net/ui'
|
||||||
import Chart from '@/components/dashboard/Chart'
|
import Chart from '@/components/dashboard/Chart'
|
||||||
import TopPages from '@/components/dashboard/ContentStats'
|
import TopPages from '@/components/dashboard/ContentStats'
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { useParams, useRouter } from 'next/navigation'
|
|||||||
import { getSite, type Site } from '@/lib/api/sites'
|
import { getSite, type Site } from '@/lib/api/sites'
|
||||||
import { getStats, getRealtime, getDailyStats, getTopPages, getTopReferrers, getCountries, getCities, getRegions, getBrowsers, getOS, getDevices, getScreenResolutions, getEntryPages, getExitPages, getDashboard, getPerformanceByPage, type Stats, type DailyStat, type PerformanceByPageStat } from '@/lib/api/stats'
|
import { getStats, getRealtime, getDailyStats, getTopPages, getTopReferrers, getCountries, getCities, getRegions, getBrowsers, getOS, getDevices, getScreenResolutions, getEntryPages, getExitPages, getDashboard, getPerformanceByPage, type Stats, type DailyStat, type PerformanceByPageStat } from '@/lib/api/stats'
|
||||||
import { formatNumber, formatDuration, getDateRange } from '@/lib/utils/format'
|
import { formatNumber, formatDuration, getDateRange } from '@/lib/utils/format'
|
||||||
import { toast } from 'sonner'
|
import { toast } from '@ciphera-net/ui'
|
||||||
import { LoadingOverlay } from '@ciphera-net/ui'
|
import { LoadingOverlay } from '@ciphera-net/ui'
|
||||||
import { Select, DatePicker } from '@ciphera-net/ui'
|
import { Select, DatePicker } from '@ciphera-net/ui'
|
||||||
import ContentStats from '@/components/dashboard/ContentStats'
|
import ContentStats from '@/components/dashboard/ContentStats'
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { useEffect, useState } from 'react'
|
|||||||
import { useParams, useRouter } from 'next/navigation'
|
import { useParams, useRouter } from 'next/navigation'
|
||||||
import { getSite, type Site } from '@/lib/api/sites'
|
import { getSite, type Site } from '@/lib/api/sites'
|
||||||
import { getRealtimeVisitors, getSessionDetails, type Visitor, type SessionEvent } from '@/lib/api/realtime'
|
import { getRealtimeVisitors, getSessionDetails, type Visitor, type SessionEvent } from '@/lib/api/realtime'
|
||||||
import { toast } from 'sonner'
|
import { toast } from '@ciphera-net/ui'
|
||||||
import { LoadingOverlay } from '@ciphera-net/ui'
|
import { LoadingOverlay } from '@ciphera-net/ui'
|
||||||
|
|
||||||
function formatTimeAgo(dateString: string) {
|
function formatTimeAgo(dateString: string) {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useParams, useRouter } from 'next/navigation'
|
import { useParams, useRouter } from 'next/navigation'
|
||||||
import { getSite, updateSite, resetSiteData, deleteSite, type Site, type GeoDataLevel } from '@/lib/api/sites'
|
import { getSite, updateSite, resetSiteData, deleteSite, type Site, type GeoDataLevel } from '@/lib/api/sites'
|
||||||
import { toast } from 'sonner'
|
import { toast } from '@ciphera-net/ui'
|
||||||
import { LoadingOverlay } from '@ciphera-net/ui'
|
import { LoadingOverlay } from '@ciphera-net/ui'
|
||||||
import VerificationModal from '@/components/sites/VerificationModal'
|
import VerificationModal from '@/components/sites/VerificationModal'
|
||||||
import { PasswordInput } from '@ciphera-net/ui'
|
import { PasswordInput } from '@ciphera-net/ui'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { createSite } from '@/lib/api/sites'
|
import { createSite } from '@/lib/api/sites'
|
||||||
import { toast } from 'sonner'
|
import { toast } from '@ciphera-net/ui'
|
||||||
import { Button, Input } from '@ciphera-net/ui'
|
import { Button, Input } from '@ciphera-net/ui'
|
||||||
|
|
||||||
export default function NewSitePage() {
|
export default function NewSitePage() {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
OrganizationInvitation,
|
OrganizationInvitation,
|
||||||
Organization
|
Organization
|
||||||
} from '@/lib/api/organization'
|
} from '@/lib/api/organization'
|
||||||
import { toast } from 'sonner'
|
import { toast } from '@ciphera-net/ui'
|
||||||
import { motion, AnimatePresence } from 'framer-motion'
|
import { motion, AnimatePresence } from 'framer-motion'
|
||||||
import {
|
import {
|
||||||
AlertTriangleIcon,
|
AlertTriangleIcon,
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
} from '@ciphera-net/ui'
|
} from '@ciphera-net/ui'
|
||||||
import { Site } from '@/lib/api/sites'
|
import { Site } from '@/lib/api/sites'
|
||||||
import { getRealtime } from '@/lib/api/stats'
|
import { getRealtime } from '@/lib/api/stats'
|
||||||
import { toast } from 'sonner'
|
import { toast } from '@ciphera-net/ui'
|
||||||
|
|
||||||
interface VerificationModalProps {
|
interface VerificationModalProps {
|
||||||
isOpen: boolean
|
isOpen: boolean
|
||||||
|
|||||||
Reference in New Issue
Block a user