mirror of
https://github.com/pawelmalak/snippet-box.git
synced 2025-12-24 06:28:07 +01:00
Fixed issue with copying snippets. Added Changelog file
This commit is contained in:
@@ -6,6 +6,7 @@ import { Badge, Button, Card } from '../UI';
|
||||
import { SnippetsContext } from '../../store';
|
||||
import Icon from '@mdi/react';
|
||||
import { mdiPin } from '@mdi/js';
|
||||
import copy from 'clipboard-copy';
|
||||
|
||||
interface Props {
|
||||
snippet: Snippet;
|
||||
@@ -17,7 +18,7 @@ export const SnippetCard = (props: Props): JSX.Element => {
|
||||
const { setSnippet } = useContext(SnippetsContext);
|
||||
|
||||
const copyHandler = () => {
|
||||
navigator.clipboard.writeText(code);
|
||||
copy(code);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -6,6 +6,7 @@ import { dateParser } from '../../utils';
|
||||
import { Button, Card } from '../UI';
|
||||
import Icon from '@mdi/react';
|
||||
import { mdiPin } from '@mdi/js';
|
||||
import copy from 'clipboard-copy';
|
||||
|
||||
interface Props {
|
||||
snippet: Snippet;
|
||||
@@ -30,7 +31,7 @@ export const SnippetDetails = (props: Props): JSX.Element => {
|
||||
const updateDate = dateParser(updatedAt);
|
||||
|
||||
const copyHandler = () => {
|
||||
navigator.clipboard.writeText(code);
|
||||
copy(code);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user