mirror of
https://github.com/pheralb/svgl.git
synced 2025-12-29 08:01:36 +08:00
⚙️ Update svgs page with new data.
This commit is contained in:
@@ -2,8 +2,8 @@
|
|||||||
import type { iSVG } from '@/types/svg';
|
import type { iSVG } from '@/types/svg';
|
||||||
|
|
||||||
// Get all svgs:
|
// Get all svgs:
|
||||||
import { svgs } from '@/data/svgs';
|
import { svgsData } from '@/data';
|
||||||
const allSvgs = JSON.parse(JSON.stringify(svgs));
|
const allSvgs = JSON.parse(JSON.stringify(svgsData));
|
||||||
|
|
||||||
// Components:
|
// Components:
|
||||||
import Search from '@/components/search.svelte';
|
import Search from '@/components/search.svelte';
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
if (searchTerm.length === 0) {
|
if (searchTerm.length === 0) {
|
||||||
filteredSvgs = allSvgs.sort((a: iSVG, b: iSVG) => {
|
filteredSvgs = allSvgs.sort((a: iSVG, b: iSVG) => {
|
||||||
return b.id - a.id;
|
return b.id! - a.id!;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@
|
|||||||
// Sort by latest:
|
// Sort by latest:
|
||||||
const sortByLatest = () => {
|
const sortByLatest = () => {
|
||||||
filteredSvgs = filteredSvgs.sort((a: iSVG, b: iSVG) => {
|
filteredSvgs = filteredSvgs.sort((a: iSVG, b: iSVG) => {
|
||||||
return b.id - a.id;
|
return b.id! - a.id!;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user