Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit d826a39

Browse files
committed
Merge branch 'release/0.20.1'
2 parents b124389 + 0c81790 commit d826a39

23 files changed

+244
-81
lines changed

app/js/App.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ class App extends Component {
146146
}
147147

148148
onSupportClick = () => {
149-
openInNewTab('https://blockstack.zendesk.com/hc/en-us')
149+
openInNewTab('https://forum.blockstack.org/t/frequently-ask-questions/2123')
150150
}
151151

152152
closeModal() {

app/js/account/CreateAccountPage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class CreateAccountPage extends Component {
102102
<div className="form-group">
103103
<fieldset>
104104
<div className="col-xs-offset-3 col-xs-8 pull-right m-t-11 m-b-5">
105-
<button className="btn btn-block btn-secondary" onClick={this.createAccount}>
105+
<button className="btn btn-block btn-tertiary" onClick={this.createAccount}>
106106
Create Account
107107
</button>
108108
</div>

app/js/account/components/DeleteAccountModal.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const DeleteAccountModal = (props) => (
2828
</button>
2929
<button
3030
onClick={props.closeModal}
31-
className="btn btn-secondary btn-block"
31+
className="btn btn-tertiary btn-block"
3232
>
3333
Cancel
3434
</button>

app/js/components/Navbar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ class Navbar extends Component {
114114
return (
115115
<header
116116
className="container-fluid no-padding bg-white fixed-top"
117-
style={{ maxWidth: 'unset', zIndex: 9 }}
117+
style={{ maxWidth: 'unset', zIndex: 9 }}
118118
>
119119
<nav className="navbar navbar-expand container-lg mx-auto" >
120120
<ul className="navbar-nav container-fluid">

app/js/components/SecondaryNavBar.js

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const SecondaryNavLink = props => {
88

99
return (
1010
<Link
11-
className={`btn btn-link btn-block ${alignment} ${active}`}
11+
className={`btn btn-outline-dark btn-pill btn-sm ${active} ${props.customButtonClass}`}
1212
to={props.link}>
1313
{props.title}
1414
</Link>
@@ -21,7 +21,7 @@ const SecondaryNavButton = props => {
2121

2222
return (
2323
<button
24-
className={`btn btn-link btn-block ${alignment} ${active}`}
24+
className={`btn btn-outline-dark btn-pill btn-sm ${active} ${props.customButtonClass}`}
2525
title={props.title}
2626
onClick={props.onClick}>
2727
{props.title}
@@ -47,15 +47,16 @@ class SecondaryNavBar extends Component {
4747
isLeftActive: PropTypes.bool,
4848
isCenterActive: PropTypes.bool,
4949
isRightActive: PropTypes.bool,
50-
activeClass: PropTypes.string
50+
activeClass: PropTypes.string,
51+
customButtonClass: PropTypes.string
5152
}
5253

5354
render() {
5455
const activeClass = this.props.activeClass ? this.props.activeClass : ""
5556
return (
56-
<div className="container-fluid secondary-nav no-padding">
57+
<div className="container-fluid secondary-nav mx-auto">
5758
<div className="row">
58-
<div className="col">
59+
<div className="col text-left">
5960
{this.props.leftButtonTitle !== undefined && (
6061
this.props.leftIsButton ?
6162
<SecondaryNavButton
@@ -64,6 +65,7 @@ class SecondaryNavBar extends Component {
6465
align="left"
6566
isActive={this.props.isLeftActive}
6667
activeClass={activeClass}
68+
customButtonClass={this.props.customButtonClass}
6769
/>
6870
:
6971
<SecondaryNavLink
@@ -72,6 +74,7 @@ class SecondaryNavBar extends Component {
7274
align="left"
7375
isActive={this.props.isLeftActive}
7476
activeClass={activeClass}
77+
customButtonClass={this.props.customButtonClass}
7578
/>
7679
) }
7780
</div>
@@ -84,6 +87,7 @@ class SecondaryNavBar extends Component {
8487
align="right"
8588
isActive={this.props.isCenterActive}
8689
activeClass={activeClass}
90+
customButtonClass={this.props.customButtonClass}
8791
/>
8892
:
8993
<SecondaryNavLink
@@ -92,26 +96,29 @@ class SecondaryNavBar extends Component {
9296
align="right"
9397
isActive={this.props.isCenterActive}
9498
activeClass={activeClass}
99+
customButtonClass={this.props.customButtonClass}
95100
/>
96101
)}
97102
</div>
98-
<div className="col">
103+
<div className="col text-right">
99104
{this.props.rightButtonTitle !== undefined && (
100105
this.props.rightIsButton ?
101106
<SecondaryNavButton
102107
title={this.props.rightButtonTitle}
103108
onClick={this.props.onRightButtonClick}
104109
align="right"
105-
isActive={this.props.isRightActive}
110+
isActive={this.props.isRightActive}
106111
activeClass={activeClass}
112+
customButtonClass={this.props.customButtonClass}
107113
/>
108114
:
109115
<SecondaryNavLink
110116
title={this.props.rightButtonTitle}
111117
link={this.props.rightButtonLink}
112118
align="right"
113119
isActive={this.props.isRightActive}
114-
activeClass={activeClass}
120+
activeClass={activeClass}
121+
customButtonClass={this.props.customButtonClass}
115122
/>
116123
) }
117124
</div>

app/js/profiles/DefaultProfilePage.js

Lines changed: 86 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { connect } from 'react-redux'
44
import { Link } from 'react-router'
55
import { Person } from 'blockstack'
66
import Modal from 'react-modal'
7-
import SecondaryNavBar from '../components/SecondaryNavBar'
87
import Image from '../components/Image'
98
import { IdentityActions } from './store/identity'
109
import { AccountActions } from '../account/store/account'
@@ -26,14 +25,19 @@ const logger = log4js.getLogger('profiles/DefaultProfilePage.js')
2625
const accountTypes = [
2726
'twitter',
2827
'facebook',
29-
'linkedIn',
3028
'github',
31-
'instagram',
3229
'hackerNews',
3330
'bitcoin',
3431
'ethereum',
3532
'pgp',
36-
'ssh'
33+
'ssh',
34+
'linkedIn',
35+
'instagram'
36+
]
37+
38+
const hiddenAccountTypes = [
39+
'linkedIn',
40+
'instagram'
3741
]
3842

3943
function mapStateToProps(state) {
@@ -86,7 +90,8 @@ class DefaultProfilePage extends Component {
8690
socialAccountModalIsOpen: false,
8791
accountModalIsOpen: false,
8892
editingSocialAccount: {},
89-
editingAccount: {}
93+
editingAccount: {},
94+
showHiddenPlaceholders: false
9095
}
9196

9297
this.onValueChange = this.onValueChange.bind(this)
@@ -329,6 +334,12 @@ class DefaultProfilePage extends Component {
329334
this.closeAccountModal()
330335
}
331336

337+
onMoreAccountsClick = () => {
338+
this.setState({
339+
showHiddenPlaceholders: true
340+
})
341+
}
342+
332343
componentHasNewLocalIdentities(props) {
333344
logger.trace('componentHasNewLocalIdentities')
334345
const identityIndex = this.props.defaultIdentity
@@ -516,6 +527,7 @@ class DefaultProfilePage extends Component {
516527

517528
const filledAccounts = []
518529
const placeholders = []
530+
let hiddenAccounts = hiddenAccountTypes
519531

520532
if (this.state.profile.hasOwnProperty('account')) {
521533
accountTypes.forEach((accountType) => {
@@ -528,18 +540,38 @@ class DefaultProfilePage extends Component {
528540
}
529541
})
530542

543+
const hideAccount = (hiddenAccounts.indexOf(accountType) >= 0)
544+
545+
if (hasAccount && hideAccount) {
546+
hiddenAccounts = hiddenAccounts.filter(hiddenAccount => hiddenAccount !== accountType)
547+
}
548+
531549
if (!hasAccount) {
532-
placeholders.push(this.createPlaceholderAccount(accountType))
550+
if (hideAccount) {
551+
if (this.state.showHiddenPlaceholders) {
552+
placeholders.push(this.createPlaceholderAccount(accountType))
553+
}
554+
} else {
555+
placeholders.push(this.createPlaceholderAccount(accountType))
556+
}
533557
}
534558
})
535559
} else {
536560
accountTypes.forEach((accountType) => {
537-
placeholders.push(this.createPlaceholderAccount(accountType))
561+
const hideAccount = (hiddenAccounts.indexOf(accountType) >= 0)
562+
if (hideAccount) {
563+
if (this.state.showHiddenPlaceholders) {
564+
placeholders.push(this.createPlaceholderAccount(accountType))
565+
}
566+
} else {
567+
placeholders.push(this.createPlaceholderAccount(accountType))
568+
}
538569
})
539570
}
540571

541572
// const accounts = person.profile().account || []
542573
const accounts = filledAccounts.concat(placeholders)
574+
const showMoreAccountsButton = hiddenAccounts.length > 0
543575
// const connections = person.connections() || []
544576

545577
return (
@@ -602,15 +634,6 @@ class DefaultProfilePage extends Component {
602634
</div>
603635
</ToolTip>
604636
<div>
605-
<SecondaryNavBar
606-
leftButtonTitle={this.state.editMode ? 'Save' : 'Edit'}
607-
leftIsButton
608-
onLeftButtonClick={this.state.editMode ? this.onSaveClick : this.onEditClick}
609-
rightButtonTitle={this.state.editMode ? 'Cancel' : 'More'}
610-
rightIsButton={this.state.editMode}
611-
onRightButtonClick={this.state.editMode ? this.onCancelClick : null}
612-
rightButtonLink={this.state.editMode ? '' : '/profiles/i/all'}
613-
/>
614637

615638
{profileCompleteness < 1 &&
616639
<ProfileCompletion completePct={profileCompleteness} />
@@ -676,7 +699,7 @@ class DefaultProfilePage extends Component {
676699
{identity.canAddUsername ?
677700
<Link
678701
to={`/profiles/i/add-username/${identityIndex}/search`}
679-
className="btn btn-link btn-link-mute btn-xs"
702+
className="btn btn-outline-dark btn-pill btn-xs m-t-15 m-b-15"
680703
>
681704
Add a username
682705
</Link>
@@ -706,7 +729,7 @@ class DefaultProfilePage extends Component {
706729
</div>
707730

708731
<div className="pro-card-body text-center m-b-25">
709-
{(person.description() && person.description().length > 0) ?
732+
{(person.description() && person.description().length > 0) ?
710733
person.description() :
711734
<span className="placeholder">Add your bio</span>}
712735
<span className="pro-card-edit">
@@ -741,8 +764,8 @@ class DefaultProfilePage extends Component {
741764
<div className="row">
742765
<div className="col-12">
743766

744-
<div className="pro-card-trust-level text-center m-t-25 m-b-30">
745-
<span className="pro-card-trust-level-badge">
767+
<div className="container-fluid text-center m-t-25 m-b-40" >
768+
<span className="btn btn-dark btn-pill btn-xs" style={{ boxShadow: 'none' }} >
746769
{trustLevel >= 3 && <i className="fa fa-lg fa-check-circle" />}
747770
<span className="pro-card-trust-level">Trust Level: {trustLevel} </span>
748771
{trustLevel <= 1 &&
@@ -757,7 +780,39 @@ class DefaultProfilePage extends Component {
757780
</div>
758781

759782
<div className="container-fluid p-0">
760-
<div className="row m-t-30 no-gutters">
783+
<div className="row m-t-10 text-center">
784+
<div className="col">
785+
<button
786+
className="btn btn-outline-dark btn-pill btn-sm ml-5"
787+
title={this.state.editMode ? 'Save' : 'Edit'}
788+
onClick={this.state.editMode ? this.onSaveClick : this.onEditClick}
789+
>
790+
{this.state.editMode ? 'Save' : 'Edit'}
791+
</button>
792+
</div>
793+
<div className="col">
794+
{this.state.editMode ?
795+
<button
796+
className="btn btn-outline-dark btn-pill btn-sm mr-5"
797+
title="Cancel"
798+
onClick={this.onCancelClick}
799+
>
800+
Cancel
801+
</button>
802+
:
803+
<Link
804+
className="btn btn-outline-dark btn-pill btn-sm mr-5"
805+
to="/profiles/i/all"
806+
>
807+
More
808+
</Link>
809+
}
810+
</div>
811+
</div>
812+
</div>
813+
814+
<div className="container-fluid p-0">
815+
<div className="row m-t-50 no-gutters">
761816
<div className="col">
762817
<div className="profile-accounts">
763818
<ul>
@@ -810,6 +865,16 @@ class DefaultProfilePage extends Component {
810865
}
811866
})}
812867
</ul>
868+
<div className="text-center">
869+
{(!this.state.showHiddenPlaceholders && showMoreAccountsButton) &&
870+
<button
871+
className="btn btn-link btn-link-mute btn-link-small"
872+
onClick={this.onMoreAccountsClick}
873+
>
874+
More accounts
875+
</button>
876+
}
877+
</div>
813878
</div>
814879
</div>
815880
</div>

app/js/profiles/ImportProfilePage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(ImportPage)
6161

6262
/*
6363
<div>
64-
<button className="btn btn-secondary" onClick={this.refreshAddress}>
64+
<button className="btn btn-tertiary" onClick={this.refreshAddress}>
6565
New Address
6666
</button>
6767
</div>

app/js/profiles/ZoneFilePage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ class ZoneFilePage extends Component {
234234
Broadcast update
235235
</button>
236236
<button
237-
className="btn btn-sm btn-secondary"
237+
className="btn btn-sm btn-tertiary"
238238
onClick={this.reset}
239239
disabled={this.state.disabled}
240240
title="Reset your edits to the current zone file."

app/js/profiles/components/EditSocialAccountModal.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,17 @@ import { connect } from 'react-redux'
44
import Modal from 'react-modal'
55
import InputGroup from '../../components/InputGroup'
66
import VerificationInfo from '../components/VerificationInfo'
7+
import { openInNewTab } from '../../utils'
78

89
import { getWebAccountTypes } from '../../utils'
910

11+
const helpPages = {
12+
twitter: 'https://forum.blockstack.org/t/twitter-verification-process/2143',
13+
facebook: 'https://forum.blockstack.org/t/facebook-verification-process/2142/3',
14+
github: 'https://forum.blockstack.org/t/github-verification-process/2145',
15+
instagram: 'https://forum.blockstack.org/t/instagram-verification-process/2144',
16+
}
17+
1018
function mapStateToProps(state) {
1119
return {
1220
api: state.settings.api
@@ -127,6 +135,12 @@ class EditSocialAccountModal extends Component {
127135
return !this.props.verified && (this.props.identifier.length > 0)
128136
}
129137

138+
showHelp = () => {
139+
if (helpPages.hasOwnProperty(this.props.service)) {
140+
openInNewTab(helpPages[this.props.service])
141+
}
142+
}
143+
130144
render() {
131145
const webAccountTypes = getWebAccountTypes(this.props.api)
132146
const verifiedClass = this.props.verified ? "verified" : (this.state.collapsed ? "pending" : "")
@@ -205,6 +219,11 @@ class EditSocialAccountModal extends Component {
205219
this.state.identifier, this.state.proofUrl)}>
206220
Verify
207221
</button>
222+
<div className="text-center">
223+
{helpPages.hasOwnProperty(this.props.service) &&
224+
<button className="btn btn-link btn-link-small p-t-10" onClick={this.showHelp}>Need help?</button>
225+
}
226+
</div>
208227
</Modal>
209228
)
210229
} else {

0 commit comments

Comments
 (0)