Skip to content
Snippets Groups Projects
Commit 4f99fd41 authored by James Calfee's avatar James Calfee Committed by Valentine Zavgorodnev
Browse files

Adjust wallet permissions layout to preview WIF key trunction. (close #360) (#373)

parent 7d117cf3
No related branches found
No related tags found
No related merge requests found
...@@ -101,3 +101,9 @@ label { ...@@ -101,3 +101,9 @@ label {
.NotFound { .NotFound {
width: 640px; width: 640px;
} }
@media print {
.noPrint {
display:none;
}
}
...@@ -60,10 +60,8 @@ class Keys extends Component { ...@@ -60,10 +60,8 @@ class Keys extends Component {
return ( return (
<span> <span>
<div className="row"> <div className="row">
<div className="column small-2"> <div className="column small-12">
<label>{authType}</label> <label>{authType}</label>
</div>
<div className="column small-10">
{auths} {auths}
</div> </div>
</div> </div>
......
...@@ -59,26 +59,27 @@ class ShowKey extends Component { ...@@ -59,26 +59,27 @@ class ShowKey extends Component {
render() { render() {
const {onShow, showLogin, props: {pubkey, cmpProps, children, authType}} = this const {onShow, showLogin, props: {pubkey, cmpProps, children, authType}} = this
const {show, wif} = this.state const {show, wif} = this.state
const keyIcon = <span style={{fontSize: '100%'}}>Hide private key</span> const keyIcon = <span>Hide private key</span>
// Tooltip is trigggering a setState on unmounted component exception // Tooltip is trigggering a setState on unmounted component exception
const showTip = 'Show private key'//<Tooltip t="Show private key (WIF)">show</Tooltip> const showTip = <span>Show private key</span> //<Tooltip t="Show private key (WIF)">show</Tooltip>
const keyLink = wif ? const keyLink = wif ?
<div style={{marginBottom: 0}} className="hollow tiny button"><a onClick={onShow}>{show ? keyIcon : showTip}</a></div> : <div style={{marginBottom: 0}} className="hollow tiny button slim"><a onClick={onShow}>{show ? keyIcon : showTip}</a></div> :
authType === 'memo' ? null : authType === 'memo' ? null :
authType === 'owner' ? null : authType === 'owner' ? null :
<div style={{marginBottom: 0}} className="hollow tiny button"><a onClick={showLogin}>Login to show</a></div>; <div style={{marginBottom: 0}} className="hollow tiny button slim"><a onClick={showLogin}>Login to show</a></div>;
return (<div className="row"> return (<div className="row">
<div className="column small-9 overflow-ellipsis"> <div className="column small-10">
{/* Keep this as wide as possible, check print preview makes sure WIF it not cut off */}
<span {...cmpProps}>{show ? wif : pubkey}</span> <span {...cmpProps}>{show ? wif : pubkey}</span>
</div> </div>
<div className="column small-2"> <div className="column small-2 noPrint">
{keyLink} {keyLink}
</div> </div>
<div className="column small-1"> {/*<div className="column small-1">
{children} {children}
</div> </div>*/}
</div>) </div>)
} }
} }
......
...@@ -167,7 +167,7 @@ class Header extends React.Component { ...@@ -167,7 +167,7 @@ class Header extends React.Component {
sort_order_extra_menu = <HorizontalMenu items={items} /> sort_order_extra_menu = <HorizontalMenu items={items} />
} }
return ( return (
<header className="Header"> <header className="Header noPrint">
<div className="Header__top header"> <div className="Header__top header">
<div className="expanded row"> <div className="expanded row">
<div className="columns"> <div className="columns">
...@@ -177,7 +177,7 @@ class Header extends React.Component { ...@@ -177,7 +177,7 @@ class Header extends React.Component {
<Icon name="steem" size="2x" /> <Icon name="steem" size="2x" />
</Link> </Link>
</li> </li>
<li className="Header__top-steemit show-for-medium"><Link to={logo_link}>steemit<span className="beta">beta</span></Link></li> <li className="Header__top-steemit show-for-medium noPrint"><Link to={logo_link}>steemit<span className="beta">beta</span></Link></li>
{(topic_link || user_name || page_name) && <li className="delim show-for-medium">|</li>} {(topic_link || user_name || page_name) && <li className="delim show-for-medium">|</li>}
{topic_link && <li className="Header__top-topic">{topic_link}</li>} {topic_link && <li className="Header__top-topic">{topic_link}</li>}
{user_name && <li><Link to={`/@${user_name}`}>{user_name}</Link></li>} {user_name && <li><Link to={`/@${user_name}`}>{user_name}</Link></li>}
......
...@@ -217,9 +217,12 @@ export default class UserProfile extends React.Component { ...@@ -217,9 +217,12 @@ export default class UserProfile extends React.Component {
} else if( section === 'permissions' ) { } else if( section === 'permissions' ) {
section_title = account.name + "'s permissions" section_title = account.name + "'s permissions"
if(isMyAccount && wifShown) { if(isMyAccount && wifShown) {
printLink = <a className="float-right" onClick={onPrint}> printLink = <div>
<Icon name="printer" />&nbsp;Print&nbsp;&nbsp; <a className="float-right noPrint" onClick={onPrint}>
</a> <Icon name="printer" />&nbsp;
Print
</a>
</div>
} }
} else if( section === 'posts' ) { } else if( section === 'posts' ) {
section_title = account.name + "'s posts"; section_title = account.name + "'s posts";
...@@ -290,12 +293,16 @@ export default class UserProfile extends React.Component { ...@@ -290,12 +293,16 @@ export default class UserProfile extends React.Component {
</div> </div>
</div> </div>
</div> </div>
<div className="UserProfile__top-nav row expanded"> <div className="UserProfile__top-nav row expanded noPrint">
{top_menu} {top_menu}
</div> </div>
<div className="row"> <div className="row">
<div className="column"> <div className="column">
{printLink} {printLink}
</div>
</div>
<div className="row">
<div className="column">
{/*section_title && <h2 className="UserProfile__section-title">{section_title}</h2>*/} {/*section_title && <h2 className="UserProfile__section-title">{section_title}</h2>*/}
{tab_content} {tab_content}
</div> </div>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment