mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-19 15:21:23 +02:00
@@ -29,7 +29,7 @@ const drag = { gridArea: 'drag' };
|
|||||||
|
|
||||||
export default function Workspace() {
|
export default function Workspace() {
|
||||||
const { setWidth, width, resetWidth } = useSidebarWidth();
|
const { setWidth, width, resetWidth } = useSidebarWidth();
|
||||||
const { show, hide, hidden, toggle } = useSidebarHidden();
|
const { hide, hidden, toggle } = useSidebarHidden();
|
||||||
|
|
||||||
const windowSize = useWindowSize();
|
const windowSize = useWindowSize();
|
||||||
const [floating, setFloating] = useState<boolean>(false);
|
const [floating, setFloating] = useState<boolean>(false);
|
||||||
@@ -43,15 +43,8 @@ export default function Workspace() {
|
|||||||
// float/un-float sidebar on window resize
|
// float/un-float sidebar on window resize
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const shouldHide = windowSize.width <= WINDOW_FLOATING_SIDEBAR_WIDTH;
|
const shouldHide = windowSize.width <= WINDOW_FLOATING_SIDEBAR_WIDTH;
|
||||||
if (shouldHide && !hidden) {
|
if (shouldHide) setFloating(true);
|
||||||
setFloating(true);
|
else if (!shouldHide) setFloating(false);
|
||||||
hide();
|
|
||||||
} else if (!shouldHide && hidden) {
|
|
||||||
setFloating(false);
|
|
||||||
show();
|
|
||||||
}
|
|
||||||
|
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
||||||
}, [windowSize.width]);
|
}, [windowSize.width]);
|
||||||
|
|
||||||
const unsub = () => {
|
const unsub = () => {
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { w } from '@tauri-apps/api/clipboard-79413165';
|
||||||
import { useResponseBodyText } from '../../hooks/useResponseBodyText';
|
import { useResponseBodyText } from '../../hooks/useResponseBodyText';
|
||||||
import { useResponseContentType } from '../../hooks/useResponseContentType';
|
import { useResponseContentType } from '../../hooks/useResponseContentType';
|
||||||
import { tryFormatJson } from '../../lib/formatters';
|
import { tryFormatJson } from '../../lib/formatters';
|
||||||
|
|||||||
Reference in New Issue
Block a user