From c86d5ffa96a2015470a860f3f0022c0879d1c292 Mon Sep 17 00:00:00 2001 From: Lucemans Date: Sat, 7 Oct 2023 00:19:14 +0000 Subject: [PATCH] Introduce Creeper & POAP Dismiss --- .github/.k8s/.gitignore | 1 + .github/.k8s/deploy.yaml | 5 ++++- .github/.k8s/ingress.yaml | 2 +- .github/.k8s/svc.yaml | 2 +- Makefile | 5 +++++ components/POAPModal.tsx | 24 ++++++++++++++++++++++-- hooks/useIYKRef.ts | 23 ++++++++++++++++++++++- public/creeper.svg | 17 +++++++++++++++++ 8 files changed, 73 insertions(+), 6 deletions(-) create mode 100644 .github/.k8s/.gitignore create mode 100644 Makefile create mode 100644 public/creeper.svg diff --git a/.github/.k8s/.gitignore b/.github/.k8s/.gitignore new file mode 100644 index 0000000..4a424df --- /dev/null +++ b/.github/.k8s/.gitignore @@ -0,0 +1 @@ +secret.yaml diff --git a/.github/.k8s/deploy.yaml b/.github/.k8s/deploy.yaml index 707876f..eb626e7 100644 --- a/.github/.k8s/deploy.yaml +++ b/.github/.k8s/deploy.yaml @@ -3,7 +3,7 @@ apiVersion: apps/v1 kind: Deployment metadata: name: ens-page - namespace: default + namespace: ens-page spec: replicas: 1 selector: @@ -21,3 +21,6 @@ spec: ports: - containerPort: 3000 resources: {} + envFrom: + - secretRef: + name: iyk-api-key diff --git a/.github/.k8s/ingress.yaml b/.github/.k8s/ingress.yaml index 33fd49e..9dfb327 100644 --- a/.github/.k8s/ingress.yaml +++ b/.github/.k8s/ingress.yaml @@ -3,7 +3,7 @@ apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: ens-page - namespace: default + namespace: ens-page annotations: cert-manager.io/cluster-issuer: le-http spec: diff --git a/.github/.k8s/svc.yaml b/.github/.k8s/svc.yaml index 3fbfaa5..247f85b 100644 --- a/.github/.k8s/svc.yaml +++ b/.github/.k8s/svc.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: Service metadata: name: ens-page - namespace: default + namespace: ens-page spec: ports: - port: 3000 diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ae67ff5 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ +rollout: + kubectl rollout restart -n ens-page deployments/ens-page + +status: + kubectl get pods -n ens-page -o wide diff --git a/components/POAPModal.tsx b/components/POAPModal.tsx index 0cce5a3..867bb82 100644 --- a/components/POAPModal.tsx +++ b/components/POAPModal.tsx @@ -1,6 +1,7 @@ 'use client'; -import { FC } from 'react'; +import { FC, useState } from 'react'; +import { FiX } from 'react-icons/fi'; import { IYKRefResponse as IYKReferenceResponse } from '../hooks/useIYKRef'; import { POAPMetadata } from '../hooks/usePOAPData'; @@ -10,10 +11,19 @@ export const POAPModal: FC<{ name: string; metadata: POAPMetadata; }> = ({ data, name, metadata }) => { + const [dismissed, setDismissed] = useState(false); + + if (dismissed) return; + return (
+
- Claim your POAP to show you met {name} at frENSday! + +
+ Claim your POAP to show you met {name} at frENSday! +
diff --git a/hooks/useIYKRef.ts b/hooks/useIYKRef.ts index a4aaead..ce39025 100644 --- a/hooks/useIYKRef.ts +++ b/hooks/useIYKRef.ts @@ -20,6 +20,24 @@ export type IYKRefResponse = { linkedToken: IYKLinkedToken; }; +const DEBUG_VALUE = { + uid: '1304147270046608', + isValidRef: true, + poapEvents: [ + { + id: 22_278, + poapEventId: 127_866, + otp: '7AalDLzTKE92NMLRlPquu', + status: 'expired', + }, + ], + linkedToken: { + contractAddress: '0x6b26ca239e522ac80d636aafd61d339a90ca694d', + chainId: 137, + tokenId: '12971', + }, +}; + export const useIYKRef = async (reference?: string) => { if (!reference) return; @@ -29,5 +47,8 @@ export const useIYKRef = async (reference?: string) => { if (!response.ok) return; - return (await response.json()) as IYKRefResponse; + const result: IYKRefResponse = await response.json(); + + // return DEBUG_VALUE; + return result; }; diff --git a/public/creeper.svg b/public/creeper.svg new file mode 100644 index 0000000..43a50ae --- /dev/null +++ b/public/creeper.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + +