mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-08-24 04:13:59 +02:00
Add a typed platform package to decouple the frontend from Tauri (#539)
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
0068be9ffc
commit
2383f06e71
@@ -1,4 +1,4 @@
|
||||
import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
|
||||
import { platform } from "@yaakapp-internal/platform";
|
||||
import classNames from "classnames";
|
||||
import { useState } from "react";
|
||||
import { WINDOW_CONTROLS_WIDTH } from "../lib/constants";
|
||||
@@ -40,7 +40,7 @@ export function WindowControls({
|
||||
<Button
|
||||
className="h-full! px-4 text-text-subtle hocus:text hocus:bg-surface-highlight rounded-none"
|
||||
color="custom"
|
||||
onClick={() => getCurrentWebviewWindow().minimize()}
|
||||
onClick={() => platform.window.minimize()}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<title>Minimize</title>
|
||||
@@ -51,7 +51,7 @@ export function WindowControls({
|
||||
className="h-full! px-4 text-text-subtle hocus:text hocus:bg-surface-highlight rounded-none"
|
||||
color="custom"
|
||||
onClick={async () => {
|
||||
const w = getCurrentWebviewWindow();
|
||||
const w = platform.window;
|
||||
const isMaximized = await w.isMaximized();
|
||||
if (isMaximized) {
|
||||
await w.unmaximize();
|
||||
@@ -82,7 +82,7 @@ export function WindowControls({
|
||||
<Button
|
||||
color="custom"
|
||||
className="h-full! px-4 text-text-subtle rounded-none hocus:bg-danger hocus:text-text"
|
||||
onClick={() => getCurrentWebviewWindow().close()}
|
||||
onClick={() => platform.window.close()}
|
||||
>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<title>Close</title>
|
||||
|
||||
Reference in New Issue
Block a user