mirror of
https://github.com/yude-jp/yude.jp
synced 2025-01-24 12:20:10 +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.",
|
"footer": "This page is licensed under the MIT License.",
|
||||||
"source": "Source code",
|
"source": "Source code",
|
||||||
"tos": "yude.jp Terms of Service",
|
"tos": "yude.jp Terms of Service"
|
||||||
"yes_playing": "Playing {{playing}}"
|
|
||||||
}
|
}
|
@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"footer": "このページは MIT License の下でライセンスされています。",
|
"footer": "このページは MIT License の下でライセンスされています。",
|
||||||
"source": "ソースコード",
|
"source": "ソースコード",
|
||||||
"tos": "yude.jp サービス利用規約",
|
"tos": "yude.jp サービス利用規約"
|
||||||
"yes_playing": "{{playing}} をプレイ中"
|
|
||||||
}
|
}
|
@ -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";
|
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 App = () => {
|
||||||
const [status, setStatus] = React.useState(0);
|
const [status, setStatus] = React.useState(0);
|
||||||
React.useEffect(() => {
|
React.useEffect(() => {
|
||||||
fetch(url)
|
fetch(url)
|
||||||
.then((r) => r.json())
|
.then((r) => r.json())
|
||||||
.then((j) => setStatus(j.members[0].status))
|
.then((j) => setStatus(j.members[15].status))
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
if (status === "online") {
|
if (status === "online") {
|
||||||
|
@ -7,7 +7,6 @@ import Link from 'next/link'
|
|||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import DiscordStatus from './components/DiscordStatus'
|
import DiscordStatus from './components/DiscordStatus'
|
||||||
import { useRouter } from 'next/router'
|
import { useRouter } from 'next/router'
|
||||||
import DiscordPlaying from './components/DiscordPlaying'
|
|
||||||
|
|
||||||
export default function About(props) {
|
export default function About(props) {
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
@ -54,7 +53,6 @@ export default function About(props) {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
<p className="text-center text-4xl subpixel-antialiased">yude</p>
|
<p className="text-center text-4xl subpixel-antialiased">yude</p>
|
||||||
<DiscordPlaying />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user