-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* coursbeag on sidebag * added coursebag to catalog * close tag * lint * pnpm lock * checked pnpm lock * space added * chore: fixed unnecessary changes
- Loading branch information
Showing
16 changed files
with
314 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import { useAppDispatch, useAppSelector } from '../../store/hooks'; | ||
import { removeCourseFromBag } from '../../store/slices/roadmapSlice'; | ||
import Course from './Course'; | ||
import './Coursebag.scss'; | ||
import { Draggable } from 'react-beautiful-dnd'; | ||
const CourseBag = () => { | ||
const { coursebag } = useAppSelector((state) => state.roadmap); | ||
const dispatch = useAppDispatch(); | ||
|
||
return ( | ||
<div className="coursebag-container"> | ||
<h3 className="coursebag-title">Course Bag</h3> | ||
<div style={{ height: '100%' }}> | ||
{coursebag.map((course, index) => { | ||
return ( | ||
<Draggable draggableId={`coursebag-${course.id}-${index}`} key={`coursebag-${index}`} index={index}> | ||
{(provided) => ( | ||
<div | ||
ref={provided.innerRef} | ||
{...provided.draggableProps} | ||
{...provided.dragHandleProps} | ||
style={{ | ||
// use inline style here so dnd can calculate size | ||
margin: ' 0rem 2rem 1rem 2rem', | ||
cursor: 'grab', | ||
...provided.draggableProps.style, | ||
}} | ||
> | ||
<Course | ||
{...course} | ||
onDelete={() => { | ||
dispatch(removeCourseFromBag(course)); | ||
}} | ||
/> | ||
</div> | ||
)} | ||
</Draggable> | ||
); | ||
})} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default CourseBag; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.coursebag-container { | ||
padding-top: 2vh; | ||
overflow-y: auto; | ||
height: 100%; | ||
} | ||
.coursebag-title { | ||
font-size: 2rem; | ||
font-weight: 500; | ||
padding: 0 1.8rem; | ||
} | ||
.no-results { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 2rem; | ||
font-size: 1.5rem; | ||
padding: 2rem; | ||
text-align: center; | ||
|
||
img { | ||
width: 400px; | ||
max-width: 100%; | ||
} | ||
} | ||
|
||
.search-pagination { | ||
display: flex; | ||
justify-content: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.