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

Commit

Permalink
Merge branch 'release/0.20.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
larrysalibra committed Nov 3, 2017
2 parents b124389 + 0c81790 commit d826a39
Show file tree
Hide file tree
Showing 23 changed files with 244 additions and 81 deletions.
2 changes: 1 addition & 1 deletion app/js/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ class App extends Component {
}

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

closeModal() {
Expand Down
2 changes: 1 addition & 1 deletion app/js/account/CreateAccountPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class CreateAccountPage extends Component {
<div className="form-group">
<fieldset>
<div className="col-xs-offset-3 col-xs-8 pull-right m-t-11 m-b-5">
<button className="btn btn-block btn-secondary" onClick={this.createAccount}>
<button className="btn btn-block btn-tertiary" onClick={this.createAccount}>
Create Account
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/js/account/components/DeleteAccountModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const DeleteAccountModal = (props) => (
</button>
<button
onClick={props.closeModal}
className="btn btn-secondary btn-block"
className="btn btn-tertiary btn-block"
>
Cancel
</button>
Expand Down
2 changes: 1 addition & 1 deletion app/js/components/Navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Navbar extends Component {
return (
<header
className="container-fluid no-padding bg-white fixed-top"
style={{ maxWidth: 'unset', zIndex: 9 }}
style={{ maxWidth: 'unset', zIndex: 9 }}
>
<nav className="navbar navbar-expand container-lg mx-auto" >
<ul className="navbar-nav container-fluid">
Expand Down
23 changes: 15 additions & 8 deletions app/js/components/SecondaryNavBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const SecondaryNavLink = props => {

return (
<Link
className={`btn btn-link btn-block ${alignment} ${active}`}
className={`btn btn-outline-dark btn-pill btn-sm ${active} ${props.customButtonClass}`}
to={props.link}>
{props.title}
</Link>
Expand All @@ -21,7 +21,7 @@ const SecondaryNavButton = props => {

return (
<button
className={`btn btn-link btn-block ${alignment} ${active}`}
className={`btn btn-outline-dark btn-pill btn-sm ${active} ${props.customButtonClass}`}
title={props.title}
onClick={props.onClick}>
{props.title}
Expand All @@ -47,15 +47,16 @@ class SecondaryNavBar extends Component {
isLeftActive: PropTypes.bool,
isCenterActive: PropTypes.bool,
isRightActive: PropTypes.bool,
activeClass: PropTypes.string
activeClass: PropTypes.string,
customButtonClass: PropTypes.string
}

render() {
const activeClass = this.props.activeClass ? this.props.activeClass : ""
return (
<div className="container-fluid secondary-nav no-padding">
<div className="container-fluid secondary-nav mx-auto">
<div className="row">
<div className="col">
<div className="col text-left">
{this.props.leftButtonTitle !== undefined && (
this.props.leftIsButton ?
<SecondaryNavButton
Expand All @@ -64,6 +65,7 @@ class SecondaryNavBar extends Component {
align="left"
isActive={this.props.isLeftActive}
activeClass={activeClass}
customButtonClass={this.props.customButtonClass}
/>
:
<SecondaryNavLink
Expand All @@ -72,6 +74,7 @@ class SecondaryNavBar extends Component {
align="left"
isActive={this.props.isLeftActive}
activeClass={activeClass}
customButtonClass={this.props.customButtonClass}
/>
) }
</div>
Expand All @@ -84,6 +87,7 @@ class SecondaryNavBar extends Component {
align="right"
isActive={this.props.isCenterActive}
activeClass={activeClass}
customButtonClass={this.props.customButtonClass}
/>
:
<SecondaryNavLink
Expand All @@ -92,26 +96,29 @@ class SecondaryNavBar extends Component {
align="right"
isActive={this.props.isCenterActive}
activeClass={activeClass}
customButtonClass={this.props.customButtonClass}
/>
)}
</div>
<div className="col">
<div className="col text-right">
{this.props.rightButtonTitle !== undefined && (
this.props.rightIsButton ?
<SecondaryNavButton
title={this.props.rightButtonTitle}
onClick={this.props.onRightButtonClick}
align="right"
isActive={this.props.isRightActive}
isActive={this.props.isRightActive}
activeClass={activeClass}
customButtonClass={this.props.customButtonClass}
/>
:
<SecondaryNavLink
title={this.props.rightButtonTitle}
link={this.props.rightButtonLink}
align="right"
isActive={this.props.isRightActive}
activeClass={activeClass}
activeClass={activeClass}
customButtonClass={this.props.customButtonClass}
/>
) }
</div>
Expand Down
107 changes: 86 additions & 21 deletions app/js/profiles/DefaultProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { connect } from 'react-redux'
import { Link } from 'react-router'
import { Person } from 'blockstack'
import Modal from 'react-modal'
import SecondaryNavBar from '../components/SecondaryNavBar'
import Image from '../components/Image'
import { IdentityActions } from './store/identity'
import { AccountActions } from '../account/store/account'
Expand All @@ -26,14 +25,19 @@ const logger = log4js.getLogger('profiles/DefaultProfilePage.js')
const accountTypes = [
'twitter',
'facebook',
'linkedIn',
'github',
'instagram',
'hackerNews',
'bitcoin',
'ethereum',
'pgp',
'ssh'
'ssh',
'linkedIn',
'instagram'
]

const hiddenAccountTypes = [
'linkedIn',
'instagram'
]

function mapStateToProps(state) {
Expand Down Expand Up @@ -86,7 +90,8 @@ class DefaultProfilePage extends Component {
socialAccountModalIsOpen: false,
accountModalIsOpen: false,
editingSocialAccount: {},
editingAccount: {}
editingAccount: {},
showHiddenPlaceholders: false
}

this.onValueChange = this.onValueChange.bind(this)
Expand Down Expand Up @@ -329,6 +334,12 @@ class DefaultProfilePage extends Component {
this.closeAccountModal()
}

onMoreAccountsClick = () => {
this.setState({
showHiddenPlaceholders: true
})
}

componentHasNewLocalIdentities(props) {
logger.trace('componentHasNewLocalIdentities')
const identityIndex = this.props.defaultIdentity
Expand Down Expand Up @@ -516,6 +527,7 @@ class DefaultProfilePage extends Component {

const filledAccounts = []
const placeholders = []
let hiddenAccounts = hiddenAccountTypes

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

const hideAccount = (hiddenAccounts.indexOf(accountType) >= 0)

if (hasAccount && hideAccount) {
hiddenAccounts = hiddenAccounts.filter(hiddenAccount => hiddenAccount !== accountType)
}

if (!hasAccount) {
placeholders.push(this.createPlaceholderAccount(accountType))
if (hideAccount) {
if (this.state.showHiddenPlaceholders) {
placeholders.push(this.createPlaceholderAccount(accountType))
}
} else {
placeholders.push(this.createPlaceholderAccount(accountType))
}
}
})
} else {
accountTypes.forEach((accountType) => {
placeholders.push(this.createPlaceholderAccount(accountType))
const hideAccount = (hiddenAccounts.indexOf(accountType) >= 0)
if (hideAccount) {
if (this.state.showHiddenPlaceholders) {
placeholders.push(this.createPlaceholderAccount(accountType))
}
} else {
placeholders.push(this.createPlaceholderAccount(accountType))
}
})
}

// const accounts = person.profile().account || []
const accounts = filledAccounts.concat(placeholders)
const showMoreAccountsButton = hiddenAccounts.length > 0
// const connections = person.connections() || []

return (
Expand Down Expand Up @@ -602,15 +634,6 @@ class DefaultProfilePage extends Component {
</div>
</ToolTip>
<div>
<SecondaryNavBar
leftButtonTitle={this.state.editMode ? 'Save' : 'Edit'}
leftIsButton
onLeftButtonClick={this.state.editMode ? this.onSaveClick : this.onEditClick}
rightButtonTitle={this.state.editMode ? 'Cancel' : 'More'}
rightIsButton={this.state.editMode}
onRightButtonClick={this.state.editMode ? this.onCancelClick : null}
rightButtonLink={this.state.editMode ? '' : '/profiles/i/all'}
/>

{profileCompleteness < 1 &&
<ProfileCompletion completePct={profileCompleteness} />
Expand Down Expand Up @@ -676,7 +699,7 @@ class DefaultProfilePage extends Component {
{identity.canAddUsername ?
<Link
to={`/profiles/i/add-username/${identityIndex}/search`}
className="btn btn-link btn-link-mute btn-xs"
className="btn btn-outline-dark btn-pill btn-xs m-t-15 m-b-15"
>
Add a username
</Link>
Expand Down Expand Up @@ -706,7 +729,7 @@ class DefaultProfilePage extends Component {
</div>

<div className="pro-card-body text-center m-b-25">
{(person.description() && person.description().length > 0) ?
{(person.description() && person.description().length > 0) ?
person.description() :
<span className="placeholder">Add your bio</span>}
<span className="pro-card-edit">
Expand Down Expand Up @@ -741,8 +764,8 @@ class DefaultProfilePage extends Component {
<div className="row">
<div className="col-12">

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

<div className="container-fluid p-0">
<div className="row m-t-30 no-gutters">
<div className="row m-t-10 text-center">
<div className="col">
<button
className="btn btn-outline-dark btn-pill btn-sm ml-5"
title={this.state.editMode ? 'Save' : 'Edit'}
onClick={this.state.editMode ? this.onSaveClick : this.onEditClick}
>
{this.state.editMode ? 'Save' : 'Edit'}
</button>
</div>
<div className="col">
{this.state.editMode ?
<button
className="btn btn-outline-dark btn-pill btn-sm mr-5"
title="Cancel"
onClick={this.onCancelClick}
>
Cancel
</button>
:
<Link
className="btn btn-outline-dark btn-pill btn-sm mr-5"
to="/profiles/i/all"
>
More
</Link>
}
</div>
</div>
</div>

<div className="container-fluid p-0">
<div className="row m-t-50 no-gutters">
<div className="col">
<div className="profile-accounts">
<ul>
Expand Down Expand Up @@ -810,6 +865,16 @@ class DefaultProfilePage extends Component {
}
})}
</ul>
<div className="text-center">
{(!this.state.showHiddenPlaceholders && showMoreAccountsButton) &&
<button
className="btn btn-link btn-link-mute btn-link-small"
onClick={this.onMoreAccountsClick}
>
More accounts
</button>
}
</div>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/js/profiles/ImportProfilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export default connect(mapStateToProps, mapDispatchToProps)(ImportPage)

/*
<div>
<button className="btn btn-secondary" onClick={this.refreshAddress}>
<button className="btn btn-tertiary" onClick={this.refreshAddress}>
New Address
</button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/js/profiles/ZoneFilePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class ZoneFilePage extends Component {
Broadcast update
</button>
<button
className="btn btn-sm btn-secondary"
className="btn btn-sm btn-tertiary"
onClick={this.reset}
disabled={this.state.disabled}
title="Reset your edits to the current zone file."
Expand Down
19 changes: 19 additions & 0 deletions app/js/profiles/components/EditSocialAccountModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,17 @@ import { connect } from 'react-redux'
import Modal from 'react-modal'
import InputGroup from '../../components/InputGroup'
import VerificationInfo from '../components/VerificationInfo'
import { openInNewTab } from '../../utils'

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

const helpPages = {
twitter: 'https://forum.blockstack.org/t/twitter-verification-process/2143',
facebook: 'https://forum.blockstack.org/t/facebook-verification-process/2142/3',
github: 'https://forum.blockstack.org/t/github-verification-process/2145',
instagram: 'https://forum.blockstack.org/t/instagram-verification-process/2144',
}

function mapStateToProps(state) {
return {
api: state.settings.api
Expand Down Expand Up @@ -127,6 +135,12 @@ class EditSocialAccountModal extends Component {
return !this.props.verified && (this.props.identifier.length > 0)
}

showHelp = () => {
if (helpPages.hasOwnProperty(this.props.service)) {
openInNewTab(helpPages[this.props.service])
}
}

render() {
const webAccountTypes = getWebAccountTypes(this.props.api)
const verifiedClass = this.props.verified ? "verified" : (this.state.collapsed ? "pending" : "")
Expand Down Expand Up @@ -205,6 +219,11 @@ class EditSocialAccountModal extends Component {
this.state.identifier, this.state.proofUrl)}>
Verify
</button>
<div className="text-center">
{helpPages.hasOwnProperty(this.props.service) &&
<button className="btn btn-link btn-link-small p-t-10" onClick={this.showHelp}>Need help?</button>
}
</div>
</Modal>
)
} else {
Expand Down
Loading

0 comments on commit d826a39

Please sign in to comment.