Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bortoz committed Sep 3, 2024
1 parent f34e451 commit 7713fe9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion frontend/app/contestant/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export async function generateMetadata({ params: { id } }: Props): Promise<Metad
const user = await getUser(id);
return {
title: `OII Stats - ${user.contestant.first_name ?? ""} ${user.contestant.last_name}`,
description: `Statistiche e classifiche dell'edizione di ${user.contestant.first_name ?? ""} ${user.contestant.last_name} alle Olimpiadi Italiane di Informatica`,
description: `Statistiche di ${user.contestant.first_name ?? ""} ${user.contestant.last_name} alle Olimpiadi Italiane di Informatica`,
};
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/biome.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"files": {
"include": ["app", "components", "lib"]
"include": ["app", "components", "lib", "webpack"]
},
"vcs": {
"enabled": true,
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export function Search() {
<SearchIcon />
</button>
</form>
<Link href="/search" className="btn btn-ghost lg:hidden">
<Link href="/search" className="btn btn-ghost lg:hidden" aria-label="Cerca">
<SearchIcon />
</Link>
</>
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export function Table({ className, children }: { className?: string; children: R
<div className="max-xl:w-screen max-xl:-translate-x-4 max-xl:overflow-x-auto max-xl:px-4">
<div
className={clsx(
"grid min-w-fit items-center gap-x-4 gap-y-2 text-nowrap rounded-box bg-base-200 p-4",
"grid min-w-fit items-center gap-x-4 gap-y-2 text-nowrap rounded-box border border-base-content/10 bg-base-200 shadow-xl p-4",
className,
)}>
{children}
Expand Down
2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"lint": "yarn biome check --write"
"lint": "biome check --write"
},
"dependencies": {
"@olinfo/react-components": "^0.4",
Expand Down
20 changes: 10 additions & 10 deletions frontend/webpack/image-loader.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { join, extname } from "node:path";
import { extname, join } from "node:path";

import sizeOf from "image-size";
import { interpolateName } from "loader-utils";
import sharp from "sharp";
import sizeOf from "image-size";

/**
* @this {import("webpack").loader.LoaderContext}
Expand All @@ -29,11 +29,13 @@ export default async function imageLoader(source) {

if (!isDev && (width || height)) {
const [_1x, _2x, _3x] = await Promise.all(
[1, 2, 3].map((factor) => optimizeImage(this, {
width: width && factor * width,
height: height && factor * height,
fit,
}))
[1, 2, 3].map((factor) =>
optimizeImage(this, {
width: width && factor * width,
height: height && factor * height,
fit,
}),
),
);
image = _1x;
image.srcSet = `${_1x.src} 1x, ${_2x.src} 2x, ${_3x.src} 3x`;
Expand Down Expand Up @@ -64,9 +66,7 @@ function emitFile(ctx, name, data) {
const { compilerType, isDev } = ctx.getOptions();

const fileName = interpolateName(ctx, name, { content: data });
const outputPath = compilerType === "client"
? fileName
: join("..", isDev ? "" : "..", fileName);
const outputPath = compilerType === "client" ? fileName : join("..", isDev ? "" : "..", fileName);
ctx.emitFile(outputPath, data);

return join("/_next", fileName);
Expand Down

0 comments on commit 7713fe9

Please sign in to comment.