@chainfuse/ui
Advanced tools
Comparing version 0.0.4 to 0.0.5
@@ -1,1 +0,2 @@ | ||
export { Counter } from "./library/Counter.js"; | ||
import Counter from "./library/Counter"; | ||
export { Counter }; |
@@ -1,1 +0,2 @@ | ||
export { Counter } from "./library/Counter.js"; | ||
import Counter from "./library/Counter"; | ||
export { Counter }; |
@@ -1,1 +0,5 @@ | ||
export declare function Counter(): JSX.Element; | ||
declare type Props = { | ||
value?: number; | ||
}; | ||
declare const Counter: ({ value }: Props) => JSX.Element; | ||
export default Counter; |
@@ -1,8 +0,16 @@ | ||
import * as React from "react"; | ||
export function Counter() { | ||
const [count, setCount] = React.useState(0); | ||
return (<> | ||
<p>You clicked {count} times</p> | ||
<button onClick={() => setCount(count + 1)}>Click me</button> | ||
</>); | ||
} | ||
import { useState } from 'react'; | ||
const Counter = ({ value = 0 }) => { | ||
const [counter, setCounter] = useState(value); | ||
const onMinus = () => { | ||
setCounter((prev) => prev - 1); | ||
}; | ||
const onPlus = () => { | ||
setCounter((prev) => prev + 1); | ||
}; | ||
return (<div> | ||
<h1>Counter: {counter}</h1> | ||
<button onClick={onMinus}>-</button> | ||
<button onClick={onPlus}>+</button> | ||
</div>); | ||
}; | ||
export default Counter; |
{ | ||
"name": "@chainfuse/ui", | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"packageManager": "yarn@4.0.0-rc.12", | ||
@@ -8,5 +8,12 @@ "description": "UI components for ChainFuse.io", | ||
"type": "module", | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/esm/index.js", | ||
"types": "./dist/esm/index.d.ts", | ||
"scripts": { | ||
"clean": "rm -rf dist", | ||
"build": "npm run clean && tsc && cp package.json README.md yarn.lock ./dist" | ||
"build": "npm run clean && tsc && cp package.json README.md yarn.lock ./dist && yarn build:esm && yarn build:cjs", | ||
"build:esm": "tsc", | ||
"build:cjs": "tsc --module commonjs --outDir dist/cjs", | ||
"prepare": "npm run build", | ||
"prepublishOnly": "npm test && npm run prettier && npm run lint" | ||
}, | ||
@@ -21,3 +28,12 @@ "devDependencies": { | ||
"react": "^18.2.0" | ||
} | ||
}, | ||
"keywords": [ | ||
"react", | ||
"chainfuse", | ||
"web3", | ||
"nft", | ||
"nfts", | ||
"blockchain", | ||
"ethereum" | ||
] | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24298
12
58