fixing contact form
This commit is contained in:
parent
fc59fdec9c
commit
4fc7375fa2
|
@ -30,28 +30,13 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- name: Detect package manager
|
- uses: pnpm/action-setup@v2
|
||||||
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
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: "16"
|
cache: pnpm
|
||||||
cache: ${{ steps.detect-package-manager.outputs.manager }}
|
node-version: 18
|
||||||
|
registry-url: https://registry.npmjs.org/
|
||||||
- name: Setup Pages
|
- name: Setup Pages
|
||||||
id: pages
|
id: pages
|
||||||
uses: actions/configure-pages@v1
|
uses: actions/configure-pages@v1
|
||||||
|
@ -67,10 +52,10 @@ jobs:
|
||||||
path: |
|
path: |
|
||||||
.next/cache
|
.next/cache
|
||||||
# Generate a new cache whenever packages or source files change.
|
# 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.
|
# If source files changed but packages didn't, rebuild from a prior cache.
|
||||||
restore-keys: |
|
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
|
- name: Install dependencies
|
||||||
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
|
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
|
||||||
- name: Build with Next.js
|
- name: Build with Next.js
|
||||||
|
|
|
@ -7,7 +7,7 @@ function Contact() {
|
||||||
senderName: "",
|
senderName: "",
|
||||||
email: "",
|
email: "",
|
||||||
message: "",
|
message: "",
|
||||||
topic: "",
|
subject: "",
|
||||||
});
|
});
|
||||||
const [isSubmitted, setIsSubmitted] = useState(false);
|
const [isSubmitted, setIsSubmitted] = useState(false);
|
||||||
function changeInput(evt) {
|
function changeInput(evt) {
|
||||||
|
@ -19,7 +19,7 @@ function Contact() {
|
||||||
}
|
}
|
||||||
function submitForm(evt) {
|
function submitForm(evt) {
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
axios.post("/contactme/postQuery", input);
|
axios.post("/api/contact", input);
|
||||||
setIsSubmitted(true);
|
setIsSubmitted(true);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
|
@ -41,7 +41,7 @@ function Contact() {
|
||||||
<h3>
|
<h3>
|
||||||
<strong>Email:</strong>
|
<strong>Email:</strong>
|
||||||
</h3>
|
</h3>
|
||||||
<a href="mailto:portfolio@b68.dev">
|
<a href="mailto:hi@b68.dev">
|
||||||
hi@b68.dev
|
hi@b68.dev
|
||||||
</a>
|
</a>
|
||||||
</p>
|
</p>
|
||||||
|
@ -94,7 +94,7 @@ function Contact() {
|
||||||
<br />
|
<br />
|
||||||
<input
|
<input
|
||||||
name="senderName"
|
name="senderName"
|
||||||
value={input.senderName}
|
value={input.name}
|
||||||
onChange={changeInput}
|
onChange={changeInput}
|
||||||
type="text"
|
type="text"
|
||||||
className="form-control"
|
className="form-control"
|
||||||
|
@ -103,15 +103,15 @@ function Contact() {
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="form-group">
|
<div className="form-group">
|
||||||
<label htmlFor="topic">Subject </label>
|
<label htmlFor="subject">Subject </label>
|
||||||
<br />
|
<br />
|
||||||
<input
|
<input
|
||||||
name="topic"
|
name="subject"
|
||||||
value={input.topic}
|
value={input.subject}
|
||||||
onChange={changeInput}
|
onChange={changeInput}
|
||||||
type="text"
|
type="text"
|
||||||
className="form-control"
|
className="form-control"
|
||||||
id="topic"
|
id="subject"
|
||||||
placeholder="I want to talk about..."
|
placeholder="I want to talk about..."
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
Loading…
Reference in New Issue