Classes display correctly, still need to work on lectures:

This commit is contained in:
Maciek Głowacki
2020-08-23 17:22:50 +02:00
parent 9a0ee68317
commit 457169fe0e
7 changed files with 60 additions and 73 deletions

View File

@ -33,7 +33,14 @@ const RightbarTextStyled = styled.div`
export const Rightbar = () => {
const [selectedCardId, setSelectedCardId] = useState<string | null>(null);
const { choosenCourses } = useContext(coursesContext)!;
const { courses, basket } = useContext(coursesContext)!;
const getBasketGroups = () => {
const ids = basket.map(({ id }) => id);
return courses.filter(({ id }) => ids.includes(id));
};
const filteredCourses = getBasketGroups();
//działa clunky
const onCardClick = (event: MouseEvent) => {
@ -48,7 +55,7 @@ export const Rightbar = () => {
Hubert Wrzesiński<br></br>
Semestr zimowy 2020/2021
</RightbarTextStyled>
{choosenCourses.map((course, index) => (
{filteredCourses.map((course, index) => (
<CourseCard
course={course}
key={index}