Skip to content

Commit cdb7b94

Browse files
committed
Remove icon support from modal components
- remove the modal icon ├── apps │ └── editor │ └── src │ └── views │ └── prompt │ └── frontend │ └── Prompt.tsx └── packages └── ui └── src └── components └── editor └── prompt └── modals ├── AutoClosingModal │ ├── AutoClosingModal.module.scss │ ├── AutoClosingModal.stories.tsx │ ├── AutoClosingModal.tsx │ └── index.ts └── Modal ├── Modal.module.scss ├── Modal.tsx └── index.ts
1 parent 437ddf2 commit cdb7b94

5 files changed

Lines changed: 4 additions & 55 deletions

File tree

‎apps/editor/src/views/prompt/frontend/Prompt.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,6 @@ export const Prompt = () => {
746746
<div className={styles.slot}>
747747
<UiAutoClosingModal
748748
title={auto_closing_modal_data.title}
749-
type={auto_closing_modal_data.type}
750749
duration={3000}
751750
on_close={() => {
752751
set_auto_closing_modal_data(undefined)

‎packages/ui/src/components/editor/prompt/modals/AutoClosingModal/AutoClosingModal.stories.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export const Default = () => {
1717
title="Initialized in the connected browser"
1818
duration={3000}
1919
on_close={handle_close}
20-
type="success"
2120
/>
2221
) : null
2322
}

‎packages/ui/src/components/editor/prompt/modals/AutoClosingModal/AutoClosingModal.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import { useEffect, useState, useRef } from 'react'
22
import styles from './AutoClosingModal.module.scss'
33
import { Button } from '../../../common/Button'
4-
import { Modal, ModalIconType } from '../Modal'
4+
import { Modal } from '../Modal'
55

66
type Props = {
77
title: string
88
duration: number
9-
type: ModalIconType
109
on_close: () => void
1110
non_dismissable?: boolean
1211
}
@@ -45,7 +44,6 @@ export const AutoClosingModal: React.FC<Props> = (props) => {
4544
>
4645
<Modal
4746
title={props.title}
48-
icon={props.type}
4947
content_slot={
5048
<div className={styles.progress}>
5149
<div

‎packages/ui/src/components/editor/prompt/modals/Modal/Modal.module.scss‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,40 +37,12 @@
3737
}
3838
}
3939

40-
.icon {
41-
font-size: 30px !important;
42-
text-align: center;
43-
padding-top: 16px;
44-
display: flex;
45-
justify-content: center;
46-
47-
&--success {
48-
color: var(--cwc-text-color-green);
49-
}
50-
51-
&--warning {
52-
color: var(--cwc-text-color-orange);
53-
}
54-
55-
&--error {
56-
color: var(--cwc-text-color-red);
57-
}
58-
59-
&--info {
60-
color: var(--vscode-notificationsInfoIcon-foreground);
61-
}
62-
}
63-
6440
.title {
6541
text-align: center;
6642
font-weight: 500;
6743
font-size: 14px;
6844
padding: 10px 12px 0 12px;
6945

70-
&--with-icon {
71-
padding-top: 6px;
72-
}
73-
7446
&--without-content {
7547
padding-bottom: 16px;
7648
}

‎packages/ui/src/components/editor/prompt/modals/Modal/Modal.tsx‎

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,8 @@ import cn from 'classnames'
33
import { Scrollable } from '../../../common/Scrollable'
44
import styles from './Modal.module.scss'
55

6-
export type ModalIconType = 'success' | 'warning' | 'error' | 'info'
7-
86
type Props = {
97
title?: string
10-
icon?: ModalIconType
118
content_slot?: React.ReactNode
129
footer_slot?: React.ReactNode
1310
content_max_height?: string
@@ -48,29 +45,13 @@ export const Modal: React.FC<Props> = (props) => {
4845
[styles['container--full-width']]: props.use_full_width
4946
})}
5047
>
51-
{props.icon && (
52-
<div
53-
className={cn(styles.icon, 'codicon', {
54-
'codicon-check': props.icon == 'success',
55-
'codicon-warning': props.icon == 'warning',
56-
'codicon-error': props.icon == 'error',
57-
'codicon-info': props.icon == 'info',
58-
[styles['icon--success']]: props.icon == 'success',
59-
[styles['icon--warning']]: props.icon == 'warning',
60-
[styles['icon--error']]: props.icon == 'error',
61-
[styles['icon--info']]: props.icon == 'info'
62-
})}
63-
/>
64-
)}
65-
6648
{props.title && (
6749
<div
68-
className={cn(styles.title, {
69-
[styles['title--with-icon']]: !!props.icon,
70-
[styles['title--without-content']]: !props.content_slot
50+
className={cn(styles.header, {
51+
[styles['header--without-content']]: !props.content_slot
7152
})}
7253
>
73-
{props.title}
54+
<div className={styles.title}>{props.title}</div>
7455
</div>
7556
)}
7657

0 commit comments

Comments
 (0)