Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 22 additions & 17 deletions app/(navigation)/presets/components/PresetDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { AiModel } from "@/api/ai";
import { Extension } from "@/api/store";
import { getExtensionIdsFromString } from "@/utils/getExtensionIdsFromString";
import { AIExtension } from "@/components/ai-extension";
import { FloatingActionBar } from "@/components/floating-action-bar";
import { renderSafePromptContent } from "@/utils/sanitizePromptContent";
import { isTouchDevice } from "../utils/isTouchDevice";
import { shortenUrl } from "@/utils/common";
Expand Down Expand Up @@ -370,23 +371,27 @@ export function PresetDetail({ preset, relatedPresets, models, extensions }: Pre
</ToastTitle>
</Toast>

{/* Floating Action Bar for Mobile */}
{isTouch && (
<div className={styles.floatingActionBar}>
<button className={styles.floatingActionButton} data-variant="primary" onClick={handleAddToRaycast}>
<PlusCircleIcon />
Add to Raycast
</button>
<button className={styles.floatingActionButton} onClick={handleCopyData}>
<CopyClipboardIcon />
Copy JSON
</button>
<button className={styles.floatingActionButton} onClick={handleCopyUrl}>
<LinkIcon />
Share URL
</button>
</div>
)}
<FloatingActionBar
isVisible={isTouch === true}
actions={[
{
icon: <PlusCircleIcon />,
label: "Add to Raycast",
onClick: handleAddToRaycast,
variant: "primary",
},
{
icon: <CopyClipboardIcon />,
label: "Copy JSON",
onClick: handleCopyData,
},
{
icon: <LinkIcon />,
label: "Share URL",
onClick: handleCopyUrl,
},
]}
/>
</>
);
}
39 changes: 22 additions & 17 deletions app/(navigation)/prompts/[[...slug]]/prompts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { TooltipTrigger } from "@/components/tooltip";
import { Extension } from "@/api/store";
import { AIExtension } from "@/components/ai-extension";
import { renderSafePromptContent } from "@/utils/sanitizePromptContent";
import { FloatingActionBar } from "@/components/floating-action-bar";

type Props = {
models: AiModel[];
Expand Down Expand Up @@ -453,23 +454,27 @@ export function Prompts({ models, extensions }: Props) {
</div>
</div>

{/* Floating Action Bar for Mobile */}
{isTouch && selectedPrompts.length > 0 && (
<div className={styles.floatingActionBar}>
<button className={styles.floatingActionButton} data-variant="primary" onClick={handleAddToRaycast}>
<PlusCircleIcon />
Add to Raycast
</button>
<button className={styles.floatingActionButton} onClick={handleCopyData}>
<CopyClipboardIcon />
Copy JSON
</button>
<button className={styles.floatingActionButton} onClick={handleCopyUrl}>
<LinkIcon />
Share URL
</button>
</div>
)}
<FloatingActionBar
isVisible={isTouch === true && selectedPrompts.length > 0}
actions={[
{
icon: <PlusCircleIcon />,
label: "Add to Raycast",
onClick: handleAddToRaycast,
variant: "primary",
},
{
icon: <CopyClipboardIcon />,
label: "Copy JSON",
onClick: handleCopyData,
},
{
icon: <LinkIcon />,
label: "Share URL",
onClick: handleCopyUrl,
},
]}
/>
</div>
);
}
Expand Down
39 changes: 22 additions & 17 deletions app/(navigation)/prompts/shared/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import { Extension } from "@/api/store";
import { AIExtension } from "@/components/ai-extension";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/tooltip";
import { renderSafePromptContent } from "@/utils/sanitizePromptContent";
import { FloatingActionBar } from "@/components/floating-action-bar";

export function Shared({ prompts, extensions }: { prompts: Prompt[]; extensions: Extension[] }) {
const router = useRouter();
Expand Down Expand Up @@ -346,23 +347,27 @@ export function Shared({ prompts, extensions }: { prompts: Prompt[]; extensions:
)}
</div>

{/* Floating Action Bar for Mobile */}
{isTouch && selectedPrompts.length > 0 && (
<div className={styles.floatingActionBar}>
<button className={styles.floatingActionButton} data-variant="primary" onClick={handleAddToRaycast}>
<PlusCircleIcon />
Add to Raycast
</button>
<button className={styles.floatingActionButton} onClick={handleCopyData}>
<CopyClipboardIcon />
Copy JSON
</button>
<button className={styles.floatingActionButton} onClick={handleCopyUrl}>
<LinkIcon />
Share URL
</button>
</div>
)}
<FloatingActionBar
isVisible={isTouch === true && selectedPrompts.length > 0}
actions={[
{
icon: <PlusCircleIcon />,
label: "Add to Raycast",
onClick: handleAddToRaycast,
variant: "primary",
},
{
icon: <CopyClipboardIcon />,
label: "Copy JSON",
onClick: handleCopyData,
},
{
icon: <LinkIcon />,
label: "Share URL",
onClick: handleCopyUrl,
},
]}
/>
</div>
);
}
39 changes: 22 additions & 17 deletions app/(navigation)/quicklinks/[[...slug]]/quicklinks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { shortenUrl } from "@/utils/common";
import { toast } from "@/components/toast";
import { Input, InputSlot } from "@/components/input";
import { getRaycastFlavor } from "@/app/RaycastFlavor";
import { FloatingActionBar } from "@/components/floating-action-bar";

export function Quicklinks() {
const [enableViewObserver, setEnableViewObserver] = React.useState(false);
Expand Down Expand Up @@ -432,23 +433,27 @@ export function Quicklinks() {
</div>
</div>

{/* Floating Action Bar for Mobile */}
{isTouch && selectedQuicklinks.length > 0 && (
<div className={styles.floatingActionBar}>
<button className={styles.floatingActionButton} data-variant="primary" onClick={handleAddToRaycast}>
<PlusCircleIcon />
Add to Raycast
</button>
<button className={styles.floatingActionButton} onClick={handleCopyData}>
<CopyClipboardIcon />
Copy JSON
</button>
<button className={styles.floatingActionButton} onClick={handleCopyUrl}>
<LinkIcon />
Share URL
</button>
</div>
)}
<FloatingActionBar
isVisible={isTouch === true && selectedQuicklinks.length > 0}
actions={[
{
icon: <PlusCircleIcon />,
label: "Add to Raycast",
onClick: handleAddToRaycast,
variant: "primary",
},
{
icon: <CopyClipboardIcon />,
label: "Copy JSON",
onClick: handleCopyData,
},
{
icon: <LinkIcon />,
label: "Share URL",
onClick: handleCopyUrl,
},
]}
/>
</div>
);
}
Expand Down
39 changes: 22 additions & 17 deletions app/(navigation)/quicklinks/shared/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { QuicklinkComponent } from "../components/quicklink";
import { toast } from "@/components/toast";
import { shortenUrl } from "@/utils/common";
import { getRaycastFlavor } from "@/app/RaycastFlavor";
import { FloatingActionBar } from "@/components/floating-action-bar";

export function Shared({ quicklinks }: { quicklinks: Quicklink[] }) {
const router = useRouter();
Expand Down Expand Up @@ -297,23 +298,27 @@ export function Shared({ quicklinks }: { quicklinks: Quicklink[] }) {
)}
</div>

