From 4fc7375fa22ca959fa6483b9b50ccb670656457b Mon Sep 17 00:00:00 2001 From: "Jyotirmoy Bandyopadhyaya [Bravo68]" Date: Wed, 6 Dec 2023 15:26:32 +0530 Subject: [PATCH] fixing contact form --- .github/workflows/gh-pages.yml | 27 ++++++-------------------- components/{contact.js => contact.jsx} | 16 +++++++-------- 2 files changed, 14 insertions(+), 29 deletions(-) rename components/{contact.js => contact.jsx} (92%) diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index b115eaf..62e49d8 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -30,28 +30,13 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Detect package manager - id: detect-package-manager - run: | - if [ -f "${{ github.workspace }}/yarn.lock" ]; then - echo "::set-output name=manager::yarn" - echo "::set-output name=command::install" - echo "::set-output name=runner::yarn" - exit 0 - elif [ -f "${{ github.workspace }}/package.json" ]; then - echo "::set-output name=manager::npm" - echo "::set-output name=command::ci" - echo "::set-output name=runner::npx --no-install" - exit 0 - else - echo "Unable to determine packager manager" - exit 1 - fi + - uses: pnpm/action-setup@v2 - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "16" - cache: ${{ steps.detect-package-manager.outputs.manager }} + cache: pnpm + node-version: 18 + registry-url: https://registry.npmjs.org/ - name: Setup Pages id: pages uses: actions/configure-pages@v1 @@ -67,10 +52,10 @@ jobs: path: | .next/cache # Generate a new cache whenever packages or source files change. - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} # If source files changed but packages didn't, rebuild from a prior cache. restore-keys: | - ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock', '**/pnpm-lock.yaml') }}- - name: Install dependencies run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }} - name: Build with Next.js diff --git a/components/contact.js b/components/contact.jsx similarity index 92% rename from components/contact.js rename to components/contact.jsx index ea42dd6..13e328c 100644 --- a/components/contact.js +++ b/components/contact.jsx @@ -7,7 +7,7 @@ function Contact() { senderName: "", email: "", message: "", - topic: "", + subject: "", }); const [isSubmitted, setIsSubmitted] = useState(false); function changeInput(evt) { @@ -19,7 +19,7 @@ function Contact() { } function submitForm(evt) { evt.preventDefault(); - axios.post("/contactme/postQuery", input); + axios.post("/api/contact", input); setIsSubmitted(true); } return ( @@ -41,7 +41,7 @@ function Contact() {

Email:

- + hi@b68.dev

@@ -94,7 +94,7 @@ function Contact() {
- +