fix button
This commit is contained in:
@@ -12,11 +12,11 @@ const FullScreenControl = () => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{isFullScreen ? (
|
{isFullScreen ? (
|
||||||
<Button variant={controlButtonVariant} onClick={toggle} tooltip="Windowed">
|
<Button variant={controlButtonVariant} onClick={toggle} tooltip="Windowed" size="icon">
|
||||||
<MinimizeIcon />
|
<MinimizeIcon />
|
||||||
</Button>
|
</Button>
|
||||||
) : (
|
) : (
|
||||||
<Button variant={controlButtonVariant} onClick={toggle} tooltip="Full Screen">
|
<Button variant={controlButtonVariant} onClick={toggle} tooltip="Full Screen" size="icon">
|
||||||
<MaximizeIcon />
|
<MaximizeIcon />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
@@ -58,6 +58,7 @@ const WorkerLayoutControl = ({ layout, autoRunFor }: WorkerLayoutControlProps) =
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Button
|
<Button
|
||||||
|
size="icon"
|
||||||
onClick={() => (isRunning ? stop() : start())}
|
onClick={() => (isRunning ? stop() : start())}
|
||||||
tooltip={isRunning ? 'Stop the layout animation' : 'Start the layout animation'}
|
tooltip={isRunning ? 'Stop the layout animation' : 'Start the layout animation'}
|
||||||
variant={controlButtonVariant}
|
variant={controlButtonVariant}
|
||||||
@@ -142,6 +143,7 @@ const LayoutsControl = () => {
|
|||||||
<Popover open={opened} onOpenChange={setOpened}>
|
<Popover open={opened} onOpenChange={setOpened}>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button
|
<Button
|
||||||
|
size="icon"
|
||||||
variant={controlButtonVariant}
|
variant={controlButtonVariant}
|
||||||
onClick={() => setOpened((e: boolean) => !e)}
|
onClick={() => setOpened((e: boolean) => !e)}
|
||||||
tooltip="Layout Graph"
|
tooltip="Layout Graph"
|
||||||
|
@@ -118,7 +118,7 @@ export default function Settings() {
|
|||||||
return (
|
return (
|
||||||
<Popover open={opened} onOpenChange={setOpened}>
|
<Popover open={opened} onOpenChange={setOpened}>
|
||||||
<PopoverTrigger asChild>
|
<PopoverTrigger asChild>
|
||||||
<Button variant={controlButtonVariant} tooltip="Settings">
|
<Button variant={controlButtonVariant} tooltip="Settings" size="icon">
|
||||||
<SettingsIcon />
|
<SettingsIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</PopoverTrigger>
|
</PopoverTrigger>
|
||||||
|
@@ -14,13 +14,23 @@ export default function ThemeToggle() {
|
|||||||
|
|
||||||
if (theme === 'dark') {
|
if (theme === 'dark') {
|
||||||
return (
|
return (
|
||||||
<Button onClick={setLight} variant={controlButtonVariant} tooltip="Switch to light theme">
|
<Button
|
||||||
|
onClick={setLight}
|
||||||
|
variant={controlButtonVariant}
|
||||||
|
tooltip="Switch to light theme"
|
||||||
|
size="icon"
|
||||||
|
>
|
||||||
<MoonIcon />
|
<MoonIcon />
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Button onClick={setDark} variant={controlButtonVariant} tooltip="Switch to dark theme">
|
<Button
|
||||||
|
onClick={setDark}
|
||||||
|
variant={controlButtonVariant}
|
||||||
|
tooltip="Switch to dark theme"
|
||||||
|
size="icon"
|
||||||
|
>
|
||||||
<SunIcon />
|
<SunIcon />
|
||||||
</Button>
|
</Button>
|
||||||
)
|
)
|
||||||
|
@@ -4,7 +4,6 @@ import Button from '@/components/ui/Button'
|
|||||||
import { ZoomInIcon, ZoomOutIcon, FullscreenIcon } from 'lucide-react'
|
import { ZoomInIcon, ZoomOutIcon, FullscreenIcon } from 'lucide-react'
|
||||||
import { controlButtonVariant } from '@/lib/constants'
|
import { controlButtonVariant } from '@/lib/constants'
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Component that provides zoom controls for the graph viewer.
|
* Component that provides zoom controls for the graph viewer.
|
||||||
*/
|
*/
|
||||||
@@ -17,13 +16,18 @@ const ZoomControl = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button variant={controlButtonVariant} onClick={handleZoomIn} tooltip="Zoom In">
|
<Button variant={controlButtonVariant} onClick={handleZoomIn} tooltip="Zoom In" size="icon">
|
||||||
<ZoomInIcon />
|
<ZoomInIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant={controlButtonVariant} onClick={handleZoomOut} tooltip="Zoom Out">
|
<Button variant={controlButtonVariant} onClick={handleZoomOut} tooltip="Zoom Out" size="icon">
|
||||||
<ZoomOutIcon />
|
<ZoomOutIcon />
|
||||||
</Button>
|
</Button>
|
||||||
<Button variant={controlButtonVariant} onClick={handleResetZoom} tooltip="Reset Zoom">
|
<Button
|
||||||
|
variant={controlButtonVariant}
|
||||||
|
onClick={handleResetZoom}
|
||||||
|
tooltip="Reset Zoom"
|
||||||
|
size="icon"
|
||||||
|
>
|
||||||
<FullscreenIcon />
|
<FullscreenIcon />
|
||||||
</Button>
|
</Button>
|
||||||
</>
|
</>
|
||||||
|
@@ -39,10 +39,7 @@ interface ButtonProps
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
||||||
(
|
({ className, variant, tooltip, size, side = 'right', asChild = false, ...props }, ref) => {
|
||||||
{ className, variant, tooltip, size = 'icon', side = 'right', asChild = false, ...props },
|
|
||||||
ref
|
|
||||||
) => {
|
|
||||||
const Comp = asChild ? Slot : 'button'
|
const Comp = asChild ? Slot : 'button'
|
||||||
if (!tooltip) {
|
if (!tooltip) {
|
||||||
return (
|
return (
|
||||||
|
Reference in New Issue
Block a user