diff --git a/src/components/Card.tsx b/src/components/Card.tsx index 18f1cb7..1e60f4d 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -1,23 +1,68 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faEnvelope } from '@fortawesome/free-regular-svg-icons' -import { faPhone } from '@fortawesome/free-solid-svg-icons' +import { faPhone, faMusic } from '@fortawesome/free-solid-svg-icons' import { faXTwitter, faDiscord, faGithub } from '@fortawesome/free-brands-svg-icons' -import NowPlaying from "./NowPlaying" +import { useState, useEffect } from 'react'; + import Logo from "./Logo" +interface NowPlaying { + album?: string + artist?: string + isPlaying: boolean + title?: string + link?: string + album_art?: string +} + export default function Card() { + const [np, setNp] = useState(); + + useEffect(() => { + fetch( + "https://vercel-spotify-api.vercel.app/api/Spotify" + ) + .then(res => res.json()) + .then(data => { + if (data) { + setNp(data) + } + }) + }) + return ( - <> +
+
-
-

- +

+ +

+ {np && np.isPlaying && +

+
+ +
+
+ {np.artist} +

{np.title}

+
+
+ }

-

{" "} @@ -46,7 +91,7 @@ export default function Card() {

- +
) } \ No newline at end of file diff --git a/src/components/Logo.tsx b/src/components/Logo.tsx index b823984..71c4444 100644 --- a/src/components/Logo.tsx +++ b/src/components/Logo.tsx @@ -5,7 +5,7 @@ export default function Logo() { id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlnsXlink="http://www.w3.org/1999/xlink" - width="100px" + width="140px" viewBox="0 0 188 127" enableBackground="new 0 0 188 127" xmlSpace="preserve" diff --git a/src/components/NowPlaying.tsx b/src/components/NowPlaying.tsx deleted file mode 100644 index 716c6a0..0000000 --- a/src/components/NowPlaying.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import { useState, useEffect } from 'react'; - -import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' -import { faMusic } from '@fortawesome/free-solid-svg-icons' - -export interface NowPlaying { - album?: string - artist?: string - isPlaying: boolean - title?: string - link?: string - album_art?: string - } - - -export default function NowPlaying() { - const [np, setNp] = useState(); - - useEffect(() => { - fetch( - "https://vercel-spotify-api.vercel.app/api/Spotify" - ) - .then(res => res.json()) - .then(data => { - if (data) { - setNp(data) - } - }) - }) - - return ( - <> - {np && np.isPlaying && -
-
- -
-
- {np.artist} -

{np.title}

-
-
- } - - ) - } - \ No newline at end of file