-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: create settiing page Signed-off-by: neil <[email protected]> * feat: profile setting page Signed-off-by: neil <[email protected]> * feat: settings page Signed-off-by: neil <[email protected]> * feat: add pages Signed-off-by: neil <[email protected]> * feat: fetch user info * feat: auth redirect Signed-off-by: neil <[email protected]> * feat: login page Signed-off-by: neil <[email protected]> * feat: user profile update Signed-off-by: neil <[email protected]> * feat: userinfo loading Signed-off-by: neil <[email protected]> --------- Signed-off-by: neil <[email protected]>
- Loading branch information
Showing
49 changed files
with
1,479 additions
and
320 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"profile": { | ||
"avatar": "Avatar", | ||
"userinfo": "Profile", | ||
"account_settings": "Account Settings", | ||
"form": { | ||
"name": "name", | ||
"name_placeholder": "Please enter your name", | ||
"email": "email", | ||
"email_ques_icon": "The email is used to receive project update notifications.", | ||
"email_placeholder": "Please enter your email address", | ||
"error_require": "{{field}} is a required field", | ||
"error_name_max_len": "nickname cannot exceed {{length}} characters", | ||
"error_email_format": "email format is incorrect" | ||
}, | ||
"connected_accounts": "Connected Accounts", | ||
"connected": "Connected", | ||
"disconnect": "Disconnect", | ||
"connect_multiple_accounts_to_your_user_and_sign_in": "Connect multiple accounts to your user and sign in with any of them", | ||
"delete_account": "Delete account", | ||
"delete_account_btn": "Delete account", | ||
"delete_account_warning": " Once you delete your account, there is no going back. Please be certain when taking this action.", | ||
"can_be_used_to_submit_project_after_binding": "Can be used to submit project after binding", | ||
"verified": "Verified", | ||
"unverified_yet": "Unverified yet,", | ||
"resend_verification_email": "resend verification email" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
{ | ||
"profile": { | ||
"avatar": "头像", | ||
"userinfo": "用户信息", | ||
"account_settings": "账号设置", | ||
"form": { | ||
"name": "昵称", | ||
"name_placeholder": "请输入昵称", | ||
"email": "邮箱", | ||
"email_ques_icon": "该电子邮件用于接收项目更新通知", | ||
"email_placeholder": "请输入邮箱地址", | ||
"error_require": "{{field}}不能为空", | ||
"error_name_max_len": "昵称长度不能超过{{length}}", | ||
"error_email_format": "邮件格式不正确" | ||
}, | ||
"connected_accounts": "第三方绑定", | ||
"connected": "绑定", | ||
"disconnect": "解绑", | ||
"connect_multiple_accounts_to_your_user_and_sign_in": "绑定第三方账号,即可使用任何一个账户进行登录。", | ||
"delete_account": "删除账号", | ||
"delete_account_btn": "删除我的账号", | ||
"delete_account_warning": "删除账户后,就无法进行撤销。在执行此操作时,请确保您已经仔细考虑过。", | ||
"can_be_used_to_submit_project_after_binding": "绑定后可用于提交项目", | ||
"verified": "已验证", | ||
"unverified_yet": "未验证,", | ||
"resend_verification_email": "发送验证邮件" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import React from 'react'; | ||
import Link from 'next/link'; | ||
import { useRouter } from 'next/router'; | ||
import Image from 'next/image'; | ||
import { AiOutlineUser } from 'react-icons/ai'; | ||
import { MdOutlineLogout } from 'react-icons/md'; | ||
import client from '@graphql/client'; | ||
import { useSignOutMutation } from '@graphql/generated'; | ||
import { resetUserInfo } from '@modules/auth/UserInfoStore'; | ||
import { useTranslation } from 'react-i18next'; | ||
import useProviderInfo from '@modules/auth/useProviderInfo'; | ||
|
||
const User = () => { | ||
const { t } = useTranslation(); | ||
const router = useRouter(); | ||
const mutation = useSignOutMutation(client); | ||
const { providerUser: user } = useProviderInfo(); | ||
|
||
if (!user) { | ||
return ( | ||
<Link href="/auth/signin"> | ||
<a className={'ml-6 font-medium text-white'}>{t('common:signin')}</a> | ||
</Link> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="group relative flex h-full items-center pl-6 transition"> | ||
<div className="flex h-[32px] cursor-pointer items-center justify-center overflow-hidden rounded-full group-hover:bg-[#333333]"> | ||
<Image src={user?.avatarUrl!} width={32} height={32} alt="" /> | ||
</div> | ||
|
||
<div className="absolute top-[100%] -right-4 z-dropdown hidden w-auto group-hover:block"> | ||
<div className="mt-[2px] bg-black/90 text-white"> | ||
{/*<Link href="/settings/subscribe">*/} | ||
{/* <a className="flex cursor-pointer border-b border-white/20 py-4 pl-6 text-center last:border-b-0 hover:bg-[#333333]">*/} | ||
{/* {t('common:subscribe')}*/} | ||
{/* </a>*/} | ||
{/*</Link>*/} | ||
|
||
<Link href="/settings/profile"> | ||
<a className="flex cursor-pointer items-center whitespace-nowrap border-b border-white/20 py-4 px-6 text-center last:border-b-0 hover:bg-[#333333]"> | ||
<AiOutlineUser className="mr-2 text-base" /> | ||
{t('common:profile_setting')} | ||
</a> | ||
</Link> | ||
|
||
<div | ||
className="flex cursor-pointer items-center whitespace-nowrap border-b border-white/20 py-4 pl-6 text-center last:border-b-0 hover:bg-[#333333]" | ||
onClick={() => { | ||
mutation.mutate( | ||
{}, | ||
{ | ||
onSuccess: () => { | ||
resetUserInfo(); | ||
router.push('/auth/signin'); | ||
}, | ||
} | ||
); | ||
}} | ||
> | ||
<MdOutlineLogout className="mr-2 text-base" /> {t('common:signout')} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default User; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
a6d5353
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.
Successfully deployed to the following URLs:
compass-web-preview – ./
compass-web-preview.vercel.app
compass-web-preview-compass-team.vercel.app
compass-web-preview-git-main-compass-team.vercel.app