Skip to content

Commit 6f6b76b

Browse files
authored
Merge pull request #2 from radical-data/working
Improve UI
2 parents 6437009 + 2cba3c3 commit 6f6b76b

File tree

10 files changed

+976
-231
lines changed

10 files changed

+976
-231
lines changed

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pnpm test
1+
pnpm lint-staged

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,20 @@
2525
"@sveltejs/adapter-netlify": "^5.2.4",
2626
"@sveltejs/kit": "^2.20.3",
2727
"@sveltejs/vite-plugin-svelte": "^6.2.1",
28+
"@tailwindcss/postcss": "^4.1.17",
29+
"autoprefixer": "^10.4.22",
2830
"eslint": "^9.39.1",
2931
"eslint-config-prettier": "^10.1.8",
3032
"eslint-plugin-svelte": "^3.13.0",
3133
"globals": "^15.14.0",
3234
"husky": "^9.1.7",
3335
"lint-staged": "^16.2.7",
36+
"postcss": "^8.5.6",
3437
"prettier": "^3.4.2",
3538
"prettier-plugin-svelte": "^3.3.3",
3639
"svelte": "^5.43.6",
3740
"svelte-check": "^4.2.6",
41+
"tailwindcss": "^4.1.17",
3842
"tslib": "^2.8.1",
3943
"typescript": "^5.7.2",
4044
"typescript-eslint": "^8.46.4",

pnpm-lock.yaml

Lines changed: 481 additions & 60 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

postcss.config.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
'@tailwindcss/postcss': {},
4+
autoprefixer: {}
5+
}
6+
};

src/lib/reducer.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('reduceFeatureCollection', () => {
6666
});
6767

6868
expect(result.features).toHaveLength(1);
69-
expect(result.features[0].properties).toEqual({});
69+
expect(result.features[0]).not.toHaveProperty('properties');
7070
});
7171

7272
it('handles empty property set', () => {
@@ -92,7 +92,7 @@ describe('reduceFeatureCollection', () => {
9292
propertiesToKeep: new Set()
9393
});
9494

95-
expect(result.features[0].properties).toEqual({});
95+
expect(result.features[0]).not.toHaveProperty('properties');
9696
});
9797

9898
it('handles multiple features', () => {

src/lib/reducer.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ export function reduceFeatureCollection(
1010
fc: FeatureCollection,
1111
options: ReductionOptions
1212
): FeatureCollection {
13-
const filtered = filterProperties(fc, options.propertiesToKeep);
1413
// eslint-disable-next-line @typescript-eslint/no-explicit-any
15-
return truncate(filtered as any, { precision: options.precision });
14+
const truncated = truncate(fc as any, { precision: options.precision });
15+
return filterProperties(truncated, options.propertiesToKeep);
1616
}
1717

1818
function filterProperties(fc: FeatureCollection, propertiesToKeep: Set<string>): FeatureCollection {
@@ -26,7 +26,13 @@ function filterProperties(fc: FeatureCollection, propertiesToKeep: Set<string>):
2626
filteredProps[key] = props[key];
2727
}
2828
}
29-
return { ...feature, properties: filteredProps };
29+
// Exclude properties from the spread, then conditionally add it back
30+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
31+
const { properties, ...rest } = feature;
32+
return {
33+
...rest,
34+
...(Object.keys(filteredProps).length > 0 ? { properties: filteredProps } : {})
35+
} as typeof feature; // Type assertion to preserve intentional omission of properties
3036
})
3137
};
3238
}

src/routes/+layout.svelte

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,31 @@
22
import '../style.css';
33
</script>
44

5-
<slot />
5+
<div class="min-h-screen">
6+
<div class="mx-auto flex min-h-screen max-w-5xl flex-col gap-6 px-6 py-8">
7+
<main class="flex-1">
8+
<slot />
9+
</main>
10+
<footer class="border-t border-slate-200 pt-4 text-xs text-slate-500">
11+
Developed by
12+
<a
13+
href="https://radicaldata.org"
14+
target="_blank"
15+
rel="noopener"
16+
class="font-medium text-sky-700 hover:text-sky-800"
17+
>
18+
Radical Data
19+
</a>
20+
for our Comapping project and the rewrite of Queering the Map. For more tools and projects at the
21+
intersection of technology, art and activism, visit
22+
<a
23+
href="https://radicaldata.org"
24+
target="_blank"
25+
rel="noopener"
26+
class="font-medium text-sky-700 hover:text-sky-800"
27+
>
28+
radicaldata.org
29+
</a>.
30+
</footer>
31+
</div>
32+
</div>

0 commit comments

Comments
 (0)