Skip to content

Commit

Permalink
Docs update (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaypozo authored Nov 28, 2023
1 parent 4646c1b commit 1130cac
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ dist
# Custom
src/tailwind-output.css
vite.config.ts.*

.idea
storybook-static
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,18 @@ import {
} from "@covalenthq/goldrush-kit";
```

## Ready-to-go example
## Ready-to-go React Component example

Here's a full example that you can copy-paste to get started. If you're using `next.js` versions `^13.0` and are using `app` router, make sure you have `use client;` at the top of the file to disable Next's server component modules.
Here's a full example to get you started. If you're using `next.js` versions `^13.0` and are using `app` router, make sure you have `use client;` at the top of the file to disable Next's server component modules.

**Note:** You should always keep your API key private, never put it directly into your code, especially front end code. Instead, use an environment variable to inject the key into your code.

Be sure to secure your key to prevent unauthorized use in the Covalent platform by restricting usage to specific URLs.

```tsx
// 'use client';
// If using Next.js
<GoldRushProvider apikey="<YOUR_API_KEY>" mode="dark" color="emerald">
// If using Next.js, put your API key in a .env.local file
<GoldRushProvider apikey={process.env.NEXT_PUBLIC_API_KEY} mode="dark" color="emerald">
<TokenBalancesListView
chain_names={[
"eth-mainnet",
Expand All @@ -83,11 +87,11 @@ Here's a full example that you can copy-paste to get started. If you're using `n

## Build and customize with Storybook

The components used above are built using Storybook, React, Tailwind, and TypeScript.
The components used above are built React, Tailwind, and TypeScript. You can preview and customize the components using Storybook.

Storybook provides developers with a way to quickly prototype and develop components in isolation, while React provides the tools to quickly build out a web application. Tailwind provides a library of pre-built UI components and utility classes, while TypeScript adds type safety and autocompletion to the development process. Together, these tools provide developers with the tools they need to quickly and easily build complex, modern web applications.

### Environmental Variable
### Storybook Environmental Variable

Create and add a `.env` file to the root directory of your project and the following to the file.

Expand Down

0 comments on commit 1130cac

Please sign in to comment.