Files
supabase/studio/components/layouts/ProjectLayout/LayoutHeader/HelpPopover.tsx
T
8057309e51 chore: upgrade next 13 + react 18 (#17839)
* update deps + image codemod (studio)

* update next links (studio)

* update deps

* update links (ui)

* remove next-transpile-modules

* move next-themes dependency

* chore: update ConfirmDialog

* chore: remove old ConfirmModal js file. migrated to TS

* dependency wrangling

* remove empty page

* update next links (www)

* First run bump react-data-grid-v7 beta 4

* fix package-lock.json

* more deps wrangling

* update recharts

* update sentry options

* fix some broken things in www

* studio fixes

* fix graphiql

* fix studio build

* fix menu hydration

* small build error

* update turbo

* fix www typescript errors

* docs image codemod

* links codemod docs

* fix docs typescript errors

* move useConsent to ui to prevent circular deps

* Fix links

* Fix homepage

* Fix links

* move studio/ to apps/

* Revert "move studio/ to apps/"

This reverts commit 1b0a985fcb.

* disable outputFileTracingRoot

* remove outputFileTracingRoot

* fix homepage product cards

* fix PrivacySettings links

* Fix links

* Fix the build for www.

* Minor fixes for JWTGenerator.

* Fix the docs and ui tests.

* Revert codehike back to 0.8.3

* remove ConfirmAlert()

* reenable babel because mobx hates me

* fix blog image and comparison page avatar

* Fix svg errors

* update image synthax

* Fix code hike

* Move the button in a div so that it doesn't inherit its parent height and make the button look weird.

* When components are defined in a component, they get recreated on each render. This makes them unstable in certain cases and causes infinite rerenders.

* Replace the next/head usage with next/script.

* Chore/upgrade next 13 fix table editor (#18431)

* fix table editor styling and fix row deletion logic

* Fix deleting selected rows from header, and fix checkboxes not clearing up

* Fix deleting all rows when filter applied, and fix deleting all rows

* Fix grid size styling issue

* Fix TS error

* Hydration errors

* studio org pages fixes

* fix more studio links

* audit logs fixes

* dropdown icon styling fixes

* fix some images in www

* upgrade to next 14

* try new sentry wrapper for api

* see if this is even invoked

* Revert "see if this is even invoked"

This reverts commit 86c3973ffa.

* Revert "try new sentry wrapper for api"

This reverts commit f67623ebad.

* Revert "upgrade to next 14"

This reverts commit a24dd6131e.

* chore: allow node version 19/20

* Try to fix the LogTable so that it renders with the newer "react-data-grid" version.

* Fix type errors in the log renderer code.

* Fix the replication screen.

* Add the CSS for the GraphiQL.

* Fix SQL editor results rendering

* Lint

* Fix SQL editor results height issue

* Fix auth RLS not invalidating RQ when toggling RLS

* Fix database tables new/edit column regressed

* Fix migrations page empty state if migrations schema not yet created

* Fix API side panel docs temp remove postgrest text for column description PK and FK

* Fix + improve timeout handling in SQL editor

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
Co-authored-by: Francesco Sansalvadore <f.sansalvadore@gmail.com>
Co-authored-by: Terry Sutton <saltcod@gmail.com>
Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
Co-authored-by: Kevin Grüneberg <k.grueneberg1994@gmail.com>
2023-10-31 05:51:46 +00:00

171 lines
5.9 KiB
TypeScript

import * as Tooltip from '@radix-ui/react-tooltip'
import Image from 'next/legacy/image'
import Link from 'next/link'
import { useRouter } from 'next/router'
import SVG from 'react-inlinesvg'
import {
Button,
IconActivity,
IconBookOpen,
IconHelpCircle,
IconMail,
IconMessageCircle,
IconTool,
Popover,
PopoverContent_Shadcn_,
PopoverTrigger_Shadcn_,
Popover_Shadcn_,
} from 'ui'
interface HelpPopoverProps {
alt?: boolean
}
const HelpPopover = ({ alt = false }: HelpPopoverProps) => {
const router = useRouter()
const projectRef = router.query.ref
const supportUrl = `/support/new${projectRef ? `?ref=${projectRef}` : ''}`
return (
<Popover_Shadcn_>
<Tooltip.Root delayDuration={0}>
<PopoverTrigger_Shadcn_ asChild>
<Tooltip.Trigger asChild>
<div className="relative flex items-center">
<Button
id="help-popover-button"
type={alt ? 'text' : 'default'}
className={alt ? 'px-1' : ''}
icon={
<IconHelpCircle
size={alt ? 18 : 16}
strokeWidth={1.5}
className={alt ? 'text-foreground-light' : 'text-foreground-lighter'}
/>
}
>
{!alt && <span>Help</span>}
</Button>
</div>
</Tooltip.Trigger>
</PopoverTrigger_Shadcn_>
{alt ? (
<Tooltip.Portal>
<Tooltip.Content side="bottom">
<Tooltip.Arrow className="radix-tooltip-arrow" />
<div
className={[
'rounded bg-scale-100 py-1 px-2 leading-none shadow',
'space-y-2 border border-scale-200',
].join(' ')}
>
<p className="text-xs text-foreground">Help</p>
</div>
</Tooltip.Content>
</Tooltip.Portal>
) : null}
</Tooltip.Root>
<PopoverContent_Shadcn_ className="w-[400px] space-y-4 p-0 py-5" align="end" side="bottom">
<div className="mb-5 space-y-4 px-5">
<h5 className="text-foreground">Need help with your project?</h5>
<p className="text-sm text-foreground-lighter">
For issues with your project hosted on supabase.com, or other inquiries about our hosted
services.
</p>
<div className="space-x-1">
<Button asChild type="default" icon={<IconTool />}>
<Link
href="https://supabase.com/docs/guides/platform/troubleshooting"
target="_blank"
rel="noreferrer"
>
Troubleshooting
</Link>
</Button>
<Button asChild type="text" size="tiny" icon={<IconBookOpen />}>
<Link href="https://supabase.com/docs/" target="_blank" rel="noreferrer">
Docs
</Link>
</Button>
<Button asChild type="text" size="tiny" icon={<IconActivity />}>
<Link href="https://status.supabase.com/" target="_blank" rel="noreferrer">
Supabase Status
</Link>
</Button>
</div>
<p className="text-sm text-foreground-lighter">
Expected response time is based on your billing plan. Pro and Pay as You Go plans are
prioritized.
</p>
<div>
<Button asChild type="default" icon={<IconMail />}>
<Link href={supportUrl}>Contact Support</Link>
</Button>
</div>
</div>
<Popover.Separator />
<div className="mb-4 space-y-2">
<div className="mb-4 px-5">
<h5 className={'mb-2'}>Reach out to the community</h5>
<p className="text-sm text-foreground-lighter">
For other support, including questions on our client libraries, advice, or best
practices.
</p>
</div>
<div className="px-5">
<div
className="relative space-y-2 overflow-hidden rounded px-5 py-4 pb-12 shadow-md"
style={{ background: '#404EED' }}
>
<a
href="https://discord.supabase.com"
target="_blank"
rel="noreferrer"
className="dark block cursor-pointer"
>
<Image
className="absolute left-0 top-0 opacity-50"
src={`${router.basePath}/img/support/discord-bg-small.jpg`}
layout="fill"
objectFit="cover"
alt="discord illustration header"
/>
<Button
type="secondary"
icon={<SVG src={`${router.basePath}/img/discord-icon.svg`} className="h-4 w-4" />}
>
<span style={{ color: '#404EED' }}>Join Discord server</span>
</Button>
</a>
</div>
</div>
<div className="px-5">
<div className="relative space-y-2 overflow-hidden rounded px-5 py-4 pb-12 shadow-md">
<a
href="https://github.com/supabase/supabase/discussions"
target="_blank"
rel="noreferrer"
className="block cursor-pointer"
>
<Image
className="absolute left-0 top-0 opacity-50"
src={`${router.basePath}/img/support/github-bg.jpg?v-1`}
layout="fill"
objectFit="cover"
alt="discord illustration header"
/>
<Button type="secondary" icon={<IconMessageCircle />}>
GitHub Discussions
</Button>
</a>
</div>
</div>
</div>
</PopoverContent_Shadcn_>
</Popover_Shadcn_>
)
}
export default HelpPopover