mirror of
https://github.com/wassname/talk.git
synced 2026-07-16 11:22:16 +08:00
Removing innecesary connects, and classes
This commit is contained in:
@@ -2,7 +2,7 @@ import React from 'react';
|
||||
import {TabCount} from 'plugin-api/beta/client/components/ui';
|
||||
import InfoIcon from './InfoIcon';
|
||||
import {t} from 'plugin-api/beta/client/services';
|
||||
import Tooltip from '../containers/Tooltip';
|
||||
import Tooltip from './Tooltip';
|
||||
|
||||
export default ({active, asset: {featuredCommentsCount}, tooltip, ...props}) => {
|
||||
return (
|
||||
@@ -12,7 +12,7 @@ export default ({active, asset: {featuredCommentsCount}, tooltip, ...props}) =>
|
||||
{t('talk-plugin-featured-comments.featured')}
|
||||
<TabCount active={active} sub>{featuredCommentsCount}</TabCount>
|
||||
<InfoIcon />
|
||||
{tooltip && <Tooltip />}
|
||||
{tooltip && <Tooltip />}
|
||||
</span>
|
||||
);
|
||||
};
|
||||
@@ -2,16 +2,12 @@ import React from 'react';
|
||||
import {Icon} from 'plugin-api/beta/client/components/ui';
|
||||
import styles from './Tooltip.css';
|
||||
|
||||
export default class Tooltip extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<div className={styles.tooltip}>
|
||||
<Icon name="info_outline" className={styles.icon} />
|
||||
<h3 className={styles.headline}>Featured Comments:</h3>
|
||||
<p className={styles.description}>
|
||||
Comments selected by our team as worth reading
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
export default () => (
|
||||
<div className={styles.tooltip}>
|
||||
<Icon name="info_outline" className={styles.icon} />
|
||||
<h3 className={styles.headline}>Featured Comments:</h3>
|
||||
<p className={styles.description}>
|
||||
Comments selected by our team as worth reading
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
import {bindActionCreators} from 'redux';
|
||||
import {showTooltip, hideTooltip} from '../actions';
|
||||
import {connect} from 'plugin-api/beta/client/hocs';
|
||||
import Tooltip from '../components/Tooltip';
|
||||
|
||||
const mapStateToProps = ({talkPluginFeaturedComments: state}) => state;
|
||||
|
||||
const mapDispatchToProps = (dispatch) =>
|
||||
bindActionCreators({
|
||||
showTooltip,
|
||||
hideTooltip,
|
||||
}, dispatch);
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(Tooltip);
|
||||
Reference in New Issue
Block a user