-
Notifications
You must be signed in to change notification settings - Fork 939
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
Chore: Rewrite profile settings to server component #642
Chore: Rewrite profile settings to server component #642
Conversation
@Dhruwang is attempting to deploy a commit to the formbricks Team on Vercel. A member of the Team first needs to authorize it. |
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.
@Dhruwang thanks a lot for the PR 😊 Looks pretty good already! I made a few suggestions as comments.
The most important thing is that we get the types and services right. This is still a progress as we all learn more while using this pattern all over the whole app 😊
apps/web/app/(app)/environments/[environmentId]/settings/profile/EditProfile.tsx
Outdated
Show resolved
Hide resolved
apps/web/app/(app)/environments/[environmentId]/settings/profile/action.tsx
Outdated
Show resolved
Hide resolved
apps/web/app/(app)/environments/[environmentId]/settings/profile/action.tsx
Outdated
Show resolved
Hide resolved
…profile-setting-to-server-components
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.
LGTM!
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.
@Dhruwang thanks a lot for the PR 💪 Looks great and works as expected 🎉
I just fixed some merge conflicts and added a TProfileUpdateInput
type so we don't need to rely on prisma but our own types. Now it's ready to get merged 😊
* Chore: moved profile settings to server component * ran pnpm format * fisxed a build issue * made requested changes * made some refactors --------- Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* Chore: moved profile settings to server component * ran pnpm format * fisxed a build issue * made requested changes * made some refactors --------- Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
* Chore: moved profile settings to server component * ran pnpm format * fisxed a build issue * made requested changes * made some refactors --------- Co-authored-by: Matthias Nannt <mail@matthiasnannt.com>
What does this PR do?
Decoupled the components in EditProfile into individual ones (EditName, EditAvatar, DeleteAccount).
Added data fetching functions for profile to
packages/services/profile.ts
(getProfile, updateProfile, deleteProfile)Added types for the same to
packages/types/v1/profile.ts
Added server actions to
action.tsx
Added a skeleton loading state
Fixes 1061
Type of change
How should this be tested?
Check profile settings
Checklist
pnpm build
console.logs
git pull origin main