mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
💄 format getGutter code style
This commit is contained in:
parent
78a1427ec0
commit
0cadae921a
@ -64,23 +64,23 @@ export default class Row extends React.Component<RowProps, RowState> {
|
||||
}
|
||||
|
||||
getGutter(): [number, number] {
|
||||
const gutter: [number, number] = [0, 0];
|
||||
const { gutter: gutter_setting } = this.props;
|
||||
|
||||
(Array.isArray(gutter_setting) ? gutter_setting : [gutter_setting, 0]).forEach((g, index) => {
|
||||
const results: [number, number] = [0, 0];
|
||||
const { gutter } = this.props;
|
||||
const { screens } = this.state;
|
||||
const normalizedGutter = Array.isArray(gutter) ? gutter : [gutter, 0];
|
||||
normalizedGutter.forEach((g, index) => {
|
||||
if (typeof g === 'object') {
|
||||
for (let i = 0; i < responsiveArray.length; i++) {
|
||||
const breakpoint: Breakpoint = responsiveArray[i];
|
||||
if (this.state.screens[breakpoint] && g[breakpoint] !== undefined) {
|
||||
gutter[index] = g[breakpoint] as number;
|
||||
if (screens[breakpoint] && g[breakpoint] !== undefined) {
|
||||
results[index] = g[breakpoint] as number;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
gutter[index] = g as number;
|
||||
results[index] = g || 0;
|
||||
}
|
||||
});
|
||||
|
||||
return gutter;
|
||||
return results;
|
||||
}
|
||||
|
||||
renderRow = ({ getPrefixCls }: ConfigConsumerProps) => {
|
||||
|
Loading…
Reference in New Issue
Block a user