8000 Merge pull request #2 from homebaseio/update-homebase-react · homebaseio/homebase-react@fec947e · GitHub
[go: up one dir, main page]

Skip to content

Commit fec947e

Browse files
Merge pull request #2 from homebaseio/update-homebase-react
chore(*): update hbr and cleanup dead code
2 parents 9a1dcc0 + eae0a39 commit fec947e

File tree

20 files changed

+22949
-32162
lines changed

20 files changed

+22949
-32162
lines changed

examples/counter-example/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Heavily adopted from `create-react-app` bootstrapping, here's a our Counter exam
44

55
## Installation
66
```
7-
npm install
7+
yarn install
88
```
99

1010
## Run it
1111
```
12-
npm start
12+
yarn start
1313
```

examples/counter-example/package-lock.json

Lines changed: 0 additions & 15985 deletions
This file was deleted.

examples/counter-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"@testing-library/jest-dom": "^5.11.4",
77
"@testing-library/react": "^11.1.0",
88
"@testing-library/user-event": "^12.1.10",
9-
"homebase-react": "0.0.1",
9+
"homebase-react": "^0.1.0",
1010
"react": "^17.0.1",
1111
"react-dom": "^17.0.1",
1212
"react-scripts": "4.0.0",

examples/counter-example/public/index.html

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,7 @@
55
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
77
<meta name="theme-color" content="#000000" />
8-
<meta
9-
name="description"
10-
content="Homebase counter app"
11-
/>
12-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
13-
<!--
14-
manifest.json provides metadata used when your web app is installed on a
15-
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
16-
-->
17-
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
18-
<!--
19-
Notice the use of %PUBLIC_URL% in the tags above.
20-
It will be replaced with the URL of the `public` folder during the build.
21-
Only files inside the `public` folder can be referenced from the HTML.
22-
23-
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
24-
work correctly both with client-side routing and a non-root public URL.
25-
Learn how to configure a non-root public URL by running `npm run build`.
26-
-->
27-
<title>Homebase counter app</title>
8+
<title>Homebase Counter Example</title>
289
</head>
2910
<body>
3011
<noscript>You need to enable JavaScript to run this app.</noscript>
-5.22 KB
Binary file not shown.
-9.44 KB
Binary file not shown.

examples/counter-example/public/manifest.json

Lines changed: 0 additions & 25 deletions
This file was deleted.

examples/counter-example/src/App.css

Lines changed: 3 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,6 @@
1-
.App {
2-
text-align: center;
3-
}
4-
5-
.App-logo {
6-
height: 40vmin;
7-
pointer-events: none;
8-
}
9-
10-
@media (prefers-reduced-motion: no-preference) {
11-
.App-logo {
12-
animation: App-logo-spin infinite 20s linear;
13-
}
14-
}
15-
16-
.App-header {
17-
background-color: #282c34;
18-
min-height: 100vh;
1+
html {
2+
padding: 20px;
193
display: flex;
204
flex-direction: column;
215
align-items: center;
22-
justify-content: center;
23-
font-size: calc(10px + 2vmin);
24-
color: white;
25-
}
26-
27-
.App-link {
28-
color: #61dafb;
29-
}
30-
31-
@keyframes App-logo-spin {
32-
from {
33-
transform: rotate(0deg);
34-
}
35-
to {
36-
transform: rotate(360deg);
37-
}
38-
}
6+
}

examples/counter-example/src/App.js

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import logo from './logo.svg';
2-
import './App.css';
3-
import {HomebaseProvider, useEntity, useTransact} from 'homebase-react';
1+
import React from 'react'
2+
import { HomebaseProvider, useEntity, useTransact } from 'homebase-react'
3+
import './App.css'
44

55
const config = {
66
initialData: [{
@@ -11,11 +11,13 @@ const config = {
1111
}]
1212
}
1313

14-
export const OurApp = () => (
15-
<HomebaseProvider config={config}>
16-
<Counter/>
17-
</HomebaseProvider>
18-
)
14+
export default function App() {
15+
return (
16+
<HomebaseProvider config={config}>
17+
<Counter/>
18+
</HomebaseProvider>
19+
)
20+
}
1921

2022
const Counter = () => {
2123
const [counter] = useEntity({ identity: 'counter' })
@@ -36,19 +38,3 @@ const Counter = () => {
3638
</div>
3739
)
3840
}
39-
40-
function App() {
41-
return (
42-
<div className="App">
43-
<header className="App-header">
44-
<img src={logo} className="App-logo" alt="logo" />
45-
<p>
46-
Click to "Increment" to increment counter.
47-
</p>
48-
<OurApp/>
49-
</header>
50-
</div>
51-
);
52-
}
53-
54-
export default App;

examples/counter-example/src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import ReactDOM from 'react-dom';
33
import App from './App';
44

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

examples/counter-example/src/logo.svg

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)
0