Merge branch 'master' into feature/talk-plugin-toxic-comments

This commit is contained in:
Kiwi
2017-08-31 12:31:44 +02:00
committed by GitHub
6 changed files with 21 additions and 30 deletions
@@ -1,12 +1,12 @@
import React from 'react';
import styles from './Category.css';
import {Slot, IfSlotIsNotEmpty} from 'plugin-api/beta/client/components';
import {Slot} from 'plugin-api/beta/client/components';
const childFactory = (child) => <li className={styles.listItem} key={child.key}>{child}</li>;
const ViewingOptions = ({slot, title, data, asset, root}) => {
return (
<IfSlotIsNotEmpty slot={slot} className={styles.root}>
<div className={styles.root}>
<div className={styles.title}>{title}</div>
<Slot
fill={slot}
@@ -16,7 +16,7 @@ const ViewingOptions = ({slot, title, data, asset, root}) => {
data={data}
queryData={{asset, root}}
/>
</IfSlotIsNotEmpty>
</div>
);
};
@@ -2,6 +2,7 @@ import React from 'react';
import cn from 'classnames';
import styles from './Menu.css';
import {capitalize} from 'plugin-api/beta/client/utils';
import {IfSlotIsNotEmpty} from 'plugin-api/beta/client/components';
import Category from './Category';
import {t} from 'plugin-api/beta/client/services';
@@ -16,11 +17,12 @@ class Menu extends React.Component {
<div className={cn([styles.menu, 'talk-plugin-viewing-options-menu'])}>
{
Object.keys(this.categories).map((category) =>
<Category
key={category}
slot={`viewingOptions${capitalize(category)}`}
title={this.categories[category]}
/>
<IfSlotIsNotEmpty slot={`viewingOptions${capitalize(category)}`} key={category}>
<Category
slot={`viewingOptions${capitalize(category)}`}
title={this.categories[category]}
/>
</IfSlotIsNotEmpty>
)
}
</div>