Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
mmiller42 committed Jul 1, 2024
1 parent d87f954 commit 8762c3f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ export function BadMagicClient() {
],
};

return (
<BadMagic workspaces={[superheroWorkspace]} />
);
return <BadMagic basename="/dev/api" workspaces={[superheroWorkspace]} />;
}
```

Expand Down Expand Up @@ -150,6 +148,7 @@ Usage:
```jsx
<BadMagic
applyAxiosInterceptors={applyAxiosInterceptors}
basename="/dev/api"
workspaces={workspaces}
/>
```
Expand All @@ -174,7 +173,7 @@ export function AuthForm({
<TextInput name="password" />
<Button onClick={() => {
// axios request to login user, fetch access token, and store access token in state or local storage
// then in the `applyAxiosInterceptors`, the `getAccessToken()` function can fetch the token from state or
// then in the `applyAxiosInterceptors`, the `getAccessToken()` function can fetch the token from state or
// local storage
}}>
</div>
Expand Down Expand Up @@ -246,7 +245,7 @@ Example:
export function HistoryMetadata({
metadata,
}: {
metadata: Record<string, any>;
metadata: Record<string, any>,
}) {
if (!metadata?.accessToken) {
return null;
Expand All @@ -267,6 +266,7 @@ Usage:
<BadMagic
HistoryMetadata={HistoryMetadata}
applyAxiosInterceptors={applyAxiosInterceptors}
basename="/dev/api"
workspaces={workspaces}
/>
```
Expand All @@ -280,7 +280,7 @@ Usage:
- Alternatively, you can import BadMagic's stylesheet for default styling:
```html
<link
href="https://unpkg.com/badmagic@^0.0.16/dist/css/markdown.min.css"
href="https://unpkg.com/badmagic@^0.0.40/dist/css/markdown.min.css"
rel="stylesheet"
/>
```
Expand Down Expand Up @@ -311,6 +311,7 @@ const superheroes = {
```
## Route Deprecation
- Each route can specify its deprecation status by adding a `deprecated` key to the object.
- `deprecated` accepts a boolean and will by default is set to `false`
Expand All @@ -324,13 +325,14 @@ const superheroes = {
{
name: "Fetch Superhero",
path: "/v1/superheroes/:superhero_id",
deprecated: true
deprecated: true,
},
],
};
```
## Input Field Tooltip
- Each input type can have a tooltip hover to describe what the input field is expecting if the name is ambiguous.
- The existence of a `description` attribute will generate the on-hover icon and it will pull the text from the `description` as well
Expand All @@ -346,7 +348,7 @@ const superheroes = {
path: "/v1/superheroes/:superhero_id",
method: "PATCH",
body: [
{
{
name: "first_name",
required: true,
description: "The first name of the hero you want to update to"
Expand Down

0 comments on commit 8762c3f

Please sign in to comment.