Skip to content

Commit

Permalink
Feature: Gist card: Add hide_border option support (anuraghazra#3080)
Browse files Browse the repository at this point in the history
  • Loading branch information
qwerty541 committed Dec 22, 2023
1 parent 04cf481 commit 2be2df9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions api/gist.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default async (req, res) => {
border_radius,
border_color,
show_owner,
hide_border,
} = req.query;

res.setHeader("Content-Type", "image/svg+xml");
Expand Down Expand Up @@ -72,6 +73,7 @@ export default async (req, res) => {
border_color,
locale: locale ? locale.toLowerCase() : null,
show_owner: parseBoolean(show_owner),
hide_border: parseBoolean(hide_border),
}),
);
} catch (err) {
Expand Down
2 changes: 2 additions & 0 deletions src/cards/gist-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ const renderGistCard = (gistData, options = {}) => {
border_radius,
border_color,
show_owner = false,
hide_border = false,
} = options;

// returns theme based colors with proper overrides and defaults
Expand Down Expand Up @@ -164,6 +165,7 @@ const renderGistCard = (gistData, options = {}) => {
.gray { font: 400 12px 'Segoe UI', Ubuntu, Sans-Serif; fill: ${textColor} }
.icon { fill: ${iconColor} }
`);
card.setHideBorder(hide_border);

return card.render(`
<text class="description" x="25" y="-5">
Expand Down
1 change: 1 addition & 0 deletions src/cards/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,6 @@ type WakaTimeOptions = CommonOptions & {
};

export type GistCardOptions = CommonOptions & {
hide_border: boolean;
show_owner: boolean;
};

0 comments on commit 2be2df9

Please sign in to comment.