Skip to content

Commit

Permalink
add page for audiofeed
Browse files Browse the repository at this point in the history
  • Loading branch information
ethancedwards8 committed Dec 21, 2024
1 parent bb0ca0d commit b7eb16a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
36 changes: 36 additions & 0 deletions pages/audiofeed.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import Link from 'next/link';
import dayjs from 'dayjs';
import Head from 'next/head';
import { useState } from 'react';

import styles from '../styles/blog.module.scss';

export default function AudioFeed() {
let [link, setLink] = useState("");

async function handleSubmit(event) {
event.preventDefault();

// so i can immediately clear the link var
let tmp = link;
setLink('');

const response = await fetch(`https://api.ethancedwards.com/audiofeed/v1?link=${tmp}`, {
method: 'POST',
});
}

return (
<>
<Head>
<title>Ethan's Audio Feed</title>
</Head>

<form onSubmit={handleSubmit} method="POST">
<label for="link" className={styles.text}>Enter your address: </label>
<input type="text" name="link" value={link} onChange={(e) => setLink(e.target.value)} required/>
<input type="submit" value="Add Link" className={styles.submit} />
</form>
</>
);
}
2 changes: 1 addition & 1 deletion pages/congress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function Congress() {
<form onSubmit={handleSubmit} method="GET">
<label for="address" className={styles.text}>Enter your address: </label>
<input type="text" name="address" value={address} onChange={(e) => setAddress(e.target.value)} required/>
<input type="submit" value="Submit" />
<input type="submit" value="Search Address" className={styles.submit} />
</form>
<hr />

Expand Down
2 changes: 1 addition & 1 deletion pages/podcast.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Head from 'next/head';

import styles from '../styles/blog.module.scss';

export default function Blog({ episodes }) {
export default function Podcast({ episodes }) {

return (
<>
Expand Down

0 comments on commit b7eb16a

Please sign in to comment.