File tree Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Expand file tree Collapse file tree 2 files changed +34
-2
lines changed Original file line number Diff line number Diff line change 1+ 'use client' ;
2+
3+ import { useState , useEffect } from 'react' ;
4+
5+ export default function Followers ( ) {
6+ const [ goalString , setGoalString ] = useState ( '?/?' ) ;
7+
8+ useEffect ( ( ) => {
9+ fetch ( 'https://spotify-api-wrapper.appspot.com/artist/david-kando' )
10+ . then ( response => response . json ( ) )
11+ . then ( json => {
12+ console . log ( `json` , json ) ;
13+
14+ if (
15+ json
16+ && json . artists
17+ && json . artists . items
18+ && json . artists . items . length > 0
19+ ) {
20+ const followers = json . artists . items [ 0 ] . followers . total ;
21+
22+ setGoalString ( `${ followers } /?` ) ;
23+ }
24+ } )
25+ } , [ ] ) ;
26+
27+ return (
28+ < div className = "ml-[15px] lg:ml-[20px] mt-[5px]" >
29+ Follower progress: { goalString }
30+ </ div >
31+ )
32+ }
Original file line number Diff line number Diff line change 11// import Form from './email-list/form';
2- // import Followers from './followers';
2+ import Followers from './followers' ;
33
44export default function Page ( ) {
55 return (
@@ -20,7 +20,7 @@ export default function Page() {
2020 1. Support me with a follow on{ ' ' }
2121 < a className = "font-bold link" href = "https://open.spotify.com/artist/6ep6Hvwexmaa5IqcPxMxqC?si=t24Vsf6LRsKSIy5lV0wvNw" target = "_blank" > Spotify</ a > .
2222 </ div >
23- { /* <Followers /> */ }
23+ < Followers />
2424 < br />
2525 < div >
2626 2. Follow me on{ ' ' }
You can’t perform that action at this time.
0 commit comments