accounts page, list all sessions

This commit is contained in:
Max Peintner
2023-05-17 15:25:25 +02:00
parent d3562b1f63
commit 202e0b7635
9 changed files with 152 additions and 36 deletions

View File

@@ -26,10 +26,16 @@ export const Avatar: FC<AvatarProps> = ({
// const { resolvedTheme } = useTheme();
let credentials = "";
console.log(name, loginName);
if (name) {
const split = name.split(" ");
const initials = split[0].charAt(0) + (split[1] ? split[1].charAt(0) : "");
credentials = initials;
if (split) {
const initials =
split[0].charAt(0) + (split[1] ? split[1].charAt(0) : "");
credentials = initials;
} else {
return name.charAt(0);
}
} else {
const username = loginName.split("@")[0];
let separator = "_";

View File

@@ -46,7 +46,7 @@ export default function PasswordForm() {
function submitPasswordAndContinue(value: Inputs): Promise<boolean | void> {
console.log(value);
return submitPassword(value).then((resp: any) => {
return router.push(`/success`);
return router.push(`/accounts`);
});
}

View File

@@ -4,16 +4,21 @@ import Link from "next/link";
type Props = {
loginName: string;
displayName?: string;
showDropdown: boolean;
};
export default function UserAvatar({ loginName, showDropdown }: Props) {
export default function UserAvatar({
loginName,
displayName,
showDropdown,
}: Props) {
return (
<div className="flex h-full w-full flex-row items-center rounded-full border p-[1px] dark:border-white/20">
<div>
<Avatar
size={AvatarSize.SMALL}
name={loginName}
name={displayName ?? loginName}
loginName={loginName}
/>
</div>