Skip to content

Commit

Permalink
Make list end text customizable (#4145)
Browse files Browse the repository at this point in the history
* only try to initialize once

* nit

* change to `You have reached the end`

* make the text at end of list customizable

* make the text at end of list customizable

* update intl
  • Loading branch information
haileyok authored May 21, 2024
1 parent b89e4de commit 1ec4e0a
Show file tree
Hide file tree
Showing 19 changed files with 591 additions and 457 deletions.
26 changes: 11 additions & 15 deletions src/components/Lists.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@ export function ListFooter({
onRetry,
height,
style,
showEndMessage = false,
endMessageText,
}: {
isFetchingNextPage?: boolean
hasNextPage?: boolean
error?: string
onRetry?: () => Promise<unknown>
height?: number
style?: StyleProp<ViewStyle>
showEndMessage?: boolean
endMessageText?: string
}) {
const t = useTheme()

Expand All @@ -41,21 +45,13 @@ export function ListFooter({
]}>
{isFetchingNextPage ? (
<Loader size="xl" />
) : (
<>
{error ? (
<ListFooterMaybeError error={error} onRetry={onRetry} />
) : (
<>
{!hasNextPage && (
<Text style={[a.text_sm, t.atoms.text_contrast_low]}>
<Trans>End of list</Trans>
</Text>
)}
</>
)}
</>
)}
) : error ? (
<ListFooterMaybeError error={error} onRetry={onRetry} />
) : !hasNextPage && showEndMessage ? (
<Text style={[a.text_sm, t.atoms.text_contrast_low]}>
{endMessageText ?? <Trans>You have reached the end</Trans>}
</Text>
) : null}
</View>
)
}
Expand Down
60 changes: 34 additions & 26 deletions src/locale/locales/ca/messages.po
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,7 @@ msgstr "Tanca la imatge"
msgid "Close image viewer"
msgstr "Tanca el visor d'imatges"

#: src/components/dms/MessagesNUX.tsx:159
#: src/components/dms/MessagesNUX.tsx:162
msgid "Close modal"
msgstr ""

Expand Down Expand Up @@ -1662,7 +1662,7 @@ msgstr "Vols dir alguna cosa?"
msgid "Dim"
msgstr "Tènue"

#: src/components/dms/MessagesNUX.tsx:85
#: src/components/dms/MessagesNUX.tsx:88
msgid "Direct messages are here!"
msgstr ""

Expand Down Expand Up @@ -2009,8 +2009,8 @@ msgid "End of feed"
msgstr "Fi del canal"

#: src/components/Lists.tsx:52
msgid "End of list"
msgstr ""
#~ msgid "End of list"
#~ msgstr ""

#: src/view/com/modals/AddAppPasswords.tsx:167
msgid "Enter a name for this App Password"
Expand Down Expand Up @@ -2095,8 +2095,8 @@ msgstr "Tothom"
msgid "Everybody can reply"
msgstr ""

#: src/components/dms/MessagesNUX.tsx:128
#: src/components/dms/MessagesNUX.tsx:131
#: src/components/dms/MessagesNUX.tsx:134
#: src/screens/Messages/Settings.tsx:74
#: src/screens/Messages/Settings.tsx:77
msgid "Everyone"
Expand Down Expand Up @@ -2232,7 +2232,7 @@ msgstr ""
msgid "Failed to submit appeal, please try again."
msgstr ""

#: src/components/dms/MessagesNUX.tsx:58
#: src/components/dms/MessagesNUX.tsx:60
#: src/screens/Messages/Settings.tsx:34
msgid "Failed to update settings"
msgstr ""
Expand Down Expand Up @@ -2498,7 +2498,7 @@ msgstr "De <0/>"
msgid "Gallery"
msgstr "Galeria"

#: src/components/dms/MessagesNUX.tsx:165
#: src/components/dms/MessagesNUX.tsx:168
msgid "Get started"
msgstr ""

