click na grupe niezwija karty przedmiotu

This commit is contained in:
wrzesinski-hubert
2020-08-31 18:10:36 +02:00
parent 1e9e336ee9
commit d75530887e
2 changed files with 7 additions and 19 deletions

View File

@ -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>