-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
correct error,linking,image profile, performeOME
- Loading branch information
1 parent
fd15d21
commit f307e96
Showing
12 changed files
with
121 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,4 @@ | ||
import {useEffect, useState} from "react"; | ||
import {AuthService, GHUser} from "../services/openapi"; | ||
|
||
|
||
export const ImageCreator= ({username}: {username :string}) => { | ||
const [user,setUser]=useState<GHUser>(); | ||
|
||
useEffect(() => { | ||
fetchUser() | ||
}, []); | ||
async function fetchUser(){ | ||
const ghuser=await AuthService.getUserInfo(username); | ||
setUser(ghuser); | ||
} | ||
|
||
if(user){ | ||
return( | ||
<><img src={user.avatar_url}/></> | ||
|
||
) | ||
} | ||
return( | ||
<> | ||
<span className="loading loading-ring loading-lg"></span> | ||
</>) | ||
return(<><img src={`https://github.com/${username}.png`}/></>) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.