react-rx 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/jest.config.js +0 -5
- package/website/.babelrc +0 -21
- package/website/.prettierrc +0 -7
- package/website/README.mdx +0 -1
- package/website/package.json +0 -84
- package/website/src/@types/babel.d.ts +0 -4
- package/website/src/@types/mdx.d.ts +0 -11
- package/website/src/@types/react-css-burger.d.ts +0 -4
- package/website/src/App.tsx +0 -68
- package/website/src/components/Header.tsx +0 -118
- package/website/src/components/Link.tsx +0 -18
- package/website/src/components/LoadPage.tsx +0 -60
- package/website/src/components/Sidebar.tsx +0 -88
- package/website/src/components/logos/Github.tsx +0 -10
- package/website/src/components/logos/React.tsx +0 -27
- package/website/src/components/logos/ReactRxLogo.tsx +0 -39
- package/website/src/components/logos/RxJs.tsx +0 -69
- package/website/src/components/repl/Checkerboard.tsx +0 -25
- package/website/src/components/repl/CodeBlock.tsx +0 -147
- package/website/src/components/repl/CodeMirror.tsx +0 -37
- package/website/src/components/repl/CodeMirrorMode.tsx +0 -67
- package/website/src/components/repl/EvalCode.tsx +0 -55
- package/website/src/components/repl/Prelude.tsx +0 -50
- package/website/src/components/repl/ShowError.tsx +0 -27
- package/website/src/components/repl/codemirror-lib.ts +0 -8
- package/website/src/components/repl/codemirror-theme.css +0 -131
- package/website/src/components/repl/compile/babel.ts +0 -21
- package/website/src/components/repl/eval/evalCallback.ts +0 -27
- package/website/src/components/repl/eval/evalCode.ts +0 -7
- package/website/src/components/repl/eval/evalExpression.ts +0 -4
- package/website/src/components/repl/eval/evalReactDomRender.ts +0 -23
- package/website/src/components/repl/index.ts +0 -1
- package/website/src/components/repl/runMode.ts +0 -42
- package/website/src/datastores/location.ts +0 -14
- package/website/src/datastores/page.ts +0 -11
- package/website/src/datastores/pageTransition.ts +0 -97
- package/website/src/entries/main.css +0 -2
- package/website/src/entries/main.tsx +0 -6
- package/website/src/examples/FizzBuzz/FizzBuzzExample.tsx +0 -39
- package/website/src/examples/FizzBuzz/index.tsx +0 -9
- package/website/src/examples/_utils/globalScope.ts +0 -45
- package/website/src/examples/animation/AnimationExample.tsx +0 -152
- package/website/src/examples/animation/easings.ts +0 -0
- package/website/src/examples/animation/index.tsx +0 -15
- package/website/src/examples/context/Context.example.jsx +0 -67
- package/website/src/examples/context/index.tsx +0 -9
- package/website/src/examples/errors/Errors.example.jsx +0 -69
- package/website/src/examples/errors/index.tsx +0 -9
- package/website/src/examples/event-handlers/EventHandlersExample.tsx +0 -48
- package/website/src/examples/event-handlers/index.tsx +0 -9
- package/website/src/examples/fetch/FetchExample.jsx +0 -43
- package/website/src/examples/fetch/a.txt +0 -1
- package/website/src/examples/fetch/b.txt +0 -1
- package/website/src/examples/fetch/index.tsx +0 -9
- package/website/src/examples/form-data/FormDataExample.jsx +0 -119
- package/website/src/examples/form-data/index.tsx +0 -12
- package/website/src/examples/form-data/storage.ts +0 -27
- package/website/src/examples/forward-ref/ForwardRefExample.tsx +0 -55
- package/website/src/examples/forward-ref/index.tsx +0 -9
- package/website/src/examples/hello-world/HelloWorld.example.jsx +0 -6
- package/website/src/examples/hello-world/index.tsx +0 -9
- package/website/src/examples/hooks-interop/HooksInterop.example.tsx +0 -42
- package/website/src/examples/hooks-interop/index.tsx +0 -9
- package/website/src/examples/passthrough-props/PassThroughPropsExample.jsx +0 -57
- package/website/src/examples/passthrough-props/index.tsx +0 -11
- package/website/src/examples/reactive-state/ReactiveState.example.jsx +0 -43
- package/website/src/examples/reactive-state/index.ts +0 -9
- package/website/src/examples/readme-examples/README.mdx +0 -0
- package/website/src/examples/readme-examples/index.ts +0 -11
- package/website/src/examples/shared-state/SharedState.example.tsx +0 -59
- package/website/src/examples/shared-state/index.tsx +0 -9
- package/website/src/examples/simple/Counter.example.tsx +0 -14
- package/website/src/examples/simple/index.tsx +0 -9
- package/website/src/examples/sync/Sync.example.tsx +0 -9
- package/website/src/examples/sync/index.tsx +0 -9
- package/website/src/examples/tick/TickExample.jsx +0 -51
- package/website/src/examples/tick/index.ts +0 -9
- package/website/src/examples/todo-app/TodoApp.example.tsx +0 -88
- package/website/src/examples/todo-app/index.tsx +0 -12
- package/website/src/examples/todo-app/storage.ts +0 -27
- package/website/src/examples/use-element/UseElementExample.tsx +0 -70
- package/website/src/examples/use-element/index.tsx +0 -9
- package/website/src/examples/use-observable/search/SearchExample.tsx +0 -82
- package/website/src/examples/use-observable/search/index.tsx +0 -8
- package/website/src/examples/use-observable/use-observable/UseObservableExample.tsx +0 -70
- package/website/src/examples/use-observable/use-observable/index.tsx +0 -9
- package/website/src/index.html +0 -10
- package/website/src/mdx-components.tsx +0 -74
- package/website/src/pages/Api/Api.mdx +0 -134
- package/website/src/pages/Api/ApiPage.tsx +0 -25
- package/website/src/pages/Examples/Examples.tsx +0 -105
- package/website/src/pages/Examples/ExamplesPage.tsx +0 -13
- package/website/src/pages/Guide/Guide.mdx +0 -275
- package/website/src/pages/Guide/GuidePage.tsx +0 -25
- package/website/src/pages/Index/IndexPage.tsx +0 -50
- package/website/src/pages/Index/ReactRxReadme.md +0 -20
- package/website/src/pages/NotFound.tsx +0 -3
- package/website/src/pages/pages.ts +0 -46
- package/website/src/pages/styles.tsx +0 -24
- package/website/src/theme.ts +0 -61
- package/website/src/utils/parseCodeFenceHeader.ts +0 -32
- package/website/tsconfig.json +0 -30
- package/website/vercel.json +0 -4
- package/website/webpack/config.js +0 -5
- package/website/webpack/createConfig.js +0 -95
- package/website/webpack/mdx-toc-loader.js +0 -38
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-rx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "React + RxJS = <3",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/cjs/index.d.ts",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"observable-callback": "^1.0.1"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"react": "
|
|
29
|
-
"rxjs": "^6
|
|
28
|
+
"react": "^16.8 || ^17",
|
|
29
|
+
"rxjs": "^6.5 || ^7"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@testing-library/dom": "^7.29.6",
|
package/jest.config.js
DELETED
package/website/.babelrc
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
"@babel/react",
|
|
4
|
-
"@babel/typescript",
|
|
5
|
-
[
|
|
6
|
-
"@babel/env",
|
|
7
|
-
{
|
|
8
|
-
"targets": {
|
|
9
|
-
"esmodules": true
|
|
10
|
-
},
|
|
11
|
-
"modules": false
|
|
12
|
-
}
|
|
13
|
-
]
|
|
14
|
-
],
|
|
15
|
-
"plugins": [
|
|
16
|
-
"@babel/plugin-proposal-optional-chaining",
|
|
17
|
-
"@babel/plugin-proposal-class-properties",
|
|
18
|
-
"babel-plugin-static-fs",
|
|
19
|
-
"babel-plugin-styled-components"
|
|
20
|
-
]
|
|
21
|
-
}
|
package/website/.prettierrc
DELETED
package/website/README.mdx
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
WRONG README
|
package/website/package.json
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "react-rx-website",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "1.0.0",
|
|
5
|
-
"description": "React rx website",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "NODE_ENV=production webpack --mode=production --config webpack/config.js",
|
|
8
|
-
"watch": "webpack -w --config webpack/config.js",
|
|
9
|
-
"start": "webpack-dev-server --config webpack/config.js",
|
|
10
|
-
"dev": "npm start",
|
|
11
|
-
"postinstall": "cp ../README.md src/pages/Index/ReactRxReadme.md"
|
|
12
|
-
},
|
|
13
|
-
"keywords": [],
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@babel/core": "^7.10.3",
|
|
16
|
-
"@babel/plugin-proposal-class-properties": "^7.10.1",
|
|
17
|
-
"@babel/plugin-proposal-optional-chaining": "^7.10.3",
|
|
18
|
-
"@babel/plugin-transform-typescript": "^7.10.3",
|
|
19
|
-
"@babel/preset-react": "^7.10.1",
|
|
20
|
-
"@babel/preset-typescript": "^7.10.1",
|
|
21
|
-
"@mdx-js/react": "^1.6.6",
|
|
22
|
-
"@types/babel__core": "^7.1.9",
|
|
23
|
-
"@types/codemirror": "^0.0.96",
|
|
24
|
-
"@types/history": "^4.7.6",
|
|
25
|
-
"@types/mdx-js__react": "^1.5.2",
|
|
26
|
-
"@types/react": "^16.9.41",
|
|
27
|
-
"@types/react-dom": "^16.9.8",
|
|
28
|
-
"@types/styled-components": "^5.1.0",
|
|
29
|
-
"@typescript-eslint/eslint-plugin": "^3.4.0",
|
|
30
|
-
"@typescript-eslint/parser": "^3.4.0",
|
|
31
|
-
"bezier-easing": "^2.1.0",
|
|
32
|
-
"codemirror": "^5.55.0",
|
|
33
|
-
"date-fns": "^2.14.0",
|
|
34
|
-
"eslint": "^7.3.1",
|
|
35
|
-
"eslint-config-prettier": "^6.11.0",
|
|
36
|
-
"eslint-plugin-prettier": "^3.1.4",
|
|
37
|
-
"eslint-plugin-react": "^7.20.0",
|
|
38
|
-
"history": "^5.0.0",
|
|
39
|
-
"jest": "^26.1.0",
|
|
40
|
-
"lodash": "^4.17.15",
|
|
41
|
-
"observable-callback": "^1.0.1",
|
|
42
|
-
"prettier": "2.0.5",
|
|
43
|
-
"react": "^17.0.1",
|
|
44
|
-
"react-codemirror2": "^7.2.1",
|
|
45
|
-
"react-css-burger": "^0.2.0",
|
|
46
|
-
"react-dom": "^17.0.1",
|
|
47
|
-
"react-rx": "1.0.0-beta.4",
|
|
48
|
-
"remark-emoji": "^2.1.0",
|
|
49
|
-
"rimraf": "^3.0.2",
|
|
50
|
-
"rxjs": "^6.5.5",
|
|
51
|
-
"styled-components": "^5.1.1",
|
|
52
|
-
"webpack": "^4.43.0",
|
|
53
|
-
"webpack-cli": "^3.3.12"
|
|
54
|
-
},
|
|
55
|
-
"author": "",
|
|
56
|
-
"license": "ISC",
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@babel/preset-env": "^7.10.3",
|
|
59
|
-
"@babel/standalone": "^7.10.3",
|
|
60
|
-
"@mdx-js/loader": "^1.6.6",
|
|
61
|
-
"@mdx-js/mdx": "^1.6.6",
|
|
62
|
-
"@types/lodash": "^4.14.157",
|
|
63
|
-
"@types/node": "^14.0.14",
|
|
64
|
-
"@webhotelier/webpack-fast-refresh": "5.0.1",
|
|
65
|
-
"babel-loader": "^8.1.0",
|
|
66
|
-
"babel-plugin-static-fs": "^3.0.0",
|
|
67
|
-
"babel-plugin-styled-components": "^1.10.7",
|
|
68
|
-
"clean-webpack-plugin": "^3.0.0",
|
|
69
|
-
"copy-webpack-plugin": "^6.0.2",
|
|
70
|
-
"css-loader": "^3.6.0",
|
|
71
|
-
"github-slugger": "^1.3.0",
|
|
72
|
-
"html-loader": "^1.1.0",
|
|
73
|
-
"html-webpack-plugin": "^4.3.0",
|
|
74
|
-
"markdown-toc": "^1.2.0",
|
|
75
|
-
"react-refresh": "0.8.3",
|
|
76
|
-
"remark-slug": "^6.0.0",
|
|
77
|
-
"style-loader": "^1.2.1",
|
|
78
|
-
"ts-loader": "^7.0.5",
|
|
79
|
-
"ts-node": "^8.10.2",
|
|
80
|
-
"tsconfig-paths": "^3.9.0",
|
|
81
|
-
"typescript": "^3.9.5",
|
|
82
|
-
"webpack-dev-server": "^3.11.0"
|
|
83
|
-
}
|
|
84
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
declare module '*.md' {
|
|
2
|
-
const MDXComponent: (props: any) => JSX.Element
|
|
3
|
-
export default MDXComponent
|
|
4
|
-
export {MDXComponent as Toc}
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
declare module '*.mdx' {
|
|
8
|
-
const MDXComponent: (props: any) => JSX.Element
|
|
9
|
-
export default MDXComponent
|
|
10
|
-
export {MDXComponent as Toc}
|
|
11
|
-
}
|
package/website/src/App.tsx
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import {createGlobalStyle} from 'styled-components'
|
|
3
|
-
import {rxComponent} from 'react-rx'
|
|
4
|
-
import {map} from 'rxjs/operators'
|
|
5
|
-
import {COLORS, media} from './theme'
|
|
6
|
-
import {pageTransition$} from './datastores/pageTransition'
|
|
7
|
-
|
|
8
|
-
const GlobalStyle = createGlobalStyle`
|
|
9
|
-
body {
|
|
10
|
-
${media.between('xsmall', 'small')} {
|
|
11
|
-
font-size: 12px;
|
|
12
|
-
}
|
|
13
|
-
${media.between('small', 'medium')} {
|
|
14
|
-
font-size: 14px;
|
|
15
|
-
}
|
|
16
|
-
${media.greaterThan('medium')} {
|
|
17
|
-
font-size: 16px;
|
|
18
|
-
}
|
|
19
|
-
${media.greaterThan('large')} {
|
|
20
|
-
font-size: 18px;
|
|
21
|
-
}
|
|
22
|
-
padding: 0;
|
|
23
|
-
margin: 0;
|
|
24
|
-
background: ${COLORS.background};
|
|
25
|
-
color: ${COLORS.text};
|
|
26
|
-
font-family: Inter, -apple-system, system-ui, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
27
|
-
'Droid Sans', 'Helvetica Neue', 'Fira Sans', system-ui, sans-serif;
|
|
28
|
-
font-size: 1.125rem;
|
|
29
|
-
overflow-y: scroll;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
h1::before, h2::before, h3::before, h4::before {
|
|
33
|
-
display: block;
|
|
34
|
-
content: " ";
|
|
35
|
-
visibility: hidden;
|
|
36
|
-
pointer-events: none;
|
|
37
|
-
}
|
|
38
|
-
h2::before, h3::before, h4::before {
|
|
39
|
-
margin-top: -6em;
|
|
40
|
-
height: 6em;
|
|
41
|
-
}
|
|
42
|
-
h1::before {
|
|
43
|
-
margin-top: -6em;
|
|
44
|
-
height: 6em;
|
|
45
|
-
}
|
|
46
|
-
a:link,
|
|
47
|
-
a:visited {
|
|
48
|
-
color: ${COLORS.link};
|
|
49
|
-
text-decoration: none;
|
|
50
|
-
}
|
|
51
|
-
`
|
|
52
|
-
|
|
53
|
-
export const App = rxComponent(
|
|
54
|
-
pageTransition$.pipe(
|
|
55
|
-
map((transition) => {
|
|
56
|
-
return (
|
|
57
|
-
<>
|
|
58
|
-
<GlobalStyle />
|
|
59
|
-
{transition.component ? (
|
|
60
|
-
<transition.component />
|
|
61
|
-
) : (
|
|
62
|
-
<div>Loading…</div>
|
|
63
|
-
)}
|
|
64
|
-
</>
|
|
65
|
-
)
|
|
66
|
-
})
|
|
67
|
-
)
|
|
68
|
-
)
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import {Link} from './Link'
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
import styled from 'styled-components'
|
|
4
|
-
import {rxComponent} from 'react-rx'
|
|
5
|
-
import {pages} from '../pages/pages'
|
|
6
|
-
|
|
7
|
-
import {map} from 'rxjs/operators'
|
|
8
|
-
import {GithubLogo} from './logos/Github'
|
|
9
|
-
import {COLORS} from '../theme'
|
|
10
|
-
import {ReactRxLogo} from './logos/ReactRxLogo'
|
|
11
|
-
import {pageTransition$} from '../datastores/pageTransition'
|
|
12
|
-
import {omit} from 'lodash'
|
|
13
|
-
|
|
14
|
-
const StyledHeader = styled.header`
|
|
15
|
-
z-index: 2000;
|
|
16
|
-
position: fixed;
|
|
17
|
-
top: 0;
|
|
18
|
-
left: 0;
|
|
19
|
-
right: 0;
|
|
20
|
-
padding-bottom: 0;
|
|
21
|
-
background: ${COLORS.header.background};
|
|
22
|
-
a,
|
|
23
|
-
a:link,
|
|
24
|
-
a:visited {
|
|
25
|
-
color: ${COLORS.header.text};
|
|
26
|
-
}
|
|
27
|
-
`
|
|
28
|
-
|
|
29
|
-
const HeaderInner = styled.div`
|
|
30
|
-
display: flex;
|
|
31
|
-
flex-direction: row;
|
|
32
|
-
justify-content: space-between;
|
|
33
|
-
align-items: center;
|
|
34
|
-
height: 5em;
|
|
35
|
-
padding: 0.5em 1em 0.5em 1em;
|
|
36
|
-
background-color: ${COLORS.header.background};
|
|
37
|
-
`
|
|
38
|
-
|
|
39
|
-
const LinkWrapper = styled.div`
|
|
40
|
-
color: #efefef;
|
|
41
|
-
padding: 0.5em 1.2em 0.5em 0;
|
|
42
|
-
`
|
|
43
|
-
|
|
44
|
-
const omitProps = <T extends React.ComponentType>(
|
|
45
|
-
Component: T,
|
|
46
|
-
omitProps: string[]
|
|
47
|
-
) => (props: React.ComponentProps<T>) => {
|
|
48
|
-
const omitted: any = omit(props, omitProps)
|
|
49
|
-
return <Component {...omitted} />
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const PageLink = styled(omitProps(Link, ['isActive', 'isTransitioningTo']))<{
|
|
53
|
-
isActive: boolean
|
|
54
|
-
isTransitioningTo: boolean
|
|
55
|
-
}>`
|
|
56
|
-
display: block;
|
|
57
|
-
color: ${COLORS.text};
|
|
58
|
-
font-size: 1em;
|
|
59
|
-
&:link,
|
|
60
|
-
&:visited {
|
|
61
|
-
color: ${COLORS.text};
|
|
62
|
-
text-decoration: ${(props) =>
|
|
63
|
-
(props.isActive || props.isTransitioningTo) && `underline`};
|
|
64
|
-
text-decoration-style: ${(props) => props.isTransitioningTo && `wavy`};
|
|
65
|
-
}
|
|
66
|
-
`
|
|
67
|
-
|
|
68
|
-
const LogoWrapper = styled.div`
|
|
69
|
-
font-family: Roboto, 'Helvetica Neue Light', 'Helvetica Neue', Helvetica,
|
|
70
|
-
Arial, 'Lucida Grande', sans-serif;
|
|
71
|
-
-webkit-font-smoothing: antialiased;
|
|
72
|
-
font-weight: bold;
|
|
73
|
-
font-size: 1.3em;
|
|
74
|
-
display: flex;
|
|
75
|
-
flex-grow: 1;
|
|
76
|
-
align-items: center;
|
|
77
|
-
`
|
|
78
|
-
const Logo = () => (
|
|
79
|
-
<LogoWrapper>
|
|
80
|
-
<Link href="/">
|
|
81
|
-
<ReactRxLogo size="2em" style={{paddingRight: '0.4em'}} />
|
|
82
|
-
ReactRx
|
|
83
|
-
</Link>
|
|
84
|
-
</LogoWrapper>
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
export const Header = rxComponent((page$) =>
|
|
88
|
-
pageTransition$.pipe(
|
|
89
|
-
map((transitionState) => (
|
|
90
|
-
<StyledHeader>
|
|
91
|
-
<HeaderInner>
|
|
92
|
-
<Logo />
|
|
93
|
-
{pages
|
|
94
|
-
.filter((page) => page.id !== 'home')
|
|
95
|
-
.map((page) => {
|
|
96
|
-
return (
|
|
97
|
-
<LinkWrapper key={page.id}>
|
|
98
|
-
<PageLink
|
|
99
|
-
href={page.route}
|
|
100
|
-
isTransitioningTo={
|
|
101
|
-
transitionState.isTransitioning &&
|
|
102
|
-
transitionState.next === page
|
|
103
|
-
}
|
|
104
|
-
isActive={transitionState.current === page}
|
|
105
|
-
>
|
|
106
|
-
{page.title}
|
|
107
|
-
</PageLink>
|
|
108
|
-
</LinkWrapper>
|
|
109
|
-
)
|
|
110
|
-
})}
|
|
111
|
-
<a href="https://github.com/sanity-io/react-rx">
|
|
112
|
-
<GithubLogo style={{color: '#fff'}} height="25" width="25" />
|
|
113
|
-
</a>
|
|
114
|
-
</HeaderInner>
|
|
115
|
-
</StyledHeader>
|
|
116
|
-
))
|
|
117
|
-
)
|
|
118
|
-
)
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import {navigate} from '../datastores/location'
|
|
3
|
-
|
|
4
|
-
export function Link(props: React.ComponentProps<'a'>) {
|
|
5
|
-
const onClick = React.useCallback(
|
|
6
|
-
event => {
|
|
7
|
-
if (props.onClick) {
|
|
8
|
-
props.onClick(event)
|
|
9
|
-
}
|
|
10
|
-
event.preventDefault()
|
|
11
|
-
if (props.href) {
|
|
12
|
-
navigate(props.href)
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
[props.href, props.onClick]
|
|
16
|
-
)
|
|
17
|
-
return <a {...props} onClick={onClick} />
|
|
18
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import {rxComponent} from 'react-rx'
|
|
2
|
-
import {map, scan, switchMap} from 'rxjs/operators'
|
|
3
|
-
import {Page} from '../pages/pages'
|
|
4
|
-
import {concat, from, of} from 'rxjs'
|
|
5
|
-
import * as React from 'react'
|
|
6
|
-
import {Header} from './Header'
|
|
7
|
-
import {Container, Content} from '../pages/styles'
|
|
8
|
-
|
|
9
|
-
interface Props {
|
|
10
|
-
page: Page
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface PageWrapperProps {
|
|
14
|
-
title: string
|
|
15
|
-
isLoading: boolean
|
|
16
|
-
component: React.ComponentType<any>
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const PageWrapper = (props: PageWrapperProps) => {
|
|
20
|
-
return (
|
|
21
|
-
<>
|
|
22
|
-
<div style={{position: 'fixed', top: 0, zIndex: 10000}}>
|
|
23
|
-
{props.isLoading ? `Loading ` : 'Loaded '}
|
|
24
|
-
{props.title}
|
|
25
|
-
</div>
|
|
26
|
-
{props.component && <props.component />}
|
|
27
|
-
</>
|
|
28
|
-
)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const INITIAL_COMPONENT = () => (
|
|
32
|
-
<>
|
|
33
|
-
<Header />
|
|
34
|
-
<Container>
|
|
35
|
-
<Content>Loading</Content>
|
|
36
|
-
</Container>
|
|
37
|
-
</>
|
|
38
|
-
)
|
|
39
|
-
|
|
40
|
-
export const LoadPage = rxComponent<Props>(props$ => {
|
|
41
|
-
return props$.pipe(
|
|
42
|
-
map(props => props.page),
|
|
43
|
-
switchMap(page =>
|
|
44
|
-
concat(
|
|
45
|
-
of({title: page.title, isLoading: true, component: INITIAL_COMPONENT}),
|
|
46
|
-
from(page.load()).pipe(
|
|
47
|
-
map(component => ({
|
|
48
|
-
isLoading: false,
|
|
49
|
-
title: page.title,
|
|
50
|
-
component
|
|
51
|
-
}))
|
|
52
|
-
)
|
|
53
|
-
)
|
|
54
|
-
),
|
|
55
|
-
scan((prev, next) => ({...prev, ...next})),
|
|
56
|
-
map(({isLoading, title, component}) => (
|
|
57
|
-
<PageWrapper title={title} component={component} isLoading={isLoading} />
|
|
58
|
-
))
|
|
59
|
-
)
|
|
60
|
-
})
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components'
|
|
2
|
-
import {COLORS, media} from '../theme'
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import Burger from 'react-css-burger'
|
|
5
|
-
|
|
6
|
-
const SidebarContentInner = styled.div`
|
|
7
|
-
${media.greaterThan('large')} {
|
|
8
|
-
position: fixed;
|
|
9
|
-
}
|
|
10
|
-
> ul {
|
|
11
|
-
overflow-y: auto;
|
|
12
|
-
bottom: 2em;
|
|
13
|
-
height: calc(100vh - 18em);
|
|
14
|
-
}
|
|
15
|
-
ul {
|
|
16
|
-
padding: 0 0 0 0.5em;
|
|
17
|
-
li {
|
|
18
|
-
padding: 0.3em 0;
|
|
19
|
-
list-style: none;
|
|
20
|
-
a,
|
|
21
|
-
a:link,
|
|
22
|
-
a:visited {
|
|
23
|
-
color: ${COLORS.link};
|
|
24
|
-
}
|
|
25
|
-
a.selected {
|
|
26
|
-
border-bottom: 3px solid ${COLORS.secondary};
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`
|
|
31
|
-
|
|
32
|
-
const SidebarWrapper = styled.div<{isOpen: boolean}>`
|
|
33
|
-
${media.lessThan('large')} {
|
|
34
|
-
position: fixed;
|
|
35
|
-
left: 0;
|
|
36
|
-
padding: 0;
|
|
37
|
-
z-index: 2000;
|
|
38
|
-
top: 4.8em;
|
|
39
|
-
}
|
|
40
|
-
${media.greaterThan('large')} {
|
|
41
|
-
button {
|
|
42
|
-
display: none;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
${media.lessThan('large')} {
|
|
46
|
-
border-radius: 0 0.5em 0.5em 0;
|
|
47
|
-
box-shadow: ${props =>
|
|
48
|
-
props.isOpen ? `0 4px 10px 0 ${COLORS.shadow}` : '0'};
|
|
49
|
-
background-color: ${props =>
|
|
50
|
-
props.isOpen ? '#eff0f3' : COLORS.header.background};
|
|
51
|
-
}
|
|
52
|
-
`
|
|
53
|
-
const SidebarContent = styled.div<{isOpen: boolean}>`
|
|
54
|
-
padding: 2em 0 0 1em;
|
|
55
|
-
width: 250px;
|
|
56
|
-
max-height: calc(100vh - 12em);
|
|
57
|
-
|
|
58
|
-
${media.lessThan('large')} {
|
|
59
|
-
display: ${(props: any) => (props.isOpen ? '' : 'none')};
|
|
60
|
-
}
|
|
61
|
-
${media.greaterThan('large')} {
|
|
62
|
-
width: 230px;
|
|
63
|
-
}
|
|
64
|
-
`
|
|
65
|
-
|
|
66
|
-
export const Sidebar = (props: {
|
|
67
|
-
heading: string
|
|
68
|
-
children: React.ReactNode
|
|
69
|
-
}) => {
|
|
70
|
-
const [isOpen, setOpen] = React.useState(false)
|
|
71
|
-
return (
|
|
72
|
-
<SidebarWrapper isOpen={isOpen}>
|
|
73
|
-
<Burger
|
|
74
|
-
scale={0.6}
|
|
75
|
-
active={isOpen}
|
|
76
|
-
marginLeft="0"
|
|
77
|
-
marginTop="0"
|
|
78
|
-
onClick={() => setOpen(isOpen => !isOpen)}
|
|
79
|
-
/>
|
|
80
|
-
<SidebarContent onClick={e => setOpen(false)} isOpen={isOpen}>
|
|
81
|
-
<SidebarContentInner>
|
|
82
|
-
<h4>{props.heading}</h4>
|
|
83
|
-
{props.children}
|
|
84
|
-
</SidebarContentInner>
|
|
85
|
-
</SidebarContent>
|
|
86
|
-
</SidebarWrapper>
|
|
87
|
-
)
|
|
88
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
|
-
export const GithubLogo = (props: React.ComponentProps<'svg'>) => (
|
|
4
|
-
<svg {...props} viewBox="0 0 496 512" fill="currentColor">
|
|
5
|
-
<path
|
|
6
|
-
fill="currentColor"
|
|
7
|
-
d="M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"
|
|
8
|
-
/>
|
|
9
|
-
</svg>
|
|
10
|
-
)
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
|
|
3
|
-
export const ReactLogo = (props: React.ComponentProps<'svg'>) => (
|
|
4
|
-
<svg
|
|
5
|
-
{...props}
|
|
6
|
-
viewBox="0 0 256 230"
|
|
7
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
-
preserveAspectRatio="xMinYMin meet"
|
|
9
|
-
>
|
|
10
|
-
<path
|
|
11
|
-
d="M.754 114.75c0 19.215 18.763 37.152 48.343 47.263-5.907 29.737-1.058 53.706 15.136 63.045 16.645 9.6 41.443 2.955 64.98-17.62 22.943 19.744 46.13 27.514 62.31 18.148 16.63-9.627 21.687-35.221 15.617-65.887 30.81-10.186 48.044-25.481 48.044-44.949 0-18.769-18.797-35.006-47.979-45.052 6.535-31.933.998-55.32-15.867-65.045-16.259-9.376-39.716-1.204-62.996 19.056C104.122 2.205 80.897-4.36 64.05 5.392 47.806 14.795 43.171 39.2 49.097 69.487 20.515 79.452.754 96.057.754 114.75z"
|
|
12
|
-
fill="#FFF"
|
|
13
|
-
/>
|
|
14
|
-
<path
|
|
15
|
-
d="M201.025 79.674a151.364 151.364 0 0 0-7.274-2.292 137.5 137.5 0 0 0 1.124-4.961c5.506-26.728 1.906-48.26-10.388-55.348-11.787-6.798-31.065.29-50.535 17.233a151.136 151.136 0 0 0-5.626 5.163 137.573 137.573 0 0 0-3.744-3.458c-20.405-18.118-40.858-25.752-53.139-18.643-11.776 6.817-15.264 27.06-10.307 52.39a150.91 150.91 0 0 0 1.67 7.484c-2.894.822-5.689 1.698-8.363 2.63-23.922 8.34-39.2 21.412-39.2 34.97 0 14.004 16.4 28.05 41.318 36.566a128.44 128.44 0 0 0 6.11 1.91 147.813 147.813 0 0 0-1.775 8.067c-4.726 24.89-1.035 44.653 10.71 51.428 12.131 6.995 32.491-.195 52.317-17.525 1.567-1.37 3.14-2.823 4.715-4.346a148.34 148.34 0 0 0 6.108 5.573c19.204 16.525 38.17 23.198 49.905 16.405 12.12-7.016 16.058-28.247 10.944-54.078-.39-1.973-.845-3.988-1.355-6.04 1.43-.422 2.833-.858 4.202-1.312 25.904-8.582 42.757-22.457 42.757-36.648 0-13.607-15.77-26.767-40.174-35.168z"
|
|
16
|
-
fill="#53C1DE"
|
|
17
|
-
/>
|
|
18
|
-
<path
|
|
19
|
-
d="M195.406 142.328c-1.235.409-2.503.804-3.795 1.187-2.86-9.053-6.72-18.68-11.442-28.625 4.507-9.71 8.217-19.213 10.997-28.208 2.311.67 4.555 1.375 6.717 2.12 20.91 7.197 33.664 17.84 33.664 26.04 0 8.735-13.775 20.075-36.14 27.486zm-9.28 18.389c2.261 11.422 2.584 21.749 1.086 29.822-1.346 7.254-4.052 12.09-7.398 14.027-7.121 4.122-22.35-1.236-38.772-15.368-1.883-1.62-3.78-3.35-5.682-5.18 6.367-6.964 12.73-15.06 18.94-24.05 10.924-.969 21.244-2.554 30.603-4.717.46 1.86.87 3.683 1.223 5.466zm-93.85 43.137c-6.957 2.457-12.498 2.527-15.847.596-7.128-4.11-10.09-19.98-6.049-41.265a138.507 138.507 0 0 1 1.65-7.502c9.255 2.047 19.5 3.52 30.45 4.408 6.251 8.797 12.798 16.883 19.396 23.964a118.863 118.863 0 0 1-4.305 3.964c-8.767 7.664-17.552 13.1-25.294 15.835zm-32.593-61.58c-11.018-3.766-20.117-8.66-26.354-14-5.604-4.8-8.434-9.565-8.434-13.432 0-8.227 12.267-18.722 32.726-25.855a139.276 139.276 0 0 1 7.777-2.447c2.828 9.197 6.537 18.813 11.013 28.537-4.534 9.869-8.296 19.638-11.15 28.943a118.908 118.908 0 0 1-5.578-1.746zm10.926-74.37c-4.247-21.703-1.427-38.074 5.67-42.182 7.56-4.376 24.275 1.864 41.893 17.507 1.126 1 2.257 2.047 3.39 3.13-6.564 7.049-13.051 15.074-19.248 23.82-10.627.985-20.8 2.567-30.152 4.686a141.525 141.525 0 0 1-1.553-6.962zm97.467 24.067a306.982 306.982 0 0 0-6.871-11.3c7.21.91 14.117 2.12 20.603 3.601-1.947 6.241-4.374 12.767-7.232 19.457a336.42 336.42 0 0 0-6.5-11.758zm-39.747-38.714c4.452 4.823 8.911 10.209 13.297 16.052a284.245 284.245 0 0 0-26.706-.006c4.39-5.789 8.887-11.167 13.409-16.046zm-40.002 38.78a285.24 285.24 0 0 0-6.378 11.685c-2.811-6.667-5.216-13.222-7.18-19.552 6.447-1.443 13.322-2.622 20.485-3.517a283.79 283.79 0 0 0-6.927 11.384zm7.133 57.683c-7.4-.826-14.379-1.945-20.824-3.348 1.995-6.442 4.453-13.138 7.324-19.948a283.494 283.494 0 0 0 6.406 11.692 285.27 285.27 0 0 0 7.094 11.604zm33.136 27.389c-4.575-4.937-9.138-10.397-13.595-16.27 4.326.17 8.737.256 13.22.256 4.606 0 9.159-.103 13.64-.303-4.4 5.98-8.843 11.448-13.265 16.317zm46.072-51.032c3.02 6.884 5.566 13.544 7.588 19.877-6.552 1.495-13.625 2.699-21.078 3.593a337.537 337.537 0 0 0 6.937-11.498 306.632 306.632 0 0 0 6.553-11.972zm-14.915 7.15a316.478 316.478 0 0 1-10.84 17.49c-6.704.479-13.632.726-20.692.726-7.031 0-13.871-.219-20.458-.646A273.798 273.798 0 0 1 96.72 133.28a271.334 271.334 0 0 1-9.64-18.206 273.864 273.864 0 0 1 9.611-18.216v.002a271.252 271.252 0 0 1 10.956-17.442c6.72-.508 13.61-.774 20.575-.774 6.996 0 13.895.268 20.613.78a290.704 290.704 0 0 1 10.887 17.383 316.418 316.418 0 0 1 9.741 18.13 290.806 290.806 0 0 1-9.709 18.29zm19.913-107.792c7.566 4.364 10.509 21.961 5.755 45.038a127.525 127.525 0 0 1-1.016 4.492c-9.374-2.163-19.554-3.773-30.212-4.773-6.209-8.841-12.642-16.88-19.1-23.838a141.92 141.92 0 0 1 5.196-4.766c16.682-14.518 32.273-20.25 39.377-16.153z"
|
|
20
|
-
fill="#FFF"
|
|
21
|
-
/>
|
|
22
|
-
<path
|
|
23
|
-
d="M128.221 94.665c11.144 0 20.177 9.034 20.177 20.177 0 11.144-9.033 20.178-20.177 20.178-11.143 0-20.177-9.034-20.177-20.178 0-11.143 9.034-20.177 20.177-20.177"
|
|
24
|
-
fill="#53C1DE"
|
|
25
|
-
/>
|
|
26
|
-
</svg>
|
|
27
|
-
)
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import {CSSProperties} from 'react'
|
|
3
|
-
import {RxJSLogo} from './RxJs'
|
|
4
|
-
import styled from 'styled-components'
|
|
5
|
-
import {ReactLogo} from './React'
|
|
6
|
-
|
|
7
|
-
const StyledRxJSLogo = styled(RxJSLogo)`
|
|
8
|
-
width: ${props => props.width};
|
|
9
|
-
opacity: 0.7;
|
|
10
|
-
position: absolute;
|
|
11
|
-
`
|
|
12
|
-
const StyledReactLogo = styled(ReactLogo)`
|
|
13
|
-
width: ${props => props.width};
|
|
14
|
-
opacity: 0.7;
|
|
15
|
-
position: absolute;
|
|
16
|
-
`
|
|
17
|
-
|
|
18
|
-
export function ReactRxLogo(props: {
|
|
19
|
-
className?: string
|
|
20
|
-
style?: CSSProperties
|
|
21
|
-
size: string
|
|
22
|
-
}) {
|
|
23
|
-
return (
|
|
24
|
-
<div
|
|
25
|
-
className={props.className}
|
|
26
|
-
style={{
|
|
27
|
-
display: 'inline-block',
|
|
28
|
-
verticalAlign: 'middle',
|
|
29
|
-
position: 'relative',
|
|
30
|
-
width: props.size,
|
|
31
|
-
height: props.size,
|
|
32
|
-
...props.style
|
|
33
|
-
}}
|
|
34
|
-
>
|
|
35
|
-
<StyledReactLogo width={props.size} height={props.size} />
|
|
36
|
-
<StyledRxJSLogo width={props.size} height={props.size} />
|
|
37
|
-
</div>
|
|
38
|
-
)
|
|
39
|
-
}
|