From a33c1681bd8b2470890d2780dece3fad4f46355a Mon Sep 17 00:00:00 2001 From: Rainnny7 Date: Mon, 22 Apr 2024 00:46:47 -0400 Subject: [PATCH] Add server recommendations --- Frontend/public/media/platform/bedrock.png | Bin 0 -> 2305 bytes Frontend/public/media/platform/java.png | Bin 0 -> 2978 bytes .../app/(pages)/server/[[...slug]]/page.tsx | 60 +++++++++------- .../server/server-recommendations.tsx | 66 ++++++++++++++++++ Frontend/src/app/components/ui/button.tsx | 2 +- 5 files changed, 100 insertions(+), 28 deletions(-) create mode 100644 Frontend/public/media/platform/bedrock.png create mode 100644 Frontend/public/media/platform/java.png create mode 100644 Frontend/src/app/components/server/server-recommendations.tsx diff --git a/Frontend/public/media/platform/bedrock.png b/Frontend/public/media/platform/bedrock.png new file mode 100644 index 0000000000000000000000000000000000000000..4b4feb8398f17eecfb57e4b63f76babc728a1640 GIT binary patch literal 2305 zcmV+c3I6tpP)=r3kwS$A0I|6Ff=qYMn*;~EG#fEFgG_h9v&VkDJdr>CtY1#LPA0#BO^XOK21$c zRaI3=N=igTL{Lyrb8~Zecz8QIJ0Kt+SXfv&IXO~NQfFspY;0_LdU|4FVj3D62L}fZ z4h~vcT9cEL6ciMWj*fzYf{BTVM{rDSv!F5n002F7QchC<(v#AYa&j7zanh608gY}- zQ_|AX(EtDc|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|NsC0|Ns902S*0J000NP zNklzRtea zvmtfp-C=nu1kcB}H_r$ks-e|$+v+wiP=Sz}HG&(k8J6SoPqRqj0dJlzgEwJM2#({S zdpXA9GP`{`T|fS-v~J%1Df*n�-^NG9suqgb)A_T3+VyGNeK-L-^;8;B+GEJRdJ( z&H2K{(s06Q1v)ukTmZJ9b9FwIj{hAZ$wo(Ed_GrmheO?fF#+VZC1L~QFwx!FK&DW_A>G$Abfghege1C~<Erf75 zxxbu8oL97YKt00uPIz5jPg4(Fm8XjayQcsA{eJ-O4dJQbG+eIUGA@8NoiBkFj`)2R z+hY1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%RshFXhy{Ov=yKS(M+xWaMr&|cBL(P17D`mr#JeFR6eD+5uAaFS#sS%@toso2B z{rpScuy@kJNQUlqlPrI}{pBx5Ky?3|l7bqzRuW((tMAIn2&x{))ea2{1w~O-iu&)I bgtP+yLJfN)mno(k00000NkvXXu0mjfK4mq6 literal 0 HcmV?d00001 diff --git a/Frontend/public/media/platform/java.png b/Frontend/public/media/platform/java.png new file mode 100644 index 0000000000000000000000000000000000000000..3036471e73429eec2ed4c1904d5aa9f2fc38e7fc GIT binary patch literal 2978 zcmcIm`9Bkm|DXE^p>l<6uFaTX?qlYfxeevMugTS#WA3AxOqu(RL_~>@BrGDgN|eem znGQE^xA^$}5#QJ2^?E*kc>eHwJs!^=Uaz}0R%mWc5l#RAz>P6A!k)4I{|!6S8J4vr zuK)lH88#O7#^`X1aBFotZ8;kv)Fep88;!sqBrOPXo<@o$*JUhJrIOwBujxUpqoA>_ z#(@}>vrcqDYP&0-l|kyVBKAqJSVvuRD+oki{Hm^;o3m^}z%}oDH62%=XRfLxK@N+x z3l8wL!I%L~ zfiENMWDNbK9dEr+`O-b2W8ikaCn@j3?Dv*7RDS@W9Jq?pwkT47gw-0f2RLH^%0g#BcrftHoyBvDfVHv%8UZ@T$)5J)QZDx&>2OZKm_ef~Wv%k_9UHhW%#+t*3MP8WF$6N=C(_>e< z-FS`=<9mkk16+frN@uFzon#!p$ULt2{R`^W$~t;QCzjvaklMm0EG6laEsH7kAKcgj z>Ju%p@x_htdVOyw%3Qr$QUXE`WKX+G;jyZGj@g(xh>sLkNk-*62^_yqHV;nbUkLLL zm}j=-Bil);d_R}yMWkUYez4fjEkhb>tX&&7i_6)CVRyV_v_;Xs&Ar*R=l-Gq{upUxgBAQSgWelCgLn=RlSv;BZDLAQAFc*RSLVn~aku7li zkk?f!*X}{rpg7qnA2UBL+{l;Y>6ypzuoqr+yH5Y=qXfU_2LQk?p?(sX-;q&-^|8|{ zH}>WuDktwnm6W#>Ddv*uO!JPsPEr!S-3^vUl(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$!deiCCntnpV~3 z(8T6(sBEc-*`SCB6#?U(wHu;eq>rhfSJli9O0vytE&|ep%|C4$TGx2n#l;EIOaD0k z2oira4DgjFXpX&L?`fqLG>}Ep?l0JmH9i7b+IM{Rr0iY%@^YQQ{l{u#`)syLOH4kP zFMl=V&O9fDP*vNtIQhmZfwIgc{~cR#$+xa9v7BjgHPWr5q;1~o#X<^aUjvjcp-oWV zU&pRS$1(N3VFW8|KLx>Enkz1EM`;c2<;@>{(ptfC|Eu|TRo(jQOZuu4sk-UU7$fiu z&c0f5ESm|J%Wnovy|_f>bzAG*HLO>y`F!;{2ZjLYe9WyiP(|S}b9eWr-}73jKV{jF zPJ?cm(Vfp71s!>*dK3=fKXP8YTS3qrlf<-I%pm%5azwW9eJIOhea-VzP6i9E@x~YP z$&8zSCBH2H;cU6U`;yzi9sOd}AUVx)z{U`2(+7Ooyf#Chrz7JA)K(~_%(_DTtrA7v z!1;v3O`rMXMD`cb(_PRWegQTCzhZDee{c8933{N%Wxk8w>!H`*lx6iah8zR+Gi z>v7P|Rgso!`buqceQfwwD@y48f=xJE))W@}v@_TT+|GWd7T8~Wq7j`9a(HdmTH~e@ z(wWiJbo$2nYhVY*YH{qbUN^D4AdK0i;R4W<`6;VdJVEI5>r9{bSwHXr4_k;#`NL`3 zCz}g0a^7h+nY^3;=FFPA{CrAUhtDxh->+yrY>gBszj4?_apI=kI9mC;n)a$f2+9-O65=S2aBNx`AmHc4FW60dg#) zG5qvfs2YfF%R5@>X^ZUU84EoP4G28q=U@}Me5LU=RM%@V>ipsD=Q8_@QS_&8H3d0E z)%hZwc6u`lH&{U4v#y}o_Nmqc#;y$-E?qxssk`pVL5d0UufYFWpdRDS => { // Render the page return ( -
+
-

