Skip to content

Commit

Permalink
revert readme
Browse files Browse the repository at this point in the history
  • Loading branch information
domin-mnd committed Nov 1, 2023
1 parent 6c71073 commit 2a8ee78
Showing 1 changed file with 6 additions and 33 deletions.
39 changes: 6 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,47 +25,20 @@ pnpm add reacord react discord.js
<!-- prettier-ignore -->
```tsx
import { useState } from "react"
import { Embed, EmbedField, 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>
)
}
import { Embed, Button } from "reacord"

function Counter() {
const [showEmbed, setShowEmbed] = useState<boolean>(false)
const [count, setCount] = useState<number>(0)
const instance = useInstance()
const [count, setCount] = useState(0)

return (
<>
this button was clicked {count} times
<EmbedCounter count={count} visible={showEmbed} />
<Embed title="Counter">
This button has been clicked {count} times.
</Embed>
<Button
style="primary"
label="clicc"
label="+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()}
/>
</>
)
}
Expand Down

0 comments on commit 2a8ee78

Please sign in to comment.