-
Notifications
You must be signed in to change notification settings - Fork 154
♻️ Refactor AppBar: Convert to Server Components and remove use client directives #1380
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
Conversation
…r Components Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Updates to Preview Branch (devin/1744864520-appbar-refactoring) ↗︎
Tasks are run on every commit but only new migration files are pushed.
View logs for this Workflow Run ↗︎. |
Please write description in English |
Please convert to draft |
…g directly Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
let project: Tables<'Project'> | null = null | ||
if (projectId) { | ||
project = await getProject(projectId) | ||
} |
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.
null is not necessary
Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
let project: Tables<'Project'> | null | undefined | ||
if (projectId) { | ||
project = await getProject(projectId) | ||
} |
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.
Please delete null
@@ -40,8 +37,14 @@ export const AppBar = ({ | |||
avatarInitial = 'L', | |||
avatarColor = 'var(--avatar-background)', | |||
minimal = false, | |||
children, |
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.
children is not passed. please delete it
@@ -1,5 +1,4 @@ | |||
'use client' | |||
|
|||
import { getProject } from '@/features/projects/pages/ProjectDetailPage/getProject' |
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.
Since the columns to select are different, the getProject function for this component should be defined here
Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
try { | ||
const headersList = headers() as unknown as { | ||
get(name: string): string | null | ||
} | ||
pathname = headersList.get('x-pathname') || '' | ||
} catch (error) { | ||
console.error('Error getting pathname from headers:', error) | ||
} |
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.
Please use getPathname
console.error('Error getting pathname from headers:', error) | ||
} | ||
|
||
let extractedProjectId = projectId |
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.
projectId props doesn't need
Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
Co-Authored-By: hirotaka.miyagi@route06.co.jp <hirotaka.miyagi@route06.co.jp>
What changes does this PR introduce?
Refactoring:
PR Checklist
Screenshots
None
Additional Information
Refactoring based on PR #1361:
Link to Devin run: https://app.devin.ai/sessions/b9ad63baf00b444eb57ebad3c4e6244d
Requested by: hirotaka.miyagi@route06.co.jp