import React from 'react'; import { useState } from 'react'; import { Modal, Pagination, DatePicker, TimePicker, Select, Button, Cascader, LocaleProvider } from '../../index'; import zh_CN from '@douyinfe/semi-ui/locale/source/zh_CN'; import en_GB from '@douyinfe/semi-ui/locale/source/en_GB'; import en_US from '@douyinfe/semi-ui/locale/source/en_US'; import ko_KR from '@douyinfe/semi-ui/locale/source/ko_KR'; import ja_JP from '@douyinfe/semi-ui/locale/source/ja_JP'; import ru_RU from '@douyinfe/semi-ui/locale/source/ru_RU'; import vi_VN from '@douyinfe/semi-ui/locale/source/vi_VN'; const { Option } = Select; export default { title: 'LocaleProvider' } // -√ Pagination // -√ Modal // -× DatePicker // -√ Table // -√ Select // -× Calendar // -√ Timepicker const TableDemo = () => {}; const CascaderDemo = () => { const treeData = [ { label: '亚洲', value: 'yazhou', children: [ { label: '中国', value: 'zhongguo', children: [ { label: '北京', value: 'beijing', }, { label: '上海', value: 'shanghai', }, ], }, { label: '日本', value: 'riben', children: [ { label: '大阪', value: 'daban', }, ], }, ], }, ]; return ; }; const I18nComponent = () => { const [modalVisible, setModalVisible] = useState(false); const style = { margin: 10 }; return ( <>
setModalVisible(false)} onCancel={() => setModalVisible(false)} >

This is the content of a basic modal.

More content...



); }; class I18nDemo extends React.Component { constructor(props) { super(props); this.state = { locale: zh_CN, }; this.onLanguageChange = this.onLanguageChange.bind(this); } onLanguageChange(code) { let language = { zh_CN: zh_CN, en_GB: en_GB, ko_KR: ko_KR, ja_JP: ja_JP, }; this.setState({ locale: language[code] }); } render() { const { locale } = this.state; return ( <>
); } } export const LocaleZhCn = () => ( ); LocaleZhCn.story = { name: 'Locale zh_CN', }; export const LocaleEnGb = () => ( ); LocaleEnGb.story = { name: 'Locale en-GB', }; export const LocaleEnUs = () => ( ); LocaleEnUs.story = { name: 'Locale en-US', }; export const LocaleJaJp = () => ( ); LocaleJaJp.story = { name: 'Locale ja_JP', }; export const LocaleKoKr = () => ( ); LocaleKoKr.story = { name: 'Locale ko_KR', }; export const LocaleRuRu = () => ( ); LocaleRuRu.story = { name: 'Locale ru_RU', }; export const LocaleViVn = () => ( ); LocaleViVn.story = { name: 'Locale vi_VN', }; export const Locale = () => ;