fixing contact form
This commit is contained in:
parent
fc59fdec9c
commit
4fc7375fa2
|
@ -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
|
||||
|
|
|
@ -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() {
|
|||
<h3>
|
||||
<strong>Email:</strong>
|
||||
</h3>
|
||||
<a href="mailto:portfolio@b68.dev">
|
||||
<a href="mailto:hi@b68.dev">
|
||||
hi@b68.dev
|
||||
</a>
|
||||
</p>
|
||||
|
@ -94,7 +94,7 @@ function Contact() {
|
|||
<br />
|
||||
<input
|
||||
name="senderName"
|
||||
value={input.senderName}
|
||||
value={input.name}
|
||||
onChange={changeInput}
|
||||
type="text"
|
||||
className="form-control"
|
||||
|
@ -103,15 +103,15 @@ function Contact() {
|
|||
/>
|
||||
</div>
|
||||
<div className="form-group">
|
||||
<label htmlFor="topic">Subject </label>
|
||||
<label htmlFor="subject">Subject </label>
|
||||
<br />
|
||||
<input
|
||||
name="topic"
|
||||
value={input.topic}
|
||||
name="subject"
|
||||
value={input.subject}
|
||||
onChange={changeInput}
|
||||
type="text"
|
||||
className="form-control"
|
||||
id="topic"
|
||||
id="subject"
|
||||
placeholder="I want to talk about..."
|
||||
/>
|
||||
</div>
|
Loading…
Reference in New Issue