Skip to content

Commit

Permalink
fix: badge native ts
Browse files Browse the repository at this point in the history
  • Loading branch information
paranoidjk committed Jul 17, 2017
1 parent 273e6df commit ccc2122
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
7 changes: 5 additions & 2 deletions components/badge/index.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import React from 'react';
import { View, Text } from 'react-native';
import BadgeStyle from './style/index';
import BadgeStyle, { TBadgeStyle } from './style/index';
import BadgeProps from './PropsType';

export default class Badge extends React.Component<BadgeProps, any> {
export interface BadgeNativeProps extends BadgeProps {
styles: TBadgeStyle;
}
export default class Badge extends React.Component<BadgeNativeProps, any> {
static defaultProps = {
size: 'small',
overflowCount: 99,
Expand Down
14 changes: 12 additions & 2 deletions components/badge/style/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
import { StyleSheet, Platform } from 'react-native';
import { StyleSheet, Platform, ViewStyle, TextStyle } from 'react-native';
import variables from '../../style/themes/default';

const grid = 4;
export default StyleSheet.create({
export interface TBadgeStyle {
wrap: ViewStyle;
textCornerWrap: ViewStyle;
dot: ViewStyle;
dotSizelarge: ViewStyle;
textDom: ViewStyle;
textCorner: ViewStyle;
textCornerlarge: ViewStyle;
text: TextStyle;
}
export default StyleSheet.create<TBadgeStyle>({
wrap: {
flexDirection: 'row',
},
Expand Down

0 comments on commit ccc2122

Please sign in to comment.