consolidate tag components

This commit is contained in:
Eric Bailey
2023-10-10 19:12:17 -05:00
parent 3bae37460d
commit 4e26c97594
2 changed files with 2 additions and 29 deletions
-27
View File
@@ -30,33 +30,6 @@ export function Tag({
)
}
export function InlineTag({
value,
textSize,
}: {
value: string
textSize?: CustomTextProps['type']
}) {
const pal = usePalette('default')
const type = textSize || 'xs-medium'
return (
<TextLink
type={type}
text={`#${value}`}
accessible
href={`/search?q=${value}`}
style={[
pal.link,
{
paddingTop: 0,
paddingBottom: 2,
},
]}
/>
)
}
export function EditableTag({
value,
onRemove,
+2 -2
View File
@@ -7,7 +7,7 @@ import {lh} from 'lib/styles'
import {toShortUrl} from 'lib/strings/url-helpers'
import {useTheme, TypographyVariant} from 'lib/ThemeContext'
import {usePalette} from 'lib/hooks/usePalette'
import {InlineTag} from 'view/com/Tag'
import {Tag} from 'view/com/Tag'
const WORD_WRAP = {wordWrap: 1}
@@ -95,7 +95,7 @@ export function RichText({
/>,
)
} else if (tag && AppBskyRichtextFacet.validateTag(tag).success) {
els.push(<InlineTag key={key} value={tag.tag} textSize={type} />)
els.push(<Tag key={key} value={tag.tag} textSize={type} />)
} else {
els.push(segment.text)
}