From db4e4e8958bac923ef193325acaee4e183d9deea Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Wed, 29 Mar 2023 11:24:49 +0800 Subject: [PATCH] perf: beautify url tag style --- .../com.msgbyte.bbcode/src/tags/UrlTag.tsx | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/client/web/plugins/com.msgbyte.bbcode/src/tags/UrlTag.tsx b/client/web/plugins/com.msgbyte.bbcode/src/tags/UrlTag.tsx index 591c92b3..3431ad3c 100644 --- a/client/web/plugins/com.msgbyte.bbcode/src/tags/UrlTag.tsx +++ b/client/web/plugins/com.msgbyte.bbcode/src/tags/UrlTag.tsx @@ -1,7 +1,13 @@ import { Link } from '@capital/component'; import React from 'react'; +import styled from 'styled-components'; import type { TagProps } from '../bbcode/type'; +const UnderlineSpan = styled.span` + text-decoration: underline; + text-decoration-style: dotted; +`; + export const UrlTag: React.FC = React.memo((props) => { const { node } = props; const text = node.content.join(''); @@ -9,17 +15,25 @@ export const UrlTag: React.FC = React.memo((props) => { if (url.startsWith('/')) { // 内部地址,使用 react-router 进行导航 - return {text}; + return ( + + {text} + + ); } if (url.startsWith(window.location.origin)) { // 内部地址,使用 react-router 进行导航 - return {text}; + return ( + + {text} + + ); } return ( - {text} + {text} ); });