Skip to content

Commit e6a0dd2

Browse files
author
Ives van Hoorne
committed
Add React TS to menu
1 parent fd56211 commit e6a0dd2

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
newVueSandboxUrl,
1212
importFromGitHubUrl,
1313
uploadFromCliUrl,
14+
newReactTypeScriptSandboxUrl,
1415
} from 'app/utils/url-generator';
1516

1617
const Container = styled.div`
@@ -32,6 +33,12 @@ export default () => (
3233
<Link style={{ textDecoration: 'none' }} to={newSandboxUrl()}>
3334
<MenuItem>New React Sandbox</MenuItem>
3435
</Link>
36+
<Link
37+
style={{ textDecoration: 'none' }}
38+
to={newReactTypeScriptSandboxUrl()}
39+
>
40+
<MenuItem>New React TypeScript Sandbox</MenuItem>
41+
</Link>
3542
<Link style={{ textDecoration: 'none' }} to={newPreactSandboxUrl()}>
3643
<MenuItem>New Preact Sandbox</MenuItem>
3744
</Link>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ class EditorPreview extends React.PureComponent<Props, State> {
173173
sandboxId={sandbox.id}
174174
dependencies={sandbox.npmDependencies}
175175
setCurrentModule={sandboxActions.setCurrentModule}
176-
addDependency={sandboxActions.addNPMDependency}
176+
addDependency={sandbox.owned && sandboxActions.addNPMDependency}
177177
template={sandbox.template}
178178
/>
179179
</FullSize>

src/app/utils/url-generator.js

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

2121
export const newSandboxUrl = () => `/s/new`;
22+
export const newReactTypeScriptSandboxUrl = () => `/s/react-ts`;
2223
export const newPreactSandboxUrl = () => `/s/preact`;
2324
export const newVueSandboxUrl = () => `/s/vue`;
2425
export const importFromGitHubUrl = () => `/s/github`;

0 commit comments

Comments
 (0)