add title attr to text text links (#1228)
* add title attr to text text links
* Revert "add title attr to text text links"
This reverts commit c028cd184e.
* use css tooltips
* add to expanded post state
* handle theming
* add to bskyweb
This commit is contained in:
@@ -6,6 +6,8 @@ import {useTheme, TypographyVariant} from 'lib/ThemeContext'
|
||||
export type CustomTextProps = TextProps & {
|
||||
type?: TypographyVariant
|
||||
lineHeight?: number
|
||||
title?: string
|
||||
dataSet?: Record<string, string | number>
|
||||
}
|
||||
|
||||
export function Text({
|
||||
@@ -13,13 +15,19 @@ export function Text({
|
||||
children,
|
||||
lineHeight,
|
||||
style,
|
||||
title,
|
||||
dataSet,
|
||||
...props
|
||||
}: React.PropsWithChildren<CustomTextProps>) {
|
||||
const theme = useTheme()
|
||||
const typography = theme.typography[type]
|
||||
const lineHeightStyle = lineHeight ? lh(theme, type, lineHeight) : undefined
|
||||
return (
|
||||
<RNText style={[s.black, typography, lineHeightStyle, style]} {...props}>
|
||||
<RNText
|
||||
style={[s.black, typography, lineHeightStyle, style]}
|
||||
// @ts-ignore web only -esb
|
||||
dataSet={Object.assign({tooltip: title}, dataSet || {})}
|
||||
{...props}>
|
||||
{children}
|
||||
</RNText>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user