You've already forked factorio-sites
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:
@@ -118,7 +118,11 @@ export const BlueprintTile: React.FC<BlueprintTileProps> = ({
|
|||||||
<Box className="block">
|
<Box className="block">
|
||||||
<div className="image">
|
<div className="image">
|
||||||
{imageError ? (
|
{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
|
<Image
|
||||||
loader={({ src }) => src}
|
loader={({ src }) => src}
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ export const Index: NextPage<IndexProps> = ({
|
|||||||
<Box>
|
<Box>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
onChange={(value: string) => updateSearch({ order: value })}
|
onChange={(value: string) => updateSearch({ order: value })}
|
||||||
value={(router.query.order as string) || "favorites"}
|
value={(router.query.order as string) || "date"}
|
||||||
>
|
>
|
||||||
<Stack>
|
<Stack>
|
||||||
<Radio value="favorites">Favorites</Radio>
|
<Radio value="favorites">Favorites</Radio>
|
||||||
@@ -262,7 +262,7 @@ export const getServerSideProps = pageHandler(async ({ query }, { session }) =>
|
|||||||
await init();
|
await init();
|
||||||
const page = Number(query.page || "1");
|
const page = Number(query.page || "1");
|
||||||
const perPage = Number(query["per-page"] || "20");
|
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 _query = query.q ? String(query.q) : undefined;
|
||||||
const tags = query.tags ? String(query.tags).split(",") : undefined;
|
const tags = query.tags ? String(query.tags).split(",") : undefined;
|
||||||
const entities = query.entities ? String(query.entities).split(",") : undefined;
|
const entities = query.entities ? String(query.entities).split(",") : undefined;
|
||||||
|
|||||||
Reference in New Issue
Block a user