Skip to content

Commit ecacd02

Browse files
author
Ives van Hoorne
committed
Fix eslint
1 parent bf9543d commit ecacd02

File tree

4 files changed

+37
-55
lines changed

4 files changed

+37
-55
lines changed

src/app/components/sandbox/CodeEditor/index.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import React from 'react';
22
import Loadable from 'react-loadable';
33

44
import Loading from 'app/components/Loading';
5+
import Title from 'app/components/text/Title';
6+
import SubTitle from 'app/components/text/SubTitle';
7+
import Centered from 'app/components/flex/Centered';
8+
import Margin from 'app/components/spacing/Margin';
59
import { Preferences, Module, Directory } from 'common/types';
610

711
import isImage from 'is-image';
@@ -40,6 +44,21 @@ export default (props: Props) => {
4044
/>
4145
);
4246
}
47+
48+
return (
49+
<Margin top={2}>
50+
<Centered horizontal vertical>
51+
<Title>This file is too big to edit</Title>
52+
<SubTitle>
53+
We will add support for this as soon as possible.
54+
</SubTitle>
55+
56+
<a href={module.code} target="_blank" rel="noreferrer noopener">
57+
Open file externally
58+
</a>
59+
</Centered>
60+
</Margin>
61+
);
4362
}
4463
}
4564

src/app/components/sandbox/GithubBadge.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const StyledA = styled.a`text-decoration: none;`;
4343
type Props = {
4444
username: string,
4545
repo: string,
46-
branch?: string,
46+
branch: ?string,
4747
url: ?string,
4848
};
4949

src/app/pages/Sandbox/Editor/Workspace/Git/index.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,20 @@ const ErrorMessage = styled.div`
4545
font-size: 0.875rem;
4646
`;
4747

48+
const Notice = styled.div`
49+
font-size: 0.75rem;
50+
color: white;
51+
padding: 0.125rem 0.2rem;
52+
background-image: linear-gradient(
53+
45deg,
54+
${({ theme }) => theme.secondary.darken(0.2)} 0%,
55+
${({ theme }) => theme.secondary.darken(0.1)} 100%
56+
);
57+
border-radius: 4px;
58+
float: right;
59+
margin-right: 2rem;
60+
`;
61+
4862
function hasWriteAccess(rights: 'none' | 'read' | 'write' | 'admin') {
4963
return rights === 'write' || rights === 'admin';
5064
}
@@ -151,6 +165,7 @@ export default class Git extends React.PureComponent<Props, State> {
151165
: 0;
152166
return (
153167
<Container>
168+
<Notice>beta</Notice>
154169
<WorkspaceSubtitle>GitHub Repository</WorkspaceSubtitle>
155170
<Margin margin={1}>
156171
<GithubBadge
Lines changed: 2 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,5 @@
11
import type { Sandbox, Module, Directory } from 'common/types';
2-
import {
3-
getResourceTag,
4-
getIndexHtmlBody,
5-
createFile,
6-
createDirectoryWithFiles,
7-
} from '../';
8-
9-
const getHTML = (modules, directories, resources) =>
10-
`<!doctype html>
11-
<html lang="en">
12-
<head>
13-
<meta charset="utf-8">
14-
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
15-
<meta name="theme-color" content="#000000">
16-
<!--
17-
manifest.json provides metadata used when your web app is added to the
18-
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
19-
-->
20-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
21-
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
22-
<!--
23-
Notice the use of %PUBLIC_URL% in the tags above.
24-
It will be replaced with the URL of the \`public\` folder during the build.
25-
Only files inside the \`public\` folder can be referenced from the HTML.
26-
27-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
28-
work correctly both with client-side routing and a non-root public URL.
29-
Learn how to configure a non-root public URL by running \`npm run build\`.
30-
-->
31-
<title>React App</title>
32-
${resources.map(getResourceTag).join('\n')}
33-
</head>
34-
<body>
35-
${getIndexHtmlBody(modules, directories)}
36-
<!--
37-
This HTML file is a template.
38-
If you open it directly in the browser, you will see an empty page.
39-
40-
You can add webfonts, meta tags, or analytics to this file.
41-
The build step will place the bundled scripts into the <body> tag.
42-
43-
To begin the development, run \`npm start\` or \`yarn start\`.
44-
To create a production bundle, use \`npm run build\` or \`yarn build\`.
45-
-->
46-
</body>
47-
</html>
48-
`;
2+
import { createFile, createDirectoryWithFiles } from '../';
493

504
export default async function createZip(
515
zip,
@@ -56,7 +10,7 @@ export default async function createZip(
5610
await Promise.all(
5711
modules
5812
.filter(x => x.directoryShortid == null)
59-
.filter(x => x.title !== 'index.html') // This will be included in the body
13+
.filter(x => x.title !== 'yarn.lock' && x.title !== 'package-lock.json')
6014
.map(x => createFile(x, zip))
6115
);
6216

@@ -66,11 +20,5 @@ export default async function createZip(
6620
.map(x => createDirectoryWithFiles(modules, directories, x, zip))
6721
);
6822

69-
const publicFolder = zip.folder('public');
70-
71-
publicFolder.file(
72-
'index.html',
73-
getHTML(modules, directories, sandbox.externalResources)
74-
);
7523
return zip;
7624
}

0 commit comments

Comments
 (0)