Skip to content
This repository has been archived by the owner on Dec 21, 2021. It is now read-only.

Commit

Permalink
Merge pull request #87 from Ultimaker/account-manage-link-optional
Browse files Browse the repository at this point in the history
Hide account management URL button if no URL is passed
  • Loading branch information
Alan authored Oct 25, 2018
2 parents 5bdb558 + 417743c commit 1f3df5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/components/user_account_menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface UserAccountMenuProps {
/** Called when the sign out button is clicked */
onSignOutClickHandler: () => void;
/** URL to the account management page */
manageAccountURL: string;
manageAccountURL?: string;
/** The display name of the user. */
displayName: string
/** An URL for the user profile image. */
Expand Down Expand Up @@ -117,10 +117,10 @@ export class UserAccountMenu extends React.Component<UserAccountMenuProps, UserA
</div>

<div className="account-section__buttons">
<Button style="secondary" type="link" linkURL={manageAccountURL} linkToNewTab>
{manageAccountURL && <Button style="secondary" type="link" linkURL={manageAccountURL} linkToNewTab>
{I18n.translate("User account menu button", "Manage account")}
<LinkIcon />
</Button>
</Button>}

<Button style="secondary" onClickHandler={() => { this._setShowMenu(false); onSignOutClickHandler() }}>
{I18n.translate("User account menu button", "Sign out")}
Expand Down
4 changes: 2 additions & 2 deletions src/stories/menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ stories.add('User account menu', withInfo(
)(() =>
<UserAccountMenu
onSignOutClickHandler={action('clicked')}
manageAccountURL="https://account-staging.ultimaker.com"
manageAccountURL={text('Account Management URL', 'https://account.ultimaker.com')}
displayName="Test User"
triggerWidth={text('Trigger width', null)}
triggerHeight={text('Trigger height', null)}
signedOut={boolean('Sign out', false)}
onSignInClickHandler={action('clicked')}
></UserAccountMenu>
/>
));

0 comments on commit 1f3df5d

Please sign in to comment.