added adminbar to layout

This commit is contained in:
2025-10-10 13:35:09 -04:00
parent d8fbcbbf4d
commit 8bf4c7516f
13 changed files with 157 additions and 17 deletions

1
utilities/canUseDOM.ts Normal file
View File

@@ -0,0 +1 @@
export default !!(typeof window !== 'undefined' && window.document && window.document.createElement)

26
utilities/getURL.ts Normal file
View File

@@ -0,0 +1,26 @@
import canUseDOM from './canUseDOM'
export const getServerSideURL = () => {
return (
process.env.NEXT_PUBLIC_SERVER_URL ||
(process.env.VERCEL_PROJECT_PRODUCTION_URL
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
: 'http://localhost:3000')
)
}
export const getClientSideURL = () => {
if (canUseDOM) {
const protocol = window.location.protocol
const domain = window.location.hostname
const port = window.location.port
return `${protocol}//${domain}${port ? `:${port}` : ''}`
}
if (process.env.VERCEL_PROJECT_PRODUCTION_URL) {
return `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
}
return process.env.NEXT_PUBLIC_SERVER_URL || ''
}

6
utilities/ui.ts Normal file
View File

@@ -0,0 +1,6 @@
import { type ClassValue, clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}