Skip to content

Commit aa32766

Browse files
author
Ives van Hoorne
committed
Add Import from GitHub to header
1 parent 2a9ce85 commit aa32766

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

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

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { Tooltip } from 'react-tippy';
1515
import type { Sandbox, CurrentUser } from 'common/types';
1616
import sandboxActionCreators from 'app/store/entities/sandboxes/actions';
1717
import userActionCreators from 'app/store/user/actions';
18-
import { newSandboxUrl } from 'app/utils/url-generator';
18+
import { newSandboxUrl, importFromGitHubUrl } from 'app/utils/url-generator';
1919
import ModeIcons from 'app/components/sandbox/ModeIcons';
2020

2121
import User from 'app/containers/Navigation/User';
@@ -53,24 +53,25 @@ const Left = styled.div`
5353

5454
const Chevron = styled.div`
5555
svg {
56-
transition: 0.3s ease all;
57-
font-size: 1.5rem;
58-
display: flex;
59-
align-items: center;
60-
justify-content: center;
61-
height: 3rem;
62-
margin-left: 0.5rem;
63-
margin-right: 0.5rem;
64-
z-index: 20;
65-
66-
cursor: pointer;
67-
&:hover {
68-
transform: rotateZ(${props =>
69-
props.workspaceHidden ? '135deg' : '45deg'});
70-
color: white;
71-
}
56+
transition: 0.3s ease all;
57+
font-size: 1.5rem;
58+
display: flex;
59+
align-items: center;
60+
justify-content: center;
61+
height: 3rem;
62+
margin-left: 0.5rem;
63+
margin-right: 0.5rem;
64+
z-index: 20;
65+
66+
cursor: pointer;
67+
&:hover {
68+
transform: rotateZ(
69+
${props => (props.workspaceHidden ? '135deg' : '45deg')}
70+
);
71+
color: white;
72+
}
7273
73-
transform: rotateZ(${props => (props.workspaceHidden ? '180deg' : '0')});
74+
transform: rotateZ(${props => (props.workspaceHidden ? '180deg' : '0')});
7475
}
7576
`;
7677

@@ -200,6 +201,11 @@ export default class Header extends React.PureComponent {
200201
email={user.email}
201202
sendMessage={userActions.sendFeedback}
202203
/>
204+
<Action
205+
href={importFromGitHubUrl()}
206+
tooltip="Import from GitHub"
207+
Icon={GithubIcon}
208+
/>
203209
<Action
204210
href={newSandboxUrl()}
205211
tooltip="New Sandbox"

src/app/utils/url-generator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const host = () => {
1616
export const protocolAndHost = () => `${location.protocol}//${host()}`;
1717

1818
export const newSandboxUrl = () => `/s/new`;
19+
export const importFromGitHubUrl = () => `/s/github`;
1920

2021
const sandboxGitUrl = (git: {
2122
repo: string,

0 commit comments

Comments
 (0)