Skip to content

Commit 72ca21c

Browse files
authored
Update: Removing some redundant code (#9)
1 parent 2790015 commit 72ca21c

6 files changed

Lines changed: 19 additions & 23 deletions

File tree

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
[Box UI Elements](https://developer.box.com/docs/box-ui-elements)
88
==========================================================================
9-
The Box UI Elements are currently in beta and may contain bugs. Their interfaces may also update as needed. Please email [box-ui-kit-feedback@box.com](mailto:box-ui-kit-feedback@box.com) to report issues or provide feedback.
9+
The Box UI Elements are currently in beta and may contain bugs. Their interfaces may also update as needed. Please email [box-ui-elements@box.com](mailto:box-ui-elements@box.com) to report issues or provide feedback.
1010

1111
## Usage
1212
If you are not building a [React](https://facebook.github.io/react) based app, please follow the [documentation on our developer docs](https://developer.box.com/docs/box-ui-elements), which shows how to use the Box UI Elements via script includes. Continue reading below to import the components into your React based app.
@@ -47,8 +47,8 @@ render(
4747
);
4848
```
4949

50-
### Attributes
51-
| Attribute | Type | Default | Description |
50+
### Props
51+
| Prop | Type | Default | Description |
5252
| --- | --- | --- | --- |
5353
| token* | string | | *See the [developer docs](https://developer.box.com/docs/box-content-explorer#section-options).* |
5454
| getLocalizedMessage* | function(string, { [string]: string }) | | Function to get localized strings. |
@@ -100,8 +100,8 @@ render(
100100
);
101101
```
102102

103-
### Attributes
104-
| Attribute | Type | Default | Description |
103+
### Props
104+
| Prop | Type | Default | Description |
105105
| --- | --- | --- | --- |
106106
| token* | string | | *See the [developer docs](https://developer.box.com/docs/box-content-picker#section-options).* |
107107
| getLocalizedMessage* | function(string, { [string]: string }) | | Function to get localized strings. |
@@ -143,8 +143,8 @@ render(
143143
);
144144
```
145145

146-
### Attributes
147-
| Attribute | Type | Default | Description |
146+
### Props
147+
| Prop | Type | Default | Description |
148148
| --- | --- | --- | --- |
149149
| token* | string | | *See the [developer docs](https://developer.box.com/docs/box-content-uploader#section-options).* |
150150
| getLocalizedMessage* | function(string, { [string]: string }) | | Function to get localized strings. |
@@ -181,8 +181,8 @@ render(
181181
);
182182
```
183183

184-
### Attributes
185-
| Attribute | Type | Default | Description |
184+
### Props
185+
| Prop | Type | Default | Description |
186186
| --- | --- | --- | --- |
187187
| token* | string | | *See the [developer docs](https://developer.box.com/docs/box-content-tree#section-options).* |
188188
| getLocalizedMessage* | function(string, { [string]: string }) | | Function to get localized strings. |
@@ -218,8 +218,8 @@ render(
218218
);
219219
```
220220

221-
### Attributes
222-
| Attribute | Type | Default | Description |
221+
### Props
222+
| Prop | Type | Default | Description |
223223
| --- | --- | --- | --- |
224224
| token* | string | | *See the [developer docs](https://developer.box.com/docs/box-content-preview#section-initialization-and-options).* |
225225
| fileId* | string | | The id of the file to preview. |

src/components/Breadcrumbs/BreadcrumbDropdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Props = {
1818
};
1919

2020
const BreadcrumbDropdown = ({ crumbs, onCrumbClick, className = '' }: Props) =>
21-
<DropdownMenu constrainToScrollParent renderElementTo='.buik-app-element'>
21+
<DropdownMenu constrainToScrollParent>
2222
<PlainButton className={`buik-breadcrumbs-drop-down ${className}`}>
2323
···
2424
</PlainButton>

src/components/ContentExplorer/ItemList.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ const ItemList = ({
162162
disableSort
163163
dataKey={FIELD_ID}
164164
cellRenderer={moreOptionsCell}
165-
width={isSmall ? 58 : 140}
165+
width={isSmall || !canShare ? 58 : 140}
166166
flexShrink={0}
167167
/>
168168
</Table>}

src/components/ContentExplorer/moreOptionsCellRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default (
6363

6464
return (
6565
<div className='bce-more-options'>
66-
<DropdownMenu isRightAligned constrainToScrollParent renderElementTo='.bce-content'>
66+
<DropdownMenu isRightAligned constrainToScrollParent>
6767
<Button onFocus={onFocus} className='bce-btn-more-options'>
6868
···
6969
</Button>

src/components/DropdownMenu/DropdownMenu.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Props = {
1414
constrainToScrollParent: boolean,
1515
constrainToWindow: boolean,
1616
isRightAligned: boolean,
17-
renderElementTo: string
17+
bodyElement: string | HTMLElement
1818
};
1919

2020
type DefaultProps = {|
@@ -217,13 +217,7 @@ class DropdownMenu extends PureComponent<DefaultProps, Props, State> {
217217
* @return {Element}
218218
*/
219219
render() {
220-
const {
221-
children,
222-
isRightAligned,
223-
constrainToScrollParent,
224-
constrainToWindow,
225-
renderElementTo
226-
}: Props = this.props;
220+
const { children, isRightAligned, constrainToScrollParent, constrainToWindow, bodyElement }: Props = this.props;
227221
const { isOpen, initialFocusIndex }: State = this.state;
228222
const elements = Children.toArray(children);
229223

@@ -287,7 +281,7 @@ class DropdownMenu extends PureComponent<DefaultProps, Props, State> {
287281
targetAttachment={targetAttachment}
288282
constraints={constraints}
289283
enabled={isOpen}
290-
renderElementTo={renderElementTo}
284+
bodyElement={bodyElement}
291285
>
292286
{cloneElement(menuButton, menuButtonProps)}
293287
{isOpen ? cloneElement(menu, menuProps) : null}

test/explorer-no-react.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ <h1>Content Explorer</h1>
8585
document.querySelector('.explorer1').innerHTML = '';
8686
explorer1.show(folderId, token, {
8787
container: '.explorer1',
88+
currentFolderId: '4579229774',
89+
canShare: false,
8890
logoUrl: 'https://d30y9cdsu7xlg0.cloudfront.net/png/12458-200.png'
8991
});
9092
}

0 commit comments

Comments
 (0)