Skip to content

Commit ec9e777

Browse files
committed
[map]: update mocks folder; Indiamap SVG; githooks
1 parent 206198c commit ec9e777

File tree

13 files changed

+152
-86
lines changed

13 files changed

+152
-86
lines changed

.githooks/pre-commit

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,6 @@ echo "Running pre-commit checks for branch: $BRANCH_NAME"
2121
echo "$BRANCH_NAME" | grep -Eq '^(feature|bugfix|hotfix|task)/[A-Za-z]+-[0-9]+'
2222
if [ $? -ne 0 ]; then
2323
echo "Error: Branch name '$BRANCH_NAME' is invalid."
24-
echo "Use a valid branch naming convention, e.g., feature/XYZ-123-description."
24+
echo "Use a valid branch naming convention, e.g., feature|bugfix|hotfix|task/XYZ-123-description."
2525
exit 1
26-
fi
27-
28-
# Step 2: Run poetry linting tools
29-
echo "Running poetry linting tools..."
30-
if ! poetry run flake8 .; then
31-
echo "flake8 failed. Aborting commit."
32-
exit 1
33-
fi
34-
35-
if ! poetry run black --check .; then
36-
echo "black failed. Aborting commit."
37-
exit 1
38-
fi
39-
40-
if ! poetry run mypy .; then
41-
echo "mypy failed. Aborting commit."
42-
exit 1
43-
fi
44-
45-
echo "Pre-commit checks passed!"
46-
exit 0
26+
fi

.vscode/cspell.json

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,39 @@
77
{
88
"name": "teamMember",
99
"path": "./dictionaries/team-member.txt"
10+
},
11+
{
12+
"name": "geo",
13+
"path": "./dictionaries/india.txt"
1014
}
1115
],
12-
"dictionaries": ["projectTerms", "teamMember"],
16+
"dictionaries": [
17+
"projectTerms",
18+
"teamMember",
19+
"india"
20+
],
21+
"ignorePaths": [
22+
"**/*.svg",
23+
"src/assets/json/*.json"
24+
],
1325
"languageSettings": [
1426
{
1527
"languageId": "*",
16-
"dictionaries": ["projectTerms"]
28+
"dictionaries": [
29+
"projectTerms"
30+
]
1731
},
1832
{
1933
"languageId": "json, md",
20-
"dictionaries": ["teamMember"]
34+
"dictionaries": [
35+
"teamMember",
36+
"geo"
37+
]
2138
}
2239
],
23-
"enableFiletypes": ["astro", "jsx", "tsx"]
24-
}
40+
"enableFiletypes": [
41+
"astro",
42+
"jsx",
43+
"tsx"
44+
]
45+
}

.vscode/dictionaries/india.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Andhra
2+
Kuchipudi
3+
Pradesh
4+
Sankranti

.vscode/dictionaries/project-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
andhrapradesh
12
argmax
23
argmin
34
astro

.vscode/settings.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,25 @@
3030
"git.openRepositoryInParentFolders": "always",
3131
"typescript.updateImportsOnFileMove.enabled": "always",
3232
"editor.linkedEditing": true,
33-
"cSpell.userWords": ["nojekyll", "testid"],
33+
"cSpell.userWords": [
34+
"nojekyll",
35+
"testid"
36+
],
3437
"editor.tabSize": 2,
3538
"git.enableSmartCommit": true,
3639
"files.watcherExclude": {
3740
"**/node_modules/*/**": true
3841
},
3942
"files.autoSave": "afterDelay",
40-
"git.branchProtection": ["main", "develop"],
43+
"git.branchProtection": [
44+
"main",
45+
"develop"
46+
],
4147
"[CODEOWNERS]": {
4248
"editor.formatOnSave": false
4349
},
4450
"cSpell.words": [
51+
"behaviour",
4552
"DUMMYUSER"
4653
],
4754
"workbench.colorCustomizations": {
@@ -66,4 +73,4 @@
6673
"peacock.color": "#e05bf7",
6774
"css.format.enable": true,
6875
"css.lint.unknownAtRules": "ignore"
69-
}
76+
}

