Skip to content

Commit

Permalink
feat: bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
katungi committed Jun 20, 2024
1 parent c2a6f7c commit 8822537
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 51 deletions.
21 changes: 21 additions & 0 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tauri-build = { version = "1.5", features = [] }
[dependencies]
serde_json = "1.0"
serde = { version = "1.0", features = ["derive"] }
tauri = { version = "1.5", features = [ "system-tray", "macos-private-api", "api-all"] }
tauri = { version = "1.5", features = [ "updater", "system-tray", "macos-private-api", "api-all"] }
window-vibrancy = "0.4.0"
tauri-plugin-clipboard = "0.6.0"
tauri-plugin-positioner = { version = "1.0.4", features = ["system-tray"] }
Expand Down
6 changes: 4 additions & 2 deletions src-tauri/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial};
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]

#[tauri::command]
fn on_button_clicked() -> String {
let start = SystemTime::now();
Expand Down Expand Up @@ -60,14 +59,17 @@ fn main() {
})
.setup(|app| {
let window = app.get_window("main").unwrap();

// #[cfg(target_os = "macos")]
// {
// use cocoa::appkit::{NSMainMenuWindowLevel, NSWindow, NSWindowCollectionBehavior};
// use cocoa::base::id;
// let ns_win = window.ns_window().unwrap() as id;
// unsafe {
// ns_win.setLevel_(((NSMainMenuWindowLevel + 1) as u64).try_into().unwrap());
// ns_win.setCollectionBehavior_(NSWindowCollectionBehavior::NSWindowCollectionBehaviorCanJoinAllSpaces);
// ns_win.setCollectionBehavior_(
// NSWindowCollectionBehavior::NSWindowCollectionBehaviorCanJoinAllSpaces,
// );
// // ns_win.setCollectionBehavior_(NSWindowCollectionBehavior::NSWindowCollectionBehaviorMoveToActiveSpace);
// }
// }
Expand Down
3 changes: 3 additions & 0 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"all": true,
"writeText": true,
"readText": true
},
"globalShortcut": {
"all": true
}
},
"bundle": {
Expand Down
8 changes: 2 additions & 6 deletions src/components/TextCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ export const ClipboardItem: React.FC<ClipboardItemProps> = ({ clip }) => {
}

return (
<div className="flex items-center gap-2 p-2 rounded-md bg-gray-100 dark:bg-gray-800 cursor-pointer hover:bg-gray-200">
<Button
size="sm"
variant={"ghost"}
onClick={async () => AddToClipBoard()}
>
<div className="flex items-center gap-2 p-2 rounded-md bg-gray-100 dark:bg-gray-800 cursor-pointer hover:bg-gray-200" >
<Button size="sm" variant={"ghost"} onClick={async () => AddToClipBoard()}>
<ClipboardIcon className="h-6 w-6 rounded-md text-muted" />
</Button>
<div className="flex-1 grid gap-1">
Expand Down
12 changes: 7 additions & 5 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
onTextUpdate,
startListening,
} from "tauri-plugin-clipboard-api"
import { exit } from '@tauri-apps/api/process';

import Empty from "@/components/Empty"
import { SearchIcon } from "@/components/Icons"
Expand Down Expand Up @@ -83,11 +84,12 @@ const Home: NextPage = () => {
</CardContent>
<CardFooter className="p-0">
<footer className="flex justify-between p-4">
<Button size="sm" variant="ghost">
View All
</Button>
<Button size="sm" variant="ghost">
Color Settings
<Button size="sm" className="w-full" variant="ghost"
onClick={async () => {
await exit(1);
}}
>
Quit Pasta 🍝
</Button>
</footer>
</CardFooter>
Expand Down
37 changes: 0 additions & 37 deletions tailwind.config.js

This file was deleted.

86 changes: 86 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
import type { Config } from "tailwindcss"
const { fontFamily } = require('tailwindcss/defaultTheme')


const config = {
darkMode: ["class"],
content: [
'./pages/**/*.{ts,tsx}',
'./components/**/*.{ts,tsx}',
'./app/**/*.{ts,tsx}',
'./src/**/*.{ts,tsx}',
],
prefix: "",
theme: {
container: {
center: true,
padding: "2rem",
screens: {
"2xl": "1400px",
},
},
extend: {
fontFamily: {
scary: ['var(--font-scary)', ...fontFamily.sans],
heading: ['"Recursive"', ...fontFamily.sans]
},
colors: {
border: "hsl(var(--border))",
input: "hsl(var(--input))",
ring: "hsl(var(--ring))",
background: "hsl(var(--background))",
foreground: "hsl(var(--foreground))",
primary: {
DEFAULT: "hsl(var(--primary))",
foreground: "hsl(var(--primary-foreground))",
},
secondary: {
DEFAULT: "hsl(var(--secondary))",
foreground: "hsl(var(--secondary-foreground))",
},
destructive: {
DEFAULT: "hsl(var(--destructive))",
foreground: "hsl(var(--destructive-foreground))",
},
muted: {
DEFAULT: "hsl(var(--muted))",
foreground: "hsl(var(--muted-foreground))",
},
accent: {
DEFAULT: "hsl(var(--accent))",
foreground: "hsl(var(--accent-foreground))",
},
popover: {
DEFAULT: "hsl(var(--popover))",
foreground: "hsl(var(--popover-foreground))",
},
card: {
DEFAULT: "hsl(var(--card))",
foreground: "hsl(var(--card-foreground))",
},
},
borderRadius: {
lg: "var(--radius)",
md: "calc(var(--radius) - 2px)",
sm: "calc(var(--radius) - 4px)",
},
keyframes: {
"accordion-down": {
from: { height: "0" },
to: { height: "var(--radix-accordion-content-height)" },
},
"accordion-up": {
from: { height: "var(--radix-accordion-content-height)" },
to: { height: "0" },
},
},
animation: {
"accordion-down": "accordion-down 0.2s ease-out",
"accordion-up": "accordion-up 0.2s ease-out",
},
},
},
plugins: [require("tailwindcss-animate")],
} satisfies Config

export default config

0 comments on commit 8822537

Please sign in to comment.