-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yaochuxia
committed
Aug 13, 2021
1 parent
603aae4
commit 67430ea
Showing
3 changed files
with
131 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
NoticeBar 通告栏 | ||
--- | ||
|
||
在导航栏下方,一般用作系统提醒、活动提醒等通知。 | ||
|
||
### 基础示例 | ||
|
||
<!--DemoStart--> | ||
```jsx | ||
import React from 'react'; | ||
import { NoticeBar, Spacing } from '@uiw/react-native'; | ||
|
||
const NoticeBarExample = () => { | ||
const customIcon = ( | ||
<Image | ||
// tslint:disable-next-line:jsx-no-multiline-js | ||
source={{ | ||
uri: 'https://zos.alipayobjects.com/rmsportal/bRnouywfdRsCcLU.png', | ||
}} | ||
style={{ width: 12, height: 12 }} | ||
/> | ||
) | ||
return ( | ||
<View style={{ marginTop: 10 }}> | ||
<NoticeBar | ||
onPress={() => console.log('click')} | ||
marqueeProps={{ loop: true, style: { fontSize: 12, color: 'red' } }}> | ||
Notice: The arrival time of incomes and transfers of Yu 'E Bao will be | ||
delayed during National Day. | ||
</NoticeBar> | ||
<Spacing /> | ||
<NoticeBar mode="closable" onPress={() => console.log('will close')}> | ||
Notice: The arrival time of incomes and transfers of Yu 'E Bao will be | ||
delayed during National Day. | ||
</NoticeBar> | ||
<Spacing /> | ||
<NoticeBar mode="closable" icon={customIcon}> | ||
Customized icon. | ||
</NoticeBar> | ||
<Spacing /> | ||
<NoticeBar mode="link" onPress={() => console.log('link')}> | ||
Notice: The arrival time of incomes and transfers of Yu 'E Bao will be | ||
delayed during National Day. | ||
</NoticeBar> | ||
<Spacing /> | ||
<NoticeBar mode="closable" icon={undefined}> | ||
Remove the default icon. | ||
</NoticeBar> | ||
<Spacing /> | ||
<NoticeBar | ||
mode="closable" | ||
action={<Text style={{ color: '#a1a1a1' }}>不再提示</Text>}> | ||
Closable demo for `actionText`. | ||
</NoticeBar> | ||
<Spacing /> | ||
<NoticeBar mode="link" action={<Text>去看看</Text>}> | ||
Link demo for `actionText`. | ||
</NoticeBar> | ||
</View> | ||
) | ||
} | ||
export default NoticeBarExample; | ||
``` | ||
<!--End--> | ||
## Props | ||
属性 | 说明 | 类型 | 默认值 | ||
----|-----|------|------ | ||
| mode | 提示类型,可选 `closable`,`link` | String | '' | | ||
| icon | 在开始位置设置图标 | ReactNode | `<Icon type={require('./trips.svg')} size="xxs" />`| | ||
| onPress | 点击关闭或者操作区域的回调函数 | (): void | | | ||
| marqueeProps | marquee 参数 | Object | `{loop: false, leading: 500, trailing: 800, fps: 40, style: {}}` | | ||
| action | 用于替换操作 icon 的文案 | ReactElement | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters