click na grupe niezwija karty przedmiotu
This commit is contained in:
@ -31,8 +31,6 @@ const RightbarTextStyled = styled.div`
|
||||
`;
|
||||
|
||||
export const Rightbar = () => {
|
||||
const [selectedCardId, setSelectedCardId] = useState<string | null>(null);
|
||||
|
||||
const { courses, basket } = useContext(coursesContext)!;
|
||||
|
||||
const getBasketGroups = () => {
|
||||
@ -42,12 +40,6 @@ export const Rightbar = () => {
|
||||
|
||||
const filteredCourses = getBasketGroups();
|
||||
|
||||
//działa clunky
|
||||
const onCardClick = (event: MouseEvent) => {
|
||||
const target = event.currentTarget;
|
||||
selectedCardId === target.id ? setSelectedCardId(null) : setSelectedCardId(target.id);
|
||||
};
|
||||
|
||||
//need to insert student name from db and course maybe based on current time or from db too
|
||||
return (
|
||||
<RightbarStyled>
|
||||
@ -59,9 +51,6 @@ export const Rightbar = () => {
|
||||
<CourseCard
|
||||
course={course}
|
||||
key={index}
|
||||
id={index.toString()}
|
||||
onCardClick={onCardClick}
|
||||
isSelected={selectedCardId === index.toString()}
|
||||
/>
|
||||
))}
|
||||
</RightbarStyled>
|
||||
|
Reference in New Issue
Block a user