Skip to content

Commit

Permalink
Merge pull request #519 from EscolaLMS/feature/REK-65
Browse files Browse the repository at this point in the history
fixed loader
  • Loading branch information
victazzz authored Nov 29, 2024
2 parents cb39143 + 21cd347 commit a12141b
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"@capacitor/ios": "^5.7.3",
"@capacitor/local-notifications": "^5.0.7",
"@capacitor/status-bar": "^5.0.7",
"@escolalms/components": "^0.0.157",
"@escolalms/components": "^0.0.158",
"@escolalms/h5p-react": "^0.2.19",
"@escolalms/sdk": "^0.6.2",
"@escolalms/ts-models": "^0.0.35",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const ConsultationsContainerItems: React.FC<Props> = ({
}}
>
{!loading &&
consultations?.data.map((consultation) => (
consultations?.data?.map((consultation) => (
<Col md={6} lg={4} xl={3} key={consultation.id}>
<ConsultationsContainerItem consultation={consultation} />
</Col>
Expand All @@ -46,6 +46,7 @@ const ConsultationsContainerItems: React.FC<Props> = ({
onPage={(i) => handlePageChange(i)}
/>
)}
<br />
</>
);
};
Expand Down
50 changes: 31 additions & 19 deletions src/components/Profile/ProfileTutorConsultations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { ConsultationStatus } from "../../../pages/user/my-consultations";
import { EscolaLMSContext } from "@escolalms/sdk/lib/react/context";
import { Text } from "@escolalms/components/lib/components/atoms/Typography/Text";
import ConsultationTutorCard from "@/components/Consultations/ConsultationTutorCard";
import ContentLoader from "@/components/_App/ContentLoader";
import { CourseCardSkeleton } from "@/components/Skeletons/CourseCard";

interface ProfileTutorConsultationsProps {
type: ConsultationStatus;
Expand Down Expand Up @@ -35,25 +35,37 @@ const ProfileTutorConsultations = ({

return (
<>
{tutorConsultations.loading ? (
<ContentLoader />
) : consultationsData.length === 0 ? (
<Text style={{ paddingLeft: isMobile ? 20 : 40 }}>
{t<string>("MyProfilePage.OrdersEmpty")}
</Text>
) : (
<Row
style={{
gap: "30px 0",
}}
>
{consultationsData.map((consultation) => (
<Col key={consultation.consultation_term_id} xs={12} md={6} lg={3}>
<ConsultationTutorCard consultation={consultation} />
<Row
style={{
gap: "30px 0",
}}
>
{tutorConsultations.loading ? (
Array.from({ length: 8 }).map((_, index) => (
<Col md={3} key={`skeleton-card-${index}`}>
<CourseCardSkeleton />
</Col>
))}
</Row>
)}
))
) : consultationsData.length === 0 ? (
<Text style={{ paddingLeft: isMobile ? 20 : 40 }}>
{t<string>("MyProfilePage.OrdersEmpty")}
</Text>
) : (
<>
{" "}
{consultationsData.map((consultation) => (
<Col
key={consultation.consultation_term_id}
xs={12}
md={6}
lg={3}
>
<ConsultationTutorCard consultation={consultation} />
</Col>
))}
</>
)}
</Row>
</>
);
};
Expand Down
3 changes: 2 additions & 1 deletion src/pages/user/MyProfile/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export const Content = styled.section`
.courses-wrapper {
padding-top: 100px;
min-height: fit-content;
min-height: calc(100vh - 500px);
height: fit-content;
@media (max-width: 991px) {
margin-top: 0;
min-height: fit-content;
Expand Down

0 comments on commit a12141b

Please sign in to comment.