From d1d057cc8479e5cb81a1fb7cf9a838fce210cc2c Mon Sep 17 00:00:00 2001 From: yudejp Date: Sun, 30 May 2021 10:44:57 +0900 Subject: [PATCH] Make widget for WakaTime --- pages/components/WakaTime.js | 52 ++++++++++++++++++++++++++++++++++++ pages/profile.js | 7 +++-- 2 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 pages/components/WakaTime.js diff --git a/pages/components/WakaTime.js b/pages/components/WakaTime.js new file mode 100644 index 0000000..5f62c04 --- /dev/null +++ b/pages/components/WakaTime.js @@ -0,0 +1,52 @@ +import React, { useState, useEffect } from 'react'; +import useTranslation from 'next-translate/useTranslation' +import { faUserClock } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { useRouter } from 'next/router' + +export default function Modal() { + const [showModal, setShowModal] = React.useState(false); + const router = useRouter() + const { locale, locales, defaultLocale, pathname } = router + const { t, lang } = useTranslation("common") + const close = t('common:close') + return ( + <> + + {showModal ? ( + <> +
+
+ {/* Modal content */} +
+ {/* Modal body */} +
+
+
+ {/* Modal footer for close button */} +
+ +
+
+
+
+
+ + ) : null} + + ); +} \ No newline at end of file diff --git a/pages/profile.js b/pages/profile.js index 19cb1a9..50f07e5 100644 --- a/pages/profile.js +++ b/pages/profile.js @@ -1,7 +1,7 @@ import Layout from "./components/Layout" import useTranslation from 'next-translate/useTranslation' import { faDiscord, faTwitter, faGithub, faKeybase, faInstagram, faMastodon, faSteam } from '@fortawesome/free-brands-svg-icons' -import { faEnvelope, faBirthdayCake, faMapPin, faSchool, faPhone, faInfo, faKey, faDownload, faEye, faUserClock } from '@fortawesome/free-solid-svg-icons' +import { faEnvelope, faBirthdayCake, faMapPin, faSchool, faPhone, faInfo, faKey, faDownload, faEye } from '@fortawesome/free-solid-svg-icons' import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import Link from 'next/link' import Image from 'next/image' @@ -9,6 +9,7 @@ import DiscordStatus from './components/DiscordStatus' import { useRouter } from 'next/router' import DiscordPlaying from './components/DiscordPlaying' import Spotify from './components/Spotify' +import WakaTime from './components/WakaTime' export default function About(props) { const router = useRouter() @@ -202,9 +203,7 @@ export default function About(props) { // WakaTime }
-

WakaTime

-
-
+