Skip to content

Commit

Permalink
fix style tsx (temporary) (ant-design#1262)
Browse files Browse the repository at this point in the history
* fix style tsx(temporary)

* fix accordion tsx (temporary) & add style to wrapper

* update snapshot caused by add style to accordion wrapper
  • Loading branch information
BccSafe authored and lixiaoyang1992 committed Apr 26, 2018
1 parent fb9b2fa commit 9d8cba9
Show file tree
Hide file tree
Showing 20 changed files with 48 additions and 32 deletions.
4 changes: 2 additions & 2 deletions components/accordion/PropsType.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react';

interface AccordionProps {
style?: React.CSSProperties;
styles?: any;
style?: any;
/** below web only */
className?: string;
prefixCls?: string;
Expand All @@ -10,7 +11,6 @@ interface AccordionProps {
openAnimation?: any;
accordion?: boolean;
onChange?: (x: any) => void;
styles?: any;
}

export default AccordionProps;
11 changes: 7 additions & 4 deletions components/accordion/__tests__/__snapshots__/demo.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ exports[`renders ./components/accordion/demo/basic.tsx correctly 1`] = `
>
<View
style={
Object {
"borderTopColor": "#ddd",
"borderTopWidth": 0.5,
}
Array [
undefined,
Object {
"borderTopColor": "#ddd",
"borderTopWidth": 0.5,
},
]
}
>
<View>
Expand Down
11 changes: 7 additions & 4 deletions components/accordion/__tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@
exports[`Accordion renders correctly 1`] = `
<View
style={
Object {
"borderTopColor": "#ddd",
"borderTopWidth": 0.5,
}
Array [
undefined,
Object {
"borderTopColor": "#ddd",
"borderTopWidth": 0.5,
},
]
}
>
<View>
Expand Down
4 changes: 2 additions & 2 deletions components/accordion/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class Accordion extends React.Component<AccordionProps, any> {
}

render() {
const { children, styles, defaultActiveKey, activeKey } = this.props;
const { children, style, styles, defaultActiveKey, activeKey } = this.props;
let defaultActiveSection;
let activeSection;
const headers = React.Children.map(children, (child: any, index) => {
Expand All @@ -83,7 +83,7 @@ class Accordion extends React.Component<AccordionProps, any> {
});

return (
<View style={styles.container}>
<View style={[style, styles.container]}>
<RNAccordion
initiallyActiveSection={defaultActiveSection}
activeSection={activeSection}
Expand Down
2 changes: 1 addition & 1 deletion components/badge/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface BadgeProps {
corner?: boolean;
dot?: boolean;
text?: any;
style?: {};
style?: any;
/** rn only */
styles?: any;
/** web only */
Expand Down
4 changes: 2 additions & 2 deletions components/flex/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
export interface FlexProps {
/** web only */
prefixCls?: string;
style?: React.CSSProperties;
style?: any;
/** web only */
className?: string;
direction?: 'row'|'row-reverse'|'column'|'column-reverse';
Expand All @@ -27,7 +27,7 @@ export interface FlexItemProps {
/** web only */
prefixCls?: string;
className?: string;
style?: React.CSSProperties;
style?: any;
onClick?: (e?: any) => void;
children?: any;
/* touchableWithoutFeedback prop */
Expand Down
1 change: 0 additions & 1 deletion components/grid/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export interface GridProps {
renderItem?: (dataItem: DataItem | undefined, itemIndex: number) => React.ReactElement<any>;
prefixCls?: string;
className?: string;
style?: React.CSSProperties;
/** rn only **/
styles?: any;
}
2 changes: 1 addition & 1 deletion components/input-item/PropsType.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React from 'react';

interface InputItemProps {
style?: any;
/** web only */
prefixCls?: string;
/** web only */
prefixListCls?: string;
style?: React.CSSProperties;
/** web only */
className?: string;
type?: 'text'|'bankCard'|'phone'|'password'|'number'|'idcard'|'digit';
Expand Down
2 changes: 1 addition & 1 deletion components/list-view/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ interface Props {
renderScrollComponent?: Function;
scrollRenderAheadDistance?: number;
onChangeVisibleRows?: Function;
style?: any;
/** below web only */
className?: string;
prefixCls?: string;
listPrefixCls?: string;
listViewPrefixCls?: string;
style?: React.CSSProperties;
contentContainerStyle?: React.CSSProperties;
renderBodyComponent?: Function;
renderSectionBodyWrapper?: Function;
Expand Down
4 changes: 2 additions & 2 deletions components/list/PropsType.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { ReactNode } from 'react';

export interface ListProps {
style?: any;
/** web only */
prefixCls?: string;
style?: React.CSSProperties;
/** web only */
className?: string;
children?: any;
Expand Down Expand Up @@ -42,7 +42,7 @@ export interface ListItemProps {
}

export interface BriefProps {
style?: React.CSSProperties;
style?: any;
children?: any;
wrap?: boolean;
/** rn only */
Expand Down
2 changes: 1 addition & 1 deletion components/pagination/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ interface PaginationPropTypes {
className?: string;
mode?: 'button' | 'number' | 'pointer';
simple?: Boolean;
style?: React.CSSProperties;
style?: any;
current: number;
total: number;
prevText?: string;
Expand Down
2 changes: 1 addition & 1 deletion components/progress/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ interface ProgressProps {
percent?: number;
position?: 'fixed' | 'normal';
unfilled?: 'show' | 'hide';
style?: React.CSSProperties;
style?: any;
/** rn only */
wrapWidth?: number;
styles?: any;
Expand Down
2 changes: 1 addition & 1 deletion components/radio/PropsType.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

export interface RadioProps {
style?: React.CSSProperties;
style?: any;
defaultChecked?: boolean;
checked?: boolean;
disabled?: boolean;
Expand Down
2 changes: 1 addition & 1 deletion components/result/PropsType.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';

interface ResultProps {
style?: React.CSSProperties;
style?: any;
imgUrl?: string;
img?: React.ReactNode;
title?: React.ReactNode;
Expand Down
15 changes: 13 additions & 2 deletions components/result/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@ export default class Result extends React.Component<ResultProps, any> {
};

render() {
const { prefixCls, className, img, imgUrl, title, message, buttonText, buttonClick, buttonType } = this.props;
const {
prefixCls,
className,
img,
imgUrl,
title,
message,
buttonText,
buttonClick,
buttonType,
style,
} = this.props;
const wrapCls = classNames({
[`${prefixCls}`]: true,
[className as string]: className,
Expand All @@ -26,7 +37,7 @@ export default class Result extends React.Component<ResultProps, any> {
}

return (
<div className={wrapCls} role="alert">
<div className={wrapCls} style={style} role="alert">
{imgContent}
{title ? <div className={`${prefixCls}-title`}>{title}</div> : null}
{message ? <div className={`${prefixCls}-message`}>{message}</div> : null}
Expand Down
2 changes: 1 addition & 1 deletion components/search-bar/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
function noop() {}

export interface SearchBarProps {
style?: any;
defaultValue?: string;
value?: string;
placeholder?: string;
Expand All @@ -19,7 +20,6 @@ export interface SearchBarProps {
focused?: boolean;
/** web only */
prefixCls?: string;
style?: React.CSSProperties;
className?: string;
onClear?: Function;
}
Expand Down
4 changes: 2 additions & 2 deletions components/search-bar/index.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default class SearchBar extends React.Component<SearchBarProps, SearchBar
render() {
const {
prefixCls, showCancelButton, disabled, placeholder,
cancelText, className,
cancelText, className, style,
} = this.props;

const { value, focus } = this.state;
Expand All @@ -187,7 +187,7 @@ export default class SearchBar extends React.Component<SearchBarProps, SearchBar
});

return (
<form onSubmit={this.onSubmit} className={wrapCls} ref="searchInputContainer">
<form onSubmit={this.onSubmit} className={wrapCls} style={style} ref="searchInputContainer">
<div className={`${prefixCls}-input`}>
<div className={`${prefixCls}-synthetic-ph`} ref="syntheticPh">
<span className={`${prefixCls}-synthetic-ph-container`} ref="syntheticPhContainer">
Expand Down
2 changes: 1 addition & 1 deletion components/textarea-item/PropsType.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';

interface TextAreaItemProps {
style?: any;
/** web only */
prefixCls?: string;
/** web only */
prefixListCls?: string;
/** web only */
className?: string;
style?: React.CSSProperties;
title?: React.ReactNode;
maxLength?: number;
/** web only */
Expand Down
2 changes: 1 addition & 1 deletion components/white-space/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface WhiteSpaceProps {
/** web only */
prefixCls?: string;
/** web only */
style?: React.CSSProperties;
style?: any;
/** web only */
className?: string;
}
Expand Down
2 changes: 1 addition & 1 deletion components/wing-blank/PropsType.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

export interface WingBlankProps {
size?: 'sm'|'md'|'lg';
style?: React.CSSProperties;
style?: any;
/** web only */
prefixCls?: string;
/** web only */
Expand Down

0 comments on commit 9d8cba9

Please sign in to comment.