Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upgrade packages #27

Merged
merged 1 commit into from
Oct 6, 2024
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
487 changes: 190 additions & 297 deletions frontend/package-lock.json

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,21 @@
"generate:umbraco-api-client": "tsx generateUmbracoApiClient.ts"
},
"dependencies": {
"@date-fns/tz": "^1.1.2",
"@fortawesome/fontawesome-svg-core": "^6.6.0",
"@fortawesome/free-brands-svg-icons": "^6.6.0",
"@fortawesome/free-regular-svg-icons": "^6.6.0",
"@fortawesome/free-solid-svg-icons": "^6.6.0",
"@fortawesome/react-fontawesome": "^0.2.2",
"@szhsin/react-accordion": "^1.2.5",
"date-fns": "^3.6.0",
"date-fns-tz": "^3.1.3",
"next": "14.2.11",
"date-fns": "^4.1.0",
"next": "14.2.14",
"next-plausible": "^3.12.2",
"nextjs-linkedin-insight-tag": "^0.0.6",
"openapi-fetch": "^0.12.0",
"openapi-fetch": "^0.12.2",
"react": "^18",
"react-dom": "^18",
"sharp": "^0.33.5",
"sweetalert2": "^11.14.0",
"sweetalert2": "^11.14.1",
"throttle-debounce": "^5.0.2"
},
"devDependencies": {
Expand All @@ -36,13 +35,13 @@
"@types/react-dom": "^18",
"@types/throttle-debounce": "^5.0.2",
"eslint": "^8",
"eslint-config-next": "14.2.11",
"eslint-config-next": "14.2.14",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"openapi-typescript": "^6.7.6",
"postcss": "^8",
"prettier": "^3.3.3",
"tailwindcss": "^3.4.11",
"tailwindcss": "^3.4.13",
"tsx": "^4.19.1",
"typescript": "^5"
}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/api/newsletter/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export async function POST(request: Request): Promise<Response> {
list_uuids: [NEWSLETTER_LIST_ID],
}),
}).then((res) => res.json());
} catch (err) {
} catch {
return Response.json({ success: false }, { status: 500 });
}
}
Expand Down
2 changes: 0 additions & 2 deletions frontend/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import type { Metadata } from 'next';
import type { ReactNode } from 'react';
import { Source_Sans_3 } from 'next/font/google';
import PlausibleProvider from 'next-plausible';
import { LinkedInInsightTag } from 'nextjs-linkedin-insight-tag';
import { config } from '@fortawesome/fontawesome-svg-core';
import '@fortawesome/fontawesome-svg-core/styles.css';
import './globals.css';
Expand Down Expand Up @@ -40,7 +39,6 @@ export default function RootLayout({
>
{children}
<Footer />
<LinkedInInsightTag partnerId="6595308" />
</body>
</html>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/NewsletterForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function NewsletterForm() {
}).then((res) => res.json());

success = res['success'];
} catch (err) {}
} catch {}

if (!success) {
await Swal.fire({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ function getSingleGridColumnWidth(gridElement: HTMLElement) {

gridElement.appendChild(tempDiv);

gridElement.offsetHeight;

const width = tempDiv.getBoundingClientRect().width;

gridElement.removeChild(tempDiv);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Link from 'next/link';
import { NewsletterForm } from '@/components/NewsletterForm';
import type { RootPageProps } from '@/app/[conference]/page';

export interface IntroAndEmailSignupBlockProps extends RootPageProps {}
export type IntroAndEmailSignupBlockProps = RootPageProps;

export function IntroAndEmailSignupBlock({
params,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/data/parseUtcAsCst.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { parse } from 'date-fns';
import { fromZonedTime } from 'date-fns-tz';
import { CST_TZ } from '@/config';
import { TZDate } from '@date-fns/tz';

// Umbraco doesn't save dates with timezone information so we have to manually fix it
export function parseUtcAsCst(dateStr: string): Date {
const utcDate = parse(dateStr, "yyyy-MM-dd'T'HH:mm:ss'Z'", new Date());

return fromZonedTime(utcDate, CST_TZ);
return new TZDate(utcDate, CST_TZ);
}
7 changes: 4 additions & 3 deletions frontend/src/util.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { formatInTimeZone } from 'date-fns-tz';
import { format } from 'date-fns';
import { CST_TZ } from '@/config';
import { tz } from '@date-fns/tz';

export function _throw(msg: string): never {
throw msg;
Expand All @@ -12,7 +13,7 @@ export function parseUrl(urlStr?: string | null): URL | undefined {

try {
return new URL(urlStr);
} catch (e) {
} catch {
return;
}
}
Expand Down Expand Up @@ -44,7 +45,7 @@ export function splitBy<ItemType>(
}

export function formatDate(date: Date, formatStr: string): string {
return formatInTimeZone(date, CST_TZ, formatStr);
return format(date, formatStr, { in: tz(CST_TZ) });
}

export type Overwrite<T, U> = Omit<T, keyof U> & U;