mirror of
https://github.com/yude-jp/yude.jp
synced 2024-12-23 04:30:11 +09:00
Compare commits
No commits in common. "e2db2de68bd1b4b88b1893acf18e2c85e841adee" and "4d4483521d60de811aed3f9b957061450c495c9f" have entirely different histories.
e2db2de68b
...
4d4483521d
@ -1,6 +1,5 @@
|
||||
{
|
||||
"footer": "This page is licensed under the MIT License.",
|
||||
"source": "Source code",
|
||||
"tos": "yude.jp Terms of Service",
|
||||
"yes_playing": "Playing {{playing}}"
|
||||
"tos": "yude.jp Terms of Service"
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
{
|
||||
"footer": "このページは MIT License の下でライセンスされています。",
|
||||
"source": "ソースコード",
|
||||
"tos": "yude.jp サービス利用規約",
|
||||
"yes_playing": "{{playing}} をプレイ中"
|
||||
"tos": "yude.jp サービス利用規約"
|
||||
}
|
@ -1,27 +0,0 @@
|
||||
import React from "react";
|
||||
import useTranslation from 'next-translate/useTranslation'
|
||||
import { useRouter } from 'next/router'
|
||||
|
||||
const url = "https://discord.com/api/guilds/723409709306216498/widget.json";
|
||||
const App = () => {
|
||||
const router = useRouter()
|
||||
const { locale, locales, defaultLocale, pathname } = router
|
||||
const { t, lang } = useTranslation("common")
|
||||
|
||||
const [playing, setPlaying] = React.useState(0);
|
||||
React.useEffect(() => {
|
||||
fetch(url)
|
||||
.then((r) => r.json())
|
||||
.then((j) => setPlaying(j.members[0].game.name))
|
||||
}, []);
|
||||
|
||||
const yes_playing = t('yes_playing', {playing: playing})
|
||||
const no_playing = t('no_playing')
|
||||
if (playing){
|
||||
return <p>{yes_playing}</p>
|
||||
}else{
|
||||
return <p> </p>
|
||||
}
|
||||
};
|
||||
|
||||
export default App;
|
@ -1,12 +1,12 @@
|
||||
import React from "react";
|
||||
|
||||
const url = "https://discord.com/api/guilds/723409709306216498/widget.json";
|
||||
const url = "https://discordapp.com/api/guilds/550309736214691840/widget.json";
|
||||
const App = () => {
|
||||
const [status, setStatus] = React.useState(0);
|
||||
React.useEffect(() => {
|
||||
fetch(url)
|
||||
.then((r) => r.json())
|
||||
.then((j) => setStatus(j.members[0].status))
|
||||
.then((j) => setStatus(j.members[15].status))
|
||||
}, []);
|
||||
|
||||
if (status === "online") {
|
||||
|
@ -7,7 +7,6 @@ import Link from 'next/link'
|
||||
import Image from 'next/image'
|
||||
import DiscordStatus from './components/DiscordStatus'
|
||||
import { useRouter } from 'next/router'
|
||||
import DiscordPlaying from './components/DiscordPlaying'
|
||||
|
||||
export default function About(props) {
|
||||
const router = useRouter()
|
||||
@ -54,7 +53,6 @@ export default function About(props) {
|
||||
/>
|
||||
|
||||
<p className="text-center text-4xl subpixel-antialiased">yude</p>
|
||||
<DiscordPlaying />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user