Expand Down Expand Up @@ -2866,7 +2866,7 @@ msgstr "Introdueix el teu proveïdor d'allotjament preferit"
msgid "Input your user handle"
msgstr "Introdueix el teu identificador d'usuari"

#: src/components/dms/MessagesNUX.tsx:79
#: src/components/dms/MessagesNUX.tsx:82
msgid "Introducing Direct Messages"
msgstr ""

Expand Down Expand Up @@ -3309,14 +3309,14 @@ msgstr "Camp d'entrada del missatge"
msgid "Message is too long"
msgstr "El missatge és massa llarg"

#: src/screens/Messages/List/index.tsx:299
#: src/screens/Messages/List/index.tsx:301
msgid "Message settings"
msgstr "Configuració dels missatges"

#: src/Navigation.tsx:520
#: src/screens/Messages/List/index.tsx:144
#: src/screens/Messages/List/index.tsx:226
#: src/screens/Messages/List/index.tsx:295
#: src/screens/Messages/List/index.tsx:297
msgid "Messages"
msgstr "Missatges"

Expand Down Expand Up @@ -3603,8 +3603,8 @@ msgid "New"
msgstr "Nova"

#: src/components/dms/NewChatDialog/index.tsx:98
#: src/screens/Messages/List/index.tsx:309
#: src/screens/Messages/List/index.tsx:316
#: src/screens/Messages/List/index.tsx:311
#: src/screens/Messages/List/index.tsx:318
msgid "New chat"
msgstr "Xat nou"

Expand Down Expand Up @@ -3715,12 +3715,16 @@ msgstr "No pot tenir més de 253 caràcters"
msgid "No messages yet"
msgstr "Encara no tens cap missatge"

#: src/screens/Messages/List/index.tsx:254
msgid "No more conversations to show"
msgstr ""

#: src/view/com/notifications/Feed.tsx:110
msgid "No notifications yet!"
msgstr "Encara no tens cap notificació"

#: src/components/dms/MessagesNUX.tsx:146
#: src/components/dms/MessagesNUX.tsx:149
#: src/components/dms/MessagesNUX.tsx:152
#: src/screens/Messages/Settings.tsx:92
#: src/screens/Messages/Settings.tsx:95
msgid "No one"
Expand All @@ -3735,7 +3739,7 @@ msgstr "Cap resultat"
msgid "No results"
msgstr ""

#: src/components/Lists.tsx:211
#: src/components/Lists.tsx:207
msgid "No results found"
msgstr "No s'han trobat resultats"

Expand Down Expand Up @@ -3891,11 +3895,11 @@ msgstr "Només {0} poden respondre."
msgid "Only contains letters, numbers, and hyphens"
msgstr "Només pot tenir lletres, nombres i guionets"

#: src/components/Lists.tsx:92
#: src/components/Lists.tsx:88
msgid "Oops, something went wrong!"
msgstr "Ostres, alguna cosa ha anat malament!"

#: src/components/Lists.tsx:195
#: src/components/Lists.tsx:191
#: src/view/screens/AppPasswords.tsx:67
#: src/view/screens/Profile.tsx:100
msgid "Oops!"
Expand Down Expand Up @@ -4145,7 +4149,7 @@ msgstr "Un altre…"
msgid "Our moderators have reviewed reports and decided to disable your access to chats on Bluesky."
msgstr ""

#: src/components/Lists.tsx:212
#: src/components/Lists.tsx:208
#: src/view/screens/NotFound.tsx:45
msgid "Page not found"
msgstr "Pàgina no trobada"
Expand Down Expand Up @@ -4428,7 +4432,7 @@ msgid "Press to change hosting provider"
msgstr "Prem per canviar el proveïdor d'allotjament"

#: src/components/Error.tsx:85
#: src/components/Lists.tsx:97
#: src/components/Lists.tsx:93
#: src/screens/Messages/Conversation/MessageListError.tsx:24
#: src/screens/Signup/index.tsx:200
msgid "Press to retry"
Expand Down Expand Up @@ -4464,7 +4468,7 @@ msgstr "Privacitat"
msgid "Privacy Policy"
msgstr "Política de privacitat"

