fix ContextTag text selection (#492)

* add default curors to ContextTag

* Create wise-readers-accept.md

* f

* f
This commit is contained in:
Felicio Mununga 2023-10-20 14:40:44 +02:00 committed by GitHub
parent 1323989f83
commit 29b9734a56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 3 deletions

View File

@ -0,0 +1,5 @@
---
"@status-im/components": patch
---
add default curors to ContextTag

View File

@ -214,6 +214,7 @@ const Avatar = (props: AvatarProps) => {
size={textSizes[props.size]} size={textSizes[props.size]}
weight="medium" weight="medium"
color="$white-100" color="$white-100"
select={false}
> >
{props.name.slice(0, 2).toUpperCase()} {props.name.slice(0, 2).toUpperCase()}
</Text> </Text>
@ -264,6 +265,7 @@ const Avatar = (props: AvatarProps) => {
size={textSizes[props.size]} size={textSizes[props.size]}
weight="medium" weight="medium"
color="$white-100" color="$white-100"
select={false}
> >
{props.name.slice(0, 2).toUpperCase()} {props.name.slice(0, 2).toUpperCase()}
</Text> </Text>
@ -271,11 +273,15 @@ const Avatar = (props: AvatarProps) => {
) )
case 'channel': case 'channel':
if (props.emoji) { if (props.emoji) {
return <Text size={channelEmojiSizes[props.size]}>{props.emoji}</Text> return (
<Text size={channelEmojiSizes[props.size]} select={false}>
{props.emoji}
</Text>
)
} }
return ( return (
<Text size={textSizes[props.size]}> <Text size={textSizes[props.size]} select={false}>
{props.name.slice(0, 1).toUpperCase()} {props.name.slice(0, 1).toUpperCase()}
</Text> </Text>
) )

View File

@ -92,7 +92,13 @@ const Label = (props: {
const { children, size, type = 'default' } = props const { children, size, type = 'default' } = props
return ( return (
<Text size={size} weight="medium" color="$neutral-100" type={type}> <Text
size={size}
weight="medium"
color="$neutral-100"
type={type}
select={false}
>
{children} {children}
</Text> </Text>
) )
@ -288,6 +294,7 @@ const Base = styled(View, {
display: 'inline-flex', display: 'inline-flex',
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
cursor: 'default',
variants: { variants: {
outline: { outline: {

View File

@ -15,6 +15,7 @@ type Props = {
color?: ColorTokens | string color?: ColorTokens | string
truncate?: boolean truncate?: boolean
wrap?: false wrap?: false
select?: false
} & ( } & (
| { size: 88; weight?: Weight } | { size: 88; weight?: Weight }
| { size: 64; weight?: Weight } | { size: 64; weight?: Weight }
@ -131,6 +132,12 @@ const Base = styled(BaseText, {
minWidth: 0, minWidth: 0,
}, },
}, },
select: {
false: {
userSelect: 'none',
},
},
} as const, } as const,
defaultVariants: { defaultVariants: {