Add color change to Join the Community!

This commit is contained in:
KingRainbow44 2023-05-12 21:49:13 -04:00
parent 8a2b860932
commit 8c0045a8d7
No known key found for this signature in database
GPG Key ID: FC2CB64B00D257BE
3 changed files with 36 additions and 1 deletions

View File

@ -86,8 +86,14 @@
}
.HomePage_Discord {
display: flex;
flex-direction: row;
border-radius: 10px;
max-height: 40px;
max-width: 150px;
height: 100%;
width: 100%;
gap: 8px;
align-self: center;
@ -98,13 +104,27 @@
height: 100%;
max-width: 44px;
max-height: 30px;
fill: #5865F2;
}
p {
font-size: 16px;
max-width: 90px;
}
}
.HomePage_Discord:hover {
cursor: pointer;
align-items: center;
justify-content: center;
max-height: 50px;
max-width: 160px;
background-color: #5865F2;
}
.HomePage_Text {
display: flex;
flex-direction: column;

View File

@ -4,6 +4,8 @@ import HomeButton from "@widgets/HomeButton";
import { ReactComponent as DiscordLogo } from "@icons/discord.svg";
import { openUrl } from "@app/utils";
import "@css/pages/HomePage.scss";
class HomePage extends React.Component<any, any> {
@ -39,7 +41,10 @@ class HomePage extends React.Component<any, any> {
<p>trademarks and copyrights of HoYoverse.</p>
</div>
<div className={"HomePage_Discord"}>
<div
className={"HomePage_Discord"}
onClick={() => openUrl("https://discord.gg/grasscutter")}
>
<DiscordLogo />
<p>Join the Community!</p>
</div>

View File

@ -144,3 +144,13 @@ export async function fetchEntityData(entity: Entity): Promise<EntityInfo> {
export async function copyToClipboard(text: string): Promise<void> {
await navigator.clipboard.writeText(text);
}
/**
* Opens a URL in a new tab.
* Uses the window.open() method.
*
* @param url The URL to open.
*/
export function openUrl(url: string): void {
window.open(url, "_blank");
}