From 29312048df003935c6abe20f0b7afcb30f50da1b Mon Sep 17 00:00:00 2001 From: skidoodle Date: Sat, 2 Apr 2022 23:50:59 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/Icon.tsx | 5 ++--- components/Time.tsx | 4 ++-- components/Weather.tsx | 23 ++++++++++++----------- package.json | 9 +++------ pages/_app.tsx | 9 --------- pages/index.tsx | 13 ++++++++----- styles/Home.module.scss | 9 +++++---- yarn.lock | 5 +++++ 8 files changed, 37 insertions(+), 40 deletions(-) diff --git a/components/Icon.tsx b/components/Icon.tsx index 287d04d..0a8d167 100644 --- a/components/Icon.tsx +++ b/components/Icon.tsx @@ -1,4 +1,3 @@ -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import toast, { Toaster } from 'react-hot-toast'; import copy from 'copy-to-clipboard' @@ -8,11 +7,11 @@ const Icon = ({icon, reference, copy = false} : {icon: any, reference: any, copy { copy ? ( doThings(reference)}> - + {icon} ) : ( - + {icon} ) } diff --git a/components/Time.tsx b/components/Time.tsx index b4d4da5..ec9229e 100644 --- a/components/Time.tsx +++ b/components/Time.tsx @@ -1,4 +1,4 @@ -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' +import { FaClock } from 'react-icons/fa'; import { useEffect, useState } from 'react' import styles from 'styles/Home.module.scss' @@ -14,7 +14,7 @@ const Timer = () => { return(
-

{date.toLocaleDateString('en-GB', { dateStyle: 'short' }) + ' • ' + date.toLocaleTimeString('en-GB', { timeStyle: 'medium', hour12: true, timeZone: 'Europe/Budapest'}).toUpperCase()}

+

{date.toLocaleDateString('en-GB', { dateStyle: 'short' }) + ' • ' + date.toLocaleTimeString('en-GB', { timeStyle: 'medium', hour12: true, timeZone: 'Europe/Budapest'}).toUpperCase()}

) } diff --git a/components/Weather.tsx b/components/Weather.tsx index e139044..69c25c4 100644 --- a/components/Weather.tsx +++ b/components/Weather.tsx @@ -1,25 +1,26 @@ -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import styles from 'styles/Home.module.scss' +import { FaSun, FaMoon, FaCloudSun, FaCloudMoon, FaCloud, FaCloudShowersHeavy } from 'react-icons/fa' +import { BsCloudDrizzleFill, BsCloudsFill, BsCloudLightningFill, BsCloudSnowFill, BsCloudFogFill } from 'react-icons/bs' const Weather = ({data}: {data: any}) => { const { temp: temperature } = data.main const { icon: weatherIcon, description: weatherDescription} = data.weather[0] const icons: any = { - _01d: ['fas', 'sun'], _01n: ['fas', 'moon'], - _02d: ['fas', 'cloud-sun'], _02n: ['fas', 'cloud-moon'], - _03d: ['fas', 'cloud'], _03n: ['fas', 'cloud'], - _04d: ['fas', 'clouds'], _04n: ['fas', 'clouds'], - _09d: ['fas', 'cloud-drizzle'], _09n: ['fas', 'cloud-drizzle'], - _10d: ['fas', 'cloud-showers-heavy'], _10n: ['fas', 'cloud-showers-heavy'], - _11d: ['fas', 'cloud-bolt-sun'], _11n: ['fas', 'cloud-bolt-moon'], - _13d: ['fas', 'snow-flake'], _13n: ['fas', 'snow-flake'], - _50d: ['fas', 'cloud-fog'], _50n: ['fas', 'cloud-fog'] + _01d: , _01n: , + _02d: , _02n: , + _03d: , _03n: , + _04d: , _04n: , + _09d: , _09n: , + _10d: , _10n: , + _11d: , _11n: , + _13d: , _13n: , + _50d: , _50n: } return (
-

It's currently {parseInt(temperature)} °C ({weatherDescription}) in Budapest

+ {icons[`_${weatherIcon}`]}

It's currently {parseInt(temperature)} °C ({weatherDescription}) in Budapest

) } diff --git a/package.json b/package.json index 8629ff6..e977283 100644 --- a/package.json +++ b/package.json @@ -9,18 +9,15 @@ "lint": "next lint" }, "dependencies": { - "@fortawesome/fontawesome-svg-core": "^6.1.1", - "@fortawesome/free-brands-svg-icons": "^6.1.1", - "@fortawesome/free-solid-svg-icons": "^6.1.1", - "@fortawesome/react-fontawesome": "^0.1.18", "@swc/core": "^1.2.160", "copy-to-clipboard": "^3.3.1", + "csstype": "^3.0.10", + "goober": "2.1.8", "next": "12.1.1", "react": "17.0.2", "react-dom": "17.0.2", "react-hot-toast": "^2.2.0", - "goober": "2.1.8", - "csstype": "^3.0.10", + "react-icons": "^4.3.1", "sass": "^1.49.9", "use-last-fm": "^0.6.1" }, diff --git a/pages/_app.tsx b/pages/_app.tsx index 0b67a12..cbf1382 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,14 +1,5 @@ -import { fas } from '@fortawesome/free-solid-svg-icons'; -import { fab } from '@fortawesome/free-brands-svg-icons'; -import { config, library } from '@fortawesome/fontawesome-svg-core'; - import type { AppProps } from 'next/app' - import 'styles/globals.scss' -import '@fortawesome/fontawesome-svg-core/styles.css' - -library.add(fab, fas) -config.autoAddCss = false const MyApp = ({ Component, pageProps }: AppProps) => { return diff --git a/pages/index.tsx b/pages/index.tsx index bf141a0..1ef5c9e 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -8,6 +8,9 @@ import MainLayout from 'components/MainLayout' import Spotify from 'components/Spotify' import Time from 'components/Time' import Weather from 'components/Weather' +import { FaSteam, FaGithub, FaEnvelope } from 'react-icons/fa' +import { RiInstagramFill } from 'react-icons/ri' +import { SiDiscord } from 'react-icons/si' const Home = ({data}: any) => { return( @@ -18,11 +21,11 @@ const Home = ({data}: any) => { - - - - - + } reference={'https://github.com/skidoodle'} copy={false} /> + } reference={'https://steamcommunity.com/id/_albert'} copy={false} /> + } reference={'hello@albrt.hu'} copy={true} /> + } reference={'https://instagram.com/albertadam_'} copy={false} /> + } reference={'albert#8838'} copy={true} />