Fix styles for loading and pagination

pull/6513/head
Kamran Ahmed 3 months ago
parent 2fb6c1ae6c
commit 51ba38e469
  1. 44
      src/components/Projects/ListProjectSolutions.tsx
  2. 20
      src/components/Projects/LoadingSolutions.tsx
  3. 2
      src/components/Projects/ProjectTabs.tsx

@ -239,21 +239,7 @@ export function ListProjectSolutions(props: ListProjectSolutionsProps) {
<section>
{leavingRoadmapModal}
<Pagination
variant="minimal"
totalPages={solutions?.totalPages || 1}
currPage={solutions?.currPage || 1}
perPage={solutions?.perPage || 21}
totalCount={solutions?.totalCount || 0}
onPageChange={(page) => {
setPageState({
...pageState,
currentPage: page,
});
}}
/>
<div className="flex flex-col divide-y divide-gray-100">
<div className="flex flex-col divide-y divide-gray-100 min-h-[500px]">
{solutions?.data.map((solution, counter) => {
const isVisited = alreadyVisitedSolutions[solution._id!];
const avatar = solution.user.avatar || '';
@ -325,18 +311,22 @@ export function ListProjectSolutions(props: ListProjectSolutionsProps) {
})}
</div>
<Pagination
totalPages={solutions?.totalPages || 1}
currPage={solutions?.currPage || 1}
perPage={solutions?.perPage || 21}
totalCount={solutions?.totalCount || 0}
onPageChange={(page) => {
setPageState({
...pageState,
currentPage: page,
});
}}
/>
{(solutions?.totalPages || 0) > 1 && (
<div className="mt-4">
<Pagination
totalPages={solutions?.totalPages || 1}
currPage={solutions?.currPage || 1}
perPage={solutions?.perPage || 21}
totalCount={solutions?.totalCount || 0}
onPageChange={(page) => {
setPageState({
...pageState,
currentPage: page,
});
}}
/>
</div>
)}
</section>
);
}

@ -1,11 +1,19 @@
export function LoadingSolutions() {
return (
<ul className="flex flex-col gap-2">
{new Array(21).fill(0).map((_, index) => (
<li
key={index}
className="h-[76px] animate-pulse rounded-md border bg-gray-200"
/>
<ul className="flex flex-col divide-y divide-transparent min-h-[500px]">
{new Array(11).fill(0).map((_, index) => (
<li key={index} className="flex h-[44px] items-center justify-between">
<span className="flex items-center">
<span className="block h-[28px] w-[28px] animate-pulse rounded-full bg-gray-200"></span>
<span
className={`ml-2 block h-[26px] w-[350px] animate-pulse rounded-full bg-gray-200`}
></span>
</span>
<span className="flex items-center gap-2">
<span className={'w-[80px] rounded-full bg-gray-200 animated-pulse h-[26px]'}></span>
<span className={'w-[113px] rounded-full bg-gray-200 animated-pulse h-[26px]'}></span>
</span>
</li>
))}
</ul>
);

@ -18,7 +18,7 @@ export function ProjectTabs(props: ProjectTabsProps) {
];
return (
<div className="my-3 flex flex-row flex-wrap items-center gap-1.5 rounded-md border bg-white px-2 text-sm">
<div className="my-3 flex flex-row flex-wrap items-center gap-1.5 rounded-md border bg-white px-2.5 text-sm">
{tabs.map((tab) => {
const isActive = tab.value === activeTab;

Loading…
Cancel
Save