Merge branch 'fe/teacherLive' into 'frontend'

[Front-End] Fe/teacher live

See merge request s11-webmobile1-sub2/S11P12A701!163
This commit is contained in:
정기영 2024-08-12 09:43:01 +09:00
commit cf0ac725d9
2 changed files with 4 additions and 4 deletions

View File

@ -3,9 +3,12 @@ import styles from './LectureHeader.module.css';
import PlayIcon from '/src/assets/icons/play.svg?react';
import CompassIcon from '/src/assets/icons/compass.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 }) {
const { lectureId } = useParams();
const userType = useBoundStore((state) => state.userType);
const isTeacher = userType === 'teacher';
return (
<div className={styles.wrapper}>
@ -39,7 +42,7 @@ export default function LectureHeader({ img, title, tutorImg, tutor, isLive = fa
<div>{tutor}</div>
</div>
<div>
{isLive ? (
{isLive || isTeacher ? (
<Link
to={`/live/${lectureId}`}
target="_blank"

View File

@ -1,7 +1,4 @@
export const userTypeSlice = (set) => ({
userType: null,
setUserType: (userType) => set({ userType }),
isTeacher: () => set.userType === 'teacher',
isStudent: () => set.userType === 'student',
isGuest: () => set.userType === null,
});