Skip to content

Commit ebe4bba

Browse files
author
Ives van Hoorne
committed
Highlight sign in button
1 parent 2d28440 commit ebe4bba

File tree

2 files changed

+30
-8
lines changed

2 files changed

+30
-8
lines changed

src/app/pages/Sandbox/Editor/Content/Header/Action.js

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import styled from 'styled-components';
44

55
import Tooltip from 'app/components/Tooltip';
66

7-
const styles = props => `
7+
const styles = props =>
8+
`
89
transition: 0.3s ease all;
910
display: flex;
1011
flex-direction: row;
@@ -19,11 +20,23 @@ const styles = props => `
1920
box-sizing: inherit;
2021
border-bottom: 2px solid transparent;
2122
z-index: 1;
23+
${props.highlight ? `
24+
background-color: ${props.theme.secondary.darken(0.1)()};
25+
color: white;
26+
border-bottom: 0px solid transparent;
27+
28+
&:hover {
29+
background-color: ${props.theme.secondary.darken(0.2)()};
30+
}
31+
` : `
32+
33+
&:hover {
34+
color: rgba(255,255,255, 1);
35+
border-color: ${props.theme.secondary()}
36+
}
37+
`}
38+
2239
23-
&:hover {
24-
color: rgba(255,255,255, 1);
25-
border-bottom: 2px solid ${props.theme.secondary()};
26-
}
2740
`;
2841

2942
const Action = styled.div`
@@ -56,9 +69,17 @@ type Props = {
5669
title: string,
5770
href: ?string,
5871
placeholder: ?boolean,
72+
highlight: ?boolean,
5973
};
6074

61-
export default ({ onClick, href, Icon, title, placeholder }: Props) => {
75+
export default ({
76+
onClick,
77+
href,
78+
Icon,
79+
title,
80+
highlight,
81+
placeholder,
82+
}: Props) => {
6283
if (placeholder) {
6384
return (
6485
<ActionTooltip message={placeholder}>
@@ -70,7 +91,7 @@ export default ({ onClick, href, Icon, title, placeholder }: Props) => {
7091
}
7192
if (onClick) {
7293
return (
73-
<Action onClick={onClick}>
94+
<Action highlight={highlight} onClick={onClick}>
7495
<IconContainer>
7596
<Icon />
7697
</IconContainer> {title}
@@ -79,7 +100,7 @@ export default ({ onClick, href, Icon, title, placeholder }: Props) => {
79100
}
80101

81102
return (
82-
<ActionLink to={href}>
103+
<ActionLink highlight={highlight} to={href}>
83104
<IconContainer>
84105
<Icon />
85106
</IconContainer> {title}

src/app/pages/Sandbox/Editor/Content/Header/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ export default class Header extends React.PureComponent {
130130
onClick={userActions.signIn}
131131
title="Sign in with Github"
132132
Icon={GithubIcon}
133+
highlight
133134
/>}
134135
</Right>
135136
</Container>

0 commit comments

Comments
 (0)