Merged in feat/SW-212-copy-to-clipboard-feedback (pull request #548)

Feat/SW-212 copy to clipboard feedback

* feat(SW-212): Added toast to give feedback when copying member id

* feat(SW-212): Update copy

* feat(SW-212): Changed to use success toast and updated copy

* fix: update copy in toast for copying membership ID


Approved-by: Christel Westerberg
Approved-by: Matilda Landström
This commit is contained in:
Tobias Johansson
2024-09-02 13:49:10 +00:00
parent 56a49ee56d
commit c0b16e8dee
7 changed files with 21 additions and 7 deletions

View File

@@ -1,15 +1,23 @@
"use client"
import { useIntl } from "react-intl"
import CopyIcon from "@/components/Icons/Copy"
import Button from "@/components/TempDesignSystem/Button"
import { toast } from "@/components/TempDesignSystem/Toasts"
import styles from "./copybutton.module.css"
import type { CopyButtonProps } from "@/types/components/myPages/membership"
export default function CopyButton({ membershipNumber }: CopyButtonProps) {
const intl = useIntl()
function handleCopy() {
navigator.clipboard.writeText(membershipNumber)
toast.success(
intl.formatMessage({ id: "Membership ID copied to clipboard" })
)
}
return (