feat: profile picture support
This commit is contained in:
@ -9,6 +9,7 @@ export interface LoginResponse {
|
|||||||
id: string;
|
id: string;
|
||||||
email: string;
|
email: string;
|
||||||
full_name: string;
|
full_name: string;
|
||||||
|
profile_picture: string;
|
||||||
access: string;
|
access: string;
|
||||||
refresh: string;
|
refresh: string;
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,18 @@ const AccountList: FC = () => {
|
|||||||
className="flex flex-row items-center p-4 border-gray-200 dark:border-gray-700/65 border-b border-r-0 border-l-0 select-none cursor-pointer hover:bg-gray-50/50 dark:hover:bg-gray-800/10 transition-colors mb-0"
|
className="flex flex-row items-center p-4 border-gray-200 dark:border-gray-700/65 border-b border-r-0 border-l-0 select-none cursor-pointer hover:bg-gray-50/50 dark:hover:bg-gray-800/10 transition-colors mb-0"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div className="rounded-full p-2 bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-gray-200 mr-3 ring ring-gray-900 dark:ring dark:ring-gray-100">
|
<div className="rounded-full w-10 h-10 overflow-hidden bg-gray-100 dark:bg-gray-700 text-gray-900 dark:text-gray-200 mr-3 ring ring-gray-400 dark:ring dark:ring-gray-500">
|
||||||
<User />
|
{account.profilePicture ? (
|
||||||
|
<img
|
||||||
|
src={account.profilePicture}
|
||||||
|
className="w-full h-full flex-1"
|
||||||
|
alt="profile"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<div className="w-full h-full flex items-center justify-center">
|
||||||
|
<User />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex flex-col">
|
<div className="flex flex-col">
|
||||||
|
@ -49,6 +49,7 @@ export default function LoginPage() {
|
|||||||
accountId: response.id,
|
accountId: response.id,
|
||||||
label: response.full_name,
|
label: response.full_name,
|
||||||
email: response.email,
|
email: response.email,
|
||||||
|
profilePicture: response.profile_picture,
|
||||||
access: response.access,
|
access: response.access,
|
||||||
refresh: response.refresh,
|
refresh: response.refresh,
|
||||||
});
|
});
|
||||||
|
@ -6,6 +6,7 @@ export interface RawLocalAccount {
|
|||||||
accountId: string;
|
accountId: string;
|
||||||
label: string;
|
label: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
profilePicture: string;
|
||||||
access: { data: number[]; iv: number[] };
|
access: { data: number[]; iv: number[] };
|
||||||
refresh: { data: number[]; iv: number[] };
|
refresh: { data: number[]; iv: number[] };
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
@ -15,6 +16,7 @@ export interface LocalAccount {
|
|||||||
accountId: string;
|
accountId: string;
|
||||||
label: string;
|
label: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
profilePicture: string;
|
||||||
access: string;
|
access: string;
|
||||||
refresh: string;
|
refresh: string;
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
@ -24,6 +26,7 @@ export interface CreateAccountRequest {
|
|||||||
accountId: string;
|
accountId: string;
|
||||||
label: string;
|
label: string;
|
||||||
email: string;
|
email: string;
|
||||||
|
profilePicture: string;
|
||||||
access: string;
|
access: string;
|
||||||
refresh: string;
|
refresh: string;
|
||||||
}
|
}
|
||||||
@ -91,6 +94,7 @@ export const useAccountRepo = () => {
|
|||||||
accountId: req.accountId,
|
accountId: req.accountId,
|
||||||
label: req.label,
|
label: req.label,
|
||||||
email: req.email,
|
email: req.email,
|
||||||
|
profilePicture: req.profilePicture,
|
||||||
access,
|
access,
|
||||||
refresh,
|
refresh,
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
@ -117,6 +121,7 @@ export const useAccountRepo = () => {
|
|||||||
accountId: account.accountId,
|
accountId: account.accountId,
|
||||||
label: account.label,
|
label: account.label,
|
||||||
email: account.email,
|
email: account.email,
|
||||||
|
profilePicture: account.profilePicture,
|
||||||
access: accessToken,
|
access: accessToken,
|
||||||
refresh: refreshToken,
|
refresh: refreshToken,
|
||||||
updatedAt: account.updatedAt,
|
updatedAt: account.updatedAt,
|
||||||
|
Reference in New Issue
Block a user