werefox-cafe/src/info/pages/testimonials/index.js

139 lines
4.3 KiB
JavaScript

import Head from "next/head";
import WCard from "../../components/werefox-card";
import TCard from "../../components/testimonial-card";
import MS from "../../components/mutant-standard";
import axios from "axios";
// Async functions to grab user avatars server-side
export const getIcon = async ({ json, name }) =>
await axios.get(json).then(
({ data }) => [name, data["icon"]["url"]],
(error) => {
console.log(error)
return [name, null];
}
);
export const getStaticProps = async () => {
const promises = Object.entries(USERS).map(([name, { json }]) =>
getIcon({ name, json })
);
const iconUrls = await Promise.all(promises);
return {
props: {
iconUrls: iconUrls.reduce(
(acc, [name, url]) => ({ ...acc, [name]: url }),
{}
),
},
};
};
// This is where you put the testimonial users' info
const USERS = {
colabunny: {
json: "https://yiff.life/@colabunny.json",
url: "https://yiff.life/@colabunny",
content: '"please stay your jokes are funny and smart"',
},
ElfLord: {
url: "https://freedom.horse/@ElfLord",
json: "https://freedom.horse/@ElfLord.json",
content: `"Someday I'm gonna visit you in Texas, and when I get there, I'm going to realize you don't live in Texas at all, and I'm in the wrong state"`,
},
Decimal: {
url: "https://plush.city/@Decimal",
json: "https://plush.city/@Decimal.json",
content: `"I will appreciate the heck out of you any day"`
},
skelly: {
url: "https://redroo.ml/@skelly",
json: "https://redroo.ml/@skelly.json",
content: `"this an an official invitation for any one of you to put 'fuck you i dont give testimonials' as a testimonial by me on your profile"`
},
Drako_Fenris: {
url: "https://yiff.life/@Drako_Fenris",
json: "https://yiff.life/@Drako_Fenris.json",
content: `"[Alexis' future wife] lives in the ether yet to be revealed. she awaits the day her big tiddie goth gf rides in on her unicorn and rescues her."`
},
"00dani": {
url: "https://vulpine.club/@00dani",
json: "https://vulpine.club/@00dani.json",
content: `"*falls in love with you* haha whoopsies 😳"`
},
Gumby: {
url: "https://puppy.cafe/@Gumby",
json: "https://puppy.cafe/@Gumby.json",
content: `"im love alexis a lot 💚 🐀"`
},
AshBunny: {
url: "https://vulpine.club/@AshBunny",
json: "https://vulpine.club/@AshBunny.json",
content: `"heck. I don't think I can take all of this support."`
},
heatherhorns: {
url: "https://plush.city/@heatherhorns",
json: "https://plush.city/@heatherhorns.json",
content: `";~;
gpsd gosh"`
},
lindsays: {
url: "https://hackers.town/@lindsays",
json: "https://hackers.town/@lindsays.json",
content: `"She's an amazing, sweet, beautiful dork, and a spectacular best friend."`
},
};
export default function Testimonials({ iconUrls }) {
return (
<div className="min-h-screen bg-werefox-grey-lighter dark:bg-werefox-grey-dark font-nerd">
<Head>
<title>Werefox Testimonials</title>
<link rel="icon" href="/favicon.ico" />
</Head>
<div className="container space-y-4 mx-auto px-4 py-4">
<WCard
isCardButton="true"
extraClasses=""
imageObj={[
{ src: "/emoji/pixel_alexis.png", alt: "Pixel Alexis!" },
{ src: "/emoji/blue_heart.svg", alt: "Blue heart" },
]}
innerText="Take me back home!"
url="/"
/>
<WCard>
<p className="p-6 text-lg text-center text-werefox-blue-dark dark:text-werefox-blue">
Sometimes, people say some nice things about me. Here are some
examples!
</p>
</WCard>
{Object.keys(USERS).map((user) => (
<TCard
key={USERS[user].url}
src={iconUrls[user]}
alt={`${user}'s Avatar`}
url={USERS[user].url}
user={user}
innerText={USERS[user].content}
/>
))}
<WCard
isCardButton="true"
extraClasses=""
imageObj={[
{ src: "/emoji/pixel_alexis.png", alt: "Pixel Alexis!" },
{ src: "/emoji/blue_heart.svg", alt: "Blue heart" },
]}
innerText="Take me back home!"
url="/"
/>
<MS />
</div>
</div>
);
}