Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
評價對話框元件,封裝自 Ant Design 的 Modal 元件。
import { RatingModal } from '@hahow/hahow-design';
import React, { useState } from 'react';
const App = () => {
const [visible, setVisible] = useState(false);
const showModal = () => setVisible(true);
const handleCancel = () => setVisible(false);
return (
<>
<Button onClick={showModal}>Open Modal</Button>
<RatingModal onCancel={handleCancel} visible={visible} />
</>
);
}
Name | Description | Default |
---|---|---|
onCancel | 點擊遮罩層或右上角叉或取消按鈕的 callback func | "null" |
onRatingChange | 點擊評分的 callback,第一個參數為評分 func | "null" |
onReviewSubmit | 點擊送出表單的 callback,第一個參數為 { title: string, description: string } func | "null" |
rating | 當前評分數 1 | 2 | 3 | 4 | 5 | "null" |
renderFooter | 評價表單底部內容
第一個參數為 { onOk: func, onCancel: func }
回傳格式詳見 Ant Design Model 元件的 `props.footer` func | "({ onOk }) => [\n <Button key=\"submit\" onClick={onOk}>\n 送出\n </Button>,\n]" |
review | 評價 { title: 標題, description: 內容 } { title: string, description: string } | "null" |
reviewFormDescription | 評價表單內容文字 string | "'內容(選填)'" |
reviewFormDescriptionPlaceholder | 評價表單內容 placeholder 文字 string | "'這堂課哪些地方對你來說最有幫助呢?有哪些特別有收穫的地方呢?和其他人分享你的學習心得吧'" |
reviewFormTitle | 評價表單標題文字 string | "'標題(選填)'" |
reviewFormTitlePlaceholder | 評價表單標題 placeholder 文字 string | "'用一句話總結你的心得吧'" |
subtitle | 對話框子標題 string | "'你覺得這堂課如何呢?幫助其他人更了解這堂課程'" |
title | 對話框標題 string | "'填寫評價'" |
visible | 對話框是否顯示 bool | "false" |