mirror of
https://github.com/NohamR/lanyard-profile-readme.git
synced 2026-05-26 04:17:19 +00:00
Update renderCard.tsx
This commit is contained in:
@@ -16,6 +16,7 @@ type Parameters = {
|
|||||||
hideBadges?: string;
|
hideBadges?: string;
|
||||||
hideProfile?: string;
|
hideProfile?: string;
|
||||||
hideActivity?: string;
|
hideActivity?: string;
|
||||||
|
hideSpotify?: string;
|
||||||
ignoreAppId?: string;
|
ignoreAppId?: string;
|
||||||
showDisplayName?: string;
|
showDisplayName?: string;
|
||||||
borderRadius?: string;
|
borderRadius?: string;
|
||||||
@@ -69,6 +70,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
let hideBadges = parseBool(params.hideBadges);
|
let hideBadges = parseBool(params.hideBadges);
|
||||||
let hideProfile = parseBool(params.hideProfile);
|
let hideProfile = parseBool(params.hideProfile);
|
||||||
let hideActivity = params.hideActivity ?? "false";
|
let hideActivity = params.hideActivity ?? "false";
|
||||||
|
let hideSpotify = parseBool(params.hideSpotify);
|
||||||
let ignoreAppId = parseAppId(params.ignoreAppId);
|
let ignoreAppId = parseAppId(params.ignoreAppId);
|
||||||
let hideDiscrim = parseBool(params.hideDiscrim);
|
let hideDiscrim = parseBool(params.hideDiscrim);
|
||||||
let showDisplayName = parseBool(params.showDisplayName);
|
let showDisplayName = parseBool(params.showDisplayName);
|
||||||
@@ -136,6 +138,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
if (hideProfile) return "130";
|
if (hideProfile) return "130";
|
||||||
if (hideActivity === "true") return "91";
|
if (hideActivity === "true") return "91";
|
||||||
if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "91";
|
if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "91";
|
||||||
|
if (hideSpotify && data.listening_to_spotify) return "91";
|
||||||
return "210";
|
return "210";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -144,6 +147,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
if (hideProfile) return "120";
|
if (hideProfile) return "120";
|
||||||
if (hideActivity === "true") return "81";
|
if (hideActivity === "true") return "81";
|
||||||
if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "81";
|
if (hideActivity === "whenNotUsed" && !activity && !data.listening_to_spotify) return "81";
|
||||||
|
if (hideSpotify && data.listening_to_spotify) return "81";
|
||||||
return "200";
|
return "200";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -412,7 +416,7 @@ const renderCard = async (body: LanyardTypes.Root, params: Parameters): Promise<
|
|||||||
}
|
}
|
||||||
|
|
||||||
${
|
${
|
||||||
data.listening_to_spotify && !activity && data.activities[Object.keys(data.activities).length - 1].type === 2
|
data.listening_to_spotify && !activity && !hideSpotify && data.activities[Object.keys(data.activities).length - 1].type === 2
|
||||||
? `
|
? `
|
||||||
<div style="
|
<div style="
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
Reference in New Issue
Block a user