Commit cb0227d
authored
Fix mypage (#46)
* fix: improve onboarding redirect logic and implement logout
- Add logout functionality in MyPage component using auth store
- Optimize onboarding page redirect by using useGoals hook with loading state
- Replace window.location.href with Next.js router.replace() for better performance
- Add loading spinner during goal data fetch in onboarding
- Remove SSR/CSR conflicts by moving redirect logic to useEffect
* fix: handle Zustand hydration delay in onboarding page
- Add hydration state check to prevent premature login state evaluation
- Wait 50ms for Zustand persist data to hydrate before checking login status
- Show loading spinner during hydration process
- Add debug console logs for hydration and auth states
- Fix redirect logic to only execute after store has been properly hydrated
* fix: resolve 401 error and smooth onboarding page transitions
- Fix premature API call issue where useGoals was called before login completion
- Add error handling and retry logic for 401 authentication errors
- Use SWR mutate function to retry goals API after successful login
- Improve loading state logic to prevent flickering during page transitions
- Set shouldRetryOnError to false to prevent automatic retries on auth errors
- Show loading spinner until proper authentication and data fetching is complete
* fix: improve loading spinner visibility and eliminate page flash
- Change spinner color from border-primary-500 to border-gray-800 for better visibility on white background
- Add additional loading state for when goals exist and redirect is about to happen
- Prevent brief flash of onboarding content during page transitions
- Show consistent loading spinner during all redirect scenarios
* feat: add useCompletedGoals hook for completed goals API
- Add completedGoals query to useQuery object
- Export useCompletedGoals hook for backward compatibility
- Connect to 목표Api.getCompletedGoals endpoint
- Return CompletedGoalListRs with todo counts and result counts
- Follow existing hook patterns and naming conventions
* refactor: integrate useCompletedGoals hook in DoneItems component
- Replace mock data with real API data using useCompletedGoals hook
- Update interface to use CompletedGoalItemRs from generated API types
- Map API response fields to component display (todoCount, dueDate)
- Remove hardcoded defaultGoals array and use dynamic data
- Maintain existing UI layout and styling patterns
* refactor: clean up component formatting and remove redundant elements
- Remove redundant status bar elements from onboarding components
- Standardize code formatting with Prettier for mypage components
- Clean up whitespace and indentation inconsistencies
- Remove hardcoded status bar time displays
- Maintain consistent React component structure patterns
* feat: integrate real API data in DoneItemDetail component
- Add useGoalWithSubGoalsAndTodos hook to API hooks file
- Update DoneItemDetail to use GoalWithSubGoalTodoRs from API
- Replace mock data with real API data in done item detail page
- Map TodoRs properties to component display (date, todoResult.fileUrl)
- Fix hook naming consistency (goalWithSubGoal vs goalWithSubGoals)
- Remove hardcoded mock goal details and use dynamic data
* fix: update DoneItems statistics display and layout
- Add flex-1 to statistics spans for better layout
- Replace hardcoded 0 with actual todoResultCount for record count
* fix: improve UserProfile edit button styling and accessibility
* feat: sync TextField styling with Figma design
- Update TextField to use design tokens (Color-gray-20, Color-primary-50)
- Add proper border styling with 1px solid border
- Implement correct focus states with ring styling
- Use consistent color scheme matching Figma specifications
- Remove custom color overrides from EditProfile component
* fix: handle empty string in profile image fallback
Changed from ?? to || operator to properly handle both null/undefined and empty string values for profileImageUrl fallback to /profile-default.png
* feat: add save success toast notification to EditProfile
Added toast notification that displays "저장 되었습니다" when user clicks save button in profile edit page. Follows existing toast implementation pattern with 2-second auto-hide duration.
* feat: implement interest selection bottom sheet with Korean localization
- Created InterestSelectionBottomSheet component using vaul library following existing patterns
- Added state management for interest selection in EditProfile component
- Updated UserUpdateRqInterestsEnumToKr converter with correct API enum mappings
- Integrated Korean display for all interest chips in both bottom sheet and main interface
- Added visual feedback with selected interests display and placeholder text
- Maintained type safety with proper TypeScript integration
Interest mappings:
- HEALTH → 건강, READING → 독서, STUDY → 학업, LANGUAGE → 어학
- SPORTS → 운동, PROGRAMMING → 프로그래밍, CAREER → 취업/이직, SELF_IMPROVEMENT → 자기개발
* fix: update EditProfile component styling and functionality
* deleteAccount is not implemeneted alert
* fix: remove non-existent props from EditProfile stories
Remove initialName, initialBio, and profileImageUrl from argTypes and story args as these props don't exist in the EditProfileProps interface. The component gets data from useMyProfile hook instead.
* feat: replace point icon placeholder with money image in PointsDisplay
* fix: resolve TypeScript error in useGoalWithSubGoalTodo hook
Switch from useGoalWithSubGoals to useGoalWithSubGoalsAndTodos to access todos property on SubGoalWithTodosRs type.
* feat: implement feed page with Figma design
Add new /feed route with coming soon message and image from Figma design.
Excludes system status bar as requested.
* refactor: restructure feed page architecture and fix height issues
- Extract FeedPage component to components/feed/
- Follow group page pattern with dynamic BottomTabBar import
- Fix height calculation to prevent scrolling (calc(100vh-56px))
- Add Storybook integration for FeedPage component
- Improve component separation and maintainability
* style: update feed page styling to exactly match Figma design
- Change background from gray to white
- Remove notification button from AppBar
- Add w-full to content container for proper width
- Clean up component styling and formatting
* feat: connect MyPage interests button to EditProfile interests selection
- Update MyPage onAddInterests to navigate to /mypage/edit?openInterests=true
- Add openInterests prop to EditProfile component
- Auto-open interests bottom sheet when openInterests query param is present
* feat: implement profile image upload functionality in EditProfile
- Add file input state and ref for image selection
- Implement handleImageUpload function to process selected files
- Connect edit button to file picker with handleEditImage
- Update onSave callback to pass selected file to parent component
- Add hidden file input with image/* accept filter
* feat: add image preview for profile picture upload
- Add previewUrl state to show selected image immediately
- Update handleImageUpload to create object URL for preview
- Update img src to display preview before save
- Add URL cleanup in useEffect to prevent memory leaks
* style: remove background from profile pictures to fill full circle
- Remove gray background and padding from EditProfile profile image
- Update UserProfile to show full-size images without background
- Keep background only for placeholder icon in UserProfile
- Increase image size to fill the full 100px circle
* style: update MyPage layout to match Figma design
- Add gray background to UserProfile component with proper padding
- Update MyPage layout structure for correct background colors
- Format NavigationList component and improve hover states
- Align profile section styling with Figma specifications
* refactor: replace custom AppBar with shared AppBar component in EditProfile
- Replace custom header implementation with AppBar component
- Use AppBar type="back" with title and onBackClick handler
- Position save button as absolute overlay on right side
- Maintain consistent header height with standardized spacing
* style: update EditProfile layout to match UserProfile styling
- Replace simple profile image section with structured layout
- Add consistent background and padding to profile section
- Use same gap and spacing pattern as UserProfile component
- Maintain visual consistency between profile components
* refactor: simplify UserProfile image handling with fallback
- Remove conditional rendering for profile image
- Use fallback to default profile image when no profileImage provided
- Consistent with EditProfile approach using profile-default.png
- Simplify component logic while maintaining functionality
* feat: update API types with new message features and user deletion
- Add file metadata (fileName, fileMimeType) to TodoResultRs
- Add GoalTitleUpdatedContent and MessageReactionContent types
- Add MESSAGE_REACTION and GOAL_TITLE_UPDATE message types
- Add user deletion endpoint
- Add new goal query endpoint with all todos
- Update group exit response status code
* feat: implement user account deletion functionality
- Replace placeholder alert with actual deleteUser API call
- Add toast notification for deletion confirmation
- Add automatic logout and redirect to home after deletion
- Import required useToast and useAuthStore hooks
* implement todoResult for both completed and incompleted
* refactor: replace manual toast with useToast hook in EditProfile
* fix: wrap useSearchParams in Suspense boundary for EditProfile page
* feat: update button text based on initial interests state
* style: add cursor pointer and improve formatting in EditIcon1 parent 0cb30a3 commit cb0227d
File tree
27 files changed
+1020
-855
lines changed- api
- generated/motimo
- app
- feed
- mypage
- done/[id]
- edit
- onboarding/_components
- components
- feed
- icons
- mypage
- hooks/queries
- lib
- public/images
27 files changed
+1020
-855
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1181 | 1181 | | |
1182 | 1182 | | |
1183 | 1183 | | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
1184 | 1203 | | |
1185 | 1204 | | |
1186 | 1205 | | |
| |||
1566 | 1585 | | |
1567 | 1586 | | |
1568 | 1587 | | |
1569 | | - | |
| 1588 | + | |
1570 | 1589 | | |
1571 | 1590 | | |
1572 | 1591 | | |
| 1592 | + | |
| 1593 | + | |
| 1594 | + | |
| 1595 | + | |
| 1596 | + | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
| 1609 | + | |
| 1610 | + | |
| 1611 | + | |
1573 | 1612 | | |
1574 | 1613 | | |
1575 | 1614 | | |
1576 | 1615 | | |
1577 | 1616 | | |
1578 | 1617 | | |
1579 | 1618 | | |
1580 | | - | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
1581 | 1623 | | |
1582 | 1624 | | |
1583 | 1625 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | | - | |
| 35 | + | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
44 | 56 | | |
45 | 57 | | |
46 | 58 | | |
| |||
132 | 144 | | |
133 | 145 | | |
134 | 146 | | |
135 | | - | |
136 | | - | |
137 | | - | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
138 | 155 | | |
139 | 156 | | |
140 | 157 | | |
| |||
156 | 173 | | |
157 | 174 | | |
158 | 175 | | |
159 | | - | |
| 176 | + | |
| 177 | + | |
160 | 178 | | |
| 179 | + | |
| 180 | + | |
161 | 181 | | |
162 | 182 | | |
163 | 183 | | |
| |||
168 | 188 | | |
169 | 189 | | |
170 | 190 | | |
171 | | - | |
172 | 191 | | |
173 | 192 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | | - | |
8 | | - | |
| 8 | + | |
| 9 | + | |
9 | 10 | | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 11 | + | |
97 | 12 | | |
98 | | - | |
99 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
100 | 20 | | |
101 | | - | |
| 21 | + | |
| 22 | + | |
102 | 23 | | |
103 | | - | |
104 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
3 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
4 | 13 | | |
5 | | - | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
10 | 26 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
15 | 37 | | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
20 | 42 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | 32 | | |
41 | 33 | | |
42 | 34 | | |
| |||
0 commit comments