- Server Lookup -

+ {/* Header */} +
+

+ Server Lookup +

-
- {/* Error */} - {error && ( - - - Error - {error} - - )} +
+ {/* Error */} + {error && ( + + + Error + {error} + + )} - {/* Search */} - -
- - {/* Server Result */} - {result && ( -
- + {/* Search */} +
- )} +
+ + {/* Server Result & Recommendations */} + {result ? ( +
+ +
+ ) : ( + + )}
); }; diff --git a/Frontend/src/app/components/server/server-recommendations.tsx b/Frontend/src/app/components/server/server-recommendations.tsx new file mode 100644 index 0000000..f61c2e5 --- /dev/null +++ b/Frontend/src/app/components/server/server-recommendations.tsx @@ -0,0 +1,66 @@ +import { ReactElement } from "react"; +import { cn } from "@/lib"; +import { minecrafter } from "@/font/fonts"; +import { ServerPlatform } from "restfulmc-lib"; +import { Button } from "@/components/ui/button"; +import Image from "next/image"; +import Link from "next/link"; + +/** + * The recommendations for a server. + */ +const RECOMMENDATIONS: { + [hostname: string]: ServerPlatform; +} = { + "hypixel.net": ServerPlatform.JAVA, + "cubecraft.net": ServerPlatform.JAVA, + "wildprison.net": ServerPlatform.JAVA, + "wildprison.bedrock.minehut.gg": ServerPlatform.BEDROCK, + "play.lbsg.net": ServerPlatform.BEDROCK, +}; + +/** + * The recommendations for + * a server to test. + * + * @return the recommendations jsx + */ +const ServerRecommendations = (): ReactElement => ( +
+ {/* Header */} +

+ Try A Server +

+ + {/* Recommendations */} +
+ {Object.entries(RECOMMENDATIONS).map( + ( + [hostname, platform]: [string, ServerPlatform], + index: number + ): ReactElement => ( + + + + ) + )} +
+
+); +export default ServerRecommendations; diff --git a/Frontend/src/app/components/ui/button.tsx b/Frontend/src/app/components/ui/button.tsx index 7bf9602..43b2c3c 100644 --- a/Frontend/src/app/components/ui/button.tsx +++ b/Frontend/src/app/components/ui/button.tsx @@ -14,7 +14,7 @@ const buttonVariants = cva( destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90", outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", + "border border-zinc-700 bg-transparent hover:text-accent-foreground", secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground",