Skip to content
Merged
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
5 changes: 5 additions & 0 deletions .changeset/native-share-sheet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
default: minor
---

Add a native share sheet on mobile via the Tauri sharekit plugin, with Web Share API support on PWA and a clipboard-copy fallback on desktop.
4 changes: 2 additions & 2 deletions src/app/components/setting-tile/SettingTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Box, IconButton, Text } from 'folds';
import { Check, Link, sizedIcon } from '$components/icons/phosphor';
import { BreakWord } from '$styles/Text.css';
import { buildSettingsLink } from '$features/settings/settingsLink';
import { copyToClipboard } from '$utils/dom';
import { shareText } from '$utils/share';
import { ScreenSize, useScreenSizeContext } from '$hooks/useScreenSize';
import { useTimeoutToggle } from '$hooks/useTimeoutToggle';
import { useSettingsLinkContext } from '$features/settings/SettingsLinkContext';
Expand Down Expand Up @@ -52,7 +52,7 @@ function SettingTileSettingLinkAction({
: settingTileSettingLinkActionMobileVisible,
].join(' ')}
onClick={async () => {
if (await copyToClipboard(copyPath)) setCopied();
if (await shareText(copyPath)) setCopied();
}}
size="300"
variant="Surface"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { type ChangeEventHandler, useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { useTimeoutToggle } from '$hooks/useTimeoutToggle';
import { copyToClipboard, downloadTextFile } from '$utils/dom';
import { downloadTextFile } from '$utils/dom';
import { shareText } from '$utils/share';
import { fetch } from '$utils/fetch';
import { useQuery, useQueryClient } from '@tanstack/react-query';
import {
Expand Down Expand Up @@ -133,7 +134,7 @@ function CatalogTweakCard({
const [copied, setCopied] = useTimeoutToggle();
const handleCopy = useCallback(async () => {
if (!copyUrl) return;
if (await copyToClipboard(copyUrl)) setCopied();
if (await shareText(copyUrl)) setCopied();
}, [copyUrl, setCopied]);

return (
Expand Down
Loading