dont ever buy api from the github bro
This commit is contained in:
parent
de77c0d6d8
commit
fc400b4eab
3 changed files with 50 additions and 18 deletions
|
|
@ -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,33 @@ export default function Reviews() {
|
|||
}
|
||||
|
||||
|
||||
function SingleReview(props: NeoReview) {
|
||||
return <div class="singlereview">
|
||||
<img src={`https://dp.nea.moe/avatar/${props.discordID}.png`} />
|
||||
<div class="reviewinfo">
|
||||
<div class="reviewname"> {props.global_name === null ? props.username : props.global_name} </div>
|
||||
<div class="reviewtext"> {props.reviewText}</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
export const theImager = async (id: string): Promise<string> => (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("");
|
||||
|
||||
onMount(async () => {
|
||||
const url = await theImager(props.discordID);
|
||||
setImageSrc(url);
|
||||
});
|
||||
|
||||
return (
|
||||
<div class="singlereview">
|
||||
<img
|
||||
src={imageSrc()}
|
||||
alt="User Avatar"
|
||||
style={{ "max-width": "3em", "border-radius": "30%" }}
|
||||
/>
|
||||
<div class="reviewinfo">
|
||||
<div class="reviewname">
|
||||
{props.global_name === null ? props.username : props.global_name}
|
||||
</div>
|
||||
<div class="reviewtext">{props.reviewText}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
export async function sendReview(review: string, token: string): Promise<boolean> {
|
||||
try {
|
||||
const response = await fetch(`https://api.review.exhq.dev/sendreview?review=${review}`, {
|
||||
|
|
@ -93,4 +110,4 @@ export async function sendReview(review: string, token: string): Promise<boolean
|
|||
} catch (error) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue