diff --git a/src/elements/WebClients.jsx b/src/elements/WebClients.jsx new file mode 100644 index 0000000..3fa0f64 --- /dev/null +++ b/src/elements/WebClients.jsx @@ -0,0 +1,48 @@ +import React from 'react' +import tt from 'counterpart' + +class WebClients extends React.Component { + static propTypes = { + } + + state = { + } + + render() { + const { web_clients } = this.props + + let appList + const webs = Object.entries(web_clients || {}) + if (webs.length) { + appList = [] + for (const [en, data] of webs) { + if (en === '_desktop') continue + const { img, ru, url } = data + appList.push( + + {ru} + ) + } + + let desktop + const { _desktop } = web_clients + if (_desktop) { + desktop =
+ {tt('web_clients_jx.or_desktop')} + {tt('web_clients_jx.or_desktop_link')} + {tt('web_clients_jx.or_desktop2')} +
+ } + + appList = +

{tt('web_clients_jx.title')}

+ {appList} + {desktop} +
+
+ } + return appList + } +} + +export default WebClients diff --git a/src/locales/en.json b/src/locales/en.json index 7e3e11a..b25d671 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -212,6 +212,12 @@ "memo_is_public": "This memo is public.", "submit": "Transfer" }, + "web_clients_jx": { + "title": "Web-clients", + "or_desktop": "Or ", + "or_desktop_link": "download desktop app", + "or_desktop2": ", which combines all these applications." + }, "oauth_transfer_nft": { "no_tokens": "You have not yet any NFT-tokens.", "token_not_exist": "No such token in your wallet. You can transfer any of these tokens:", diff --git a/src/locales/ru-RU.json b/src/locales/ru-RU.json index 8de2646..a32838b 100644 --- a/src/locales/ru-RU.json +++ b/src/locales/ru-RU.json @@ -197,11 +197,18 @@ "unfreeze": "Активировать аккаунт", "apps_title": "Приложения", "apps_empty": "Вы пока не авторизованы ни в одном приложении.", + "web_clients": "Веб-клиенты", "link": "Ссылка: ", "edit": "Настроить", "remove_authority": "Отменить доступ OAuth к моему аккаунту", "remove_authority_confirm": "Вы действительно хотите отменить доступ GolosSigner к вашему аккаунту?" }, + "web_clients_jx": { + "title": "Веб-клиенты", + "or_desktop": "Или ", + "or_desktop_link": "скачайте десктоп-клиент", + "or_desktop2": ", где объединены все эти приложения." + }, "oauth_transfer": { "from": "От", "to": "Отправить аккаунту", diff --git a/src/pages/index.jsx b/src/pages/index.jsx index 7615d55..9d666bc 100644 --- a/src/pages/index.jsx +++ b/src/pages/index.jsx @@ -5,6 +5,7 @@ import tt from 'counterpart'; import { api } from 'golos-lib-js' import RemoveAuthority from '@/elements/RemoveAuthority'; +import WebClients from '@/elements/WebClients' import Header from '@/modules/Header'; import { callApi, } from '@/utils/OAuthClient'; import { withRouterHelpers, } from '@/utils/routing'; @@ -51,7 +52,7 @@ class Index extends React.Component { render() { const { session, oauthCfg, } = this.props; const { account, clients, } = session; - const { service_account, sign_endpoint, } = oauthCfg; + const { service_account, sign_endpoint, web_clients, } = oauthCfg; let actions = []; for (let action of [ 'transfer', 'donate', 'delegate_vs', 'transfer_nft']) { @@ -102,6 +103,7 @@ class Index extends React.Component { } else { clientList =
{tt('oauth_main_jsx.apps_empty')}
} + return (
@@ -122,6 +124,7 @@ class Index extends React.Component {

{tt('oauth_main_jsx.apps_title')}

{clientList}
+