refac
This commit is contained in:
@@ -310,7 +310,6 @@
|
||||
open={$showControls}
|
||||
bind:width={controlsWidth}
|
||||
minWidth={350}
|
||||
maxWidth={640}
|
||||
storageKey="chatControlsSize"
|
||||
className="h-full z-10 bg-white dark:bg-gray-900"
|
||||
>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
export let side: 'left' | 'right' = 'right';
|
||||
export let width = 350;
|
||||
export let minWidth = 300;
|
||||
export let maxWidth = 640;
|
||||
export let maxWidth: number | null = null;
|
||||
export let storageKey = '';
|
||||
export let className = '';
|
||||
export let resizerId = 'controls-resizer';
|
||||
@@ -14,7 +14,8 @@
|
||||
let startClientX = 0;
|
||||
let startWidth = 0;
|
||||
|
||||
const clamp = (value: number) => Math.min(maxWidth, Math.max(minWidth, value));
|
||||
const clamp = (value: number) =>
|
||||
maxWidth === null ? Math.max(minWidth, value) : Math.min(maxWidth, Math.max(minWidth, value));
|
||||
|
||||
const persistWidth = () => {
|
||||
if (storageKey) {
|
||||
|
||||
Reference in New Issue
Block a user