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

View File

@ -2,20 +2,19 @@ import { useLeftPanel } from '@/hooks/useLeftPanel'
import { cn } from '@/lib/utils' import { cn } from '@/lib/utils'
import { IconLayoutSidebar } from '@tabler/icons-react' import { IconLayoutSidebar } from '@tabler/icons-react'
import { ReactNode } from '@tanstack/react-router' import { ReactNode } from '@tanstack/react-router'
import { platform } from '@tauri-apps/plugin-os'
type HeaderPageProps = { type HeaderPageProps = {
children: ReactNode children?: ReactNode
} }
const HeaderPage = ({ children }: HeaderPageProps) => { const HeaderPage = ({ children }: HeaderPageProps) => {
const platformName = platform()
const { open, setLeftPanel } = useLeftPanel() const { open, setLeftPanel } = useLeftPanel()
return ( return (
<div <div
className={cn( className={cn(
'h-10 border-b border-main-view-fg/5 pl-18 text-main-view-fg flex items-center shrink-0', 'h-10 pl-18 text-main-view-fg flex items-center shrink-0 border-b border-main-view-fg/5',
platformName === 'macos' && !open ? 'pl-18' : 'pl-4' IS_MACOS && !open ? 'pl-18' : 'pl-4',
children === undefined && 'border-none'
)} )}
> >
<div className="flex items-center w-full gap-2"> <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 { useModelProvider } from '@/hooks/useModelProvider'
import { Link } from '@tanstack/react-router' import { Link } from '@tanstack/react-router'
import { route } from '@/constants/routes' import { route } from '@/constants/routes'
import HeaderPage from './HeaderPage'
function SetupScreen() { function SetupScreen() {
const { providers } = useModelProvider() const { providers } = useModelProvider()
@ -10,6 +11,7 @@ function SetupScreen() {
return ( return (
<div className="flex h-full flex-col flex-justify-center"> <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="h-full px-8 overflow-y-auto flex flex-col gap-2 justify-center ">
<div className="w-4/6 mx-auto"> <div className="w-4/6 mx-auto">
<div className="mb-8 text-left"> <div className="mb-8 text-left">

View File

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