Skip to content

Commit

Permalink
给按钮添加icon
Browse files Browse the repository at this point in the history
  • Loading branch information
asurance committed Apr 20, 2022
1 parent f1d3a34 commit 432f3e9
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/Playground/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import { useGenerateModal } from '@/components/GenerateModal'
import { useExportModal } from '@/components/ExportModal'

import styles from './index.module.css'
import {
IconExport,
IconImport,
IconPlay,
IconStop,
} from '@douyinfe/semi-icons'

type Props = {
initialImageSrc?: string
Expand Down Expand Up @@ -106,6 +112,7 @@ const App: FC<Props> = ({ initialImageSrc = './0.jpeg' }) => {
<div className={styles['button-group']}>
<SplitButtonGroup>
<Button
icon={<IconImport />}
onClick={onClickImport}
disabled={
![PictureState.Imported, PictureState.Finished].includes(
Expand All @@ -116,6 +123,7 @@ const App: FC<Props> = ({ initialImageSrc = './0.jpeg' }) => {
导入图片
</Button>
<Button
icon={<IconPlay />}
onClick={openGenerateModal}
disabled={
![PictureState.Imported, PictureState.Finished].includes(
Expand All @@ -126,12 +134,14 @@ const App: FC<Props> = ({ initialImageSrc = './0.jpeg' }) => {
开始生成
</Button>
<Button
icon={<IconStop />}
onClick={onClickStop}
disabled={pictureState !== PictureState.Calculating}
>
停止生成
</Button>
<Button
icon={<IconExport />}
onClick={openExportModal}
disabled={pictureState !== PictureState.Finished}
>
Expand Down

0 comments on commit 432f3e9

Please sign in to comment.