abcd.code-workspace

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"editor.inlayHints.enabled": "offUnlessPressed",
6161
"editor.insertSpaces": true,
6262
"editor.linkedEditing": true,
63-
"editor.minimap.enabled": false,
63+
"editor.minimap.enabled": true,
6464
"editor.minimap.renderCharacters": false,
6565
"editor.minimap.size": "fill",
6666
"editor.multiCursorModifier": "alt",
@@ -73,9 +73,25 @@
7373
"javascript": "javascriptreact"
7474
},
7575
"eslint.options": {
76-
"extensions": [".js", ".jsx", ".md", ".mdx", ".ts", ".tsx", ".astro"]
76+
"extensions": [
77+
".js",
78+
".jsx",
79+
".md",
80+
".mdx",
81+
".ts",
82+
".tsx",
83+
".astro"
84+
]
7785
},
78-
"eslint.validate": ["mdx", "markdown", "javascript", "javascriptreact", "typescript", "typescriptreact", "astro"],
86+
"eslint.validate": [
87+
"mdx",
88+
"markdown",
89+
"javascript",
90+
"javascriptreact",
91+
"typescript",
92+
"typescriptreact",
93+
"astro"
94+
],
7995
"explorer.compactFolders": false,
8096
"explorer.confirmDelete": false,
8197
"explorer.confirmDragAndDrop": false,
@@ -103,7 +119,10 @@
103119
},
104120
"git.autofetch": true,
105121
"git.branchPrefix": "feature/",
106-
"git.branchProtection": ["develop", "main"],
122+
"git.branchProtection": [
123+
"develop",
124+
"main"
125+
],
107126
"git.branchRandomName.enable": true,
108127
"git.confirmSync": false,
109128
"git.enableCommitSigning": false,
@@ -114,7 +133,9 @@
114133
"js/ts.implicitProjectConfig.checkJs": true,
115134
"peacock.affectSideBarBorder": true,
116135
"peacock.color": "#abcd00",
117-
"prettier.documentSelectors": ["**/*.astro"],
136+
"prettier.documentSelectors": [
137+
"**/*.astro"
138+
],
118139
"prettier.printWidth": 120,
119140
"prettier.quoteProps": "consistent",
120141
"prettier.singleQuote": false,
@@ -144,8 +165,7 @@
144165
"cSpell.words": [],
145166
"workbench.editor.limit.excludeDirty": true,
146167
"files.readonlyInclude": {
147-
".githooks/**": true,
148-
".github/**": true
168+
".githooks/**": true
149169
},
150170
"workbench.colorCustomizations": {
151171
"activityBar.activeBackground": "#d5ff01",
@@ -167,6 +187,9 @@
167187
"titleBar.inactiveBackground": "#abcd0099",
168188
"titleBar.inactiveForeground": "#15202b99",
169189
"tab.activeBorder": "#d5ff01"
190+
},
191+
"files.exclude": {
192+
"**/.git": false
170193
}
171194
}
172-
}
195+
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@
292292
"official_website": "https://mizoram.gov.in",
293293
"isActive": true
294294
},
295-
296295
{
297296
"id": "rajasthan",
298297
"state_id": 22,

src/assets/styles/map/map.css

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.container_map {
1+
.container__map {
22
display: flex;
33
justify-content: center;
44
align-items: center;
@@ -7,35 +7,36 @@
77
max-width: 1200px;
88
margin: 40px auto;
99
position: relative;
10-
}
1110

12-
svg {
13-
width: 100%;
14-
height: auto;
15-
max-width: 100%;
16-
}
1711

18-
.tooltip {
19-
position: absolute;
20-
background-color: rgba(0, 0, 0, 0.8);
21-
color: white;
22-
padding: 8px 12px;
23-
border-radius: 4px;
24-
font-size: 14px;
25-
pointer-events: none;
26-
z-index: 500;
27-
display: none;
28-
}
12+
& svg {
13+
width: 100%;
14+
height: auto;
15+
max-width: 100%;
16+
}
17+
18+
.tooltip {
19+
position: absolute;
20+
background-color: rgba(0, 0, 0, 0.8);
21+
color: white;
22+
padding: 8px 12px;
23+
border-radius: 4px;
24+
font-size: 14px;
25+
pointer-events: none;
26+
z-index: 500;
27+
display: none;
28+
}
2929

30-
path {
31-
fill: #aee38a;
32-
cursor: pointer;
33-
transition:
34-
fill 0.5s ease,
35-
transform 0.5s ease;
36-
}
30+
& path {
31+
fill: #aee38a;
32+
cursor: pointer;
33+
transition:
34+
fill 0.5s ease,
35+
transform 0.5s ease;
36+
}
3737

38-
path:hover {
39-
fill: #ffa500;
40-
transform: scale(1);
41-
}
38+
& path:hover {
39+
fill: #ffa500;
40+
transform: scale(1);
41+
}
42+
}

src/components/IndiaMap.astro

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
---
2-
import statesData from "@/assets/map/Data.json";
2+
import stateJson from "@/assets/json/state.json";
33
---
44

5-
<div class="container_map">
6-
<svg id="india-map" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1500 1800">
5+
<div class="container__map">
6+
<svg id="india-map" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1500 1800" height="90vh" width="90vw">
77
<!-- States will be loaded dynamically -->
88
</svg>
99
<div id="state-tooltip" class="tooltip"></div>
1010
</div>
1111

12-
<script define:vars={{ statesData }}>
12+
<script define:vars={{ stateJson }} is:inline>
1313
document.addEventListener("DOMContentLoaded", async () => {
1414
const indiaSvg = document.getElementById("india-map");
1515
const tooltip = document.getElementById("state-tooltip");
@@ -18,8 +18,8 @@ import statesData from "@/assets/map/Data.json";
1818
const statesGroup = document.createElementNS("http://www.w3.org/2000/svg", "g");
1919
statesGroup.setAttribute("id", "india-states");
2020

21-
for (const stateKey in statesData) {
22-
const stateInfo = statesData[stateKey];
21+
for (const stateKey in stateJson) {
22+
const stateInfo = stateJson[stateKey];
2323
try {
2424
const response = await fetch(`/map/svg/${stateInfo.svg}`);
2525
const svgText = await response.text();

src/pages/blog/[slug].astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const prerender = true;
88
99
export async function getStaticPaths() {
1010
const blogs = await getCollection("blogs");
11-
return blogs.map((entry) => ({
11+
return blogs.map((entry: any) => ({
1212
params: { slug: entry.id },
1313
props: { slug: entry.id }
1414
}));

0 commit comments

Comments
 (0)