Skip to content

Commit

Permalink
Merge pull request #354 from Aar-if/seventy
Browse files Browse the repository at this point in the history
Issue #0000 feat: Course planner bug fixes
  • Loading branch information
itsvick authored Nov 27, 2024
2 parents 6fe0397 + 298d1f6 commit 8648f64
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 9 deletions.
25 changes: 17 additions & 8 deletions src/components/ResourceCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ResourceCard: React.FC<ResourceCardProps> = ({
// type,
// resource,
identifier,
appIcon
appIcon,
}) => {
// const [thumbnailUrl, setThumbnailUrl] = useState<string | StaticImageData>(placeholderImage);
const thumbnailUrl = appIcon || placeholderImage;
Expand Down Expand Up @@ -46,13 +46,18 @@ const ResourceCard: React.FC<ResourceCardProps> = ({
};

return (
<Card sx={{ width: 150, height: 180, borderRadius: 2 }}>
<Card sx={{ width: 150, height: 180, borderRadius: 2, cursor: "pointer" }}>
<CardContent>
<Box
display="flex"
justifyContent="center"
alignItems="center"
sx={{ height: 100, backgroundColor: "#f5f5f5", borderRadius: "10px" }}
sx={{
height: 100,
backgroundColor: "#f5f5f5",
borderRadius: "10px",
cursor: "pointer",
}}
onClick={openPlayers}
>
<Image
Expand All @@ -63,11 +68,15 @@ const ResourceCard: React.FC<ResourceCardProps> = ({
style={{ borderRadius: "10px" }}
/>
</Box>
<Typography variant="subtitle1" sx={{
mt: 1, whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
}}>
<Typography
variant="subtitle1"
sx={{
mt: 1,
whiteSpace: "nowrap",
overflow: "hidden",
textOverflow: "ellipsis",
}}
>
{title}
</Typography>
<Typography variant="body2" color="textSecondary">
Expand Down
3 changes: 3 additions & 0 deletions src/pages/importCsv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ const ImportCsv = () => {
};

const handleClose = () => {
setSelectedFile(null);
setOpen(false);
};

Expand Down Expand Up @@ -244,8 +245,10 @@ const ImportCsv = () => {
t("COURSE_PLANNER.COURSE_CREATED_SUCCESSFULLY"),
"success"
);
setSelectedFile(null);
setOpen(false);
} else {
setSelectedFile(null);
showToastMessage(t("COURSE_PLANNER.COURSE_NOT_CREATED"), "error");
}
} catch (error) {
Expand Down
8 changes: 7 additions & 1 deletion src/pages/resourceList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,15 @@ const ResourceList = () => {
useEffect(() => {
const fetchData = async () => {
const resources = tstore.resources;
const fetchedLearningResources = resources?.learningResources || [];

const fetchedLearningResources = resources?.learningResources || [];
if (fetchedLearningResources?.length) {
fetchedLearningResources.forEach((resource: { id: string }) => {
resource.id = resource.id.toLowerCase();
});

console.log(fetchedLearningResources);

let contents = await fetchBulkContents(
fetchedLearningResources?.map((item: any) => item.id)
);
Expand Down

0 comments on commit 8648f64

Please sign in to comment.