mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
fix: additional bugs
This commit is contained in:
parent
0c6ce121b0
commit
925276dc7a
3 changed files with 16 additions and 10 deletions
|
|
@ -8,7 +8,7 @@ import { revalidateTags } from "@services/utils/ts/requests";
|
|||
import ActivityIndicators from "@components/Pages/Courses/ActivityIndicators";
|
||||
import { useRouter } from "next/navigation";
|
||||
import GeneralWrapperStyled from "@components/StyledElements/Wrappers/GeneralWrapper";
|
||||
import { getCourseThumbnailMediaDirectory } from "@services/media/media";
|
||||
import { getCourseThumbnailMediaDirectory, getUserAvatarMediaDirectory } from "@services/media/media";
|
||||
import { ArrowRight, Check, File, Sparkles, Star, Video } from "lucide-react";
|
||||
import Avvvatars from "avvvatars-react";
|
||||
import { getUser } from "@services/users/users";
|
||||
|
|
@ -193,7 +193,7 @@ const CourseClient = (props: any) => {
|
|||
<div className="course_metadata_right space-y-3 w-72 antialiased flex flex-col ml-10 h-fit p-3 py-5 bg-white shadow-md shadow-gray-300/25 outline outline-1 outline-neutral-200/40 rounded-lg overflow-hidden">
|
||||
{user &&
|
||||
<div className="flex flex-col mx-auto space-y-3 px-2 py-2 items-center">
|
||||
<UserAvatar border="border-8" avatar_url={course.authors[0].avatar_url} width={100} />
|
||||
<UserAvatar border="border-8" avatar_url={getUserAvatarMediaDirectory(course.authors[0].user_uuid,course.authors[0].avatar_image)} width={100} />
|
||||
<div className="-space-y-2 ">
|
||||
<div className="text-[12px] text-neutral-400 font-semibold">Author</div>
|
||||
<div className="text-xl font-bold text-neutral-800">
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ function UserAvatar(props: UserAvatarProps) {
|
|||
return predefinedAvatar
|
||||
} else {
|
||||
if (props.avatar_url) {
|
||||
console.log('avatar_url',props.avatar_url)
|
||||
return props.avatar_url
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -43,11 +43,16 @@ export const AuthenticatedClientElement = (props: AuthenticatedClientElementProp
|
|||
}
|
||||
|
||||
function check() {
|
||||
|
||||
if (props.checkMethod === 'authentication') {
|
||||
setIsAllowed(session.isAuthenticated);
|
||||
} else if (props.checkMethod === 'roles') {
|
||||
return setIsAllowed(isUserAllowed(session.roles, props.action!, props.ressourceType!, org.org_uuid));
|
||||
if (session.isAuthenticated === false) {
|
||||
setIsAllowed(false);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
if (props.checkMethod === 'authentication') {
|
||||
setIsAllowed(session.isAuthenticated);
|
||||
} else if (props.checkMethod === 'roles') {
|
||||
return setIsAllowed(isUserAllowed(session.roles, props.action!, props.ressourceType!, org.org_uuid));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue