Skip to content

Extract user-menu component#130

Merged
rwjblue merged 3 commits intoember-cli:masterfrom
Gaurav0:user_menu
Aug 6, 2015
Merged

Extract user-menu component#130
rwjblue merged 3 commits intoember-cli:masterfrom
Gaurav0:user_menu

Conversation

@Gaurav0
Copy link
Copy Markdown
Contributor

@Gaurav0 Gaurav0 commented Aug 4, 2015

Relevant to issue #127

@Gaurav0
Copy link
Copy Markdown
Contributor Author

Gaurav0 commented Aug 6, 2015

@stefanpenner @rwjblue @joostdevries Can someone review this?

Comment thread app/templates/components/user-menu.hbs Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the else if session.isAuthenticated and else block are roughly the same, I'd love to remove this duplication. Looks like the following might do it:

  • Add an avatarURL and userName computeds to the component that defaults to null if session.isAuthenticated is false.
  • Use {{action (if session.isAuthenticated "signOut" "signInViaGithub")}} to get the right action.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rwjblue Duplication removed.

rwjblue added a commit that referenced this pull request Aug 6, 2015
Extract user-menu component
@rwjblue rwjblue merged commit b0e082c into ember-cli:master Aug 6, 2015
@rwjblue
Copy link
Copy Markdown
Member

rwjblue commented Aug 6, 2015

Thanks!

@joostdevries
Copy link
Copy Markdown
Member

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants