1
0
mirror of https://github.com/barthuijgen/factorio-sites.git synced 2025-11-27 23:18:35 +02:00

change default search or newest first

This commit is contained in:
Bart Huijgen
2024-11-18 21:25:58 +01:00
committed by Bart
parent aa75bc45bd
commit f757cbf80d
2 changed files with 7 additions and 3 deletions

View File

@@ -118,7 +118,11 @@ export const BlueprintTile: React.FC<BlueprintTileProps> = ({
<Box className="block">
<div className="image">
{imageError ? (
<div>The image is not generated yet.</div>
<div
data-src={`https://storage.factorio.tools/factorio-blueprint-images/thumbnail/${blueprint.image_hash}.webp`}
>
The image is not generated yet.
</div>
) : (
<Image
loader={({ src }) => src}

View File

@@ -169,7 +169,7 @@ export const Index: NextPage<IndexProps> = ({
<Box>
<RadioGroup
onChange={(value: string) => updateSearch({ order: value })}
value={(router.query.order as string) || "favorites"}
value={(router.query.order as string) || "date"}
>
<Stack>
<Radio value="favorites">Favorites</Radio>
@@ -262,7 +262,7 @@ export const getServerSideProps = pageHandler(async ({ query }, { session }) =>
await init();
const page = Number(query.page || "1");
const perPage = Number(query["per-page"] || "20");
const order = (query["order"] as string) || "favorites";
const order = (query["order"] as string) || "date";
const _query = query.q ? String(query.q) : undefined;
const tags = query.tags ? String(query.tags).split(",") : undefined;
const entities = query.entities ? String(query.entities).split(",") : undefined;