Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

add info box to let users know they can send an email to support (#29780)

Jordi Enric79f51f30a133
diff --git a/apps/studio/components/ui/CopyButton.tsx b/apps/studio/components/ui/CopyButton.tsx
index 926f9ce100e..e421901a61e 100644
--- a/apps/studio/components/ui/CopyButton.tsx
+++ b/apps/studio/components/ui/CopyButton.tsx
@@ -2,7 +2,7 @@ import { Check, Clipboard } from 'lucide-react'
import { useEffect, useState } from 'react'
import { copyToClipboard } from 'lib/helpers'
-import { Button, ButtonProps } from 'ui'
+import { Button, ButtonProps, cn } from 'ui'
export interface CopyButtonProps extends ButtonProps {
text: string
@@ -35,6 +35,12 @@ const CopyButton = ({
onClick?.(e)
}}
{...props}
+ className={cn(
+ {
+ 'px-1': iconOnly,
+ },
+ props.className
+ )}
icon={
showCopied ? <Check strokeWidth={2} className="text-brand" /> : props.icon ?? <Clipboard />
}
diff --git a/apps/studio/pages/support/new.tsx b/apps/studio/pages/support/new.tsx
index 1d933164c76..695d51e8e8e 100644
--- a/apps/studio/pages/support/new.tsx
+++ b/apps/studio/pages/support/new.tsx
@@ -1,4 +1,4 @@
-import { Loader2, Wrench } from 'lucide-react'
+import { ClipboardIcon, Loader2, Wrench } from 'lucide-react'
import Link from 'next/link'
import { useState } from 'react'
import SVG from 'react-inlinesvg'
@@ -10,12 +10,19 @@ import { useProjectsQuery } from 'data/projects/projects-query'
import { withAuth } from 'hooks/misc/withAuth'
import { BASE_PATH } from 'lib/constants'
import { Button, Tooltip_Shadcn_, TooltipContent_Shadcn_, TooltipTrigger_Shadcn_ } from 'ui'
+import InformationBox from 'components/ui/InformationBox'
+import { toast } from 'sonner'
+import { useRouter } from 'next/router'
+import { Tooltip, TooltipContent, TooltipTrigger } from '@ui/components/shadcn/ui/tooltip'
+import CopyButton from 'components/ui/CopyButton'
const SupportPage = () => {
const [sentCategory, setSentCategory] = useState<string>()
const [selectedProject, setSelectedProject] = useState<string>('no-project')
const { data, isLoading } = usePlatformStatusQuery()
const isHealthy = data?.isHealthy
+ const router = useRouter()
+ const { ref } = router.query
const { data: projectsData, isLoading: isLoadingProjects } = useProjectsQuery()
@@ -89,6 +96,70 @@ const SupportPage = () => {
/>
)}
</div>
+
+ <InformationBox
+ title="Having trouble submitting the form?"
+ description={
+ <div className="space-y-4">
+ <p className="flex items-center gap-x-1">
+ Email us directly at{' '}
+ <Link
+ href="mailto:[email protected]"
+ className="p-1 font-mono rounded-md text-foreground"
+ >
+ </Link>
+ <CopyButton
+ type="text"
+ iconOnly
+ onClick={() => {
+ toast.success('Copied to clipboard')
+ }}
+ />
+ </p>
+ <p>
+ Please, make sure to{' '}
+ <Tooltip>
+ <TooltipTrigger asChild>
+ <span className="text-foreground underline">include your project ID</span>
+ </TooltipTrigger>
+ <TooltipContent className="px-0">
+ <ul className="p-2">
+ <li className="grid pb-1 grid-cols-2 px-2 text-foreground-lighter">
+ <span>Project name</span>
+ <span>ID</span>
+ </li>
+ {projectsData?.map((project) => (
+ <li key={project.id} className="cursor-default">
+ <button
+ onClick={() => {
+ navigator.clipboard.writeText(project.ref)
+ toast.success('Copied to clipboard')
+ }}
+ className="w-full group py-1.5 px-2 gap-x-1 text-foreground hover:bg-muted grid grid-cols-2 text-left rounded-sm"
+ >
+ <span className="truncate max-w-40">{project.name}</span>
+ <span className="flex w-full gap-x-1 items-center font-mono">
+ {project.ref}
+ <ClipboardIcon
+ size="14"
+ className="text-foreground-lighter opacity-0 group-hover:opacity-100 transition-opacity"
+ />
+ </span>
+ </button>
+ </li>
+ ))}
+ </ul>
+ </TooltipContent>
+ </Tooltip>{' '}
+ and as much information as possible.
+ </p>
+ </div>
+ }
+ defaultVisibility={true}
+ hideCollapse={true}
+ />
</div>
</div>
</div>