{/* Floating Action Bar for Mobile */}
{isTouch && selectedQuicklinks.length > 0 && (
<div className={styles.floatingActionBar}>
<button className={styles.floatingActionButton} data-variant="primary" onClick={handleAddToRaycast}>
<PlusCircleIcon />
Add to Raycast
</button>
<button className={styles.floatingActionButton} onClick={handleCopyData}>
<CopyClipboardIcon />
Copy JSON
</button>
<button className={styles.floatingActionButton} onClick={handleCopyUrl}>
<LinkIcon />
Share URL
</button>
</div>
)}
<FloatingActionBar
isVisible={isTouch === true && selectedQuicklinks.length > 0}
actions={[
{
icon: <PlusCircleIcon />,
label: "Add to Raycast",
onClick: handleAddToRaycast,
variant: "primary",
},
{
icon: <CopyClipboardIcon />,
label: "Copy JSON",
onClick: handleCopyData,
},
{
icon: <LinkIcon />,
label: "Share URL",
onClick: handleCopyUrl,
},
]}
/>
</div>
);
}
39 changes: 22 additions & 17 deletions app/(navigation)/snippets/[[...slug]]/snippets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ import { ButtonGroup } from "@/components/button-group";
import { InfoDialog } from "../components/InfoDialog";
import { Kbd, Kbds } from "@/components/kbd";
import { getRaycastFlavor, getIsWindows } from "@/app/RaycastFlavor";
import { FloatingActionBar } from "@/components/floating-action-bar";

const modifiers = ["!", ":", "_", "__", "-", "@", "@@", "$", ";", ";;", "/", "//", "none"] as const;

Expand Down Expand Up @@ -549,23 +550,27 @@ export default function Snippets() {
</div>
</div>

{/* Floating Action Bar for Mobile */}
{isTouch && selectedSnippets.length > 0 && (
<div className={styles.floatingActionBar}>
<button className={styles.floatingActionButton} data-variant="primary" onClick={handleAddToRaycast}>
<PlusCircleIcon />
Add to Raycast
</button>
<button className={styles.floatingActionButton} onClick={handleCopyData}>
<CopyClipboardIcon />
Copy JSON
</button>
<button className={styles.floatingActionButton} onClick={handleCopyUrl}>
<LinkIcon />
Share URL
</button>
</div>
)}
<FloatingActionBar
isVisible={isTouch === true && selectedSnippets.length > 0}
actions={[
{
icon: <PlusCircleIcon />,
label: "Add to Raycast",
onClick: handleAddToRaycast,
variant: "primary",
},
{
icon: <CopyClipboardIcon />,
label: "Copy JSON",
onClick: handleCopyData,
},
{
icon: <LinkIcon />,
label: "Share URL",
onClick: handleCopyUrl,
},
]}
/>
</div>
);
}
Expand Down
39 changes: 22 additions & 17 deletions app/(navigation)/snippets/shared/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { Snippet } from "../snippets";
import { ButtonGroup } from "@/components/button-group";
import { InfoDialog } from "../components/InfoDialog";
import { Kbd, Kbds } from "@/components/kbd";
import { FloatingActionBar } from "@/components/floating-action-bar";

export function Shared({ snippets }: { snippets: Snippet[] }) {
const router = useRouter();
Expand Down Expand Up @@ -319,23 +320,27 @@ export function Shared({ snippets }: { snippets: Snippet[] }) {
</div>
</div>

{/* Floating Action Bar for Mobile */}
{isTouch && selectedSnippets.length > 0 && (
<div className={styles.floatingActionBar}>
<button className={styles.floatingActionButton} data-variant="primary" onClick={handleAddToRaycast}>
<PlusCircleIcon />
Add to Raycast
</button>
<button className={styles.floatingActionButton} onClick={handleCopyData}>
<CopyClipboardIcon />
Copy JSON
</button>
<button className={styles.floatingActionButton} onClick={handleDownload}>
<DownloadIcon />
Download
</button>
</div>
)}
<FloatingActionBar
isVisible={isTouch === true && selectedSnippets.length > 0}
actions={[
{
icon: <PlusCircleIcon />,
label: "Add to Raycast",
onClick: handleAddToRaycast,
variant: "primary",
},
{
icon: <CopyClipboardIcon />,
label: "Copy JSON",
onClick: handleCopyData,
},
{
icon: <DownloadIcon />,
label: "Download",
onClick: handleDownload,
},
]}
/>
</div>
);
}
Loading