1
0
Fork 0
This commit is contained in:
amy 2025-04-30 16:44:33 +03:30
parent add75dced1
commit 2310ba837a
No known key found for this signature in database

View file

@ -1,11 +1,10 @@
import { createSignal, onMount } from "solid-js"; import {createSignal, onMount} from "solid-js";
import { ishover } from "../App"; import {ishover} from "../App";
interface Review { interface Review {
reviewID: number; id: number;
discordID: string; reviewer: string;
reviewText: string; review: string;
timestamp: string;
} }
interface NeoReview extends Review { interface NeoReview extends Review {
@ -20,7 +19,7 @@ export default function Reviews() {
.then((response) => response.json()) .then((response) => response.json())
.then((data: Review[]) => { .then((data: Review[]) => {
const promises = data.map((review) => const promises = data.map((review) =>
fetch(`https://discord-info.api.amy.rip/v1/user/${review.discordID}`) fetch(`https://discord-info.api.amy.rip/v1/user/${review.reviewer}`)
.then((response) => response.json()) .then((response) => response.json())
.then((user) => ({ .then((user) => ({
...review, ...review,
@ -45,7 +44,7 @@ export default function Reviews() {
<h1 class="reviewheadertext">Reviews</h1> <h1 class="reviewheadertext">Reviews</h1>
<a <a
style={{ style={{
opacity: ishover() ? '100%': '0%', opacity: ishover() ? '100%' : '0%',
// visibility: !ishover() ? 'hidden' : 'visible', // visibility: !ishover() ? 'hidden' : 'visible',
}} }}
href="https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=token&redirect_uri=https%3A%2F%2Famy.rip%2Freview%2F&scope=identify" href="https://discord.com/oauth2/authorize?client_id=1208380910525743134&response_type=token&redirect_uri=https%3A%2F%2Famy.rip%2Freview%2F&scope=identify"
@ -79,7 +78,7 @@ function SingleReview(props: NeoReview) {
const [imageSrc, setImageSrc] = createSignal(""); const [imageSrc, setImageSrc] = createSignal("");
onMount(async () => { onMount(async () => {
const url = await theImager(props.discordID); const url = await theImager(String(props.reviewer));
setImageSrc(url); setImageSrc(url);
}); });
@ -88,13 +87,13 @@ function SingleReview(props: NeoReview) {
<img <img
src={imageSrc()} src={imageSrc()}
alt="User Avatar" alt="User Avatar"
style={{ "max-width": "3em", "border-radius": "30%" }} style={{"max-width": "3em", "border-radius": "30%"}}
/> />
<div class="reviewinfo"> <div class="reviewinfo">
<div class="reviewname"> <div class="reviewname">
{props.global_name === null ? props.username : props.global_name} {props.global_name === null ? props.username : props.global_name}
</div> </div>
<div class="reviewtext">{props.reviewText}</div> <div class="reviewtext">{props.review}</div>
</div> </div>
</div> </div>
); );