Skip to content

Commit 3aab8bf

Browse files
committed
conte-box in core. p2
1 parent b388aba commit 3aab8bf

25 files changed

Lines changed: 101 additions & 22 deletions

ashes/src/components/activity-notifications/panel.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
66
import classNames from 'classnames';
77

88
// components
9-
import ContentBox from '../content-box/content-box';
9+
import ContentBox from 'components/core/content-box';
1010
import NotificationItem from '../activity-notifications/item';
1111
import { PrimaryButton } from 'components/core/button';
1212

ashes/src/components/common/totals.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import _ from 'lodash';
4-
import ContentBox from '../content-box/content-box';
4+
import ContentBox from 'components/core/content-box';
55
import Currency from './currency';
66

77
const TotalsFooter = props => {
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
.box {
2+
color: #484848;
3+
position: relative;
4+
border: 1px solid #d9d9d9;
5+
margin-bottom: 20px;
6+
}
7+
8+
.header {
9+
display: flex;
10+
align-items: center;
11+
padding: 22px 20px 21px;
12+
13+
background-color: #f7f7f7;
14+
border-bottom: 1px solid #d9d9d9;
15+
16+
font-size: 16px;
17+
font-weight: 600;
18+
line-height: 1;
19+
}
20+
21+
.title {
22+
flex: 1;
23+
}
24+
25+
.controls {
26+
27+
}
28+
29+
.body {
30+
padding: 20px;
31+
background-color: #fff;
32+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
/* @flow */
2+
3+
// libs
4+
import { isEmpty } from 'lodash';
5+
import classNames from 'classnames';
6+
import React, { Element } from 'react';
7+
8+
// styles
9+
import s from './content-box.css';
10+
11+
type Props = {
12+
id: string,
13+
title: string | Element<any>,
14+
className: string,
15+
bodyClassName: string,
16+
actionBlock: Element<any>,
17+
children: Element<any>,
18+
footer: Element<any>,
19+
indentContent: boolean,
20+
renderContent: Function,
21+
viewContent: Element<any>,
22+
}
23+
24+
export default (props: Props) => {
25+
let body = props.children;
26+
27+
if (isEmpty(body)) {
28+
if (props.renderContent) {
29+
body = props.renderContent();
30+
} else if (props.viewContent) {
31+
body = props.viewContent;
32+
}
33+
}
34+
35+
return (
36+
<div id={props.id} className={classNames(s.box, props.className)}>
37+
<header className={s.header}>
38+
<div className={s.title}>{props.title}</div>
39+
<div className={s.controls}>{props.actionBlock}</div>
40+
</header>
41+
<div className={classNames(s.body, props.bodyClassName)}>
42+
{ body }
43+
</div>
44+
{props.footer}
45+
</div>
46+
);
47+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export default from './content-box';

ashes/src/components/coupons/form/coupon-codes.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { autobind } from 'core-decorators';
77
import { connect } from 'react-redux';
88

99
// components
10-
import ContentBox from '../../content-box/content-box';
10+
import ContentBox from 'components/core/content-box';
1111
import RadioButton from 'components/core/radio-button';
1212
import Counter from 'components/core/counter';
1313
import FormField from '../../forms/formfield';

ashes/src/components/coupons/form/usage-rules.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import React, { Component, Element } from 'react';
66
import { autobind } from 'core-decorators';
77

88
// components
9-
import ContentBox from '../../content-box/content-box';
9+
import ContentBox from 'components/core/content-box';
1010
import RadioButton from 'components/core/radio-button';
1111
import Counter from 'components/core/counter';
1212

ashes/src/components/customers/account-password.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import ContentBox from '../content-box/content-box';
3+
import ContentBox from 'components/core/content-box';
44

55
export default class CustomerAccountPassword extends React.Component {
66

ashes/src/components/customers/account-status.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
3-
import ContentBox from '../content-box/content-box';
3+
import ContentBox from 'components/core/content-box';
44
import { SliderCheckbox } from 'components/core/checkbox';
55
import { connect } from 'react-redux';
66
import * as CustomersActions from '../../modules/customers/details';

ashes/src/components/customers/address-book.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import _ from 'lodash';
33
import React from 'react';
44
import PropTypes from 'prop-types';
5-
import ContentBox from '../content-box/content-box';
5+
import ContentBox from 'components/core/content-box';
66
import Addresses, { createAddressBox } from '../addresses/addresses';
77
import AddressBox from '../addresses/address-box';
88
import AddressForm from '../addresses/address-form';

0 commit comments

Comments
 (0)