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