0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-10 22:22:45 -05:00

fix(console): show platform icons for non-universal (#3243)

This commit is contained in:
wangsijie 2023-03-04 22:25:17 +08:00 committed by GitHub
parent 85c60bf8f5
commit 89ba9bdc70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
import { ConnectorType } from '@logto/schemas';
import { ConnectorPlatform, ConnectorType } from '@logto/schemas';
import { useTranslation } from 'react-i18next';
import { useNavigate } from 'react-router-dom';
@ -26,6 +26,9 @@ const ConnectorName = ({ connectorGroup }: Props) => {
const { type, connectors } = connectorGroup;
const connector = connectors[0];
const navigate = useNavigate();
const hasNonUniversalConnector = connectors.some(
({ platform }) => platform !== ConnectorPlatform.Universal
);
if (!connector) {
const PlaceholderIcon = connectorPlaceholderIcon[type];
@ -60,7 +63,7 @@ const ConnectorName = ({ connectorGroup }: Props) => {
subtitle={
<>
{type !== ConnectorType.Social && connector.id}
{type === ConnectorType.Social && connectors.length > 1 && (
{type === ConnectorType.Social && hasNonUniversalConnector && (
<div className={styles.platforms}>
{connectors.map(
({ id, platform }) =>