Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/preview-theme.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Theme preview
on:
# Temporary disabled due to paused themes addition.
# See: https://github.com/anuraghazra/github-readme-stats/issues/3404
# pull_request_target:
# types: [opened, edited, reopened, synchronize]
# branches:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/stale-theme-pr-closer.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Close stale theme pull requests that have the 'invalid' label.
on:
# Temporary disabled due to paused themes addition.
# See: https://github.com/anuraghazra/github-readme-stats/issues/3404
# schedule:
# # ┌───────────── minute (0 - 59)
# # │ ┌───────────── hour (0 - 23)
Expand Down
1 change: 1 addition & 0 deletions src/cards/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const LONG_LOCALES = [
"fil",
"fi",
"fr",
"hu",
"id",
"ml",
"my",
Expand Down
2 changes: 1 addition & 1 deletion src/common/access.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const BLACKLISTED_MESSAGE = "This username is blacklisted";
* Guards access using whitelist/blacklist.
*
* @param {Object} args The parameters object.
* @param {Object} args.res The response object.
* @param {any} args.res The response object.
* @param {string} args.id Resource identifier (username or gist id).
* @param {"username"|"gist"|"wakatime"} args.type The type of identifier.
* @param {{ title_color?: string, text_color?: string, bg_color?: string, border_color?: string, theme?: string }} args.colors Color options for the error card.
Expand Down
9 changes: 6 additions & 3 deletions src/common/color.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

import { themes } from "../../themes/index.js";

/**
Expand Down Expand Up @@ -69,7 +71,6 @@ const fallbackColor = (color, fallbackColor) => {
* @param {string=} args.border_color Card border color.
* @param {string=} args.ring_color Card ring color.
* @param {string=} args.theme Card theme.
* @param {string=} args.fallbackTheme Fallback theme.
* @returns {CardColors} Card colors.
*/
const getCardColors = ({
Expand All @@ -80,11 +81,13 @@ const getCardColors = ({
border_color,
ring_color,
theme,
fallbackTheme = "default",
}) => {
const defaultTheme = themes[fallbackTheme];
const defaultTheme = themes["default"];
const isThemeProvided = theme !== null && theme !== undefined;

// @ts-ignore
const selectedTheme = isThemeProvided ? themes[theme] : defaultTheme;

const defaultBorderColor =
"border_color" in selectedTheme
? selectedTheme.border_color
Expand Down