mirror of
https://github.com/R0m1k3/FlowReader.git
synced 2026-10-19 21:28:10 +02:00
fix(share): resolve typescript errors in ReaderView and ShareButton
This commit is contained in:
1 parent
8279df02d3
commit
02c3c333cf
2 files changed
+2
-3
No files matched your search
@@ -1,6 +1,5 @@
|
|||||||
import { ReaderViewProps } from './ReaderView'; // Self-reference import seems wrong, removing.
|
import { useState } from 'react';
|
||||||
import { ShareButton } from './ShareButton';
|
import { ShareButton } from './ShareButton';
|
||||||
// No need to import ReaderViewProps if we define it here, but let's keep clean.
|
|
||||||
import { type Article, articlesApi } from '../api/articles';
|
import { type Article, articlesApi } from '../api/articles';
|
||||||
|
|
||||||
interface ReaderViewProps {
|
interface ReaderViewProps {
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export function ShareButton({ article, className = "" }: ShareButtonProps) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const copyToClipboard = () => {
|
const copyToClipboard = () => {
|
||||||
navigator.clipboard.writeText(article.url);
|
navigator.clipboard.writeText(article.url || window.location.href);
|
||||||
setCopied(true);
|
setCopied(true);
|
||||||
setTimeout(() => setCopied(false), 2000);
|
setTimeout(() => setCopied(false), 2000);
|
||||||
setIsOpen(false);
|
setIsOpen(false);
|
||||||
|
|||||||
Reference in new issue
Block a user