This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 219
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from blockstack/web-0.2
Web 0.2
- Loading branch information
Showing
66 changed files
with
4,704 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,7 @@ __coverage__ | |
|
||
.elasticbeanstalk/ | ||
|
||
unused | ||
unused | ||
|
||
tmp | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
import React, { Component, PropTypes } from 'react' | ||
import { bindActionCreators } from 'redux' | ||
import { connect } from 'react-redux' | ||
import { Link } from 'react-router' | ||
import { Person } from 'blockstack-profiles' | ||
|
||
import AddressBar from '../components/AddressBar' | ||
import { IdentityItem } from '../components/index' | ||
import { IdentityActions } from '../store/identities' | ||
import { AccountActions } from '../store/account' | ||
|
||
function mapStateToProps(state) { | ||
return { | ||
localIdentities: state.identities.localIdentities, | ||
lastNameLookup: state.identities.lastNameLookup, | ||
identityAddresses: state.account.identityAccount.addresses, | ||
addressLookupUrl: state.settings.api.addressLookupUrl || '' | ||
} | ||
} | ||
|
||
function mapDispatchToProps(dispatch) { | ||
return bindActionCreators(Object.assign({}, IdentityActions, AccountActions), dispatch) | ||
} | ||
|
||
class IdentityPage extends Component { | ||
static propTypes = { | ||
localIdentities: PropTypes.object.isRequired, | ||
createNewIdentity: PropTypes.func.isRequired, | ||
refreshIdentities: PropTypes.func.isRequired, | ||
addressLookupUrl: PropTypes.string.isRequired, | ||
lastNameLookup: PropTypes.array.isRequired | ||
} | ||
|
||
constructor(props) { | ||
super(props) | ||
|
||
this.state = { | ||
localIdentities: this.props.localIdentities | ||
} | ||
} | ||
|
||
componentWillMount() { | ||
this.props.refreshIdentities( | ||
this.props.identityAddresses, | ||
this.props.addressLookupUrl, | ||
this.props.localIdentities, | ||
this.props.lastNameLookup | ||
) | ||
} | ||
|
||
componentWillReceiveProps(nextProps) { | ||
this.setState({ | ||
localIdentities: nextProps.localIdentities | ||
}) | ||
} | ||
|
||
render() { | ||
return ( | ||
<div> | ||
<nav className="navbar navbar-light bg-faded"> | ||
<div className="nav navbar-nav"> | ||
<div className="nav-search"> | ||
<div className="nav-link"> | ||
<AddressBar placeholder="Search for people, apps & more…" /> | ||
</div> | ||
</div> | ||
</div> | ||
</nav> | ||
|
||
<div className="m-b-2"> | ||
<h3>Personas</h3> | ||
</div> | ||
<div className="m-b-2"> | ||
<Link to="/names/register" className="btn btn-side-emphasis btn-side-pull-left" > | ||
Register | ||
</Link> | ||
<Link to="/names/import" className="btn btn-side-secondary"> | ||
Import | ||
</Link> | ||
</div> | ||
<div className="m-b-2"> | ||
<ul className="nav sidebar-list"> | ||
{Object.keys(this.state.localIdentities).map((domainName) => { | ||
const identity = this.state.localIdentities[domainName], | ||
person = new Person(identity.profile) | ||
if (identity.domainName) { | ||
return ( | ||
<IdentityItem key={identity.domainName} | ||
label={identity.domainName} | ||
pending={!identity.registered} | ||
avatarUrl={person.avatarUrl() || ''} | ||
url={`/profile/local/${identity.domainName}`} /> | ||
) | ||
} | ||
})} | ||
</ul> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default connect(mapStateToProps, mapDispatchToProps)(IdentityPage) |
Oops, something went wrong.