Skip to content

Commit

Permalink
Merge branch 'main' into fdroid
Browse files Browse the repository at this point in the history
  • Loading branch information
rolandosborne committed Nov 8, 2023
2 parents 33c1f90 + 0d2e35a commit 270241a
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 87 deletions.
25 changes: 24 additions & 1 deletion app/mobile/src/constants/Strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,10 @@ const Strings = [
connect: 'Connect With People',
start: 'Start a Conversation',
started: 'Get Started',

deleteMessage: 'Delete Message',
blockMessage: 'Block Message',
reportMessage: 'Report Message',
},
{
languageCode: 'fr',
Expand Down Expand Up @@ -386,6 +390,10 @@ const Strings = [
connect: 'Se Connecter Avec d\'Autres',
start: 'Créer une Conversation',
started: 'Commencer',

deleteMessage: 'Supprimer le Message',
blockMessage: 'Bloquer le Message',
reportMessage: 'Signaler le Message',
},
{
languageCode: 'es',
Expand Down Expand Up @@ -577,6 +585,10 @@ const Strings = [
connect: 'Conéctate Con Gente',
start: 'Iniciar una Conversación',
started: 'Empezar',

deleteMessage: 'Borrar Mensaje',
blockMessage: 'Bloquear Mensaje',
reportMessage: 'Reportar Mensaje',
},
{
languageCode: 'de',
Expand Down Expand Up @@ -768,6 +780,10 @@ const Strings = [
connect: 'Verbinde dich mit Menschen',
start: 'Eine Konversation Beginnen',
started: 'Loslegen',

deleteMessage: 'Nachricht Löschen',
blockMessage: 'Blockieren Sie die Nachricht',
reportMessage: 'Melden Sie die Nachricht',
},
{
languageCode: 'pt',
Expand Down Expand Up @@ -944,6 +960,10 @@ const Strings = [
connect: 'Conecte-se Com As Pessoas',
start: 'Crie Uma Conversa',
started: 'Iniciar',

deleteMessage: 'Apagar Mensagem',
blockMessage: 'Bloquear Mensagem',
reportMessage: 'Denunciar Mensagem',
},
{
languageCode: 'ru',
Expand Down Expand Up @@ -1118,7 +1138,10 @@ const Strings = [
setup: 'Настройте свой профиль',
connect: 'Свяжитесь с людьми',
start: 'Начните разговор',
started: 'Начало'
started: 'Начало',
deleteMessage: 'Удаленное сообщение',
blockMessage: 'Заблокировать сообщение',
reportMessage: 'Пожаловаться на сообщение',
}
];

Expand Down
8 changes: 4 additions & 4 deletions app/mobile/src/session/conversation/Conversation.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export function Conversation({ navigation, cardId, channelId, closeConversation,
catch (err) {
console.log(err);
Alert.alert(
'Failed to Load More Messages',
'Please try again',
state.strings.error,
state.strings.tryAgain,
)
}
}
Expand All @@ -34,8 +34,8 @@ export function Conversation({ navigation, cardId, channelId, closeConversation,
catch (err) {
console.log(err);
Alert.alert(
'Failed to Update Message',
'Please try again.',
state.strings.error,
state.strings.tryAgain,
)
}
}
Expand Down
81 changes: 2 additions & 79 deletions app/mobile/src/session/conversation/topicItem/TopicItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,31 +21,6 @@ import { SafeAreaView, SafeAreaProvider } from 'react-native-safe-area-context';
export function TopicItem({ item, focused, focus, hosting, remove, update, block, report, contentKey }) {
const { state, actions } = useTopicItem(item, hosting, remove, contentKey);

const erase = () => {
Alert.alert(
"Removing Message",
"Confirm?",
[
{ text: "Cancel",
onPress: () => {},
},
{ text: "Remove",
onPress: async () => {
try {
await remove(item.topicId);
}
catch (err) {
console.log(err);
Alert.alert(
'Failed to Remove Message',
'Please try again.'
)
}
},
}
]
);
}

const shareMessage = async () => {
try {
Expand All @@ -54,64 +29,12 @@ export function TopicItem({ item, focused, focus, hosting, remove, update, block
catch(err) {
console.log(err);
Alert.alert(
'Failed to Share Message',
'Please try again.'
state.strings.error,
state.strings.tryAgain,
)
}
}

const reportMessage = () => {
Alert.alert(
"Report Message",
"Confirm?",
[
{ text: "Cancel",
onPress: () => {},
},
{ text: "Report",
onPress: async () => {
try {
await report(item.topicId);
}
catch (err) {
console.log(err);
Alert.alert(
'Failed to Report Message',
'Please try again.'
)
}
},
}
]
);
}

const hideMessage = () => {
Alert.alert(
"Blocking Message",
"Confirm?",
[
{ text: "Cancel",
onPress: () => {},
},
{ text: "Block",
onPress: async () => {
try {
await block(item.topicId);
}
catch (err) {
console.log(err);
Alert.alert(
'Failed to Block Message',
'Please try again.'
)
}
},
}
]
);
}

const renderThumb = (thumb) => {
return (
<View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ export function useTopicItem(item, hosting, remove, contentKey) {
},
promptBlock: (block) => {
display.actions.showPrompt({
title: state.strings.blockTopic,
title: state.strings.blockMessage,
centerButtons: true,
ok: { label: state.strings.confirmBlock, action: async () => await block(item.topicId), failed: () => {
Alert.alert(
Expand All @@ -444,7 +444,7 @@ export function useTopicItem(item, hosting, remove, contentKey) {
},
promptReport: (report) => {
display.actions.showPrompt({
title: state.strings.reportTopic,
title: state.strings.reportMessage,
centerButtons: true,
ok: { label: state.strings.confirmReport, action: async () => await report(item.topicId), failed: () => {
Alert.alert(
Expand All @@ -457,7 +457,7 @@ export function useTopicItem(item, hosting, remove, contentKey) {
},
promptRemove: (remove) => {
display.actions.showPrompt({
title: state.strings.deleteTopic,
title: state.strings.deleteMessage,
centerButtons: true,
ok: { label: state.strings.confirmDelete, action: async () => await remove(item.topicId), failed: () => {
Alert.alert(
Expand Down

0 comments on commit 270241a

Please sign in to comment.