Skip to content

Commit ca8abdb

Browse files
author
Ives van Hoorne
committed
Fix in case there is no name
1 parent 89c806a commit ca8abdb

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

src/app/containers/Navigation/User.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ const Name = styled.div`
3030
`;
3131

3232
const Username = styled.div`
33-
color: rgba(255, 255, 255, 0.6);
34-
font-size: .875em;
33+
color: ${props => props.main ? 'white' : 'rgba(255, 255, 255, 0.6)'};
34+
font-size: ${props => props.main ? 1 : .875}em;
3535
`;
3636

3737
type Props = {
3838
user: {
3939
username: string,
4040
avatarUrl: string,
41-
name: string,
41+
name: ?string,
4242
},
4343
small: boolean,
4444
signOut: Function,
@@ -67,8 +67,8 @@ export default class User extends React.PureComponent {
6767
<Relative>
6868
<ClickableContainer onClick={menuOpen ? this.closeMenu : this.openMenu}>
6969
<ProfileInfo>
70-
<Name>{user.name}</Name>
71-
<Username>{user.username}</Username>
70+
{user.name && <Name>{user.name}</Name>}
71+
<Username main={!user.name}>{user.username}</Username>
7272
</ProfileInfo>
7373

7474
<Tooltip title="User Menu">

src/app/containers/Navigation/UserMenu.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ const Container = styled.div`
1515
${delayEffect(0)}
1616
1717
top: 40px;
18-
left: 0;
18+
left: -20%;
1919
right: 0;
2020
21+
min-width: 150px;
22+
2123
z-index: 20;
2224
`;
2325

src/app/pages/Profile/Header/UserInfo/ProfileInfo.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ const Name = styled.div`
2626
const Username = styled.div`
2727
display: flex;
2828
align-items: center;
29-
font-size: 1.25rem;
29+
font-size: ${props => (props.main ? 1.5 : 1.25)}rem;
3030
font-weight: 200;
31-
color: rgba(255, 255, 255, 0.6);
31+
color: ${props => (props.main ? 'white' : 'rgba(255, 255, 255, 0.6)')};
3232
${delayEffect(0.15)}
3333
3434
margin-bottom: 1rem;
@@ -51,8 +51,8 @@ export default ({ username, name, avatarUrl }: Props) => (
5151
<ProfileImage alt={username} height={175} width={175} src={avatarUrl} />
5252
<Margin bottom={3}>
5353
<Column justifyContent="space-between">
54-
<Name>{name}</Name>
55-
<Username>
54+
{name && <Name>{name}</Name>}
55+
<Username main={!name}>
5656
{username}
5757
<a
5858
href={`https://github.com/${username}`}

0 commit comments

Comments
 (0)