Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…eactNative into feat.watch
  • Loading branch information
djorkaeffalexandre committed Apr 12, 2024
2 parents 904bca3 + 82d235f commit f6fa904
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@
"Supported_versions_expired_description": "An admin needs to update the workspace to a supported version in order to reenable access from mobile and desktop apps.",
"Supported_versions_expired_title": "{{workspace_name}} is running an unsupported version of Rocket.Chat",
"Supported_versions_warning_update_required": "Update required",
"System_default": "System default",
"Table": "Table",
"Tags": "Tags",
"Take_a_photo": "Take a photo",
Expand Down
1 change: 1 addition & 0 deletions app/i18n/locales/pt-BR.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,7 @@
"Supported_versions_expired_description": "Um administrador precisa atualizar o espaço de trabalho para uma versão suportada a fim de reabilitar o acesso a partir de aplicativos móveis e de desktop.",
"Supported_versions_expired_title": "{{workspace_name}} está executando uma versão não suportada do Rocket.Chat",
"Supported_versions_warning_update_required": "Atualização necessária",
"System_default": "Padrão do sistema",
"Table": "Tabela",
"Tags": "Tags",
"Take_a_photo": "Tirar uma foto",
Expand Down
2 changes: 1 addition & 1 deletion app/views/DefaultBrowserView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const DEFAULT_BROWSERS: IBrowsersValues[] = [
value: 'inApp'
},
{
title: isIOS ? 'Safari' : 'Browser',
title: 'System_default',
value: 'systemDefault:'
}
];
Expand Down
23 changes: 20 additions & 3 deletions app/views/RoomInfoView/components/RoomInfoViewTitle.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import React from 'react';
import { Text, View } from 'react-native';
import Clipboard from '@react-native-clipboard/clipboard';

import { ISubscription, SubscriptionType } from '../../../definitions';
import styles from '../styles';
import { useTheme } from '../../../theme';
import RoomTypeIcon from '../../../containers/RoomTypeIcon';
import { getRoomTitle } from '../../../lib/methods/helpers';
import CollapsibleText from '../../../containers/CollapsibleText';
import EventEmitter from '../../../lib/methods/helpers/events';
import { LISTENER } from '../../../containers/Toast';
import I18n from '../../../i18n';

interface IRoomInfoViewTitle {
room?: ISubscription;
Expand All @@ -18,14 +22,27 @@ interface IRoomInfoViewTitle {

const RoomInfoViewTitle = ({ room, name, username, statusText, type }: IRoomInfoViewTitle): React.ReactElement => {
const { colors } = useTheme();

const copyInfoToClipboard = (data: string) => {
Clipboard.setString(data);
EventEmitter.emit(LISTENER, { message: I18n.t('Copied_to_clipboard') });
};

if (type === SubscriptionType.DIRECT) {
return (
<View style={styles.roomInfoViewTitleContainer}>
<Text testID='room-info-view-name' style={[styles.roomTitle, { color: colors.titleText }]}>
{name}
</Text>
{name && (
<Text
onLongPress={() => copyInfoToClipboard(name)}
testID='room-info-view-name'
style={[styles.roomTitle, { color: colors.titleText }]}
>
{name}
</Text>
)}
{username && (
<Text
onLongPress={() => copyInfoToClipboard(username)}
testID='room-info-view-username'
style={[styles.roomUsername, { color: colors.auxiliaryText }]}
>{`@${username}`}</Text>
Expand Down

0 comments on commit f6fa904

Please sign in to comment.