Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Bulk reformats. `git config blame.ignoreRevsFile .git-blame-ignore-revs`
b13c7d4ef9f9dd3a3014901c05406046c691deec # prettier, 20 files
4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 5
Expand All @@ -20,7 +20,7 @@ updates:
update-types: [minor, patch]

- package-ecosystem: github-actions
directory: "/"
directory: '/'
schedule:
interval: weekly
open-pull-requests-limit: 3
21 changes: 21 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Build output and vendored trees — formatting these is noise.
node_modules
.next
dist
build
out
coverage
.turbo
.vercel
*.min.js
*.min.css

# Lockfiles are generated; prettier would rewrite them wholesale.
package-lock.json
pnpm-lock.yaml
yarn.lock

# Markdown is deliberately out of scope for now. Prettier rewraps prose, which
# is where it is most opinionated and least useful, and it would bury the real
# diff. Remove this line when you want docs formatted too.
*.md
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"trailingComma": "all",
"arrowParens": "always",
"endOfLine": "lf"
}
7 changes: 1 addition & 6 deletions app/api/enquiry/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,7 @@ export async function POST(request: NextRequest) {
// Log the whole enquiry, not just the failure. The send is the only copy in
// flight, so without this a bad API key silently costs him the booking —
// journald keeps it until someone can forward it by hand.
console.error(
'[enquiry] send failed:',
result.reason,
'\n',
formatEnquiry(values, locale),
);
console.error('[enquiry] send failed:', result.reason, '\n', formatEnquiry(values, locale));
return NextResponse.json({ ok: false, error: 'sendFailed' }, { status: 502 });
}

Expand Down
4 changes: 1 addition & 3 deletions app/sitemap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ import { SITE } from '@/lib/site';
* be indexed.
*/
export default function sitemap(): MetadataRoute.Sitemap {
const languages = Object.fromEntries(
LOCALES.map((l) => [HTML_LANG[l], `${SITE.url}/${l}`]),
);
const languages = Object.fromEntries(LOCALES.map((l) => [HTML_LANG[l], `${SITE.url}/${l}`]));

return LOCALES.map((locale) => ({
url: `${SITE.url}/${locale}`,
Expand Down
4 changes: 1 addition & 3 deletions components/Book.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ export function Book({ t, locale }: { t: Dictionary; locale: Locale }) {
target="_blank"
rel="noreferrer noopener"
>
<span className={`micro ${styles.n}`}>
{String(i + 1).padStart(2, '0')}
</span>
<span className={`micro ${styles.n}`}>{String(i + 1).padStart(2, '0')}</span>
<span className={styles.label}>{d.label}</span>
<span className={`micro ${styles.handle}`}>{d.handle}</span>
<span className={styles.note}>{d.note}</span>
Expand Down
27 changes: 18 additions & 9 deletions components/BookingForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ export function BookingForm({ t, locale }: { t: Dictionary; locale: Locale }) {
}
if (body.fields) setErrors(body.fields);
setState('failed');
setFailure(body.error === 'rateLimited' ? t.booking.errors.rateLimited
: body.error === 'fileTooLarge' || body.error === 'fileType'
? t.booking.errors.fileRejected
: t.booking.errors.failed);
setFailure(
body.error === 'rateLimited'
? t.booking.errors.rateLimited
: body.error === 'fileTooLarge' || body.error === 'fileType'
? t.booking.errors.fileRejected
: t.booking.errors.failed,
);
} catch {
setState('failed');
setFailure(t.booking.errors.failed);
Expand All @@ -127,10 +130,14 @@ export function BookingForm({ t, locale }: { t: Dictionary; locale: Locale }) {
<form ref={formRef} className={styles.form} onSubmit={onSubmit} noValidate>
{ENQUIRY_FIELDS.map((field) => {
const error = errors[field.id];
const hint = field.id in t.booking.hints
? t.booking.hints[field.id as keyof typeof t.booking.hints]
: undefined;
const describedBy = [hint && `${fieldId(field.id)}-hint`, error && `${fieldId(field.id)}-err`]
const hint =
field.id in t.booking.hints
? t.booking.hints[field.id as keyof typeof t.booking.hints]
: undefined;
const describedBy = [
hint && `${fieldId(field.id)}-hint`,
error && `${fieldId(field.id)}-err`,
]
.filter(Boolean)
.join(' ');

Expand Down Expand Up @@ -193,7 +200,9 @@ export function BookingForm({ t, locale }: { t: Dictionary; locale: Locale }) {
type="file"
multiple
accept={REFERENCES.accept.join(',')}
onChange={(e) => setFiles([...(e.target.files ?? [])].slice(0, REFERENCES.max).map((f) => f.name))}
onChange={(e) =>
setFiles([...(e.target.files ?? [])].slice(0, REFERENCES.max).map((f) => f.name))
}
/>
<span className={`micro ${styles.hint}`}>{t.booking.referencesHint}</span>
{files.length > 0 ? (
Expand Down
7 changes: 2 additions & 5 deletions components/Gallery.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export function Gallery({ t, works }: { t: Dictionary; works: Work[] }) {

const close = useCallback(() => setOpen(null), []);
const step = useCallback(
(dir: 1 | -1) =>
setOpen((i) => (i === null ? i : (i + dir + works.length) % works.length)),
(dir: 1 | -1) => setOpen((i) => (i === null ? i : (i + dir + works.length) % works.length)),
[works.length],
);

Expand Down Expand Up @@ -65,9 +64,7 @@ export function Gallery({ t, works }: { t: Dictionary; works: Work[] }) {
</span>

<span className={styles.meta}>
<span className={`micro ${styles.index}`}>
{String(i + 1).padStart(2, '0')}
</span>
<span className={`micro ${styles.index}`}>{String(i + 1).padStart(2, '0')}</span>
<span className={styles.title}>{work.title}</span>
<span className={`micro ${styles.placement}`}>
{work.style} / {work.placement}
Expand Down
6 changes: 1 addition & 5 deletions components/Nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@ export function Nav({ t, locale }: { t: Dictionary; locale: Locale }) {
<ul className={styles.links}>
{NAV_IDS.map((id) => (
<li key={id}>
<a
href={`#${id}`}
className={`micro ${styles.link}`}
data-active={active === id}
>
<a href={`#${id}`} className={`micro ${styles.link}`} data-active={active === id}>
{t.nav[id]}
</a>
</li>
Expand Down
4 changes: 1 addition & 3 deletions components/StickyBook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ export function StickyBook({ t }: { t: Dictionary }) {

const update = () => {
const pastHero = window.scrollY > window.innerHeight * 0.9;
const atBook = book
? book.getBoundingClientRect().top < window.innerHeight * 0.85
: false;
const atBook = book ? book.getBoundingClientRect().top < window.innerHeight * 0.85 : false;
setShown(pastHero && !atBook);
};

Expand Down
Loading