chore: add skip button joyride (#5125)
This commit is contained in:
parent
f812952044
commit
72d1192499
@ -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}
|
||||||
|
|||||||
@ -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">
|
||||||
|
|||||||
@ -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">
|
||||||
|
|||||||
@ -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}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user