Ensure long trending topic titles can wrap (#11141)
This commit is contained in:
@@ -1,7 +1,5 @@
|
|||||||
import {View} from 'react-native'
|
import {View} from 'react-native'
|
||||||
import {msg} from '@lingui/core/macro'
|
import {Trans, useLingui} from '@lingui/react/macro'
|
||||||
import {useLingui} from '@lingui/react'
|
|
||||||
import {Trans} from '@lingui/react/macro'
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
useTrendingSettings,
|
useTrendingSettings,
|
||||||
@@ -28,7 +26,7 @@ export function SidebarTrendingTopics() {
|
|||||||
|
|
||||||
function Inner() {
|
function Inner() {
|
||||||
const t = useTheme()
|
const t = useTheme()
|
||||||
const {_} = useLingui()
|
const {t: l} = useLingui()
|
||||||
const ax = useAnalytics()
|
const ax = useAnalytics()
|
||||||
const trendingPrompt = Prompt.usePromptControl()
|
const trendingPrompt = Prompt.usePromptControl()
|
||||||
const {setTrendingDisabled} = useTrendingSettingsApi()
|
const {setTrendingDisabled} = useTrendingSettingsApi()
|
||||||
@@ -54,7 +52,7 @@ function Inner() {
|
|||||||
size="tiny"
|
size="tiny"
|
||||||
color="secondary"
|
color="secondary"
|
||||||
shape="round"
|
shape="round"
|
||||||
label={_(msg`Trending options`)}
|
label={l`Trending options`}
|
||||||
onPress={() => trendingPrompt.open()}
|
onPress={() => trendingPrompt.open()}
|
||||||
style={[a.bg_transparent, {marginTop: -6, marginRight: -6}]}>
|
style={[a.bg_transparent, {marginTop: -6, marginRight: -6}]}>
|
||||||
<ButtonIcon icon={Ellipsis} size="xs" />
|
<ButtonIcon icon={Ellipsis} size="xs" />
|
||||||
@@ -90,12 +88,11 @@ function Inner() {
|
|||||||
<TrendingTopicLink
|
<TrendingTopicLink
|
||||||
key={topic.link}
|
key={topic.link}
|
||||||
topic={topic}
|
topic={topic}
|
||||||
style={[a.self_start]}
|
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
ax.metric('trendingTopic:click', {context: 'sidebar'})
|
ax.metric('trendingTopic:click', {context: 'sidebar'})
|
||||||
}}>
|
}}>
|
||||||
{({hovered}) => (
|
{({hovered}) => (
|
||||||
<View style={[a.flex_row, a.align_center, a.gap_xs]}>
|
<View style={[a.flex_1, a.flex_row, a.gap_xs]}>
|
||||||
<Text
|
<Text
|
||||||
style={[
|
style={[
|
||||||
a.text_sm,
|
a.text_sm,
|
||||||
@@ -107,13 +104,13 @@ function Inner() {
|
|||||||
</Text>
|
</Text>
|
||||||
<Text
|
<Text
|
||||||
style={[
|
style={[
|
||||||
|
a.flex_1,
|
||||||
a.text_sm,
|
a.text_sm,
|
||||||
a.leading_snug,
|
a.leading_snug,
|
||||||
hovered
|
hovered
|
||||||
? [t.atoms.text, a.underline]
|
? [t.atoms.text, a.underline]
|
||||||
: t.atoms.text_contrast_medium,
|
: t.atoms.text_contrast_medium,
|
||||||
]}
|
]}>
|
||||||
numberOfLines={1}>
|
|
||||||
{topic.displayName ?? topic.topic}
|
{topic.displayName ?? topic.topic}
|
||||||
</Text>
|
</Text>
|
||||||
</View>
|
</View>
|
||||||
@@ -126,9 +123,9 @@ function Inner() {
|
|||||||
</View>
|
</View>
|
||||||
<Prompt.Basic
|
<Prompt.Basic
|
||||||
control={trendingPrompt}
|
control={trendingPrompt}
|
||||||
title={_(msg`Hide trending topics?`)}
|
title={l`Hide trending topics?`}
|
||||||
description={_(msg`You can update this later from your settings.`)}
|
description={l`You can update this later from your settings.`}
|
||||||
confirmButtonCta={_(msg`Hide`)}
|
confirmButtonCta={l`Hide`}
|
||||||
onConfirm={onConfirmHide}
|
onConfirm={onConfirmHide}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
|
|||||||
Reference in New Issue
Block a user