feat: added hide_border

This commit is contained in:
anuraghazra 2020-07-09 20:32:34 +05:30
parent 81bcc772d2
commit a54a2a4009

View file

@ -75,7 +75,7 @@ const renderSVG = (stats, options) => {
totalPRs, totalPRs,
contributedTo, contributedTo,
} = stats; } = stats;
const { hide, show_icons } = options || {}; const { hide, show_icons, hide_border } = options || {};
const STAT_MAP = { const STAT_MAP = {
stars: ` stars: `
@ -122,7 +122,10 @@ const renderSVG = (stats, options) => {
${show_icons && "display: block"} ${show_icons && "display: block"}
} }
</style> </style>
<rect x="0.5" y="0.5" width="494" height="99%" rx="4.5" fill="#FFFEFE" stroke="#E4E2E2"/> ${
!hide_border &&
`<rect x="0.5" y="0.5" width="494" height="99%" rx="4.5" fill="#FFFEFE" stroke="#E4E2E2"/>`
}
<text x="25" y="35" class="header">${name}'s GitHub Stats</text> <text x="25" y="35" class="header">${name}'s GitHub Stats</text>
<text y="45"> <text y="45">
@ -135,7 +138,9 @@ const renderSVG = (stats, options) => {
module.exports = async (req, res) => { module.exports = async (req, res) => {
const username = req.query.username; const username = req.query.username;
const hide = req.query.hide; const hide = req.query.hide;
const hide_border = req.query.hide_border;
const show_icons = req.query.show_icons; const show_icons = req.query.show_icons;
let { let {
name, name,
totalPRs, totalPRs,
@ -156,7 +161,7 @@ module.exports = async (req, res) => {
totalPRs, totalPRs,
contributedTo, contributedTo,
}, },
{ hide: JSON.parse(hide || "[]"), show_icons } { hide: JSON.parse(hide || "[]"), show_icons, hide_border }
) )
); );
}; };