-
Notifications
You must be signed in to change notification settings - Fork 483
/
BadgeExample.js
59 lines (52 loc) · 1.86 KB
/
BadgeExample.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// BadgeExample.js
'use strict';
import React, {Component} from 'react';
import {View, ScrollView, Text} from 'react-native';
import {NavigationPage, ListRow, Badge} from 'teaset';
export default class BadgeExample extends NavigationPage {
static defaultProps = {
...NavigationPage.defaultProps,
title: 'Badge',
showBackButton: true,
};
renderPage() {
return (
<ScrollView style={{flex: 1}}>
<View style={{height: 20}} />
<ListRow title='Type capsule' detail={
<View style={{flexDirection: 'row'}}>
<Badge count={6} />
<View style={{width: 4}} />
<Badge count={68} />
<View style={{width: 4}} />
<Badge count={689} />
<View style={{width: 4}} />
<Badge count='new' />
</View>
} topSeparator='full' />
<ListRow title='Type square' detail={
<View style={{flexDirection: 'row'}}>
<Badge type='square' count={6} />
<View style={{width: 4}} />
<Badge type='square' count={68} />
<View style={{width: 4}} />
<Badge type='square' count={689} />
<View style={{width: 4}} />
<Badge type='square' count='new' />
</View>
} />
<ListRow title='Type dot' detail={<Badge type='dot' />} bottomSeparator='full' />
<View style={{height: 20}} />
<ListRow title='Custom' detail={
<View style={{flexDirection: 'row'}}>
<Badge style={{backgroundColor: '#5bc0de'}} type='square' count='券' />
<View style={{width: 4}} />
<Badge style={{backgroundColor: '#777', paddingLeft: 0, paddingRight: 0}}>
<Text style={{color: '#fff'}}>$</Text>
</Badge>
</View>
} topSeparator='full' bottomSeparator='full' />
</ScrollView>
);
}
}