Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FET-987: new avatar uploader #785

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

FET-987: new avatar uploader #785

wants to merge 12 commits into from

Conversation

staslysak
Copy link
Collaborator

No description provided.

@staslysak staslysak requested a review from sugh01 as a code owner July 29, 2024 15:17
@staslysak staslysak changed the title Fet 987 Fet 987: new avatar uploader Jul 29, 2024
Copy link

cloudflare-workers-and-pages bot commented Jul 29, 2024

Deploying ens-app-v3 with  Cloudflare Pages  Cloudflare Pages

Latest commit: f9d6cc5
Status: ✅  Deploy successful!
Preview URL: https://546da70c.ens-app-v3.pages.dev
Branch Preview URL: https://fet-987.ens-app-v3.pages.dev

View logs


const [value, setValue] = useState<string>('')

const handleUpload = async () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an upload

setView('editor')
}

const handleConfirm = (type: AvatarViewManagerType, uri: string, display?: string) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type is not used

@@ -241,6 +241,17 @@ const ProfileEditor = ({ data = {}, transactions = [], dispatch, onDismiss }: Pr

if (isLoading || resolverStatus.isLoading || !isRecordsUpdated) return <TransactionLoader />

const handleCancel = () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

handleCancel and handleConfirm are only used in the avatar component I think. Can change the name to be specific to the avatar component e.g. handleAvatarConfirm or can just use an inline function

<AvatarViewManager
name={name}
avatarFile={avatarFile}
handleCancel={() => setModalOpen(false)}
type={_modalOption}
handleSubmit={(type: 'nft' | 'upload', uri: string, display?: string) => {
handleSubmit={(type, uri, display) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type is not used

try {
handleSubmit('manual', value, value)
} catch (e) {
console.error(e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the trycatch is unnecessary here, since we are just setting state

const endpoint = await signAndUpload({ dataURL, name })

if (endpoint) {
handleSubmit('upload', endpoint, dataURL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Type isn't used

Copy link

sonarcloud bot commented Sep 4, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants