initial commit
This commit is contained in:
commit
3e90445fab
20 changed files with 961 additions and 0 deletions
21
src/mainview/components/Clock.tsx
Normal file
21
src/mainview/components/Clock.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import React, { useEffect, useState } from "react";
|
||||
|
||||
export default function Clock() {
|
||||
const locale = "en";
|
||||
const [today, setDate] = useState(new Date());
|
||||
|
||||
useEffect(() => {
|
||||
const timer = setInterval(() => {
|
||||
setDate(new Date());
|
||||
}, 60 * 1000);
|
||||
|
||||
return () => {
|
||||
clearInterval(timer);
|
||||
};
|
||||
}, []);
|
||||
return (
|
||||
<div className="flex font-semibold gap-2 items-center">
|
||||
{today.toLocaleTimeString(locale, { hour: "numeric", minute: "numeric" })}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
23
src/mainview/components/GamepadIcon.tsx
Normal file
23
src/mainview/components/GamepadIcon.tsx
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import React from "react";
|
||||
|
||||
export default function GamepadIcon({
|
||||
platform,
|
||||
variant,
|
||||
button,
|
||||
text,
|
||||
}: {
|
||||
platform: "xbox" | "playstation" | "nintendo";
|
||||
variant: string;
|
||||
button: string;
|
||||
text?: string;
|
||||
}) {
|
||||
return (
|
||||
<div className="gamepad-button-wrapper">
|
||||
<i
|
||||
className={`gamepad-button gamepad-button-${platform} gamepad-button-${platform}--${button} gamepad-button-${platform}--variant-${variant}`}
|
||||
>
|
||||
{text}
|
||||
</i>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue