Merge branch 'develop' of https://code.gab.com/gab/social/gab-social into feature/frontend_refactor
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { NavLink, withRouter } from 'react-router-dom';
|
||||
import { FormattedMessage, injectIntl } from 'react-intl';
|
||||
import NotificationsCounterIcon from './notifications_counter_icon';
|
||||
import { me } from '../../../initial_state';
|
||||
|
||||
const links = [
|
||||
<NavLink key='pr1' className='footer-bar__link' to='/home' data-preview-title-id='column.home'>
|
||||
<i className='tabs-bar__link__icon home'/>
|
||||
<FormattedMessage id='tabs_bar.home' defaultMessage='Home' />
|
||||
</NavLink>,
|
||||
<NavLink key='pr2' className='footer-bar__link' to='/notifications' data-preview-title-id='column.notifications'>
|
||||
<i className='tabs-bar__link__icon notifications'/>
|
||||
<NotificationsCounterIcon />
|
||||
<FormattedMessage id='tabs_bar.notifications' defaultMessage='Notifications' />
|
||||
</NavLink>,
|
||||
<NavLink key='pr3' className='footer-bar__link' to='/groups' data-preview-title-id='column.groups'>
|
||||
<i className='tabs-bar__link__icon groups'/>
|
||||
<FormattedMessage id='tabs_bar.groups' defaultMessage='Groups' />
|
||||
</NavLink>,
|
||||
<a key='pl4' className='footer-bar__link footer-bar__link--trends' href='https://trends.gab.com' data-preview-title-id='tabs_bar.trends'>
|
||||
<i className='tabs-bar__link__icon trends'/>
|
||||
<FormattedMessage id='tabs_bar.trends' defaultMessage='Trends' />
|
||||
</a>,
|
||||
]
|
||||
|
||||
export default
|
||||
@injectIntl
|
||||
@withRouter
|
||||
class FooterBar extends React.PureComponent {
|
||||
|
||||
static propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
}
|
||||
|
||||
render () {
|
||||
const { intl: { formatMessage } } = this.props;
|
||||
|
||||
if (!me) return null;
|
||||
|
||||
return (
|
||||
<div className='footer-bar'>
|
||||
<div className='footer-bar__container'>
|
||||
{
|
||||
links.map((link) =>
|
||||
React.cloneElement(link, {
|
||||
key: link.props.to,
|
||||
'aria-label': formatMessage({
|
||||
id: link.props['data-preview-title-id']
|
||||
})
|
||||
}))
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { connect } from 'react-redux';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { me } from '../../../initial_state';
|
||||
import IconButton from '../../../components/icon_button';
|
||||
import Icon from '../../../components/icon';
|
||||
|
||||
const messages = defineMessages({
|
||||
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||||
});
|
||||
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
account: state.getIn(['accounts', me]),
|
||||
};
|
||||
};
|
||||
|
||||
class ProUpgradeModal extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
};
|
||||
|
||||
onClickClose = () => {
|
||||
this.props.onClose('PRO_UPGRADE');
|
||||
};
|
||||
|
||||
render () {
|
||||
const { intl } = this.props;
|
||||
|
||||
return (
|
||||
<div className='modal-root__modal compose-modal pro-upgrade-modal'>
|
||||
<div className='compose-modal__header'>
|
||||
<h3 className='compose-modal__header__title'><FormattedMessage id='promo.gab_pro' defaultMessage='Upgrade to GabPRO' /></h3>
|
||||
<IconButton className='compose-modal__close' title={intl.formatMessage(messages.close)} icon='times' onClick={this.onClickClose} size={20} />
|
||||
</div>
|
||||
<div className='compose-modal__content pro-upgrade-modal__content'>
|
||||
<div>
|
||||
<span className="pro-upgrade-modal__text">
|
||||
<FormattedMessage id='pro_upgrade_modal.text' defaultMessage='Gab is fully funded by people like you. Please consider supporting us on our mission to defend free expression online for all people.' />
|
||||
<FormattedMessage id='pro_upgrade_modal.benefits' defaultMessage='Here are just some of the benefits that thousands of GabPRO members receive:' />
|
||||
</span>
|
||||
<ul className="pro-upgrade-modal__list">
|
||||
<li>Schedule Posts</li>
|
||||
<li>Get Verified</li>
|
||||
<li>Create Groups</li>
|
||||
<li>Larger Video and Image Uploads</li>
|
||||
<li>Receive the PRO Badge</li>
|
||||
<li>Remove in-feed promotions</li>
|
||||
<li>More value being added daily!</li>
|
||||
</ul>
|
||||
<a href='https://pro.gab.com' className='pro-upgrade-modal__button button'>
|
||||
<Icon id='arrow-up' fixedWidth/>
|
||||
<FormattedMessage id='promo.gab_pro' defaultMessage='Upgrade to GabPRO' />
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default injectIntl(connect(mapStateToProps)(ProUpgradeModal));
|
||||
@@ -0,0 +1,29 @@
|
||||
import React from 'react';
|
||||
import { monthlyExpensesComplete } from '../../../initial_state';
|
||||
|
||||
export default class ProgressPanel extends React.PureComponent {
|
||||
render() {
|
||||
if (!monthlyExpensesComplete) return null;
|
||||
|
||||
const completed = Math.min(monthlyExpensesComplete, 100);
|
||||
const style = {
|
||||
width: `${completed}%`,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className='wtf-panel progress-panel'>
|
||||
<div className='wtf-panel-header progress-panel-header'>
|
||||
<div className='wtf-panel-header__label'>Gab's Operational Expenses</div>
|
||||
</div>
|
||||
<div className='wtf-panel__content progress-panel__content'>
|
||||
<span className='progress-panel__text'>We are 100% funded by you.</span>
|
||||
<div className='progress-panel__bar-container'>
|
||||
<a className='progress-panel__bar' style={style} href='https://shop.dissenter.com/category/donations'>
|
||||
<span className='progress-panel__bar__text'>{completed}% covered this month</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import React from 'react';
|
||||
import { injectIntl } from 'react-intl';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import ModalLoading from './modal_loading';
|
||||
import RelativeTimestamp from '../../../components/relative_timestamp';
|
||||
|
||||
export default @injectIntl
|
||||
class StatusRevisionsList extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
loading: PropTypes.bool.isRequired,
|
||||
error: PropTypes.object,
|
||||
data: PropTypes.array
|
||||
};
|
||||
|
||||
render () {
|
||||
const { loading, error, data } = this.props;
|
||||
|
||||
if (loading || !data) return <ModalLoading />;
|
||||
|
||||
if (error) return (
|
||||
<div className='status-revisions-list'>
|
||||
<div className='status-revisions-list__error'>
|
||||
An error occured
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
return (
|
||||
<div className='status-revisions-list'>
|
||||
{data.map((revision, i) => (
|
||||
<div key={i} className='status-revisions-list__item'>
|
||||
<div className='status-revisions-list__item__timestamp'>
|
||||
<RelativeTimestamp timestamp={revision.created_at} />
|
||||
</div>
|
||||
|
||||
<div className='status-revisions-list__item__text'>{revision.text}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
import React from 'react';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import IconButton from 'gabsocial/components/icon_button';
|
||||
import StatusRevisionListContainer from '../containers/status_revision_list_container';
|
||||
|
||||
const messages = defineMessages({
|
||||
close: { id: 'lightbox.close', defaultMessage: 'Close' },
|
||||
});
|
||||
|
||||
export default @injectIntl
|
||||
class StatusRevisionModal extends ImmutablePureComponent {
|
||||
|
||||
static propTypes = {
|
||||
intl: PropTypes.object.isRequired,
|
||||
onClose: PropTypes.func.isRequired,
|
||||
status: ImmutablePropTypes.map.isRequired
|
||||
};
|
||||
|
||||
render () {
|
||||
const { intl, onClose, status } = this.props;
|
||||
|
||||
return (
|
||||
<div className='modal-root__modal status-revisions-root'>
|
||||
<div className='status-revisions'>
|
||||
<div className='status-revisions__header'>
|
||||
<h3 className='status-revisions__header__title'><FormattedMessage id='status_revisions.heading' defaultMessage='Revision History' /></h3>
|
||||
<IconButton className='status-revisions__close' title={intl.formatMessage(messages.close)} icon='times' onClick={onClose} size={20} />
|
||||
</div>
|
||||
|
||||
<div className='status-revisions__content'>
|
||||
<StatusRevisionListContainer id={status.get('id')} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import React from 'react';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
import { connect } from 'react-redux';
|
||||
import { load } from '../../../actions/status_revision_list';
|
||||
import StatusRevisionList from '../components/status_revision_list';
|
||||
|
||||
class StatusRevisionListContainer extends ImmutablePureComponent {
|
||||
componentDidMount() {
|
||||
this.props.load(this.props.id);
|
||||
}
|
||||
|
||||
render() {
|
||||
return <StatusRevisionList {...this.props} />;
|
||||
}
|
||||
}
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
loading: state.getIn(['status_revision_list', 'loading']),
|
||||
error: state.getIn(['status_revision_list', 'error']),
|
||||
data: state.getIn(['status_revision_list', 'data']),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = {
|
||||
load
|
||||
};
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(StatusRevisionListContainer);
|
||||
@@ -110,6 +110,10 @@ export function MuteModal () {
|
||||
return import(/* webpackChunkName: "modals/mute_modal" */'../../../components/modal');
|
||||
}
|
||||
|
||||
export function StatusRevisionModal () {
|
||||
return import(/* webpackChunkName: "modals/mute_modal" */'../components/status_revision_modal');
|
||||
}
|
||||
|
||||
export function ReportModal () {
|
||||
return import(/* webpackChunkName: "modals/report_modal" */'../../../components/modal');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user