Fix `me` PropType checks
This commit is contained in:
parent
099ff10987
commit
03251de773
|
@ -3,6 +3,7 @@ import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import SoapboxPropTypes from 'gabsocial/utils/soapbox_prop_types';
|
||||||
import IconButton from './icon_button';
|
import IconButton from './icon_button';
|
||||||
import DropdownMenuContainer from '../containers/dropdown_menu_container';
|
import DropdownMenuContainer from '../containers/dropdown_menu_container';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
|
@ -65,7 +66,7 @@ class StatusActionBar extends ImmutablePureComponent {
|
||||||
withDismiss: PropTypes.bool,
|
withDismiss: PropTypes.bool,
|
||||||
withGroupAdmin: PropTypes.bool,
|
withGroupAdmin: PropTypes.bool,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
me: PropTypes.string,
|
me: SoapboxPropTypes.me,
|
||||||
isStaff: PropTypes.bool.isRequired,
|
isStaff: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Provider, connect } from 'react-redux';
|
import { Provider, connect } from 'react-redux';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import SoapboxPropTypes from 'gabsocial/utils/soapbox_prop_types';
|
||||||
import Helmet from 'gabsocial/components/helmet';
|
import Helmet from 'gabsocial/components/helmet';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import configureStore from '../store/configureStore';
|
import configureStore from '../store/configureStore';
|
||||||
|
@ -55,7 +56,7 @@ class GabSocialMount extends React.PureComponent {
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
showIntroduction: PropTypes.bool,
|
showIntroduction: PropTypes.bool,
|
||||||
me: PropTypes.string,
|
me: SoapboxPropTypes.me,
|
||||||
theme: PropTypes.string,
|
theme: PropTypes.string,
|
||||||
reduceMotion: PropTypes.bool,
|
reduceMotion: PropTypes.bool,
|
||||||
systemFont: PropTypes.bool,
|
systemFont: PropTypes.bool,
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { openModal } from '../../../actions/modal';
|
import { openModal } from '../../../actions/modal';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import SoapboxPropTypes from 'gabsocial/utils/soapbox_prop_types';
|
||||||
import IconButton from '../../../components/icon_button';
|
import IconButton from '../../../components/icon_button';
|
||||||
import ImmutablePropTypes from 'react-immutable-proptypes';
|
import ImmutablePropTypes from 'react-immutable-proptypes';
|
||||||
import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
|
import DropdownMenuContainer from '../../../containers/dropdown_menu_container';
|
||||||
|
@ -69,7 +70,7 @@ class ActionBar extends React.PureComponent {
|
||||||
onEmbed: PropTypes.func,
|
onEmbed: PropTypes.func,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
onOpenUnauthorizedModal: PropTypes.func.isRequired,
|
onOpenUnauthorizedModal: PropTypes.func.isRequired,
|
||||||
me: PropTypes.string,
|
me: SoapboxPropTypes.me,
|
||||||
isStaff: PropTypes.bool.isRequired,
|
isStaff: PropTypes.bool.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import SoapboxPropTypes from 'gabsocial/utils/soapbox_prop_types';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { FormattedMessage, injectIntl } from 'react-intl';
|
import { FormattedMessage, injectIntl } from 'react-intl';
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ const SignUpPanel = ({ siteTitle, me }) => {
|
||||||
|
|
||||||
SignUpPanel.propTypes = {
|
SignUpPanel.propTypes = {
|
||||||
siteTitle: PropTypes.string,
|
siteTitle: PropTypes.string,
|
||||||
me: PropTypes.string,
|
me: SoapboxPropTypes.me,
|
||||||
};
|
};
|
||||||
|
|
||||||
export default injectIntl(connect(mapStateToProps)(SignUpPanel));
|
export default injectIntl(connect(mapStateToProps)(SignUpPanel));
|
||||||
|
|
|
@ -7,6 +7,7 @@ import { defineMessages, injectIntl } from 'react-intl';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import { Switch, withRouter } from 'react-router-dom';
|
import { Switch, withRouter } from 'react-router-dom';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import SoapboxPropTypes from 'gabsocial/utils/soapbox_prop_types';
|
||||||
import NotificationsContainer from './containers/notifications_container';
|
import NotificationsContainer from './containers/notifications_container';
|
||||||
import LoadingBarContainer from './containers/loading_bar_container';
|
import LoadingBarContainer from './containers/loading_bar_container';
|
||||||
import ModalContainer from './containers/modal_container';
|
import ModalContainer from './containers/modal_container';
|
||||||
|
@ -266,7 +267,7 @@ class UI extends React.PureComponent {
|
||||||
location: PropTypes.object,
|
location: PropTypes.object,
|
||||||
intl: PropTypes.object.isRequired,
|
intl: PropTypes.object.isRequired,
|
||||||
dropdownMenuIsOpen: PropTypes.bool,
|
dropdownMenuIsOpen: PropTypes.bool,
|
||||||
me: PropTypes.string,
|
me: SoapboxPropTypes.me,
|
||||||
streamingUrl: PropTypes.string,
|
streamingUrl: PropTypes.string,
|
||||||
meUsername: PropTypes.string,
|
meUsername: PropTypes.string,
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import SoapboxPropTypes from 'gabsocial/utils/soapbox_prop_types';
|
||||||
import { Redirect, Route } from 'react-router-dom';
|
import { Redirect, Route } from 'react-router-dom';
|
||||||
import ColumnsAreaContainer from '../containers/columns_area_container';
|
import ColumnsAreaContainer from '../containers/columns_area_container';
|
||||||
import ColumnLoading from '../components/column_loading';
|
import ColumnLoading from '../components/column_loading';
|
||||||
|
@ -22,7 +23,7 @@ class WrappedRoute extends React.Component {
|
||||||
componentParams: PropTypes.object,
|
componentParams: PropTypes.object,
|
||||||
layout: PropTypes.object,
|
layout: PropTypes.object,
|
||||||
publicRoute: PropTypes.bool,
|
publicRoute: PropTypes.bool,
|
||||||
me: PropTypes.string,
|
me: SoapboxPropTypes.me,
|
||||||
};
|
};
|
||||||
|
|
||||||
static defaultProps = {
|
static defaultProps = {
|
||||||
|
|
|
@ -8,9 +8,7 @@ export default function me(state = initialState, action) {
|
||||||
case ME_FETCH_SUCCESS:
|
case ME_FETCH_SUCCESS:
|
||||||
return action.me.id;
|
return action.me.id;
|
||||||
case ME_FETCH_FAIL:
|
case ME_FETCH_FAIL:
|
||||||
return false;
|
|
||||||
case ME_FETCH_SKIP:
|
case ME_FETCH_SKIP:
|
||||||
return false;
|
|
||||||
case AUTH_LOGGED_OUT:
|
case AUTH_LOGGED_OUT:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
me: PropTypes.oneOfType([
|
||||||
|
PropTypes.string,
|
||||||
|
PropTypes.oneOf([false, null]),
|
||||||
|
]),
|
||||||
|
meLoggedIn: PropTypes.string,
|
||||||
|
};
|
Loading…
Reference in New Issue