Skip to content

Instantly share code, notes, and snippets.

View lilpolymath's full-sized avatar
:octocat:
Exploring

Favour lilpolymath

:octocat:
Exploring
View GitHub Profile
@lilpolymath
lilpolymath / hero.tsx
Created October 24, 2024 14:43
Sample demo on how to use now-playing
// all wrapped inside <SpotifyContextProvider>
const Hero = () => {
const playingDetails = useSpotify();
const [playing, setPlaying] = useState(false);
const playerRef = useRef < HTMLAudioElement > null;
const statusText = playingDetails.isPlaying ? "NOW PLAYING" : "LAST PLAYED";