);
}
}
+TabBar.propTypes = {
+
+ // className to be added to the root element.
+ className: PropTypes.string,
+
+ // classNames allows full design customization of the component.
+ classNames: PropTypes.shape({
+ root: PropTypes.string,
+ rootSub: PropTypes.string,
+ }),
+
+ // classNames to be passed to the children.
+ tabClassNames: Tab.propTypes.classNames,
+
+ // activeTab should be set to the currently active tabId.
+ activeTab: PropTypes.string,
+
+ // onTabClick is fired whenever the tab was clicked. The tabId is passed as
+ // the first argument.
+ onTabClick: PropTypes.func,
+
+ // Sub indicates that this is a sub-tab-panel.
+ sub: PropTypes.bool,
+
+ // `aria-controls` should be set to the `id` of the `TabContent` for accessibility.
+ 'aria-controls': PropTypes.string,
+};
+
export default TabBar;
diff --git a/client/coral-ui/components/TabContent.css b/client/coral-ui/components/TabContent.css
new file mode 100644
index 000000000..debafa97c
--- /dev/null
+++ b/client/coral-ui/components/TabContent.css
@@ -0,0 +1,3 @@
+.root {
+ padding-top: 10px;
+}
diff --git a/client/coral-ui/components/TabContent.js b/client/coral-ui/components/TabContent.js
index 737c9a5e6..99676f7cc 100644
--- a/client/coral-ui/components/TabContent.js
+++ b/client/coral-ui/components/TabContent.js
@@ -1,6 +1,43 @@
import React from 'react';
+import cn from 'classnames';
+import PropTypes from 'prop-types';
+import styles from './TabContent.css';
-export default ({children, show = true}) => (
- show ?
{children}
: null
+function getRootClassName(className) {
+ return cn('talk-tab-content', className, styles.root);
+}
+
+/**
+ * The `TabContent` component accepts `TabPane` components to render
+ * the content of a `Tab`.
+ */
+const TabContent = ({children, className, activeTab, sub, ...rest}) => (
+
);
+TabContent.propTypes = {
+
+ // className to be added to the root element.
+ className: PropTypes.string,
+
+ // activeTab should be set to the currently active tabId.
+ activeTab: PropTypes.string,
+
+ // Sub indicates that this component belongs to a sub-tab-panel.
+ sub: PropTypes.bool,
+};
+
+export default TabContent;
diff --git a/client/coral-ui/components/TabCount.css b/client/coral-ui/components/TabCount.css
new file mode 100644
index 000000000..f95792a0b
--- /dev/null
+++ b/client/coral-ui/components/TabCount.css
@@ -0,0 +1,18 @@
+
+.root, .rootSub {
+ display: inline-block;
+ position: relative;
+ top: -2px;
+ background: #616161;
+ color: white;
+ font-weight: normal;
+ font-size: 10px;
+ padding: 2px;
+ margin-left: 2px;
+ margin-top: -2px;
+ min-width: 20px;
+}
+
+.rootSubActive {
+ background: #10589b;
+}
diff --git a/client/coral-ui/components/TabCount.js b/client/coral-ui/components/TabCount.js
new file mode 100644
index 000000000..01a3840a9
--- /dev/null
+++ b/client/coral-ui/components/TabCount.js
@@ -0,0 +1,47 @@
+import React from 'react';
+import cn from 'classnames';
+import styles from './TabCount.css';
+import PropTypes from 'prop-types';
+
+function getNumber(no) {
+ let result = Number.parseInt(no);
+ if (no >= 1000) {
+ result = `${Math.round(result / 100) / 10}k`;
+ }
+ return result;
+}
+
+function getRootClassName({className, active, sub}) {
+ return cn(
+ 'talk-tab-count',
+ className,
+ {
+ [styles.root]: !sub,
+ [styles.rootSub]: sub,
+ [styles.rootActive]: active && !sub,
+ [styles.rootSubActive]: active && sub,
+ 'talk-tab-active': active,
+ }
+ );
+}
+
+/**
+ * The `TabCount` renders a count number next to a tab name.
+ */
+const TabCount = ({children, active, sub, className}) => (
+ {getNumber(children)}
+);
+
+TabCount.propTypes = {
+
+ // className to be added to the root element.
+ className: PropTypes.string,
+
+ // active indicates that the related tab is currently active.
+ active: PropTypes.bool,
+
+ // Sub indicates that this component belongs to a sub-tab-panel.
+ sub: PropTypes.bool,
+};
+
+export default TabCount;
diff --git a/client/coral-ui/components/TabPane.js b/client/coral-ui/components/TabPane.js
new file mode 100644
index 000000000..16750b335
--- /dev/null
+++ b/client/coral-ui/components/TabPane.js
@@ -0,0 +1,34 @@
+import React from 'react';
+import cn from 'classnames';
+import PropTypes from 'prop-types';
+
+function getRootClassName(className) {
+ return cn('talk-pane', className);
+}
+
+/**
+ * The `TabPane` component is used inside the `TabContent` component to render
+ * the content of a `Tab`.
+ */
+const TabPane = ({children, className, tabId: _a, sub: _b, ...rest}) => (
+
+ {children}
+
+);
+
+TabPane.propTypes = {
+
+ // className to be added to the root element.
+ className: PropTypes.string,
+
+ tabId: PropTypes.string,
+
+ // Sub indicates that this component belongs to a sub-tab-panel.
+ // This is injected by the `TabContent` component.
+ sub: PropTypes.bool,
+};
+
+export default TabPane;
diff --git a/client/coral-ui/index.js b/client/coral-ui/index.js
index 3e9456727..8a538d120 100644
--- a/client/coral-ui/index.js
+++ b/client/coral-ui/index.js
@@ -4,7 +4,9 @@ export {default as CoralLogo} from './components/CoralLogo';
export {default as FabButton} from './components/FabButton';
export {default as TabBar} from './components/TabBar';
export {default as Tab} from './components/Tab';
+export {default as TabCount} from './components/TabCount';
export {default as TabContent} from './components/TabContent';
+export {default as TabPane} from './components/TabPane';
export {default as Button} from './components/Button';
export {default as Spinner} from './components/Spinner';
export {default as Tooltip} from './components/Tooltip';
diff --git a/locales/en.yml b/locales/en.yml
index 44db5e1b8..e3bf42e5e 100644
--- a/locales/en.yml
+++ b/locales/en.yml
@@ -2,6 +2,7 @@ en:
your_account_has_been_suspended: Your account has been temporarily suspended.
your_account_has_been_banned: Your account has been banned.
your_username_has_been_rejected: Your account has been suspended because your username has been deemed inappropriate. To restore your account please enter a new username.
+ embed_comments_tab: Comments
bandialog:
are_you_sure: "Are you sure you would like to ban {0}?"
ban_user: "Ban User?"
diff --git a/locales/es.yml b/locales/es.yml
index a6b1bc4cd..fe6030b74 100644
--- a/locales/es.yml
+++ b/locales/es.yml
@@ -2,6 +2,7 @@ es:
your_account_has_been_suspended: Su cuenta ha sido temporalmente suspendida.
your_account_has_been_banned: Su cuenta ha sido suspendida.
your_username_has_been_rejected: Su cuenta ha sido suspendida porque tu nombre de usuario ha sido considerado no apropiado para el espacio. Para recuperar la cuenta, por favor ingresar un nuevo nombre de usuario.
+ embed_comments_tab: Comentarios
bandialog:
are_you_sure: "¿Estás segura que quieres suspender a {0}?"
ban_user: "¿Quieres suspender el Usuario?"
diff --git a/plugins/coral-plugin-auth/client/components/styles.css b/plugins/coral-plugin-auth/client/components/styles.css
index c8fbf9a30..735f34d31 100644
--- a/plugins/coral-plugin-auth/client/components/styles.css
+++ b/plugins/coral-plugin-auth/client/components/styles.css
@@ -66,7 +66,7 @@ input.error{
}
.userBox {
- padding: 10px 0 20px;
+ margin: 10px 0 20px;
letter-spacing: 0.1px;
}
diff --git a/plugins/coral-plugin-like/client/LikeButton.js b/plugins/coral-plugin-like/client/LikeButton.js
index 34b5e40f2..dfbf88d1c 100644
--- a/plugins/coral-plugin-like/client/LikeButton.js
+++ b/plugins/coral-plugin-like/client/LikeButton.js
@@ -48,7 +48,7 @@ class LikeButton extends React.Component {
{t(alreadyReacted ? 'coral-plugin-like.liked' : 'coral-plugin-like.like')}
-
+ {count > 0 && count}