revert readme
This commit is contained in:
39
README.md
39
README.md
@@ -25,47 +25,20 @@ pnpm add reacord react discord.js
|
|||||||
<!-- prettier-ignore -->
|
<!-- prettier-ignore -->
|
||||||
```tsx
|
```tsx
|
||||||
import { useState } from "react"
|
import { useState } from "react"
|
||||||
import { Embed, EmbedField, Button } from "reacord"
|
import { Embed, Button } from "reacord"
|
||||||
|
|
||||||
interface EmbedCounterProps {
|
|
||||||
count: number
|
|
||||||
visible: boolean
|
|
||||||
}
|
|
||||||
|
|
||||||
function EmbedCounter({ count, visible }: EmbedCounterProps) {
|
|
||||||
if (!visible) return <></>
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Embed title="the counter">
|
|
||||||
<EmbedField name="is it even?">{count % 2 ? "no" : "yes"}</EmbedField>
|
|
||||||
</Embed>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
function Counter() {
|
function Counter() {
|
||||||
const [showEmbed, setShowEmbed] = useState<boolean>(false)
|
const [count, setCount] = useState(0)
|
||||||
const [count, setCount] = useState<number>(0)
|
|
||||||
const instance = useInstance()
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
this button was clicked {count} times
|
<Embed title="Counter">
|
||||||
<EmbedCounter count={count} visible={showEmbed} />
|
This button has been clicked {count} times.
|
||||||
|
</Embed>
|
||||||
<Button
|
<Button
|
||||||
style="primary"
|
label="+1"
|
||||||
label="clicc"
|
|
||||||
onClick={() => setCount(count + 1)}
|
onClick={() => setCount(count + 1)}
|
||||||
/>
|
/>
|
||||||
<Button
|
|
||||||
style="secondary"
|
|
||||||
label={showEmbed ? "hide embed" : "show embed"}
|
|
||||||
onClick={() => setShowEmbed(!showEmbed)}
|
|
||||||
/>
|
|
||||||
<Button
|
|
||||||
style="danger"
|
|
||||||
label="deactivate"
|
|
||||||
onClick={() => instance.destroy()}
|
|
||||||
/>
|
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user