mirror of
https://github.com/logto-io/logto.git
synced 2025-02-03 21:48:55 -05:00
fix(console): fix connector platform label i18n (#1347)
This commit is contained in:
parent
f6bf53bd8e
commit
b18388ce57
1 changed files with 4 additions and 1 deletions
|
@ -1,9 +1,11 @@
|
||||||
import { ConnectorDTO } from '@logto/schemas';
|
import { ConnectorDTO } from '@logto/schemas';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import useSWR from 'swr';
|
import useSWR from 'swr';
|
||||||
|
|
||||||
|
import { connectorPlatformLabel } from '@/consts';
|
||||||
import ConnectorPlatformIcon from '@/icons/ConnectorPlatformIcon';
|
import ConnectorPlatformIcon from '@/icons/ConnectorPlatformIcon';
|
||||||
|
|
||||||
import * as styles from './index.module.scss';
|
import * as styles from './index.module.scss';
|
||||||
|
@ -14,6 +16,7 @@ type Props = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const ConnectorTabs = ({ target, connectorId }: Props) => {
|
const ConnectorTabs = ({ target, connectorId }: Props) => {
|
||||||
|
const { t } = useTranslation(undefined, { keyPrefix: 'admin_console' });
|
||||||
const { data } = useSWR<ConnectorDTO[]>(`/api/connectors?target=${target}`);
|
const { data } = useSWR<ConnectorDTO[]>(`/api/connectors?target=${target}`);
|
||||||
|
|
||||||
if (!data) {
|
if (!data) {
|
||||||
|
@ -35,7 +38,7 @@ const ConnectorTabs = ({ target, connectorId }: Props) => {
|
||||||
<ConnectorPlatformIcon platform={connector.platform} />
|
<ConnectorPlatformIcon platform={connector.platform} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{connector.platform}
|
{connector.platform && t(connectorPlatformLabel[connector.platform])}
|
||||||
</Link>
|
</Link>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue