Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Merge remote-tracking branch 'origin' into editor-redesign

ameer2468820f3dcba3d5
diff --cc apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
index cfb4e1e40,709b1798e..4faa52834
--- a/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
+++ b/apps/desktop/src/routes/(window-chrome)/settings/recordings.tsx
@@@ -1,12 -1,29 +1,29 @@@
- import { createQuery } from "@tanstack/solid-query";
++import Tooltip from "@corvu/tooltip";
+ import {
+ createMutation,
+ createQuery,
+ queryOptions,
+ useQueryClient,
+ } from "@tanstack/solid-query";
import { convertFileSrc } from "@tauri-apps/api/core";
- import { For, ParentProps, Show, createSignal } from "solid-js";
++import { remove } from "@tauri-apps/plugin-fs";
++import { cx } from "cva";
+ import {
+ createMemo,
+ createSignal,
+ For,
+ JSX,
+ ParentProps,
+ Show,
+ } from "solid-js";
-import Tooltip from "@corvu/tooltip";
-import { cx } from "cva";
-import { remove } from "@tauri-apps/plugin-fs";
- import Tooltip from "@corvu/tooltip";
++import { ask } from "@tauri-apps/plugin-dialog";
++import { open } from "@tauri-apps/plugin-shell";
import { trackEvent } from "~/utils/analytics";
- import { commands, events, type RecordingMeta } from "~/utils/tauri";
+ import { commands, events, RecordingMetaWithType } from "~/utils/tauri";
-import { open } from "@tauri-apps/plugin-shell";
-import { ask } from "@tauri-apps/plugin-dialog";
- type MediaEntry = {
+ type Recording = {
+ meta: RecordingMetaWithType;
id: string;
path: string;
prettyName: string;
@@@ -60,18 -113,36 +113,36 @@@ export default function Recordings()
};
return (
- <div class="flex flex-col w-full h-full divide-y divide-[--gray-200] pt-1 pb-12">
- <div class="overflow-y-auto flex-1">
- <ul class="p-[0.625rem] flex flex-col gap-[0.5rem] w-full text-[--text-primary]">
- <Show
- when={fetchRecordings.data && fetchRecordings.data.length > 0}
- fallback={
- <p class="text-center text-[--text-tertiary]">
- No recordings found
- </p>
- }
- >
- <For each={fetchRecordings.data}>
+ <div class="flex flex-col w-full h-full">
+ <Show
+ when={recordings.data && recordings.data.length > 0}
+ fallback={
+ <p class="text-center text-[--text-tertiary]">No recordings found</p>
+ }
+ >
+ <div class="p-4 border-b border-gray-300 border-dashed">
+ <div class="flex gap-3 items-center w-fit">
+ <For each={Tabs}>
+ {(tab) => (
+ <div
+ class={cx(
+ "flex gap-1.5 items-center transition-colors duration-200 p-2 px-3 border rounded-full",
+ activeTab() === tab.id
+ ? "bg-gray-300 cursor-default border-gray-300"
+ : "bg-transparent cursor-pointer hover:bg-gray-200 border-gray-200"
+ )}
+ onClick={() => setActiveTab(tab.id)}
+ >
+ {tab.icon && tab.icon}
+ <p class="text-xs text-gray-500">{tab.label}</p>
+ </div>
+ )}
+ </For>
+ </div>
+ </div>
- <div class="flex flex-col flex-1 overflow-auto">
++ <div class="flex overflow-auto flex-col flex-1">
+ <ul class="p-4 flex flex-col gap-[0.5rem] w-full text-[--text-primary]">
+ <For each={filteredRecordings()}>
{(recording) => (
<RecordingItem
recording={recording}