-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move farcaster avatars to pinata (#1469)
* feat: move farcaster avatars to pinata on profile update * chore: restrict submit when uploading image * feat: upload farcaster image to IPFS in EditProfile * feat(EditProfilePicture): show spinner if progress is not available * refactor: extract image uploader * refactor: exclude not required fields * chore: rename uploader * cleanup(StartProfile): remove unnecessary loading condition isUploadingShown already handles it, avoiding confusion about why the button might be disabled --------- Co-authored-by: valid <[email protected]>
- Loading branch information
1 parent
81e2a2e
commit c6a1b5a
Showing
5 changed files
with
50 additions
and
27 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Uploader } from "hooks/usePinata/usePinata" | ||
|
||
export const uploadImageUrlToPinata = async ({ | ||
image, | ||
onUpload, | ||
}: { image: URL; onUpload: Uploader["onUpload"] }) => { | ||
const data = await (await fetch(image)).blob() | ||
const fileName = image.pathname.split("/").at(-1) || "unknown" | ||
onUpload({ | ||
data: [new File([data], fileName)], | ||
fileNames: [fileName], | ||
}) | ||
} |