fix: update translation link

show external link on hover
pull/3083/head
yougotwill 9 months ago
parent 4a3adaa5e4
commit 3ad09b38a4

@ -1,5 +1,6 @@
import styled from 'styled-components';
import { shell } from 'electron';
import { isEmpty, pick } from 'lodash';
import { ReactNode } from 'react';
import { Flex } from '../basic/Flex';
@ -130,12 +131,21 @@ export const SessionSettingsItemWrapper = (props: {
);
};
export const SessionSettingsTitleWithLink = (props: { title: string; onClick: () => void }) => {
const { onClick, title } = props;
export const SessionSettingsTitleWithLink = (props: { title: string; link: string }) => {
const { title, link } = props;
return (
<StyledSettingItemClickable onClick={onClick}>
<StyledSettingItemClickable
onClick={() => {
void shell.openExternal(link);
}}
>
<SettingsTitleAndDescription title={title} />
<SessionIconButton iconSize={'medium'} iconType="externalLink" isSelected={true} />
<SessionIconButton
title={link}
iconSize={'medium'}
iconType="externalLink"
isSelected={true}
/>
</StyledSettingItemClickable>
);
};

@ -1,4 +1,4 @@
import { ipcRenderer, shell } from 'electron';
import { ipcRenderer } from 'electron';
import { SessionButtonShape, SessionButtonType } from '../../basic/SessionButton';
@ -19,19 +19,19 @@ export const SettingsCategoryHelp = () => {
/>
<SessionSettingsTitleWithLink
title={window.i18n('surveyTitle')}
onClick={() => void shell.openExternal('https://getsession.org/survey')}
link={'https://getsession.org/survey'}
/>
<SessionSettingsTitleWithLink
title={window.i18n('helpUsTranslateSession')}
onClick={() => void shell.openExternal('https://crowdin.com/project/session-desktop/')}
link={'https://getsession.org/translate'}
/>
<SessionSettingsTitleWithLink
title={window.i18n('faq')}
onClick={() => void shell.openExternal('https://getsession.org/faq')}
link={'https://getsession.org/faq'}
/>
<SessionSettingsTitleWithLink
title={window.i18n('support')}
onClick={() => void shell.openExternal('https://sessionapp.zendesk.com/hc/en-us')}
link={'https://sessionapp.zendesk.com/hc/en-us'}
/>
</>
);

Loading…
Cancel
Save