Commit 9593b0b0 authored by Steven's avatar Steven

chore: fix link rel field

parent ca536304
interface Props {
url: string;
}
const AutoLink: React.FC<Props> = ({ url }: Props) => {
return (
<a
className="text-blue-600 dark:text-blue-400 cursor-pointer underline break-all hover:opacity-80 decoration-1"
href={url}
target="_blank"
>
{url}
</a>
);
};
export default AutoLink;
interface Props {
text: string;
url: string;
text?: string;
}
const Link: React.FC<Props> = ({ text, url }: Props) => {
......@@ -9,8 +9,9 @@ const Link: React.FC<Props> = ({ text, url }: Props) => {
className="text-blue-600 dark:text-blue-400 cursor-pointer underline break-all hover:opacity-80 decoration-1"
href={url}
target="_blank"
rel="noopener noreferrer"
>
{text}
{text || url}
</a>
);
};
......
......@@ -22,7 +22,6 @@ import {
TextNode,
UnorderedListNode,
} from "@/types/proto/api/v2/markdown_service";
import AutoLink from "./AutoLink";
import Blockquote from "./Blockquote";
import Bold from "./Bold";
import BoldItalic from "./BoldItalic";
......@@ -85,7 +84,7 @@ const Renderer: React.FC<Props> = ({ node }: Props) => {
case NodeType.LINK:
return <Link {...(node.linkNode as LinkNode)} />;
case NodeType.AUTO_LINK:
return <AutoLink {...(node.autoLinkNode as AutoLinkNode)} />;
return <Link {...(node.autoLinkNode as AutoLinkNode)} />;
case NodeType.TAG:
return <Tag {...(node.tagNode as TagNode)} />;
case NodeType.STRIKETHROUGH:
......
......@@ -95,7 +95,12 @@ const UserProfile = () => {
<UserAvatar className="!w-20 !h-20 mb-2 drop-shadow" avatarUrl={user?.avatarUrl} />
<div className="w-full flex flex-row justify-center items-center">
<p className="text-3xl text-black leading-none opacity-80 dark:text-gray-200">{user?.nickname}</p>
<a className="ml-1 cursor-pointer text-gray-500" href={`/u/${user?.id}/rss.xml`} target="_blank">
<a
className="ml-1 cursor-pointer text-gray-500"
href={`/u/${user?.id}/rss.xml`}
target="_blank"
rel="noopener noreferrer"
>
<Icon.Rss className="w-5 h-auto opacity-60 mt-0.5" />
</a>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment