1.0.11-studio-v3.3 • Published 2 years ago

@snorreeb/sanity-plugin-dashboard-widget-cats v1.0.11-studio-v3.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

sanity-plugin-dashboard-widget-cats

NOTE

This is the Sanity Studio v3 version of sanity-plugin-dashboard-widget-cats.

For the v2 version, please refer to the v2-branch.

What is it?

An example dashboard widget for @sanity/dashboard that shows a random cat.

This plugin mostly exist to show how a simple widget can be made.

Cat widget

Install

npm install --save sanity-plugin-dashboard-widget-cats

or

yarn add sanity-plugin-dashboard-widget-cats

Ensure that you have followed install and usage instructions for @sanity/dashboard.

Usage

Add it as a widget to @sanity/dashboard plugin in sanity.config.ts (or .js):

import { dashboardTool } from "@sanity/dashboard";
import { catsWidget } from "sanity-plugin-dashboard-widget-cats";

export default createConfig({
  // ...
  plugins: [
     dashboardTool({
             widgets: [
                 catsWidget(),
             ],
         }
     ),
  ] 
})

Configure

The widget size can be controlled using layout.width:

dashboardTool({
        widgets: [
            catsWidget({ layout: { width: "small" } }),
        ],
    }
)

License

MIT-licensed. See LICENSE.

Develop & test

Make sure to run npm run build once, then run

npm run link-watch

In another shell, cd to your test studio and run:

npx yalc add sanity-plugin-dashboard-widget-cats --link && yarn install

Now, changes in this repo will be automatically built and pushed to the studio, triggering hotreload. Yalc avoids issues with react-hooks that are typical when using yarn/npm link.

About build & watch

This plugin uses @sanity/plugin-sdk with default configuration for build & watch scripts.

1.0.11

2 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago