mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
feat(console): enable icon in modal header (#4023)
This commit is contained in:
parent
1c38ad374d
commit
4ed72121b8
2 changed files with 13 additions and 2 deletions
|
@ -17,6 +17,12 @@
|
|||
flex-shrink: 0;
|
||||
margin-bottom: _.unit(6);
|
||||
|
||||
.iconAndTitle {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: _.unit(3);
|
||||
}
|
||||
|
||||
.closeIcon {
|
||||
color: var(--color-text-secondary);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import classNames from 'classnames';
|
||||
import type { ReactNode } from 'react';
|
||||
import { type ReactElement, type ReactNode } from 'react';
|
||||
|
||||
import Close from '@/assets/images/close.svg';
|
||||
|
||||
|
@ -16,6 +16,7 @@ type Props = {
|
|||
onClose?: () => void;
|
||||
className?: string;
|
||||
size?: 'medium' | 'large' | 'xlarge';
|
||||
headerIcon?: ReactElement;
|
||||
} & Pick<CardTitleProps, 'learnMoreLink' | 'title' | 'subtitle' | 'isWordWrapEnabled'>;
|
||||
|
||||
function ModalLayout({
|
||||
|
@ -24,12 +25,16 @@ function ModalLayout({
|
|||
onClose,
|
||||
className,
|
||||
size = 'medium',
|
||||
headerIcon,
|
||||
...cardTitleProps
|
||||
}: Props) {
|
||||
return (
|
||||
<Card className={classNames(styles.container, styles[size])}>
|
||||
<div className={styles.header}>
|
||||
<CardTitle {...cardTitleProps} />
|
||||
<div className={styles.iconAndTitle}>
|
||||
{headerIcon}
|
||||
<CardTitle {...cardTitleProps} />
|
||||
</div>
|
||||
{onClose && (
|
||||
<IconButton
|
||||
onClick={() => {
|
||||
|
|
Loading…
Reference in a new issue