[Utils] Remove copyText (#39)

[Cleanup] Fix imports
This commit is contained in:
Jack 2023-03-20 16:11:27 -04:00 committed by GitHub
parent e000d8384c
commit 13cf5e6872
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 5 additions and 19 deletions

View file

@ -1,9 +1,8 @@
import { Asset } from "@types";
import { ReactNative as RN, stylesheet } from "@metro/common";
import { ReactNative as RN, stylesheet, clipboard } from "@metro/common";
import { showToast } from "@ui/toasts";
import { getAssetIDByName } from "@ui/assets";
import { Forms } from "@ui/components";
import copyText from "@lib/utils/copyText";
interface AssetDisplayProps {
asset: Asset;
@ -24,7 +23,7 @@ export default function AssetDisplay({ asset }: AssetDisplayProps) {
label={`${asset.name} - ${asset.id}`}
trailing={<RN.Image source={asset.id} style={styles.asset} />}
onPress={() => {
copyText(asset.name);
clipboard.setString(asset.name);
showToast("Copied asset name to clipboard.", getAssetIDByName("toast_copy_link"));
}}
/>

View file

@ -1,4 +1,4 @@
import { ReactNative as RN, clipboard, stylesheet } from "@metro/common";
import { ReactNative as RN, stylesheet, clipboard } from "@metro/common";
import { HTTP_REGEX } from "@lib/constants";
import { showInputAlert } from "@ui/alerts";
import { getAssetIDByName } from "@ui/assets";

View file

@ -1,7 +1,7 @@
import { clipboard } from "@metro/common";
import { getAssetIDByName } from "@ui/assets";
import { showToast } from "@ui/toasts";
import { Forms } from "@ui/components";
import copyText from "@utils/copyText";
interface VersionProps {
label: string;
@ -18,7 +18,7 @@ export default function Version({ label, version, icon }: VersionProps) {
leading={<FormRow.Icon source={getAssetIDByName(icon)} />}
trailing={<FormText>{version}</FormText>}
onPress={() => {
copyText(`${label} - ${version}`);
clipboard.setString(`${label} - ${version}`);
showToast("Copied version to clipboard.", getAssetIDByName("toast_copy_link"));
}}
/>