Skip to content

Commit b0ed073

Browse files
committed
html: reformat code
1 parent 84ac40a commit b0ed073

File tree

8 files changed

+432
-441
lines changed

8 files changed

+432
-441
lines changed

html/.editorconfig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@ root = true
22

33
[*]
44
charset = utf-8
5-
indent_size = 2
5+
indent_size = 4
66
indent_style = space
77
insert_final_newline = true
88
trim_trailing_whitespace = true
99

10+
[{*.json, *.scss}]
11+
indent_size = 2
12+
1013
[*.md]
1114
trim_trailing_whitespace = false

html/prettier.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
trailingComma: "es5",
3+
tabWidth: 4,
4+
printWidth: 120,
5+
singleQuote: true,
6+
};

html/src/components/app.tsx

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,41 @@ import { ITerminalOptions, ITheme } from 'xterm';
44
import { Xterm } from './terminal';
55

66
if ((module as any).hot) {
7-
// tslint:disable-next-line:no-var-requires
8-
require('preact/debug');
7+
// tslint:disable-next-line:no-var-requires
8+
require('preact/debug');
99
}
1010

1111
const protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
1212
const wsPath = window.location.pathname.endsWith('/') ? 'ws' : '/ws';
13-
const url = [
14-
protocol,
15-
window.location.host,
16-
window.location.pathname,
17-
wsPath,
18-
window.location.search,
19-
].join('');
13+
const url = [protocol, window.location.host, window.location.pathname, wsPath, window.location.search].join('');
2014
const termOptions = {
21-
fontSize: 13,
22-
fontFamily:
23-
'Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace',
24-
theme: {
25-
foreground: '#d2d2d2',
26-
background: '#2b2b2b',
27-
cursor: '#adadad',
28-
black: '#000000',
29-
red: '#d81e00',
30-
green: '#5ea702',
31-
yellow: '#cfae00',
32-
blue: '#427ab3',
33-
magenta: '#89658e',
34-
cyan: '#00a7aa',
35-
white: '#dbded8',
36-
brightBlack: '#686a66',
37-
brightRed: '#f54235',
38-
brightGreen: '#99e343',
39-
brightYellow: '#fdeb61',
40-
brightBlue: '#84b0d8',
41-
brightMagenta: '#bc94b7',
42-
brightCyan: '#37e6e8',
43-
brightWhite: '#f1f1f0',
44-
} as ITheme,
15+
fontSize: 13,
16+
fontFamily: 'Menlo For Powerline,Consolas,Liberation Mono,Menlo,Courier,monospace',
17+
theme: {
18+
foreground: '#d2d2d2',
19+
background: '#2b2b2b',
20+
cursor: '#adadad',
21+
black: '#000000',
22+
red: '#d81e00',
23+
green: '#5ea702',
24+
yellow: '#cfae00',
25+
blue: '#427ab3',
26+
magenta: '#89658e',
27+
cyan: '#00a7aa',
28+
white: '#dbded8',
29+
brightBlack: '#686a66',
30+
brightRed: '#f54235',
31+
brightGreen: '#99e343',
32+
brightYellow: '#fdeb61',
33+
brightBlue: '#84b0d8',
34+
brightMagenta: '#bc94b7',
35+
brightCyan: '#37e6e8',
36+
brightWhite: '#f1f1f0',
37+
} as ITheme,
4538
} as ITerminalOptions;
4639

4740
export class App extends Component {
48-
render() {
49-
return <Xterm id="terminal-container" url={url} options={termOptions} />;
50-
}
41+
render() {
42+
return <Xterm id="terminal-container" url={url} options={termOptions} />;
43+
}
5144
}

html/src/components/modal/index.tsx

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,25 @@ import { Component, ComponentChildren, h } from 'preact';
33
import './modal.scss';
44

55
interface Props {
6-
show: boolean;
7-
children: ComponentChildren;
6+
show: boolean;
7+
children: ComponentChildren;
88
}
99

1010
export class Modal extends Component<Props> {
11-
constructor(props) {
12-
super(props);
13-
}
11+
constructor(props) {
12+
super(props);
13+
}
1414

15-
render({ show, children }: Props) {
16-
return (
17-
show && (
18-
<div className="modal">
19-
<div className="modal-background" />
20-
<div className="modal-content">
21-
<div className="box">{children}</div>
22-
</div>
23-
</div>
24-
)
25-
);
26-
}
15+
render({ show, children }: Props) {
16+
return (
17+
show && (
18+
<div className="modal">
19+
<div className="modal-background" />
20+
<div className="modal-content">
21+
<div className="box">{children}</div>
22+
</div>
23+
</div>
24+
)
25+
);
26+
}
2727
}

0 commit comments

Comments
 (0)