New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-github-calendar

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-github-calendar - npm Package Compare versions

Comparing version 4.1.1 to 4.1.2

60

build/index.d.ts
import { FunctionComponent } from 'react';
import {
Activity,
Props as ActivityCalendarProps,
} from 'react-activity-calendar';
import { Props as ActivityCalendarProps } from 'react-activity-calendar';
export interface Props extends Omit<ActivityCalendarProps, 'data'> {
username: string;
year?: number | 'last';
transformData?: (data: Array<Activity>) => Array<Activity>;
transformTotalCount?: boolean;
throwOnError?: boolean;
errorMessage?: string;
export interface Activity {
date: string;
count: number;
level: 0 | 1 | 2 | 3 | 4;
}
export type Year = number | "last";
export type Color = string;
export type ColorScale = [
Color,
Color,
Color,
Color,
Color
];
export type ThemeInput = {
light: ColorScale | [
from: Color,
to: Color
];
dark?: ColorScale | [
from: Color,
to: Color
];
} | {
light?: ColorScale | [
from: Color,
to: Color
];
dark: ColorScale | [
from: Color,
to: Color
];
};
export interface Props extends Omit<ActivityCalendarProps, "data" | "theme"> {
username: string;
errorMessage?: string;
theme?: ThemeInput;
throwOnError?: boolean;
transformData?: (data: Array<Activity>) => Array<Activity>;
transformTotalCount?: boolean;
year?: Year;
}
declare const GitHubCalendar: FunctionComponent<Props>;
export default GitHubCalendar;
export {
GitHubCalendar as default,
};
export {};

@@ -37,4 +37,2 @@ 'use client';

// noinspection SuspiciousTypeOfGuard The caller might not use TypeScript
const transformData = (data, transformFn) => {

@@ -83,7 +81,7 @@ if (typeof transformFn !== 'function') {

const [loading, setLoading] = React.useState(false);
const [fetchError, setFetchError] = React.useState(null);
const [error, setError] = React.useState(null);
const fetchData = React.useCallback(() => {
setLoading(true);
setFetchError(null);
fetchCalendarData(username, year).then(setData).catch(setFetchError).finally(() => setLoading(false));
setError(null);
fetchCalendarData(username, year).then(setData).catch(setError).finally(() => setLoading(false));
}, [username, year]);

@@ -93,5 +91,5 @@ React.useEffect(fetchData, [fetchData]);

// React error boundaries can't handle asynchronous code, so rethrow.
if (fetchError) {
if (error) {
if (throwOnError) {
throw fetchError;
throw error;
} else {

@@ -98,0 +96,0 @@ return /*#__PURE__*/React__default.default.createElement("div", null, errorMessage);

{
"name": "react-github-calendar",
"version": "4.1.1",
"description": " A flexible React component to display a GitHub contributions graph",
"version": "4.1.2",
"description": " React component to display a GitHub contributions calendar",
"author": "Jonathan Gruber <gruberjonathan@gmail.com>",

@@ -17,2 +17,3 @@ "license": "MIT",

"lint": "eslint 'src/**/*' 'example/src/**/*'",
"postbuild": "dts-bundle-generator src/index.tsx -o build/index.d.ts --no-check --no-banner",
"predeploy": "cd example && ./sync-version.js && pnpm install && npm run build",

@@ -38,2 +39,3 @@ "prepare": "npm run build",

"@typescript-eslint/parser": "^6.18.1",
"dts-bundle-generator": "^9.2.5",
"eslint": "^8.56.0",

@@ -48,3 +50,2 @@ "eslint-plugin-react": "^7.32.2",

"rollup": "^4.9.5",
"rollup-plugin-copy": "^3.3.0",
"rollup-plugin-filesize": "^10.0.0",

@@ -51,0 +52,0 @@ "rollup-plugin-peer-deps-external": "^2.2.2",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc