chore: add skip button joyride (#5125)

This commit is contained in:
Faisal Amir 2025-05-28 20:10:59 +07:00 committed by GitHub
parent f812952044
commit 72d1192499
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 13 additions and 8 deletions

View File

@ -37,7 +37,11 @@ export function CustomTooltipJoyRide(props: TooltipRenderProps) {
)}
>
{step.showSkipButton && (
<Button variant="link" className="px-0" {...skipProps}>
<Button
variant="link"
className="px-0 text-main-view-fg/70"
{...skipProps}
>
{skipProps.title}
</Button>
)}
@ -45,7 +49,7 @@ export function CustomTooltipJoyRide(props: TooltipRenderProps) {
{index > 0 && (
<Button
variant="link"
className="px-0 text-main-view-fg/60"
className="px-0 text-main-view-fg/70"
{...backProps}
>
{backProps.title}

View File

@ -2,20 +2,19 @@ import { useLeftPanel } from '@/hooks/useLeftPanel'
import { cn } from '@/lib/utils'
import { IconLayoutSidebar } from '@tabler/icons-react'
import { ReactNode } from '@tanstack/react-router'
import { platform } from '@tauri-apps/plugin-os'
type HeaderPageProps = {
children: ReactNode
children?: ReactNode
}
const HeaderPage = ({ children }: HeaderPageProps) => {
const platformName = platform()
const { open, setLeftPanel } = useLeftPanel()
return (
<div
className={cn(
'h-10 border-b border-main-view-fg/5 pl-18 text-main-view-fg flex items-center shrink-0',
platformName === 'macos' && !open ? 'pl-18' : 'pl-4'
'h-10 pl-18 text-main-view-fg flex items-center shrink-0 border-b border-main-view-fg/5',
IS_MACOS && !open ? 'pl-18' : 'pl-4',
children === undefined && 'border-none'
)}
>
<div className="flex items-center w-full gap-2">

View File

@ -2,6 +2,7 @@ import { Card } from './Card'
import { useModelProvider } from '@/hooks/useModelProvider'
import { Link } from '@tanstack/react-router'
import { route } from '@/constants/routes'
import HeaderPage from './HeaderPage'
function SetupScreen() {
const { providers } = useModelProvider()
@ -10,6 +11,7 @@ function SetupScreen() {
return (
<div className="flex h-full flex-col flex-justify-center">
<HeaderPage></HeaderPage>
<div className="h-full px-8 overflow-y-auto flex flex-col gap-2 justify-center ">
<div className="w-4/6 mx-auto">
<div className="mb-8 text-left">

View File

@ -94,7 +94,7 @@ function ProviderDetail() {
tooltipComponent={CustomTooltipJoyRide}
spotlightPadding={0}
continuous={true}
showSkipButton={false}
showSkipButton={true}
hideCloseButton={true}
spotlightClicks={true}
disableOverlayClose={true}