Merge branch 'fe/teacherLive' into 'frontend'
[Front-End] Fe/teacher live See merge request s11-webmobile1-sub2/S11P12A701!163
This commit is contained in:
commit
cf0ac725d9
@ -3,9 +3,12 @@ import styles from './LectureHeader.module.css';
|
|||||||
import PlayIcon from '/src/assets/icons/play.svg?react';
|
import PlayIcon from '/src/assets/icons/play.svg?react';
|
||||||
import CompassIcon from '/src/assets/icons/compass.svg?react';
|
import CompassIcon from '/src/assets/icons/compass.svg?react';
|
||||||
import UserIcon from '/src/assets/icons/user.svg?react';
|
import UserIcon from '/src/assets/icons/user.svg?react';
|
||||||
|
import useBoundStore from '../../store';
|
||||||
|
|
||||||
export default function LectureHeader({ img, title, tutorImg, tutor, isLive = false }) {
|
export default function LectureHeader({ img, title, tutorImg, tutor, isLive = false }) {
|
||||||
const { lectureId } = useParams();
|
const { lectureId } = useParams();
|
||||||
|
const userType = useBoundStore((state) => state.userType);
|
||||||
|
const isTeacher = userType === 'teacher';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrapper}>
|
<div className={styles.wrapper}>
|
||||||
@ -39,7 +42,7 @@ export default function LectureHeader({ img, title, tutorImg, tutor, isLive = fa
|
|||||||
<div>{tutor}</div>
|
<div>{tutor}</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{isLive ? (
|
{isLive || isTeacher ? (
|
||||||
<Link
|
<Link
|
||||||
to={`/live/${lectureId}`}
|
to={`/live/${lectureId}`}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
|
@ -1,7 +1,4 @@
|
|||||||
export const userTypeSlice = (set) => ({
|
export const userTypeSlice = (set) => ({
|
||||||
userType: null,
|
userType: null,
|
||||||
setUserType: (userType) => set({ userType }),
|
setUserType: (userType) => set({ userType }),
|
||||||
isTeacher: () => set.userType === 'teacher',
|
|
||||||
isStudent: () => set.userType === 'student',
|
|
||||||
isGuest: () => set.userType === null,
|
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user