Skip to content

Commit 32b940d

Browse files
committed
Applied prettier configs and refactored resizing
1 parent 5e6aff0 commit 32b940d

38 files changed

+1474
-1545
lines changed

demo/.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"tabWidth": 4,
3+
"useTabs": true,
4+
"printWidth": 150,
5+
"semi": true,
6+
"trailingComma": "all",
7+
"jsxBracketSameLine": true,
8+
"arrowParens": "always"
9+
}

demo/src/App.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import App from './App';
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import App from "./App";
44

5-
it('renders without crashing', () => {
6-
const div = document.createElement('div');
7-
ReactDOM.render(<App />, div);
8-
ReactDOM.unmountComponentAtNode(div);
5+
it("renders without crashing", () => {
6+
const div = document.createElement("div");
7+
ReactDOM.render(<App />, div);
8+
ReactDOM.unmountComponentAtNode(div);
99
});

demo/src/App.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React from 'react';
2-
import './App.scss';
3-
import ReactGA from 'react-ga';
1+
import React from "react";
2+
import "./App.scss";
3+
import ReactGA from "react-ga";
44
// import { Test } from './Test';
5-
import { UI } from './ui-demo/UI';
5+
import { UI } from "./ui-demo/UI";
66

77
ReactGA.initialize("UA-144490437-1");
88
ReactGA.pageview(window.location.pathname + window.location.search);
99

1010
const App: React.FC = () => {
11-
return <UI />
12-
}
11+
return <UI />;
12+
};
1313

1414
export default App;

demo/src/Test.tsx

Lines changed: 46 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,58 @@
11
import React from "react";
22
import * as Space from "react-spaces";
3-
import './Test.scss';
3+
import "./Test.scss";
44
import { Info } from "react-spaces";
55

66
const COLLAPSED_SIZE = 20;
77
const MINIMUM_SIZE = 200;
88

9-
export const Test : React.FC = () => {
10-
const [ size, setSize ] = React.useState("25%");
9+
export const Test: React.FC = () => {
10+
const [size, setSize] = React.useState("25%");
1111

12-
const onResizeStart = () => {
13-
};
14-
15-
const onResizeEnd = (width: number) => {
16-
// setSize(width);
17-
}
18-
19-
return (
20-
<Space.ViewPort className="test">
12+
const onResizeStart = () => {};
2113

22-
<Space.Left
23-
style={{ backgroundColor: 'yellow', padding: 10 }}
24-
size={size}
25-
trackSize={false}
26-
order={1}>
27-
<Space.Info>
28-
{(info) => <span>Hello<br />{info.width} x {info.height}</span>}
29-
</Space.Info>
30-
<div>Something else</div>
31-
</Space.Left>
14+
const onResizeEnd = (width: number) => {
15+
// setSize(width);
16+
};
3217

33-
<Space.Left
34-
style={{ backgroundColor: 'navy', color: 'white', padding: 10 }}
35-
size={200}
36-
trackSize={false}
37-
order={2}>
38-
<Space.Info>
39-
{(info) => <span>Something<br />{info.width} x {info.height}</span>}
40-
</Space.Info>
41-
</Space.Left>
18+
return (
19+
<Space.ViewPort className="test">
20+
<Space.Left style={{ backgroundColor: "yellow", padding: 10 }} size={size} trackSize={false} order={1}>
21+
<Space.Info>
22+
{(info) => (
23+
<span>
24+
Hello
25+
<br />
26+
{info.width} x {info.height}
27+
</span>
28+
)}
29+
</Space.Info>
30+
<div>Something else</div>
31+
</Space.Left>
4232

43-
<Space.Fill
44-
style={{ backgroundColor: 'red', padding: 10 }}
45-
trackSize={false}>
46-
<Space.Info>
47-
{(info) => <span>World<br />{info.width} x {info.height}</span>}
48-
</Space.Info>
49-
</Space.Fill>
33+
<Space.Left style={{ backgroundColor: "navy", color: "white", padding: 10 }} size={200} trackSize={false} order={2}>
34+
<Space.Info>
35+
{(info) => (
36+
<span>
37+
Something
38+
<br />
39+
{info.width} x {info.height}
40+
</span>
41+
)}
42+
</Space.Info>
43+
</Space.Left>
5044

51-
</Space.ViewPort>
52-
)
53-
}
45+
<Space.Fill style={{ backgroundColor: "red", padding: 10 }} trackSize={false}>
46+
<Space.Info>
47+
{(info) => (
48+
<span>
49+
World
50+
<br />
51+
{info.width} x {info.height}
52+
</span>
53+
)}
54+
</Space.Info>
55+
</Space.Fill>
56+
</Space.ViewPort>
57+
);
58+
};

demo/src/index.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import React from 'react';
2-
import ReactDOM from 'react-dom';
3-
import App from './App';
4-
import * as serviceWorker from './serviceWorker';
1+
import React from "react";
2+
import ReactDOM from "react-dom";
3+
import App from "./App";
4+
import * as serviceWorker from "./serviceWorker";
55

6-
ReactDOM.render(<App />, document.getElementById('root'));
6+
ReactDOM.render(<App />, document.getElementById("root"));
77

88
// If you want your app to work offline and load faster, you can change
99
// unregister() to register() below. Note this comes with some pitfalls.

demo/src/react-app-env.d.ts

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,64 @@
1-
/// <reference types="node" />
2-
/// <reference types="react" />
3-
/// <reference types="react-dom" />
4-
5-
declare namespace NodeJS {
6-
interface ProcessEnv {
7-
readonly NODE_ENV: 'development' | 'production' | 'test';
8-
readonly PUBLIC_URL: string;
9-
}
10-
}
11-
12-
declare module '*.bmp' {
13-
const src: string;
14-
export default src;
15-
}
16-
17-
declare module '*.gif' {
18-
const src: string;
19-
export default src;
20-
}
21-
22-
declare module '*.jpg' {
23-
const src: string;
24-
export default src;
25-
}
26-
27-
declare module '*.jpeg' {
28-
const src: string;
29-
export default src;
30-
}
31-
32-
declare module '*.png' {
33-
const src: string;
34-
export default src;
35-
}
36-
37-
declare module '*.webp' {
38-
const src: string;
39-
export default src;
40-
}
41-
42-
declare module '*.svg' {
43-
import * as React from 'react';
44-
45-
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
46-
47-
const src: string;
48-
export default src;
49-
}
50-
51-
declare module '*.module.css' {
52-
const classes: { [key: string]: string };
53-
export default classes;
54-
}
55-
56-
declare module '*.module.scss' {
57-
const classes: { [key: string]: string };
58-
export default classes;
59-
}
60-
61-
declare module '*.module.sass' {
62-
const classes: { [key: string]: string };
63-
export default classes;
1+
/// <reference types="node" />
2+
/// <reference types="react" />
3+
/// <reference types="react-dom" />
4+
5+
declare namespace NodeJS {
6+
interface ProcessEnv {
7+
readonly NODE_ENV: "development" | "production" | "test";
8+
readonly PUBLIC_URL: string;
9+
}
10+
}
11+
12+
declare module "*.bmp" {
13+
const src: string;
14+
export default src;
15+
}
16+
17+
declare module "*.gif" {
18+
const src: string;
19+
export default src;
20+
}
21+
22+
declare module "*.jpg" {
23+
const src: string;
24+
export default src;
25+
}
26+
27+
declare module "*.jpeg" {
28+
const src: string;
29+
export default src;
30+
}
31+
32+
declare module "*.png" {
33+
const src: string;
34+
export default src;
35+
}
36+
37+
declare module "*.webp" {
38+
const src: string;
39+
export default src;
40+
}
41+
42+
declare module "*.svg" {
43+
import * as React from "react";
44+
45+
export const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
46+
47+
const src: string;
48+
export default src;
49+
}
50+
51+
declare module "*.module.css" {
52+
const classes: { [key: string]: string };
53+
export default classes;
54+
}
55+
56+
declare module "*.module.scss" {
57+
const classes: { [key: string]: string };
58+
export default classes;
59+
}
60+
61+
declare module "*.module.sass" {
62+
const classes: { [key: string]: string };
63+
export default classes;
6464
}

0 commit comments

Comments
 (0)