chore: update @ciphera-net/ui dependency to version 0.0.40 in package.json and package-lock.json; add useOnlineStatus hook to LayoutContent for dynamic padding adjustment
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
import { OfflineBanner } from '@/components/OfflineBanner'
|
import { OfflineBanner } from '@/components/OfflineBanner'
|
||||||
import { Header, Footer } from '@ciphera-net/ui'
|
import { Header, Footer } from '@ciphera-net/ui'
|
||||||
import { useAuth } from '@/lib/auth/context'
|
import { useAuth } from '@/lib/auth/context'
|
||||||
|
import { useOnlineStatus } from '@/lib/hooks/useOnlineStatus'
|
||||||
import Link from 'next/link'
|
import Link from 'next/link'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { getUserOrganizations, switchContext } from '@/lib/api/organization'
|
import { getUserOrganizations, switchContext } from '@/lib/api/organization'
|
||||||
@@ -12,6 +13,7 @@ import { useRouter } from 'next/navigation'
|
|||||||
export default function LayoutContent({ children }: { children: React.ReactNode }) {
|
export default function LayoutContent({ children }: { children: React.ReactNode }) {
|
||||||
const auth = useAuth()
|
const auth = useAuth()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const isOnline = useOnlineStatus()
|
||||||
const [orgs, setOrgs] = useState<any[]>([])
|
const [orgs, setOrgs] = useState<any[]>([])
|
||||||
|
|
||||||
// * Fetch organizations for the header workspace switcher
|
// * Fetch organizations for the header workspace switcher
|
||||||
@@ -53,11 +55,9 @@ export default function LayoutContent({ children }: { children: React.ReactNode
|
|||||||
showFaq={false}
|
showFaq={false}
|
||||||
showSecurity={false}
|
showSecurity={false}
|
||||||
showPricing={true}
|
showPricing={true}
|
||||||
|
bottomContent={<OfflineBanner />}
|
||||||
/>
|
/>
|
||||||
<div className="pt-24">
|
<main className={`flex-1 pb-8 ${isOnline ? 'pt-24' : 'pt-32'}`}>
|
||||||
<OfflineBanner />
|
|
||||||
</div>
|
|
||||||
<main className="flex-1 pt-24 pb-8">
|
|
||||||
{children}
|
{children}
|
||||||
</main>
|
</main>
|
||||||
<Footer
|
<Footer
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export function OfflineBanner() {
|
|||||||
if (isOnline) return null;
|
if (isOnline) return null;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="bg-yellow-500/10 dark:bg-yellow-500/20 border-b border-yellow-500/20 dark:border-yellow-500/30 text-yellow-600 dark:text-yellow-400 px-4 py-2 text-sm flex items-center justify-center gap-2 font-medium">
|
<div className="bg-yellow-500/10 dark:bg-yellow-500/20 border-b border-yellow-500/20 dark:border-yellow-500/30 text-yellow-600 dark:text-yellow-400 px-4 sm:px-8 py-2 text-sm flex items-center justify-center gap-2 font-medium">
|
||||||
<FiWifiOff className="w-4 h-4" />
|
<FiWifiOff className="w-4 h-4" />
|
||||||
<span>You are currently offline. Changes may not be saved.</span>
|
<span>You are currently offline. Changes may not be saved.</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
9
package-lock.json
generated
9
package-lock.json
generated
@@ -8,7 +8,7 @@
|
|||||||
"name": "pulse-frontend",
|
"name": "pulse-frontend",
|
||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ciphera-net/ui": "^0.0.39",
|
"@ciphera-net/ui": "^0.0.40",
|
||||||
"@ducanh2912/next-pwa": "^10.2.9",
|
"@ducanh2912/next-pwa": "^10.2.9",
|
||||||
"axios": "^1.13.2",
|
"axios": "^1.13.2",
|
||||||
"country-flag-icons": "^1.6.4",
|
"country-flag-icons": "^1.6.4",
|
||||||
@@ -1467,9 +1467,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@ciphera-net/ui": {
|
"node_modules/@ciphera-net/ui": {
|
||||||
"version": "0.0.39",
|
"version": "0.0.40",
|
||||||
"resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.39/021cbbe26d3d960bc8e0b037be33eddae2694d96",
|
"resolved": "https://npm.pkg.github.com/download/@ciphera-net/ui/0.0.40/876fb0a795d894ad2f089ae5b0c7c91a7904c784",
|
||||||
"integrity": "sha512-UJF38xQZusy01D3i6lUWGnVt2PgIunsQjdoTG2n4r/XyxP/3O8JjliJH90BI++Aix6hAO/TN2on35MYIbAQuTg==",
|
"integrity": "sha512-CTtzNU8AIOuFEoU1cUDFutTmmaT8nnuoyIv7D6siT51nJz8MwnWEDbR0vC3t9QFAjx+jq2laK9MvZg4Z5IP3hQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@radix-ui/react-icons": "^1.3.0",
|
"@radix-ui/react-icons": "^1.3.0",
|
||||||
"clsx": "^2.1.0",
|
"clsx": "^2.1.0",
|
||||||
@@ -6841,6 +6841,7 @@
|
|||||||
"node_modules/next": {
|
"node_modules/next": {
|
||||||
"version": "16.1.2",
|
"version": "16.1.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@next/env": "16.1.2",
|
"@next/env": "16.1.2",
|
||||||
"@swc/helpers": "0.5.15",
|
"@swc/helpers": "0.5.15",
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
"type-check": "tsc --noEmit"
|
"type-check": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ciphera-net/ui": "^0.0.39",
|
"@ciphera-net/ui": "^0.0.40",
|
||||||
"@ducanh2912/next-pwa": "^10.2.9",
|
"@ducanh2912/next-pwa": "^10.2.9",
|
||||||
"axios": "^1.13.2",
|
"axios": "^1.13.2",
|
||||||
"country-flag-icons": "^1.6.4",
|
"country-flag-icons": "^1.6.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user