From c4e9419504f77dbe2ae6c99f9816fc34f2cfe5a8 Mon Sep 17 00:00:00 2001 From: Ansh Saini Date: Tue, 29 Oct 2024 19:36:03 +0530 Subject: [PATCH 1/3] feat: add sponsor deadline feature --- 2024/gatsby-config.js | 1 + 2024/src/gatsby-types.d.ts | 61 +++++++++++--------------------------- 2024/src/pages/index.tsx | 5 +++- 3 files changed, 22 insertions(+), 45 deletions(-) diff --git a/2024/gatsby-config.js b/2024/gatsby-config.js index 23f5c6111..e55ec9cc0 100644 --- a/2024/gatsby-config.js +++ b/2024/gatsby-config.js @@ -12,6 +12,7 @@ module.exports = { cfpFormUrl: "https://docs.google.com/forms/d/e/1FAIpQLScWYqrnSqD-CTnJX6GATU8IzTk6qKwJyXb8GOoVD70EbGXbDA/viewform", cfpDeadline: new Date("2024-10-01T00:00:00.000+0900"), + sponsorDeadline: new Date("2024-10-01T00:00:00.000+0900"), previousFiscalYear: `2023`, enableSpeakers: true, enableVenue: true, diff --git a/2024/src/gatsby-types.d.ts b/2024/src/gatsby-types.d.ts index 9ffb6c106..29a2f6003 100644 --- a/2024/src/gatsby-types.d.ts +++ b/2024/src/gatsby-types.d.ts @@ -2053,17 +2053,14 @@ type Query_membersYamlArgs = { type Query_siteArgs = { buildTime: InputMaybe; children: InputMaybe; - graphqlTypegen: InputMaybe; + graphqlTypegen: InputMaybe; host: InputMaybe; id: InputMaybe; internal: InputMaybe; - jsxRuntime: InputMaybe; parent: InputMaybe; pathPrefix: InputMaybe; - polyfill: InputMaybe; port: InputMaybe; siteMetadata: InputMaybe; - trailingSlash: InputMaybe; }; @@ -2186,17 +2183,14 @@ type Query_talksYamlArgs = { type Site = Node & { readonly buildTime: Maybe; readonly children: ReadonlyArray; - readonly graphqlTypegen: Maybe; + readonly graphqlTypegen: Maybe; readonly host: Maybe; readonly id: Scalars['ID']; readonly internal: Internal; - readonly jsxRuntime: Maybe; readonly parent: Maybe; readonly pathPrefix: Maybe; - readonly polyfill: Maybe; readonly port: Maybe; readonly siteMetadata: Maybe; - readonly trailingSlash: Maybe; }; @@ -2381,33 +2375,27 @@ type SiteEdge = { type SiteFieldSelector = { readonly buildTime: InputMaybe; readonly children: InputMaybe; - readonly graphqlTypegen: InputMaybe; + readonly graphqlTypegen: InputMaybe; readonly host: InputMaybe; readonly id: InputMaybe; readonly internal: InputMaybe; - readonly jsxRuntime: InputMaybe; readonly parent: InputMaybe; readonly pathPrefix: InputMaybe; - readonly polyfill: InputMaybe; readonly port: InputMaybe; readonly siteMetadata: InputMaybe; - readonly trailingSlash: InputMaybe; }; type SiteFilterInput = { readonly buildTime: InputMaybe; readonly children: InputMaybe; - readonly graphqlTypegen: InputMaybe; + readonly graphqlTypegen: InputMaybe; readonly host: InputMaybe; readonly id: InputMaybe; readonly internal: InputMaybe; - readonly jsxRuntime: InputMaybe; readonly parent: InputMaybe; readonly pathPrefix: InputMaybe; - readonly polyfill: InputMaybe; readonly port: InputMaybe; readonly siteMetadata: InputMaybe; - readonly trailingSlash: InputMaybe; }; type SiteFunction = Node & { @@ -2552,30 +2540,6 @@ type SiteFunctionSortInput = { readonly relativeCompiledFilePath: InputMaybe; }; -type SiteGraphqlTypegen = { - readonly documentSearchPaths: Maybe>>; - readonly generateOnBuild: Maybe; - readonly typesOutputPath: Maybe; -}; - -type SiteGraphqlTypegenFieldSelector = { - readonly documentSearchPaths: InputMaybe; - readonly generateOnBuild: InputMaybe; - readonly typesOutputPath: InputMaybe; -}; - -type SiteGraphqlTypegenFilterInput = { - readonly documentSearchPaths: InputMaybe; - readonly generateOnBuild: InputMaybe; - readonly typesOutputPath: InputMaybe; -}; - -type SiteGraphqlTypegenSortInput = { - readonly documentSearchPaths: InputMaybe; - readonly generateOnBuild: InputMaybe; - readonly typesOutputPath: InputMaybe; -}; - type SiteGroupConnection = { readonly distinct: ReadonlyArray; readonly edges: ReadonlyArray; @@ -2920,6 +2884,7 @@ type SiteSiteMetadata = { readonly enableVenue: Maybe; readonly previousFiscalYear: Maybe; readonly siteUrl: Maybe; + readonly sponsorDeadline: Maybe; readonly sponsorFormUrl: Maybe; readonly ticketUrl: Maybe; readonly title: Maybe; @@ -2942,6 +2907,14 @@ type SiteSiteMetadata_previousFiscalYearArgs = { locale: InputMaybe; }; + +type SiteSiteMetadata_sponsorDeadlineArgs = { + difference: InputMaybe; + formatString: InputMaybe; + fromNow: InputMaybe; + locale: InputMaybe; +}; + type SiteSiteMetadataFieldSelector = { readonly author: InputMaybe; readonly cfpDeadline: InputMaybe; @@ -2953,6 +2926,7 @@ type SiteSiteMetadataFieldSelector = { readonly enableVenue: InputMaybe; readonly previousFiscalYear: InputMaybe; readonly siteUrl: InputMaybe; + readonly sponsorDeadline: InputMaybe; readonly sponsorFormUrl: InputMaybe; readonly ticketUrl: InputMaybe; readonly title: InputMaybe; @@ -2970,6 +2944,7 @@ type SiteSiteMetadataFilterInput = { readonly enableVenue: InputMaybe; readonly previousFiscalYear: InputMaybe; readonly siteUrl: InputMaybe; + readonly sponsorDeadline: InputMaybe; readonly sponsorFormUrl: InputMaybe; readonly ticketUrl: InputMaybe; readonly title: InputMaybe; @@ -2987,6 +2962,7 @@ type SiteSiteMetadataSortInput = { readonly enableVenue: InputMaybe; readonly previousFiscalYear: InputMaybe; readonly siteUrl: InputMaybe; + readonly sponsorDeadline: InputMaybe; readonly sponsorFormUrl: InputMaybe; readonly ticketUrl: InputMaybe; readonly title: InputMaybe; @@ -2996,17 +2972,14 @@ type SiteSiteMetadataSortInput = { type SiteSortInput = { readonly buildTime: InputMaybe; readonly children: InputMaybe; - readonly graphqlTypegen: InputMaybe; + readonly graphqlTypegen: InputMaybe; readonly host: InputMaybe; readonly id: InputMaybe; readonly internal: InputMaybe; - readonly jsxRuntime: InputMaybe; readonly parent: InputMaybe; readonly pathPrefix: InputMaybe; - readonly polyfill: InputMaybe; readonly port: InputMaybe; readonly siteMetadata: InputMaybe; - readonly trailingSlash: InputMaybe; }; type SortOrderEnum = diff --git a/2024/src/pages/index.tsx b/2024/src/pages/index.tsx index fc7043986..fda3cfad2 100644 --- a/2024/src/pages/index.tsx +++ b/2024/src/pages/index.tsx @@ -116,6 +116,7 @@ export default function IndexPage() { sponsorFormUrl cfpFormUrl cfpDeadline + sponsorDeadline enableVenue } } @@ -200,6 +201,8 @@ export default function IndexPage() { }) const cfpOverDue = Date.now() > new Date(site.siteMetadata.cfpDeadline).getTime() + const sponsorDateOverDue = + Date.now() > new Date(site.siteMetadata.sponsorDeadline).getTime() const parts = [ { @@ -263,7 +266,7 @@ export default function IndexPage() { subTitle: t("callForSponsors"), available: site.siteMetadata.sponsorFormUrl, render: () => - false ? ( + !sponsorDateOverDue ? ( Date: Thu, 31 Oct 2024 13:44:22 +0530 Subject: [PATCH 2/3] chore: trigger build From 4f833bb6d77dced54c0e5d7c10d46e8678e5170a Mon Sep 17 00:00:00 2001 From: Ansh Saini Date: Thu, 31 Oct 2024 14:19:09 +0530 Subject: [PATCH 3/3] fix: sponsor section logic --- 2024/src/pages/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2024/src/pages/index.tsx b/2024/src/pages/index.tsx index fda3cfad2..791e86bb6 100644 --- a/2024/src/pages/index.tsx +++ b/2024/src/pages/index.tsx @@ -264,9 +264,9 @@ export default function IndexPage() { }, { subTitle: t("callForSponsors"), - available: site.siteMetadata.sponsorFormUrl, + available: !sponsorDateOverDue, render: () => - !sponsorDateOverDue ? ( + site.siteMetadata.sponsorFormUrl ? (