diff --git a/CHANGELOG.md b/CHANGELOG.md
index e3a961c..a172248 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,5 @@
### v1.1 (2021-09-24)
+- Added pin icon directly to snippet card ([#4](https://github.com/pawelmalak/snippet-box/issues/4))
- Fixed issue with copying snippets ([#6](https://github.com/pawelmalak/snippet-box/issues/6))
### v1.0 (2021-09-23)
diff --git a/client/src/components/Snippets/SnippetCard.tsx b/client/src/components/Snippets/SnippetCard.tsx
index 4ac2575..d880a30 100644
--- a/client/src/components/Snippets/SnippetCard.tsx
+++ b/client/src/components/Snippets/SnippetCard.tsx
@@ -4,9 +4,8 @@ import { Snippet } from '../../typescript/interfaces';
import { dateParser, badgeColor } from '../../utils';
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';
+import { SnippetPin } from './SnippetPin';
interface Props {
snippet: Snippet;
@@ -26,7 +25,7 @@ export const SnippetCard = (props: Props): JSX.Element => {
{/* TITLE */}
{title}
- {isPinned ? : ''}
+
diff --git a/client/src/components/Snippets/SnippetDetails.tsx b/client/src/components/Snippets/SnippetDetails.tsx
index 5b0c947..9de585b 100644
--- a/client/src/components/Snippets/SnippetDetails.tsx
+++ b/client/src/components/Snippets/SnippetDetails.tsx
@@ -1,12 +1,11 @@
import { useContext } from 'react';
-import { Link } from 'react-router-dom';
+import { useHistory } from 'react-router-dom';
import { SnippetsContext } from '../../store';
import { Snippet } from '../../typescript/interfaces';
import { dateParser } from '../../utils';
import { Button, Card } from '../UI';
-import Icon from '@mdi/react';
-import { mdiPin } from '@mdi/js';
import copy from 'clipboard-copy';
+import { SnippetPin } from './SnippetPin';
interface Props {
snippet: Snippet;
@@ -24,8 +23,9 @@ export const SnippetDetails = (props: Props): JSX.Element => {
isPinned
} = props.snippet;
- const { deleteSnippet, toggleSnippetPin, setSnippet } =
- useContext(SnippetsContext);
+ const history = useHistory();
+
+ const { deleteSnippet, setSnippet } = useContext(SnippetsContext);
const creationDate = dateParser(createdAt);
const updateDate = dateParser(updatedAt);
@@ -38,7 +38,7 @@ export const SnippetDetails = (props: Props): JSX.Element => {
{title}
- {isPinned ? : ''}
+
{description}
@@ -59,33 +59,22 @@ export const SnippetDetails = (props: Props): JSX.Element => {
Last updated
{updateDate.relative}
-
{/* ACTIONS */}
-
-
-