Skip to content

Commit fa8e1a1

Browse files
committed
update clan explorer code
1 parent 0079bc7 commit fa8e1a1

File tree

2 files changed

+3
-42
lines changed

2 files changed

+3
-42
lines changed

src/components/Card.astro

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -61,39 +61,7 @@ import "@/assets/styles/card.css";
6161
const cardContainer = document.getElementById("card-container") as HTMLElement;
6262
const searchInput = document.getElementById("searchInput") as HTMLInputElement;
6363

64-
function createKeyValuePairs(branch: Branch, query: string) {
65-
return Object.entries(branch)
66-
.filter(([key]) => ["Caste", "Gotra", "Deity"].includes(key))
67-
.map(([key, value]) => {
68-
let icon = "";
69-
switch (key) {
70-
case "Gotra":
71-
icon = "🧬";
72-
break;
73-
case "Deity":
74-
icon = "🕉";
75-
break;
76-
case "Caste":
77-
icon = "🌿";
78-
break;
79-
default:
80-
icon = "🔑";
81-
}
82-
const highlightedValue = highlightText(value?.hi || "", query);
83-
return `
84-
<p title="${key}"><span data-name="${key}" class="icon">${icon}</span> : <span>${highlightedValue}</span></p>
85-
`;
86-
})
87-
.join("");
88-
}
89-
90-
function createSurnameCards(
91-
surnames: Surname[],
92-
gotra: string,
93-
deity: string,
94-
branchName: string,
95-
query: string
96-
): string {
64+
function createSurnameCards(surnames: Surname[], query: string): string {
9765
return surnames
9866
.filter((surname): surname is Surname => surname?.hi !== undefined && surname?.en !== undefined)
9967
.map(
@@ -107,14 +75,8 @@ import "@/assets/styles/card.css";
10775
}
10876

10977
function createCardContent(branch: Branch, query: string) {
110-
const keyValueHTML = createKeyValuePairs(branch, query);
111-
const surnamesHTML = createSurnameCards(
112-
branch.Surnames,
113-
branch.Gotra.hi,
114-
branch.Deity.hi,
115-
branch.Caste.hi,
116-
query
117-
);
78+
//const keyValueHTML = createKeyValuePairs(branch, query);
79+
const surnamesHTML = createSurnameCards(branch.Surnames, query);
11880
const surnamesCount = branch.Surnames.length;
11981

12082
return `

src/pages/about.astro

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
---
22
import "@/assets/styles/about.css";
3-
import Help from "@/components/Help.astro";
43
import BaseLayout from "@/layouts/Base";
54
---
65

0 commit comments

Comments
 (0)