Pull site_title from Instance
This commit is contained in:
parent
606d240703
commit
16a51fb56c
7 changed files with 24 additions and 16 deletions
|
@ -8,7 +8,7 @@ import classNames from 'classnames';
|
|||
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
|
||||
import { Link } from 'react-router-dom';
|
||||
import Icon from 'gabsocial/components/icon';
|
||||
import { me, siteTitle } from 'gabsocial/initial_state';
|
||||
import { me } from 'gabsocial/initial_state';
|
||||
import { fetchLists } from 'gabsocial/actions/lists';
|
||||
import { createSelector } from 'reselect';
|
||||
|
||||
|
@ -31,6 +31,7 @@ const getOrderedLists = createSelector([state => state.get('lists')], lists => {
|
|||
const mapStateToProps = state => {
|
||||
return {
|
||||
lists: getOrderedLists(state),
|
||||
siteTitle: state.getIn(['instance', 'title']),
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -76,7 +77,7 @@ class ColumnHeader extends React.PureComponent {
|
|||
}
|
||||
|
||||
render () {
|
||||
const { active, children, intl: { formatMessage }, activeItem, activeSubItem, lists } = this.props;
|
||||
const { active, children, intl: { formatMessage }, activeItem, activeSubItem, lists, siteTitle } = this.props;
|
||||
const { collapsed, animating, expandedFor } = this.state;
|
||||
|
||||
const wrapperClassName = classNames('column-header__wrapper', {
|
||||
|
|
|
@ -8,7 +8,6 @@ import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
|||
import ColumnSettingsContainer from './containers/column_settings_container';
|
||||
import HomeColumnHeader from '../../components/home_column_header';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { siteTitle } from '../../initial_state';
|
||||
|
||||
const messages = defineMessages({
|
||||
title: { id: 'column.home', defaultMessage: 'Home' },
|
||||
|
@ -17,6 +16,7 @@ const messages = defineMessages({
|
|||
const mapStateToProps = state => ({
|
||||
hasUnread: state.getIn(['timelines', 'home', 'unread']) > 0,
|
||||
isPartial: state.getIn(['timelines', 'home', 'isPartial']),
|
||||
siteTitle: state.getIn(['instance', 'title']),
|
||||
});
|
||||
|
||||
export default @connect(mapStateToProps)
|
||||
|
@ -68,7 +68,7 @@ class HomeTimeline extends React.PureComponent {
|
|||
}
|
||||
|
||||
render () {
|
||||
const { intl, hasUnread } = this.props;
|
||||
const { intl, hasUnread, siteTitle} = this.props;
|
||||
|
||||
return (
|
||||
<Column label={intl.formatMessage(messages.title)}>
|
||||
|
|
|
@ -16,7 +16,6 @@ import {
|
|||
connectPublicStream,
|
||||
} from '../../actions/streaming';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { siteTitle } from '../../initial_state';
|
||||
|
||||
const messages = defineMessages({
|
||||
title: { id: 'column.public', defaultMessage: 'Federated timeline' },
|
||||
|
@ -31,6 +30,7 @@ const mapStateToProps = state => {
|
|||
timelineId,
|
||||
onlyMedia,
|
||||
hasUnread: state.getIn(['timelines', `${timelineId}${onlyMedia ? ':media' : ''}`, 'unread']) > 0,
|
||||
siteTitle: state.getIn(['instance', 'title']),
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -79,7 +79,7 @@ class CommunityTimeline extends React.PureComponent {
|
|||
}
|
||||
|
||||
render () {
|
||||
const { intl, hasUnread, onlyMedia, timelineId } = this.props;
|
||||
const { intl, hasUnread, onlyMedia, timelineId, siteTitle } = this.props;
|
||||
|
||||
return (
|
||||
<Column label={intl.formatMessage(messages.title)}>
|
||||
|
|
|
@ -5,10 +5,10 @@ import { Link } from 'react-router-dom';
|
|||
import { invitesEnabled, version, repository, source_url, me } from 'gabsocial/initial_state';
|
||||
import { connect } from 'react-redux';
|
||||
import { openModal } from '../../../actions/modal';
|
||||
import { siteTitle } from 'gabsocial/initial_state';
|
||||
|
||||
const mapStateToProps = state => ({
|
||||
account: state.getIn(['accounts', me]),
|
||||
siteTitle: state.getIn(['instance', 'title']),
|
||||
});
|
||||
|
||||
const mapDispatchToProps = (dispatch) => ({
|
||||
|
@ -17,7 +17,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|||
},
|
||||
});
|
||||
|
||||
const LinkFooter = ({ onOpenHotkeys, account }) => (
|
||||
const LinkFooter = ({ onOpenHotkeys, account, siteTitle }) => (
|
||||
<div className='getting-started__footer'>
|
||||
<ul>
|
||||
{(invitesEnabled && account) && <li><a href='/invites'><FormattedMessage id='getting_started.invite' defaultMessage='Invite people' /></a> · </li>}
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
import React from 'react';
|
||||
import { FormattedMessage } from 'react-intl';
|
||||
import { connect } from 'react-redux';
|
||||
import { FormattedMessage, injectIntl } from 'react-intl';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
import { me, siteTitle } from 'gabsocial/initial_state';
|
||||
import { me } from 'gabsocial/initial_state';
|
||||
|
||||
const SignUpPanel = () => {
|
||||
const mapStateToProps = state => {
|
||||
return {
|
||||
siteTitle: state.getIn(['instance', 'title']),
|
||||
};
|
||||
};
|
||||
|
||||
const SignUpPanel = ({ siteTitle }) => {
|
||||
if (me) return null;
|
||||
|
||||
return (
|
||||
|
@ -27,4 +34,4 @@ const SignUpPanel = () => {
|
|||
)
|
||||
}
|
||||
|
||||
export default SignUpPanel;
|
||||
export default injectIntl(connect(mapStateToProps)(SignUpPanel));
|
||||
|
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import PropTypes from 'prop-types';
|
||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||
import { connect } from 'react-redux';
|
||||
import { me, siteTitle } from '../../../initial_state';
|
||||
import { me } from '../../../initial_state';
|
||||
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||
import Avatar from '../../../components/avatar';
|
||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||
|
@ -15,6 +15,7 @@ const messages = defineMessages({
|
|||
const mapStateToProps = state => {
|
||||
return {
|
||||
account: state.getIn(['accounts', me]),
|
||||
siteTitle: state.getIn(['instance', 'title']),
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -30,7 +31,7 @@ class UnauthorizedModal extends ImmutablePureComponent {
|
|||
};
|
||||
|
||||
render () {
|
||||
const { intl, onClose, account } = this.props;
|
||||
const { intl, onClose, account, siteTitle } = this.props;
|
||||
|
||||
return (
|
||||
<div className='modal-root__modal compose-modal unauthorized-modal'>
|
||||
|
|
|
@ -31,7 +31,6 @@ import SearchPage from 'gabsocial/pages/search_page';
|
|||
import HomePage from 'gabsocial/pages/home_page';
|
||||
import GroupSidebarPanel from '../groups/sidebar_panel';
|
||||
import SidebarMenu from '../../components/sidebar_menu';
|
||||
import { siteTitle } from 'gabsocial/initial_state';
|
||||
|
||||
import {
|
||||
Status,
|
||||
|
@ -76,7 +75,7 @@ import '../../components/status';
|
|||
import { fetchGroups } from '../../actions/groups';
|
||||
|
||||
const messages = defineMessages({
|
||||
beforeUnload: { id: 'ui.beforeunload', defaultMessage: 'Your draft will be lost if you leave {site_title}.', values: {site_title: siteTitle} },
|
||||
beforeUnload: { id: 'ui.beforeunload', defaultMessage: 'Your draft will be lost if you leave.' },
|
||||
publish: { id: 'compose_form.publish', defaultMessage: 'Publish' },
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue