diff --git a/src/components/api.tsx b/src/components/api.tsx index 82d0f61..beeb473 100644 --- a/src/components/api.tsx +++ b/src/components/api.tsx @@ -21,7 +21,7 @@ export default function Reviews() { .then(response => response.json()) .then((data: Review[]) => { const promises = data.map(review => ( - fetch(`https://discordlookup.mesalytic.moe/v1/user/${review.discordID}`) + fetch(`https://dc-lookup.mono.exhq.dev/v1/user/${review.discordID}`) .then(response => response.json()) .then(user => ({ ...review, @@ -66,16 +66,34 @@ export default function Reviews() { } -function SingleReview(props: NeoReview) { - return
- -
-
{props.global_name === null ? props.username : props.global_name}
-
{props.reviewText}
-
-
-} +export const theImager = async (id: string): Promise => (await fetch(`https://dc-lookup.mono.exhq.dev/v1/user/${id}`) + .then(res => res.json()).then(data => data.avatar.link).catch(() => "https://http.cat/status/100")); + function SingleReview(props: NeoReview) { + const [imageSrc, setImageSrc] = createSignal(""); + + // Assuming the user has a discordid or some identifier in props + onMount(async () => { + const url = await theImager(props.discordID); // Fetch the avatar image URL + setImageSrc(url); // Set the avatar image URL + }); + + return ( +
+ User Avatar +
+
+ {props.global_name === null ? props.username : props.global_name} +
+
{props.reviewText}
+
+
+ ); + } export async function sendReview(review: string, token: string): Promise { try { const response = await fetch(`https://api.review.exhq.dev/sendreview?review=${review}`, { diff --git a/src/components/comps.tsx b/src/components/comps.tsx index 131d764..2c8ad51 100644 --- a/src/components/comps.tsx +++ b/src/components/comps.tsx @@ -1,3 +1,5 @@ +import { createSignal, onMount } from "solid-js"; +import { theImager } from "./api" import "./comps.css" // warning: this IS horrible code. its a joke. DO NOT try this at home because // your local senior programmer CAN and WILL hunt you down @@ -7,8 +9,25 @@ export function AdvancedBr({ count }: { count: number }) { } export function SingularOomfie({ url, discordid }: { name: string, url: string, discordid: string }) { - return LMAO IMAGINE BEING BLIND + const [imageSrc, setImageSrc] = createSignal(""); + + // Fetch the image URL when the component mounts + onMount(async () => { + const url = await theImager(discordid); + setImageSrc(url); + }); + + return ( + + LMAO IMAGINE BEING BLIND + + ); } \ No newline at end of file diff --git a/src/components/pfp.tsx b/src/components/pfp.tsx index a1b084d..78d947e 100644 --- a/src/components/pfp.tsx +++ b/src/components/pfp.tsx @@ -1,5 +1,7 @@ +import { createSignal, onMount } from "solid-js"; import HoverComponent from "./name" import "./pfp.css" +import { theImager } from "./api"; function remov() { for (let i = 0; i < document.styleSheets.length; i++) { @@ -15,36 +17,63 @@ function remov() { } export function Bdpfp() { - return
-
- LMAO IMAGINE BEING BLIND - - -
-
+ const [imageSrc, setImageSrc] = createSignal(""); + onMount(async () => { + const url = await theImager("712639419785412668"); + setImageSrc(url); + }); + + return ( +
+
+ LMAO IMAGINE BEING BLIND + Birthday Hat + +
+
+ ); } export function Normalpfp() { - return
- LMAO IMAGINE BEING BLIND { - (e.target as HTMLImageElement).animate([ - { transform: "rotateZ(0deg)" }, - { transform: "rotateZ(360deg)" }, - ], { - duration: 400, - iterations: 1, - }) - }} onClick={(e) => { - (e.target as HTMLImageElement).animate([ - { transform: "rotateY(0deg)" }, - { transform: "rotateY(360deg)" }, - ], { - duration: 150, - iterations: 1, - }) - }} /> - -
+ const [imageSrc, setImageSrc] = createSignal(""); + + onMount(async () => { + const url = await theImager("712639419785412668"); + setImageSrc(url); + }); + + return ( +
+ LMAO IMAGINE BEING BLIND { + (e.target as HTMLImageElement).animate([ + { transform: "rotateZ(0deg)" }, + { transform: "rotateZ(360deg)" }, + ], { + duration: 400, + iterations: 1, + }); + }} + onClick={(e) => { + (e.target as HTMLImageElement).animate([ + { transform: "rotateY(0deg)" }, + { transform: "rotateY(360deg)" }, + ], { + duration: 150, + iterations: 1, + }); + }} + /> + +
+ ); } \ No newline at end of file