Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Add link markdown style in bio #7339

Merged
merged 3 commits into from
Jun 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion components/user/UserProfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ function UserProfile({ BASE_URL, data }) {
saveAs(blob, `linkfree-${data.username}.png`)
);

// Custom component for rendering links within ReactMarkdown
const LinkRenderer = ({ href, children }) => (
<Link href={href}>
{children}
</Link>
);

return (
<>
<div className="flex justify-center items-center flex-col md:flex-row gap-x-6">
Expand Down Expand Up @@ -59,7 +66,7 @@ function UserProfile({ BASE_URL, data }) {
</div>
</div>
<div className="flex justify-center my-4 text-center">
<ReactMarkdown>{data.bio}</ReactMarkdown>
<ReactMarkdown components={{ a: LinkRenderer }}>{data.bio}</ReactMarkdown>
</div>
{!qrShow && (
<div className="flex flex-wrap justify-center">
Expand Down