Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any plans to support copy to clipboard (markdown code) for notes? #195 #197

Merged
merged 3 commits into from
Jun 9, 2024

Conversation

kamtschatka
Copy link
Collaborator

added a button to copy the markdown and added code highlighting

1 component seems unused
I am not sure how to test the mobile version/if that should also use the new component

…rder-app#195

added a button to copy the markdown and added code highlighting
Copy link
Collaborator

@MohamedBassem MohamedBassem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Left a bunch of small comments about reusing some of the exiting code.

apps/mobile/components/bookmarks/BookmarkCard.tsx Outdated Show resolved Hide resolved
@@ -45,18 +45,15 @@ export default function TextCard({

return (
<>
{/* TODO: Where is that used? Is it simply unused?*/}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the bookmark card shown in the BookmarkGrid.

Screenshot 2024-06-07 at 11 03 14 AM

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the thing is, if I remove the BookmarkedTextViewer, nothing changes, so I am not quite sure what it does?
Hovering the element in the React Extension does not highlight it either and previewModalOpen is only bound to this component, nothing else, so I don't think that value can actually change?

apps/web/components/ui/code-copy-button.tsx Outdated Show resolved Hide resolved
apps/web/components/ui/code-copy-button.tsx Outdated Show resolved Hide resolved
apps/web/components/ui/code-copy-button.tsx Outdated Show resolved Hide resolved
apps/web/components/ui/markdown-component.tsx Outdated Show resolved Hide resolved
code({ className, children, ...props }) {
const match = /language-(\w+)/.exec(className ?? "");
return match ? (
// @ts-expect-error i have absolutely no idea what it complains about and passing refs to it also does not solve it
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the error you're getting?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Types of property ref are incompatible.
Type LegacyRef<HTMLElement> | undefined is not assignable to type LegacyRef<SyntaxHighlighter> | undefined
Types of property ref are incompatible.
Type LegacyRef<HTMLElement> | undefined is not assignable to type LegacyRef<SyntaxHighlighter> | undefined
Type (instance: HTMLElement | null) => void is not assignable to type LegacyRef<SyntaxHighlighter> | undefined
Type (instance: HTMLElement | null) => void is not assignable to type (instance: SyntaxHighlighter | null) => void
Types of parameters instance and instance are incompatible.
Type SyntaxHighlighter | null is not assignable to type HTMLElement | null
Type Component<SyntaxHighlighterProps, {}, any> is missing the following properties from type HTMLElement:
accessKey, accessKeyLabel, autocapitalize, dir
, and 290 more.

kamtschatka and others added 2 commits June 8, 2024 12:44
…rder-app#195

Changed the copy-button to a generic one
added a safeguard and a message to the copy button if copying is not possible
@MohamedBassem MohamedBassem merged commit be1bb38 into hoarder-app:main Jun 9, 2024
3 checks passed
@kamtschatka kamtschatka deleted the copy-markdown branch June 9, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants