ArnoChen commited on
Commit
019f743
·
1 Parent(s): b406777

fix button

Browse files
lightrag/api/graph_viewer_webui/src/components/FullScreenControl.tsx CHANGED
@@ -12,11 +12,11 @@ const FullScreenControl = () => {
12
  return (
13
  <>
14
  {isFullScreen ? (
15
- <Button variant={controlButtonVariant} onClick={toggle} tooltip="Windowed">
16
  <MinimizeIcon />
17
  </Button>
18
  ) : (
19
- <Button variant={controlButtonVariant} onClick={toggle} tooltip="Full Screen">
20
  <MaximizeIcon />
21
  </Button>
22
  )}
 
12
  return (
13
  <>
14
  {isFullScreen ? (
15
+ <Button variant={controlButtonVariant} onClick={toggle} tooltip="Windowed" size="icon">
16
  <MinimizeIcon />
17
  </Button>
18
  ) : (
19
+ <Button variant={controlButtonVariant} onClick={toggle} tooltip="Full Screen" size="icon">
20
  <MaximizeIcon />
21
  </Button>
22
  )}
lightrag/api/graph_viewer_webui/src/components/LayoutsControl.tsx CHANGED
@@ -58,6 +58,7 @@ const WorkerLayoutControl = ({ layout, autoRunFor }: WorkerLayoutControlProps) =
58
 
59
  return (
60
  <Button
 
61
  onClick={() => (isRunning ? stop() : start())}
62
  tooltip={isRunning ? 'Stop the layout animation' : 'Start the layout animation'}
63
  variant={controlButtonVariant}
@@ -142,6 +143,7 @@ const LayoutsControl = () => {
142
  <Popover open={opened} onOpenChange={setOpened}>
143
  <PopoverTrigger asChild>
144
  <Button
 
145
  variant={controlButtonVariant}
146
  onClick={() => setOpened((e: boolean) => !e)}
147
  tooltip="Layout Graph"
 
58
 
59
  return (
60
  <Button
61
+ size="icon"
62
  onClick={() => (isRunning ? stop() : start())}
63
  tooltip={isRunning ? 'Stop the layout animation' : 'Start the layout animation'}
64
  variant={controlButtonVariant}
 
143
  <Popover open={opened} onOpenChange={setOpened}>
144
  <PopoverTrigger asChild>
145
  <Button
146
+ size="icon"
147
  variant={controlButtonVariant}
148
  onClick={() => setOpened((e: boolean) => !e)}
149
  tooltip="Layout Graph"
lightrag/api/graph_viewer_webui/src/components/Settings.tsx CHANGED
@@ -118,7 +118,7 @@ export default function Settings() {
118
  return (
119
  <Popover open={opened} onOpenChange={setOpened}>
120
  <PopoverTrigger asChild>
121
- <Button variant={controlButtonVariant} tooltip="Settings">
122
  <SettingsIcon />
123
  </Button>
124
  </PopoverTrigger>
 
118
  return (
119
  <Popover open={opened} onOpenChange={setOpened}>
120
  <PopoverTrigger asChild>
121
+ <Button variant={controlButtonVariant} tooltip="Settings" size="icon">
122
  <SettingsIcon />
123
  </Button>
124
  </PopoverTrigger>
lightrag/api/graph_viewer_webui/src/components/ThemeToggle.tsx CHANGED
@@ -14,13 +14,23 @@ export default function ThemeToggle() {
14
 
15
  if (theme === 'dark') {
16
  return (
17
- <Button onClick={setLight} variant={controlButtonVariant} tooltip="Switch to light theme">
 
 
 
 
 
18
  <MoonIcon />
19
  </Button>
20
  )
21
  }
22
  return (
23
- <Button onClick={setDark} variant={controlButtonVariant} tooltip="Switch to dark theme">
 
 
 
 
 
24
  <SunIcon />
25
  </Button>
26
  )
 
14
 
15
  if (theme === 'dark') {
16
  return (
17
+ <Button
18
+ onClick={setLight}
19
+ variant={controlButtonVariant}
20
+ tooltip="Switch to light theme"
21
+ size="icon"
22
+ >
23
  <MoonIcon />
24
  </Button>
25
  )
26
  }
27
  return (
28
+ <Button
29
+ onClick={setDark}
30
+ variant={controlButtonVariant}
31
+ tooltip="Switch to dark theme"
32
+ size="icon"
33
+ >
34
  <SunIcon />
35
  </Button>
36
  )
lightrag/api/graph_viewer_webui/src/components/ZoomControl.tsx CHANGED
@@ -4,7 +4,6 @@ import Button from '@/components/ui/Button'
4
  import { ZoomInIcon, ZoomOutIcon, FullscreenIcon } from 'lucide-react'
5
  import { controlButtonVariant } from '@/lib/constants'
6
 
7
-
8
  /**
9
  * Component that provides zoom controls for the graph viewer.
10
  */
@@ -17,13 +16,18 @@ const ZoomControl = () => {
17
 
18
  return (
19
  <>
20
- <Button variant={controlButtonVariant} onClick={handleZoomIn} tooltip="Zoom In">
21
  <ZoomInIcon />
22
  </Button>
23
- <Button variant={controlButtonVariant} onClick={handleZoomOut} tooltip="Zoom Out">
24
  <ZoomOutIcon />
25
  </Button>
26
- <Button variant={controlButtonVariant} onClick={handleResetZoom} tooltip="Reset Zoom">
 
 
 
 
 
27
  <FullscreenIcon />
28
  </Button>
29
  </>
 
4
  import { ZoomInIcon, ZoomOutIcon, FullscreenIcon } from 'lucide-react'
5
  import { controlButtonVariant } from '@/lib/constants'
6
 
 
7
  /**
8
  * Component that provides zoom controls for the graph viewer.
9
  */
 
16
 
17
  return (
18
  <>
19
+ <Button variant={controlButtonVariant} onClick={handleZoomIn} tooltip="Zoom In" size="icon">
20
  <ZoomInIcon />
21
  </Button>
22
+ <Button variant={controlButtonVariant} onClick={handleZoomOut} tooltip="Zoom Out" size="icon">
23
  <ZoomOutIcon />
24
  </Button>
25
+ <Button
26
+ variant={controlButtonVariant}
27
+ onClick={handleResetZoom}
28
+ tooltip="Reset Zoom"
29
+ size="icon"
30
+ >
31
  <FullscreenIcon />
32
  </Button>
33
  </>
lightrag/api/graph_viewer_webui/src/components/ui/Button.tsx CHANGED
@@ -39,10 +39,7 @@ interface ButtonProps
39
  }
40
 
41
  const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
42
- (
43
- { className, variant, tooltip, size = 'icon', side = 'right', asChild = false, ...props },
44
- ref
45
- ) => {
46
  const Comp = asChild ? Slot : 'button'
47
  if (!tooltip) {
48
  return (
 
39
  }
40
 
41
  const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
42
+ ({ className, variant, tooltip, size, side = 'right', asChild = false, ...props }, ref) => {
 
 
 
43
  const Comp = asChild ? Slot : 'button'
44
  if (!tooltip) {
45
  return (