File tree Expand file tree Collapse file tree 4 files changed +32
-4
lines changed
Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change 1616 "@tailwindcss/typography" : " ^0.5.8" ,
1717 "react" : " ^18.2.0" ,
1818 "react-dom" : " ^18.2.0" ,
19+ "react-icons" : " ^5.0.1" ,
1920 "spotify-web-api-node" : " ^5.0.2"
2021 },
2122 "devDependencies" : {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ export const spotifyApi = new SpotifyWebApi({
1616
1717const App = ( ) => {
1818 const [ isConnected , setIsConnected ] = useState ( false )
19+ const [ theme , setTheme ] = useState ( false )
1920
2021 useEffect ( ( ) => {
2122 const hash = window . location . hash ;
@@ -40,8 +41,8 @@ const App = () => {
4041 }
4142
4243 return (
43- < div className = ' h-screen flex flex-col gap-10 overflow-hidden' >
44- < Header />
44+ < div className = { ` h-screen flex flex-col gap-10 overflow-hidden transition-all ${ theme && ' bg-[#001524] text-white' } ` } >
45+ < Header theme = { theme } setTheme = { setTheme } />
4546 < div className = 'h-[85%] flex flex-col gap-4 items-center justify-center' >
4647 { isConnected ? < p className = 'bg-brand sm:min-w-[40vw] max-w-[500px] min-w-[300px] flex items-center justify-center rounded text-white h-10 cursor-pointer' onClick = { logOut } > Logout</ p > : < Login /> }
4748 < GeneratePlaylist isConnected = { isConnected } logOut = { logOut } />
Original file line number Diff line number Diff line change 1- import React from 'react'
1+ import React , { useState } from 'react'
22import { Icon } from '@iconify/react'
3+ import { MdLightMode } from "react-icons/md" ;
4+ import { MdDarkMode } from "react-icons/md" ;
35
4- const Header = ( ) => {
6+ const Header = ( { theme , setTheme } ) => {
57 return (
68 < div className = 'bg-brand flex items-center justify-between p-6 text-white min-h-[5%]' >
79 < div className = 'flex flex-col' >
810 < h1 className = 'font-bold mb-[-6px] text-fmd flex items-center' > HearItFresh< Icon icon = "material-symbols:music-note-rounded" width = "20" height = "20" inline = { true } /> </ h1 >
911 < p className = 'text-fsm' > Discover Fresh Tracks that Fit Your Style</ p >
1012 </ div >
13+ < div className = "flex items-center gap-5" >
1114 < a href = 'https://www.buymeacoffee.com/dunsinCodes' target = '_blank' className = 'bg-yellow-500 h-8 w-28 text-fxs rounded-lg flex items-center justify-center cursor-pointer sm:w-40 font-semibold' >
1215 Buy Me A Coffee
1316 </ a >
17+ < div className = 'text-xl cursor-pointer' onClick = { ( ) => setTheme ( prev => ! prev ) } >
18+ { theme ? (
19+ < MdLightMode />
20+ ) : (
21+ < MdDarkMode />
22+ ) }
23+ </ div >
24+ </ div >
1425 </ div >
1526 )
1627}
You can’t perform that action at this time.
0 commit comments