From 967994b994fd25ea7258582d4a85f66570a33e8e Mon Sep 17 00:00:00 2001 From: cohenaj194 Date: Wed, 10 Jul 2024 23:57:11 -0400 Subject: [PATCH] add copy to clipboard for craft names --- app/routes/ffxiv.craftsim._index.tsx | 32 +++++++++++++++++++++++++++- app/tailwind.css | 5 +++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/app/routes/ffxiv.craftsim._index.tsx b/app/routes/ffxiv.craftsim._index.tsx index b9bd5df2..5adba8d8 100644 --- a/app/routes/ffxiv.craftsim._index.tsx +++ b/app/routes/ffxiv.craftsim._index.tsx @@ -7,6 +7,7 @@ import { PageWrapper } from '~/components/Common' import NoResults from '~/components/Common/NoResults' import SmallTable from '~/components/WoWResults/FullScan/SmallTable' import CheckBox from '~/components/form/CheckBox' +import { ClipboardIcon } from '@heroicons/react/outline' import { InputWithLabel } from '~/components/form/InputWithLabel' import SmallFormContainer from '~/components/form/SmallFormContainer' import ItemsFilter from '~/components/form/ffxiv/ItemsFilter' @@ -46,6 +47,25 @@ import { import { SubmitButton } from '~/components/form/SubmitButton' import { dOHOptions } from '~/consts' +const CopyButton = ({ text }: { text: string }) => { + const handleCopy = async () => { + try { + await navigator.clipboard.writeText(text) + alert('Copied to clipboard!') + } catch (err) { + alert('Failed to copy text') + } + } + + return ( + + ) +} + // Overwrite default meta in the root.tsx export const meta: MetaFunction = () => { return { @@ -208,6 +228,7 @@ type ActionResponse = }) | { exception: string } | {} + export default function Index() { const loaderData = useLoaderData() const actionData = useActionData() @@ -450,7 +471,16 @@ const mobileColumnList = [ ] const columnList: Array> = [ - { columnId: 'itemName', header: 'Item Name' }, + { + columnId: 'itemName', + header: 'Item Name', + accessor: ({ row: { itemName } }) => ( +
+ {itemName} + +
+ ) + }, { columnId: 'profitEst', header: 'Profit Est per Craft.', diff --git a/app/tailwind.css b/app/tailwind.css index 79d42eee..d8d8abae 100644 --- a/app/tailwind.css +++ b/app/tailwind.css @@ -2503,6 +2503,11 @@ select { color: rgb(255 255 255 / var(--tw-text-opacity)); } +.hover\:text-blue-700:hover { + --tw-text-opacity: 1; + color: rgb(29 78 216 / var(--tw-text-opacity)); +} + .hover\:underline:hover { text-decoration-line: underline; }