-
Notifications
You must be signed in to change notification settings - Fork 0
refactor(ui): polish code quality across components #175
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -101,7 +101,6 @@ export default function AppleStandaloneLoginButton({ | |
|
|
||
| onSuccess?.() | ||
| } catch (error) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| console.error('Apple login error:', error) | ||
| const errorMessage = | ||
| error instanceof Error ? error.message : 'Login failed' | ||
| toast.error(`Apple login failed: ${errorMessage}`, { id: authToast }) | ||
|
|
@@ -111,9 +110,9 @@ export default function AppleStandaloneLoginButton({ | |
| } | ||
| } | ||
|
|
||
| const handleAppleError = (error: any) => { | ||
| console.error('Apple Sign-In error:', error) | ||
| toast.error(`Apple Sign-In failed: ${error?.error || 'Unknown error'}`) | ||
| const handleAppleError = (error: unknown) => { | ||
| const errorObj = error as Record<string, string> | null | ||
| toast.error(`Apple Sign-In failed: ${errorObj?.error || 'Unknown error'}`) | ||
| setIsLoading(false) | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,7 @@ const BackgroundUploadModal = ({ | |
| onClose, | ||
| onSave, | ||
| }: BackgroundUploadModalProps) => { | ||
| const [_selectedFile, setSelectedFile] = useState<File | null>(null) | ||
| const [, setSelectedFile] = useState<File | null>(null) | ||
| const [previewUrl, setPreviewUrl] = useState<string>('') | ||
| const [croppedUrl, setCroppedUrl] = useState<string>('') | ||
| const [isProcessing, setIsProcessing] = useState(false) | ||
|
|
@@ -156,12 +156,10 @@ const BackgroundUploadModal = ({ | |
| onClose() | ||
| }, [previewUrl, croppedUrl, onClose]) | ||
|
|
||
| // Mock API call function | ||
| const mockUploadBackground = useCallback( | ||
| async (imageUrl: string): Promise<void> => { | ||
| async (_imageUrl: string): Promise<void> => { | ||
| return new Promise((resolve) => { | ||
| setTimeout(() => { | ||
| console.log('Mock API: Background image uploaded:', imageUrl) | ||
| resolve() | ||
| }, 1000) | ||
| }) | ||
|
|
@@ -181,9 +179,8 @@ const BackgroundUploadModal = ({ | |
| onSave(croppedUrl) | ||
| toast.success('Background updated successfully!') | ||
| handleClose() | ||
| } catch (error) { | ||
| } catch { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| toast.error('Failed to update background') | ||
| console.error('Background upload error:', error) | ||
| } finally { | ||
| setIsProcessing(false) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -120,13 +120,14 @@ function ConfirmDialog({ | |||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||
| <> | ||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||
| <button | ||||||||||||||||||||||||||||||||||||
| ref={refs.setReference} | ||||||||||||||||||||||||||||||||||||
| type="button" | ||||||||||||||||||||||||||||||||||||
| onClick={() => setIsOpen(true)} | ||||||||||||||||||||||||||||||||||||
| className="cursor-pointer" | ||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||
| {children} | ||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||
| </button> | ||||||||||||||||||||||||||||||||||||
|
Comment on lines
+123
to
+130
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔴 Changing ConfirmDialog wrapper from The ConfirmDialog component's wrapper was changed from Both callers pass button childrenIn In Both result in Prompt for agentsWas this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+123
to
+130
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Great job on improving accessibility by replacing the
Suggested change
|
||||||||||||||||||||||||||||||||||||
| {isOpen && ( | ||||||||||||||||||||||||||||||||||||
| <FloatingPortal> | ||||||||||||||||||||||||||||||||||||
| <FloatingOverlay | ||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||
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.
While removing
console.erroraligns with the PR's goal of cleaning up console output, completely swallowing the error here removes valuable debugging information. If fetching the profile fails, we won't know why. It's better to log the error to a dedicated logging service (like Sentry, if used in the project) instead of just catching and ignoring it.