Commit 5c37aede authored by Roger Jungemann's avatar Roger Jungemann
Browse files

Remove old announcement code

parent 24a2d122
......@@ -87,19 +87,13 @@ class App extends React.Component {
}
shouldComponentUpdate(nextProps, nextState) {
const {
pathname,
new_visitor,
nightmodeEnabled,
showAnnouncement,
} = this.props;
const { pathname, new_visitor, nightmodeEnabled } = this.props;
const n = nextProps;
return (
pathname !== n.pathname ||
new_visitor !== n.new_visitor ||
this.state.showCallout !== nextState.showCallout ||
nightmodeEnabled !== n.nightmodeEnabled ||
showAnnouncement !== n.showAnnouncement
nightmodeEnabled !== n.nightmodeEnabled
);
}
......@@ -216,7 +210,6 @@ class App extends React.Component {
'index-page': ip,
'mini-header': miniHeader,
'whistle-view': whistleView,
withAnnouncement: this.props.showAnnouncement,
})}
ref="App_root"
>
......@@ -276,7 +269,6 @@ export default connect(
pathname: ownProps.location.pathname,
order: ownProps.params.order,
category: ownProps.params.category,
showAnnouncement: state.user.get('showAnnouncement'),
};
},
dispatch => ({
......
......@@ -3,16 +3,6 @@
padding-top: 50px;
}
.App.withAnnouncement {
padding-top: 170px;
@include MQ(M) {
padding-top: 150px;
}
@include MQ(L) {
padding-top: 100px;
}
}
.App__content {
margin-top: 1rem;
......
import PropTypes from 'prop-types';
import React from 'react';
export const Announcement = ({ onClose }) => (
<div className="annoucement-banner">
<p className="announcement-banner__text">
HF20 Update: Operations Stable, click{' '}
<a
className="announcement-banner__link"
href="https://steemit.com/steem/@steemitblog/hf20-update-operations-stable"
>
here.
</a>
</p>
<button className="close-button" type="button" onClick={onClose}>
&times;
</button>
</div>
);
Announcement.propTypes = {
onClose: PropTypes.func.isRequired,
};
export default Announcement;
......@@ -15,7 +15,6 @@ import Userpic from 'app/components/elements/Userpic';
import { SIGNUP_URL } from 'shared/constants';
import SteemLogo from 'app/components/elements/SteemLogo';
import normalizeProfile from 'app/utils/NormalizeProfile';
import Announcement from 'app/components/elements/Announcement';
class Header extends React.Component {
static propTypes = {
......@@ -171,9 +170,6 @@ class Header extends React.Component {
];
return (
<header className="Header">
{this.props.showAnnouncement && (
<Announcement onClose={this.props.hideAnnouncement} />
)}
<nav className="row Header__nav">
<div className="small-5 large-6 columns Header__logotype">
{/*LOGO*/}
......@@ -278,7 +274,6 @@ const mapStateToProps = (state, ownProps) => {
nightmodeEnabled: state.user.getIn(['user_preferences', 'nightmode']),
account_meta: user_profile,
current_account_name,
showAnnouncement: state.user.get('showAnnouncement'),
...ownProps,
};
};
......@@ -302,7 +297,6 @@ const mapDispatchToProps = dispatch => ({
hideSidePanel: () => {
dispatch(userActions.hideSidePanel());
},
hideAnnouncement: () => dispatch(userActions.hideAnnouncement()),
});
const connectedHeader = connect(mapStateToProps, mapDispatchToProps)(Header);
......
......@@ -37,8 +37,6 @@ const SHOW_SIDE_PANEL = 'user/SHOW_SIDE_PANEL';
const HIDE_SIDE_PANEL = 'user/HIDE_SIDE_PANEL';
const SHOW_POST_ADVANCED_SETTINGS = 'user/SHOW_POST_ADVANCED_SETTINGS';
const HIDE_POST_ADVANCED_SETTINGS = 'user/HIDE_POST_ADVANCED_SETTINGS';
const HIDE_ANNOUNCEMENT = 'user/HIDE_ANNOUNCEMENT';
const SHOW_ANNOUNCEMENT = 'user/SHOW_ANNOUNCEMENT';
// Saga-related
export const LOAD_SAVINGS_WITHDRAW = 'user/LOAD_SAVINGS_WITHDRAW';
......@@ -55,7 +53,6 @@ const defaultState = fromJS({
locale: DEFAULT_LANGUAGE,
show_side_panel: false,
maybeLoggedIn: false,
showAnnouncement: false,
});
export default function reducer(state = defaultState, action) {
......@@ -257,16 +254,6 @@ export default function reducer(state = defaultState, action) {
case HIDE_POST_ADVANCED_SETTINGS:
return state.set('show_post_advanced_settings_modal', '');
case SHOW_ANNOUNCEMENT:
typeof sessionStorage !== 'undefined' &&
sessionStorage.setItem('hideAnnouncement', 'false');
return state.set('showAnnouncement', true);
case HIDE_ANNOUNCEMENT:
typeof sessionStorage !== 'undefined' &&
sessionStorage.setItem('hideAnnouncement', 'true');
return state.set('showAnnouncement', false);
default:
return state;
}
......@@ -453,11 +440,3 @@ export const showPostAdvancedSettings = payload => ({
export const hidePostAdvancedSettings = () => ({
type: HIDE_POST_ADVANCED_SETTINGS,
});
export const hideAnnouncement = () => ({
type: HIDE_ANNOUNCEMENT,
});
export const showAnnouncement = () => ({
type: SHOW_ANNOUNCEMENT,
});
......@@ -123,20 +123,6 @@ function* usernameLogin(action) {
key_types: active, owner, posting keys.
*/
function* usernamePasswordLogin(action) {
// This is a great place to mess with session-related user state (:
// If the user hasn't previously hidden the announcement in this session,
// or if the user's browser does not support session storage,
// show the announcement.
if (
typeof sessionStorage === 'undefined' ||
(typeof sessionStorage !== 'undefined' &&
sessionStorage.getItem('hideAnnouncement') !== 'true')
) {
// Uncomment to re-enable announcment
// TODO: use config to enable/disable
// yield put(userActions.showAnnouncement());
}
// Sets 'loading' while the login is taking place. The key generation can take a while on slow computers.
yield call(usernamePasswordLogin2, action.payload);
const current = yield select(state => state.user.get('current'));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment