Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(console): connector placeholder icon should not have background color #1472

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions packages/console/src/assets/images/connector-email.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 7 additions & 8 deletions packages/console/src/assets/images/connector-sms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 1 addition & 8 deletions packages/console/src/consts/connectors.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { AdminConsoleKey, I18nKey } from '@logto/phrases';
import { ConnectorPlatform, ConnectorType } from '@logto/schemas';

import EmailConnectorDark from '@/assets/images/connector-email-dark.svg';
import EmailConnector from '@/assets/images/connector-email.svg';
import SmsConnectorIconDark from '@/assets/images/connector-sms-dark.svg';
import SmsConnectorIcon from '@/assets/images/connector-sms.svg';

type TitlePlaceHolder = {
Expand All @@ -30,12 +28,7 @@ type ConnectorPlaceholderIcon = {
[key in ConnectorType]?: SvgComponent;
};

export const lightModeConnectorPlaceholderIcon: ConnectorPlaceholderIcon = Object.freeze({
export const connectorPlaceholderIcon: ConnectorPlaceholderIcon = Object.freeze({
[ConnectorType.SMS]: SmsConnectorIcon,
[ConnectorType.Email]: EmailConnector,
} as const);

export const darkModeConnectorPlaceholderIcon: ConnectorPlaceholderIcon = Object.freeze({
[ConnectorType.SMS]: SmsConnectorIconDark,
[ConnectorType.Email]: EmailConnectorDark,
} as const);
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ import { Link } from 'react-router-dom';
import Button from '@/components/Button';
import ItemPreview from '@/components/ItemPreview';
import UnnamedTrans from '@/components/UnnamedTrans';
import { connectorPlatformLabel, connectorTitlePlaceHolder } from '@/consts/connectors';
import {
connectorPlaceholderIcon,
connectorPlatformLabel,
connectorTitlePlaceHolder,
} from '@/consts/connectors';
import { useTheme } from '@/hooks/use-theme';
import ConnectorPlatformIcon from '@/icons/ConnectorPlatformIcon';

import ConnectorPlaceholderIcon from '../ConnectorPlaceholderIcon';
import * as styles from './index.module.scss';

type Props = {
Expand All @@ -26,6 +29,8 @@ const ConnectorName = ({ type, connectors, onClickSetup }: Props) => {
const theme = useTheme();

if (!connector) {
const PlaceholderIcon = connectorPlaceholderIcon[type];

return (
<ItemPreview
title={
Expand All @@ -38,7 +43,7 @@ const ConnectorName = ({ type, connectors, onClickSetup }: Props) => {
}
icon={
<div className={styles.logoContainer}>
<ConnectorPlaceholderIcon type={type} className={styles.logo} />
{PlaceholderIcon && <PlaceholderIcon className={styles.logo} />}
</div>
}
/>
Expand Down

This file was deleted.