#: src/components/dms/MessagesNUX.tsx:88
#: src/components/dms/MessagesNUX.tsx:91
msgid "Privately chat with other users."
msgstr ""

Expand Down Expand Up @@ -4906,7 +4910,7 @@ msgstr "Torna a intentar l'última acció, que ha donat error"

#: src/components/dms/MessageItem.tsx:227
#: src/components/Error.tsx:90
#: src/components/Lists.tsx:108
#: src/components/Lists.tsx:104
#: src/screens/Login/LoginForm.tsx:285
#: src/screens/Login/LoginForm.tsx:292
#: src/screens/Messages/Conversation/MessageListError.tsx:25
Expand Down Expand Up @@ -5788,7 +5792,7 @@ msgstr "Comença un nou xat"
msgid "Start chat with {displayName}"
msgstr ""

#: src/components/dms/MessagesNUX.tsx:158
#: src/components/dms/MessagesNUX.tsx:161
msgid "Start chatting"
msgstr ""

Expand Down Expand Up @@ -6728,8 +6732,8 @@ msgstr "Usuaris"
msgid "users followed by <0/>"
msgstr "usuaris seguits per <0/>"

#: src/components/dms/MessagesNUX.tsx:137
#: src/components/dms/MessagesNUX.tsx:140
#: src/components/dms/MessagesNUX.tsx:143
#: src/screens/Messages/Settings.tsx:83
#: src/screens/Messages/Settings.tsx:86
msgid "Users I follow"
Expand Down Expand Up @@ -6934,7 +6938,7 @@ msgstr "Ho sentim, però no hem pogut carregar les teves paraules silenciades en
msgid "We're sorry, but your search could not be completed. Please try again in a few minutes."
msgstr "Ens sap greu, però la teva cerca no s'ha pogut fer. Prova-ho d'aquí una estona."

#: src/components/Lists.tsx:216
#: src/components/Lists.tsx:212
#: src/view/screens/NotFound.tsx:48
msgid "We're sorry! We can't find the page you were looking for."
msgstr "Ens sap greu! No podem trobar la pàgina que estàs cercant."
Expand Down Expand Up @@ -6972,8 +6976,8 @@ msgstr "En quins idiomes està aquesta publicació?"
msgid "Which languages would you like to see in your algorithmic feeds?"
msgstr "Quins idiomes t'agradaria veure en els teus canals algorítmics?"

#: src/components/dms/MessagesNUX.tsx:107
#: src/components/dms/MessagesNUX.tsx:121
#: src/components/dms/MessagesNUX.tsx:110
#: src/components/dms/MessagesNUX.tsx:124
msgid "Who can message you?"
msgstr ""

Expand Down Expand Up @@ -7071,7 +7075,7 @@ msgstr "També pots descobrir nous canals personalitzats per a seguir."
msgid "You can change these settings later."
msgstr "Pots canviar aquests paràmetres més endavant."

#: src/components/dms/MessagesNUX.tsx:116
#: src/components/dms/MessagesNUX.tsx:119
msgid "You can change this at any time."
msgstr ""

Expand Down Expand Up @@ -7179,6 +7183,10 @@ msgstr "Encara no has silenciat cap compte. per a silenciar un compte, ves al se
#~ msgid "You have not muted any accounts yet. To mute an account, go to their profile and selected \"Mute account\" from the menu on their account."
#~ msgstr "Encara no has silenciat cap compte. Per a fer-ho, al seu perfil i selecciona \"Silencia compte\" en el menú del seu compte."

#: src/components/Lists.tsx:52
msgid "You have reached the end"
msgstr ""

#: src/components/dialogs/MutedWords.tsx:249
msgid "You haven't muted any words or tags yet"
msgstr "Encara no has silenciat cap paraula ni etiqueta"
Expand Down
Loading

0 comments on commit 1ec4e0a

Please sign in to comment.