-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(components-CopyButton): implement CopyButton component (#771)
- Loading branch information
1 parent
09e9645
commit 7a1f49b
Showing
17 changed files
with
1,006 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
let navigatorClipboardMocked = false; | ||
const writeTextMock = jest.fn(); | ||
|
||
const mockNavigatorClipboard = () => { | ||
if (!navigatorClipboardMocked) { | ||
Object.defineProperty(global.navigator, 'clipboard', { | ||
value: { | ||
writeText: writeTextMock, | ||
}, | ||
}); | ||
|
||
navigatorClipboardMocked = true; | ||
} | ||
|
||
return { writeTextMock }; | ||
}; | ||
|
||
export { mockNavigatorClipboard }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
} | ||
|
||
.block { | ||
@apply relative !important; | ||
@apply mb-0 p-5 !important; | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7a1f49b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
blog – ./
blog-git-main-sabertaz.vercel.app
blog.tazimi.dev
blog-sabertaz.vercel.app