-
Notifications
You must be signed in to change notification settings - Fork 114
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
base: main
Are you sure you want to change the base?
Conversation
Deploying ens-app-v3 with Cloudflare Pages
|
|
||
const [value, setValue] = useState<string>('') | ||
|
||
const handleUpload = async () => { |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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 = () => { |
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type isn't used
Quality Gate passedIssues Measures |
No description provided.