Safe Link Modal: Make url bold (#5711)

This commit is contained in:
zubiden 2025-03-07 15:16:56 +01:00 committed by Alexander Zinchuk
parent 1633afb0eb
commit bb8b9c4f20
3 changed files with 9 additions and 7 deletions

View File

@ -580,7 +580,8 @@
"AboutPremiumDescription" = "While the free version of Telegram already gives its users more than any other messaging application, **Telegram Premium** pushes its capabilities even further.";
"AboutPremiumDescription2" = "**Telegram Premium** is a paid option, because most Premium Features require additional expenses from Telegram to third parties such as data center providers and server manufacturers. Contributions from **Telegram Premium** users allow us to cover such costs and also help Telegram stay free for everyone.";
"OpenUrlTitle" = "Open Link";
"OpenUrlAlert2" = "Do you want to open {url}?";
"OpenUrlText" = "Do you want to open **{url}**?";
"OpenUrlConfirm" = "Open";
"ConversationOpenBotLinkLogin" = "Log in to **{url}** as {user}";
"ConversationOpenBotLinkAllowMessages" = "Allow **{bot}** to send me messages";
"BotWebViewOpenBot" = "Open Bot";

View File

@ -6,7 +6,7 @@ import { ensureProtocol } from '../../util/browser/url';
import renderText from '../common/helpers/renderText';
import useCurrentOrPrev from '../../hooks/useCurrentOrPrev';
import useOldLang from '../../hooks/useOldLang';
import useLang from '../../hooks/useLang';
import ConfirmDialog from '../ui/ConfirmDialog';
@ -17,14 +17,14 @@ export type OwnProps = {
const SafeLinkModal: FC<OwnProps> = ({ url }) => {
const { toggleSafeLinkModal } = getActions();
const lang = useOldLang();
const lang = useLang();
const handleOpen = useCallback(() => {
if (!url) {
return;
}
window.open(ensureProtocol(url), '_blank', 'noopener');
window.open(ensureProtocol(url), '_blank', 'noopener noreferrer');
toggleSafeLinkModal({ url: undefined });
}, [toggleSafeLinkModal, url]);
@ -39,8 +39,8 @@ const SafeLinkModal: FC<OwnProps> = ({ url }) => {
isOpen={Boolean(url)}
onClose={handleDismiss}
title={lang('OpenUrlTitle')}
textParts={renderText(lang('OpenUrlAlert2', renderingUrl))}
confirmLabel={lang('OpenUrlTitle')}
textParts={renderText(lang('OpenUrlText', { url: renderingUrl }, { withNodes: true, withMarkdown: true }))}
confirmLabel={lang('OpenUrlConfirm')}
confirmHandler={handleOpen}
/>
);

View File

@ -516,6 +516,7 @@ export interface LangPair {
'AboutPremiumDescription': undefined;
'AboutPremiumDescription2': undefined;
'OpenUrlTitle': undefined;
'OpenUrlConfirm': undefined;
'BotWebViewOpenBot': undefined;
'WebAppReloadPage': undefined;
'WebAppRemoveBot': undefined;
@ -1540,7 +1541,7 @@ export interface LangPairWithVariables<V extends unknown = LangVariable> {
'TelegramPremiumUserDialogTitle': {
'user': V;
};
'OpenUrlAlert2': {
'OpenUrlText': {
'url': V;
};
'ConversationOpenBotLinkLogin': {