Skip to content
This repository has been archived by the owner on Mar 5, 2020. It is now read-only.

Commit

Permalink
Fixes #700 - added webmaker logo next to log in link
Browse files Browse the repository at this point in the history
  • Loading branch information
mmmavis committed Apr 15, 2015
1 parent bf48f75 commit aa43ab4
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 11 deletions.
16 changes: 10 additions & 6 deletions components/login.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,19 @@ var Login = React.createClass({
);
} else if (this.state.username) {
content = (
<span>
Logged in as {this.state.username} | <a href="" onClick={this.handleLogoutClick}>Logout</a>
</span>
<div>
<span className="login-text">Logged in as {this.state.username}</span>
<a href="" onClick={this.handleLogoutClick}>Logout</a>
</div>
);
} else {
content = (
<span>
<Link to="join">Create an account</Link> | <a href="" onClick={this.handleLoginClick}>Log in</a>
</span>
<div>
<span className="login-text">
<img src="/img/logo-webmaker-flat.svg" alt="Webmaker logo"/><a href="" onClick={this.handleLoginClick}>Log in</a>
</span>
<Link to="join">Create an account</Link>
</div>
);
}

Expand Down
34 changes: 34 additions & 0 deletions img/logo-webmaker-flat.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 11 additions & 1 deletion less/components/sidebar.less
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,17 @@ html.no-js .sidebar {
}

.sidebar-login {
padding: 1rem (@grid-gutter-width / 2) 3rem
padding: 1rem (@grid-gutter-width / 2) 3rem;
.login-text {
img {
width: 2.8rem;
margin-right: .5rem;
}
&:after {
content: "|";
padding: 0 .8rem;
}
}
}

.sidebar-menu {
Expand Down
6 changes: 2 additions & 4 deletions test/browser/login.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,10 @@ describe("login", function() {

it("triggers login when user clicks login link", function() {
var links = TestUtils.scryRenderedDOMComponentsWithTag(login, 'a');

// We should have a "create an account link" followed by a
// "Log in" link.
// We should have a "Log in" link followed by a "create an account" link
links.length.should.equal(2);

TestUtils.Simulate.click(links[1]);
TestUtils.Simulate.click(links[0]);
teachAPI.startLogin.callCount.should.equal(1);
login.state.loggingIn.should.be.true;
});
Expand Down

0 comments on commit aa43ab4

Please sign in to comment.