Skip to content

Commit 3fdb1f5

Browse files
authored
Merge pull request #272 from Web3-API/prealpha-dev
Prep 0.0.1-prealpha.13
2 parents 7d96e1f + 93d5bd1 commit 3fdb1f5

28 files changed

Lines changed: 320 additions & 516 deletions

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# Web3API 0.0.1-prealpha.13
2+
## Features
3+
* Improved template projects that are used with the `w3 create ...` CLI command.
4+
15
# Web3API 0.0.1-prealpha.12
26
## Bug Fixes
37
* Added schemas to plugin manifest modules, removing the need for `import_redirects`.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.1-prealpha.12
1+
0.0.1-prealpha.13

packages/js/client/src/Web3ApiClient.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
} from "@web3api/core-js";
2222

2323
export interface ClientConfig<TUri = string> {
24-
redirects: UriRedirect<TUri>[];
24+
redirects?: UriRedirect<TUri>[];
2525
}
2626

2727
export class Web3ApiClient implements Client {
@@ -36,20 +36,26 @@ export class Web3ApiClient implements Client {
3636
if (config) {
3737
this._config = {
3838
...config,
39-
redirects: sanitizeUriRedirects(config.redirects),
39+
redirects: config.redirects
40+
? sanitizeUriRedirects(config.redirects)
41+
: [],
4042
};
4143
} else {
4244
this._config = {
4345
redirects: [],
4446
};
4547
}
4648

49+
if (!this._config.redirects) {
50+
this._config.redirects = [];
51+
}
52+
4753
// Add all default redirects (IPFS, ETH, ENS)
4854
this._config.redirects.push(...getDefaultRedirects());
4955
}
5056

5157
public redirects(): readonly UriRedirect<Uri>[] {
52-
return this._config.redirects;
58+
return this._config.redirects || [];
5359
}
5460

5561
public async query<

packages/js/client/src/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
export * from "./Web3ApiClient";
22
export * from "./createWeb3ApiClient";
33
export * from "@web3api/core-js";
4-
5-
// TODO: client.sanitizeRedirects() -> iterate through all redirects, make sure we can resolve all of them (will call getImplementations...)
6-
// TODO: client.getImplementations(uri) -> iterate through all known Web3API's and find all implementations

packages/js/react/src/provider.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { UriRedirect, Web3ApiClient } from "@web3api/client-js";
1+
import { Web3ApiClient, ClientConfig } from "@web3api/client-js";
22
import React from "react";
33

44
type ClientContext = React.Context<Web3ApiClient>
@@ -14,10 +14,7 @@ interface Web3ApiProviderMap {
1414

1515
export const PROVIDERS: Web3ApiProviderMap = {};
1616

17-
interface Web3ApiProviderProps {
18-
redirects: UriRedirect<string>[];
19-
children: React.ReactNode;
20-
}
17+
interface Web3ApiProviderProps extends ClientConfig { }
2118

2219
export type Web3ApiProviderFC = React.FC<Web3ApiProviderProps>;
2320

packages/templates/.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.gitignore

packages/templates/app/react/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,14 @@
1515
"@types/node": "^12.0.0",
1616
"@types/react": "^16.9.0",
1717
"@types/react-dom": "^16.9.0",
18+
"@types/react-lottie": "^1.2.5",
1819
"@web3api/client-js": "0.0.1-prealpha.12",
20+
"@web3api/react": "^0.0.1-prealpha.12",
1921
"http-proxy": "1.18.1",
2022
"http-proxy-middleware": "1.0.6",
2123
"react": "^16.13.1",
2224
"react-dom": "^16.13.1",
25+
"react-lottie": "^1.2.3",
2326
"react-scripts": "3.4.1",
2427
"stream-array": "1.1.2",
2528
"typescript": "4.0.7"

packages/templates/app/react/public/index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
<meta charset="utf-8" />
55
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<style>
8+
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap");
9+
</style>
710
<meta name="theme-color" content="#000000" />
811
<meta
912
name="description"

packages/templates/app/react/public/thread.js

Lines changed: 60 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 66 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,78 @@
1-
.App {
2-
text-align: center;
1+
.main {
2+
display: flex;
3+
flex-direction: column;
4+
justify-content: center;
5+
height: 100vh;
6+
align-items: center;
37
}
48

5-
.App-logo {
6-
height: 40vmin;
7-
pointer-events: none;
9+
.main__logo {
10+
max-width: 15rem;
11+
margin-bottom: 5rem;
812
}
913

10-
@media (prefers-reduced-motion: no-preference) {
11-
.App-logo {
12-
animation: App-logo-spin infinite 20s linear;
13-
}
14+
.main__heading {
15+
font-size: 45px;
16+
margin-top: 2rem;
17+
font-weight: 700;
18+
margin-bottom: 20px;
19+
color: white;
1420
}
1521

16-
.App-header {
17-
background-color: #282c34;
18-
min-height: 100vh;
19-
display: flex;
20-
flex-direction: column;
21-
align-items: center;
22-
justify-content: center;
23-
font-size: calc(10px + 2vmin);
22+
.main__text {
23+
text-align: center;
24+
max-width: 40rem;
25+
color: #529dad;
26+
font-style: italic;
27+
line-height: 1.5;
28+
font-weight: 400;
29+
font-size: 22px;
30+
}
31+
32+
.main__link {
33+
text-decoration: none;
34+
font-size: 22px;
35+
font-weight: 600;
36+
margin-top: 2rem;
37+
color: white;
38+
}
39+
40+
.main__input {
41+
font: inherit;
2442
color: white;
43+
width: 40rem;
44+
border: 1px solid white;
45+
height: 1.1876em;
46+
margin: 2.5rem 0;
47+
display: block;
48+
padding: 1rem;
49+
min-width: 0;
50+
background: none;
51+
box-sizing: content-box;
52+
letter-spacing: inherit;
53+
animation-duration: 10ms;
54+
-webkit-tap-highlight-color: transparent;
2555
}
2656

27-
.App-link {
28-
color: #61dafb;
57+
.main__btn {
58+
font-size: 0.875rem;
59+
color: #60c093;
60+
border: 1px solid #529dad;
61+
padding: 5px 15px;
62+
font-weight: 500;
63+
line-height: 1.75;
64+
min-width: 64px;
65+
cursor: pointer;
66+
border-radius: 4px;
67+
text-transform: uppercase;
68+
background-color: transparent;
69+
transition: background-color 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
70+
box-shadow 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms,
71+
border 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;
2972
}
3073

31-
@keyframes App-logo-spin {
32-
from {
33-
transform: rotate(0deg);
34-
}
35-
to {
36-
transform: rotate(360deg);
37-
}
74+
.main__btn:hover {
75+
color: #ffffff;
76+
border: solid 1px #529dad;
77+
background-color: #60c093;
3878
}

0 commit comments

Comments
 (0)