0.1.6 • Published 1 year ago

@kodumbeats/papercuts-widget v0.1.6

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

Papercuts Widget

Install

npm install papercuts-widget react react-dom

Styles

In Next projects, add to pages/_app.[j,t]sx:

import "papercuts-widget/dist/style.css";

As HTML:

<link rel="stylesheet" href="/location/to/papercuts-widget/dist/style.css" />

Component

import type { PropsWithChildren } from "react";
import { Widget, WidgetDefaultsProvider } from "papercuts-widget";

export function AppContext({ children }: PropsWithChildren) {
  return (
    <WidgetDefaultsProvider>
      {children}
      <Widget appName="" viewUrl="" />
    </WidgetDefaultsProvider>
  );
}

Props

import type { ComponentProps } from "react";
export type WidgetProps = Pick<ComponentProps<"section">, "className"> & {
  appName: string; // what app is causing problems
  onError?: (res: Response) => Promise<void> | void;
  onSuccess?: (res: Response) => Promise<void> | void;
  postUrl?: string; // Optional, if POST requires a proxy
  viewUrl: string; // Papercuts URL to view user reports
};
0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago