Commit b1870eb6 authored by Roger Jungemann's avatar Roger Jungemann
Browse files

Fix settings

parent d9d6065c
......@@ -109,55 +109,6 @@ class Header extends React.Component {
page_title.charAt(0).toUpperCase() + page_title.slice(1);
}
//TopRightHeader Stuff
const defaultNavigate = e => {
if (e.metaKey || e.ctrlKey) {
// prevent breaking anchor tags
} else {
e.preventDefault();
}
const a =
e.target.nodeName.toLowerCase() === 'a'
? e.target
: e.target.parentNode;
browserHistory.push(a.pathname + a.search + a.hash);
};
// Since navigate isn't set, defaultNavigate will always be used.
const nav = navigate || defaultNavigate;
const wallet_link = `/@${username}/transfers`;
const account_link = `/@${username}`;
const reset_password_link = `/@${username}/password`;
const settings_link = `/@${username}/settings`;
const user_menu = [
{
link: wallet_link,
icon: 'wallet',
value: tt('g.wallet'),
},
{
link: '#',
icon: 'eye',
onClick: toggleNightmode,
value: tt('g.toggle_nightmode'),
},
{
link: reset_password_link,
icon: 'key',
value: tt('g.change_password'),
},
{ link: settings_link, icon: 'cog', value: tt('g.settings') },
loggedIn
? {
link: '#',
icon: 'enter',
onClick: logout,
value: tt('g.logout'),
}
: { link: '#', onClick: showLogin, value: tt('g.login') },
];
return (
<header className="Header">
<nav className="row Header__nav">
......@@ -169,16 +120,9 @@ class Header extends React.Component {
</div>
<div className="small-7 large-6 columns Header__buttons">
{/*NOT LOGGED IN SIGN IN AND SIGN UP LINKS*/}
{/*NOT LOGGED IN SIGN UP LINK*/}
{!loggedIn && (
<span className="Header__user-signup show-for-medium">
<a
className="Header__login-link"
href="/login.html"
onClick={showLogin}
>
{tt('g.login')}
</a>
<a
className="Header__signup-link"
href={SIGNUP_URL}
......@@ -188,33 +132,6 @@ class Header extends React.Component {
</span>
)}
{/*CUSTOM SEARCH*/}
<span className="Header__search--desktop">
<SearchInput />
</span>
<span className="Header__search">
<a href="/static/search.html">
<IconButton icon="magnifyingGlass" />
</a>
</span>
{/*USER AVATAR */}
{loggedIn && (
<DropdownMenu
className={'Header__usermenu'}
items={user_menu}
title={username}
el="span"
selected={tt('g.rewards')}
position="left"
>
<li className={'Header__userpic '}>
<span title={username}>
<Userpic account={username} />
</span>
</li>
</DropdownMenu>
)}
{/*HAMBURGER*/}
<span
onClick={showSidePanel}
......
......@@ -19,7 +19,6 @@ class Settings extends React.Component {
progress: {},
};
this.initForm(props);
this.onNsfwPrefChange = this.onNsfwPrefChange.bind(this);
}
initForm(props) {
......@@ -210,7 +209,12 @@ class Settings extends React.Component {
progress,
} = this.state;
const { account, isOwnAccount, user_preferences } = this.props;
const {
account,
isOwnAccount,
user_preferences,
toggleNightmode,
} = this.props;
return (
<div className="Settings">
......@@ -219,6 +223,13 @@ class Settings extends React.Component {
onSubmit={this.handleSubmitForm}
className="small-12 medium-6 large-4 columns"
>
<button
className="toggle-nightmode button hollow"
onClick={toggleNightmode}
>
{tt('g.toggle_nightmode')}
</button>
<hr />
<h4>{tt('settings_jsx.public_profile_settings')}</h4>
{progress.message && (
<div className="info">{progress.message}</div>
......@@ -397,5 +408,9 @@ export default connect(
};
dispatch(transactionActions.broadcastOperation(options));
},
toggleNightmode: e => {
if (e) e.preventDefault();
dispatch(appActions.toggleNightmode());
},
})
)(Settings);
.Settings {
.button {
text-decoration: none;
......@@ -25,17 +24,26 @@
}
}
}
.button.toggle-nightmode,
.button.toggle-nightmode:hover,
.button.toggle-nightmode:focus {
background-color: transparent;
box-shadow: none;
border: 1px solid #06D6A9;
color: #1FBF8F;
font-size: 0.9rem;
font-weight: 400;
text-transform: uppercase;
}
.button.toggle-nightmode:hover,
.button.toggle-nightmode:focus {
border: 1px solid #788187;
color: #333;
}
.button.disabled, .button[disabled] {
opacity: 0.25;
cursor: not-allowed;
box-shadow: 0px 0px 0px 0 rgba(0,0,0,0);
&:hover {
@include themify($themes) {
background-color: themed('buttonBackground');
box-shadow: 0px 0px 0px 0 rgba(0,0,0,0);
color: themed('buttonText');
}
}
opacity: 0.25;
cursor: not-allowed;
box-shadow: 0px 0px 0px 0 rgba(0,0,0,0);
}
.success, .error {
text-transform: capitalize;
......@@ -54,12 +62,23 @@
div.error {
padding-left: 0;
}
label {
text-transform: none!important;
}
h4 {
font-weight: bold;
font-family: $font-primary;
font-size: 1.125rem!important;
}
label {
text-transform: none!important;
}
h4 {
font-weight: bold;
font-family: $font-primary;
font-size: 1.125rem!important;
}
}
.App.theme-dark {
.Settings {
.button.toggle-nightmode,
.button.toggle-nightmode:hover,
.button.toggle-nightmode:focus {
border: 1px solid #06D6A9;
color: #1FBF8F;
}
}
}
......@@ -871,7 +871,7 @@
"title": "Steem wallet login",
"description":
"Welcome to Steemit's official Steem blockchain wallet. Use it to transfer Steem tokens, Power up, vote for Steem Witnesses and change your Steem profile details.",
"login": "Login",
"login": "View Account",
"steem_tokens": "Steem tokens",
"steem_symbol": "STEEM",
"steem_description": "Liquid platform token",
......
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