Skip to content

Commit

Permalink
feat: refactor after review
Browse files Browse the repository at this point in the history
  • Loading branch information
vladislavkeblysh committed Apr 24, 2024
1 parent 134dac9 commit 34d8fa1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/CourseAuthoringRoutes.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const CourseAuthoringRoutes = () => {
element={<PageWrap><Certificates courseId={courseId} /></PageWrap>}
/>
<Route
path="/textbooks"
path="textbooks"
element={<PageWrap><Textbooks courseId={courseId} /></PageWrap>}
/>
</Routes>
Expand Down
3 changes: 2 additions & 1 deletion src/generic/modal-dropzone/useModalDropzone.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ const useModalDropzone = ({
*/
const constructAcceptObject = (types) => types
.reduce((acc, type) => {
const mimeType = VALID_IMAGE_TYPES.includes(type) ? 'image/*' : '*/*';
// eslint-disable-next-line no-nested-ternary
const mimeType = type === 'pdf' ? 'application/pdf' : VALID_IMAGE_TYPES.includes(type) ? 'image/*' : '*/*';
if (!acc[mimeType]) {
acc[mimeType] = [];
}
Expand Down
2 changes: 1 addition & 1 deletion src/textbooks/textbook-card/TextbooksCard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const TextbookCard = ({
const { tabTitle, chapters, id } = textbook;

const onPreviewTextbookClick = () => {
window.location.href = `${config.LMS_BASE_URL}/courses/${courseId}/pdfbook/${textbookIndex}/`;
window.open(`${config.LMS_BASE_URL}/courses/${courseId}/pdfbook/${textbookIndex}/`, '_blank');

Check warning on line 47 in src/textbooks/textbook-card/TextbooksCard.jsx

View check run for this annotation

Codecov / codecov/patch

src/textbooks/textbook-card/TextbooksCard.jsx#L47

Added line #L47 was not covered by tests
};

const handleDeleteButtonSubmit = () => {
Expand Down

0 comments on commit 34d8fa1

Please sign in to comment.