33import 'chart.js/auto'
44import 'chartjs-adapter-date-fns'
55
6+ import { DialogTrigger } from '@radix-ui/react-dialog'
67import { LazyMotion , m } from 'framer-motion'
78import { PropsWithChildren } from 'react'
89import { TooltipProvider } from '~/components/ui/tooltip'
910import { useBreakpoint } from '~/lib/use-breakpoint'
1011import { useApp } from './app-provider'
1112import Sidebar from './sidebar'
13+ import { Dialog , DialogContent , DialogHeader , DialogTitle } from './ui/dialog'
1214
1315const loadFramerFeatures = ( ) => import ( './framer-features' ) . then ( ( res ) => res . default )
1416
@@ -17,17 +19,14 @@ export type LayoutProps = PropsWithChildren
1719export default function Layout ( { children } : LayoutProps ) {
1820 const { isPreview } = useApp ( )
1921 const isSmallBreakpoint = useBreakpoint ( 'lg' )
22+ const isNewDomain = location . hostname === 'database.build'
2023
2124 return (
2225 < LazyMotion features = { loadFramerFeatures } >
2326 < TooltipProvider delayDuration = { 0 } >
2427 < div className = "w-full h-full flex flex-col overflow-hidden" >
25- { isPreview && (
26- < div className = "px-3 py-3 flex justify-center text-sm text-center bg-neutral-800 text-white" >
27- Heads up! This is a preview version of postgres.new, so expect some changes here and
28- there.
29- </ div >
30- ) }
28+ { isPreview && < PreviewBanner /> }
29+ { ! isNewDomain && < RenameBanner /> }
3130 < main className = "flex-1 flex flex-col lg:flex-row min-h-0" >
3231 { /* TODO: make sidebar available on mobile */ }
3332 { ! isSmallBreakpoint && < Sidebar /> }
@@ -40,3 +39,43 @@ export default function Layout({ children }: LayoutProps) {
4039 </ LazyMotion >
4140 )
4241}
42+
43+ function PreviewBanner ( ) {
44+ return (
45+ < div className = "px-3 py-3 flex justify-center text-sm text-center bg-neutral-800 text-white" >
46+ Heads up! This is a preview version of postgres.new, so expect some changes here and there.
47+ </ div >
48+ )
49+ }
50+
51+ function RenameBanner ( ) {
52+ return (
53+ < div className = "px-3 py-3 flex justify-center text-sm text-center bg-neutral-800 text-white" >
54+ < span >
55+ Heads up - < strong > postgres.new</ strong > is renaming to < strong > database.build</ strong > .{ ' ' }
56+ < Dialog >
57+ < DialogTrigger className = "underline" > Why?</ DialogTrigger >
58+ < DialogContent className = "max-w-2xl" >
59+ < DialogHeader >
60+ < DialogTitle > Why is postgres.new renaming?</ DialogTitle >
61+ < div className = "py-2 border-b" />
62+ </ DialogHeader >
63+ < p >
64+ We are renaming due to a trademark conflict on the name "Postgres". To
65+ respect intellectual property rights, we are transitioning to our new name,{ ' ' }
66+ < a href = "https://database.build" className = "underline" >
67+ database.build
68+ </ a >
69+ .
70+ </ p >
71+ < p >
72+ { ' ' }
73+ Renaming will allow us to continue offering the same experience under a different name
74+ without any interruptions to the service.
75+ </ p >
76+ </ DialogContent >
77+ </ Dialog >
78+ </ span >
79+ </ div >
80+ )
81+ }
0 commit comments