Skip to content

Commit

Permalink
Issue #PS-0000 fix: Updated course-hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
itsvick committed Dec 5, 2024
1 parent c839a32 commit 94ecbec
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/components/CommonUserModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,7 @@ console.log("userType",userType, FormContextType.CONTENT_CREATOR)
color: "secondary",
fontSize: "14px",
fontWeight: "500",
textTransform: "capitalize"
}}
variant="outlined"
>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1044,7 +1044,7 @@ const Block: React.FC = () => {
flexDirection={"column"}
alignItems={"center"}
>
<Loader showBackdrop={false} loadingText="Loading..." />
<Loader showBackdrop={false} loadingText="Loading" />
</Box>
) : (
<>
Expand Down
26 changes: 9 additions & 17 deletions src/pages/course-hierarchy/[identifier].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@ import {
Typography,
Link,
Box,
Grid,
} from '@mui/material';
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import { getContentHierarchy } from '@/services/coursePlanner';
import { useRouter } from 'next/router';
import Loader from '@/components/Loader';
import { serverSideTranslations } from 'next-i18next/serverSideTranslations';
import ResourceCard from '@/components/ResourceCard';

const RecursiveAccordion = ({ data }: { data: any[] }) => {
let router = useRouter();
Expand All @@ -38,22 +40,12 @@ const RecursiveAccordion = ({ data }: { data: any[] }) => {
{node.children && renderAccordion(node.children, level + 1)}
</>
) : node.contentType === 'Resource' ? (
<Box
className="facilitator-bg"
sx={{
backgroundImage: `url(${node?.appIcon ? node.appIcon : '/decorationBg.png'})`,
position: 'relative',
marginLeft: `${(level - 1) * 2}px`, // Indentation for resources
cursor: 'pointer',
height: '50px',
width: '50px',
backgroundSize: 'cover',
backgroundPosition: 'center',
}}
onClick={() =>
router.push(`/play/content/${node?.identifier || node?.id}`)
}
></Box>
<Grid container>
<Grid item xs={6} md={4} lg={3} sx={{ mt: 2 }}>
<ResourceCard title={node?.name} resource={node?.resourceType} identifier={node?.identifier} mimeType={node?.mimeType} />
</Grid>
</Grid>

) : (
<Accordion sx={{ marginLeft: `${(level - 1) * 2}px` }}>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
Expand Down Expand Up @@ -114,7 +106,7 @@ export default function CourseHierarchy() {

if (loading) {
return (
<Loader showBackdrop={true} loadingText="Loading..." />
<Loader showBackdrop={true} loadingText="Loading" />
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/pages/stateDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const StateDetails = () => {
};

if (loading) {
return <Loader showBackdrop={true} loadingText="Loading..." />;
return <Loader showBackdrop={true} loadingText="Loading" />;
}

return (
Expand Down
2 changes: 1 addition & 1 deletion src/pages/subjectDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,7 @@ const SubjectDetails = () => {
}, [selectedtype]);

if (loading) {
return <Loader showBackdrop={true} loadingText="Loading..." />;
return <Loader showBackdrop={true} loadingText="Loading" />;
}

const handleBackClick = () => {
Expand Down

0 comments on commit 94ecbec

Please sign in to comment.