mirror of
https://github.com/pawelmalak/snippet-box.git
synced 2025-12-21 13:23:05 +01:00
Fixed issue with copying snippets. Added Changelog file
This commit is contained in:
@@ -1 +1,2 @@
|
||||
*.css
|
||||
*.css
|
||||
CHANGELOG.md
|
||||
5
CHANGELOG.md
Normal file
5
CHANGELOG.md
Normal file
@@ -0,0 +1,5 @@
|
||||
### v1.1 (2021-09-24)
|
||||
- Fixed issue with copying snippets ([#6](https://github.com/pawelmalak/snippet-box/issues/6))
|
||||
|
||||
### v1.0 (2021-09-23)
|
||||
Initial release
|
||||
5
client/package-lock.json
generated
5
client/package-lock.json
generated
@@ -4280,6 +4280,11 @@
|
||||
"resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz",
|
||||
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A=="
|
||||
},
|
||||
"clipboard-copy": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://registry.npmjs.org/clipboard-copy/-/clipboard-copy-4.0.1.tgz",
|
||||
"integrity": "sha512-wOlqdqziE/NNTUJsfSgXmBMIrYmfd5V0HCGsR8uAKHcg+h9NENWINcfRjtWGU77wDHC8B8ijV4hMTGYbrKovng=="
|
||||
},
|
||||
"cliui": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
"@types/react": "^17.0.21",
|
||||
"@types/react-dom": "^17.0.9",
|
||||
"axios": "^0.21.4",
|
||||
"clipboard-copy": "^4.0.1",
|
||||
"dayjs": "^1.10.7",
|
||||
"react": "^17.0.2",
|
||||
"react-dom": "^17.0.2",
|
||||
|
||||
@@ -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