-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TC#73 Enhance and optimize the news page (#144)
* TC#73: Added loader in news one page and some optimize images in carousel * TC#73: Added skeleton loader to news page * TC#73: Fixed bug with reload after any crud operations * TC#73: Refactored styles skeleton * TC#73: Removed line
- Loading branch information
1 parent
98f31ed
commit 6e23c40
Showing
10 changed files
with
139 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { Container, DatePicker, NewsTitle } from '@/shared/components/shared'; | ||
import { Skeleton } from '@/shared/components/ui'; | ||
import { cn } from '@/shared/lib'; | ||
import styles from '@/app/(root)/news/news.module.css'; | ||
|
||
import React from 'react'; | ||
|
||
export default function Loading() { | ||
const arr = new Array(12).fill(null); | ||
|
||
return ( | ||
<Container> | ||
<NewsTitle /> | ||
<DatePicker /> | ||
|
||
<div className={cn(styles.newsContainer)}> | ||
{arr.map((_, i) => ( | ||
<Skeleton key={i} className={cn(styles.skeletonCard)}> | ||
<Skeleton> | ||
<Skeleton className={cn(styles.skeletonCardImageBlock)}> | ||
<Skeleton className={cn(styles.skeletonImage)} /> | ||
</Skeleton> | ||
<Skeleton className={cn(styles.skeletonCardTextBlock)}> | ||
<div className={cn(styles.skeletonCardTextContent)}> | ||
<Skeleton className={cn(styles.skeletonCardText, 'w-[95%]')} /> | ||
<Skeleton className={cn(styles.skeletonCardText, 'w-[90%]')} /> | ||
<Skeleton className={cn(styles.skeletonCreatedAt)} /> | ||
</div> | ||
</Skeleton> | ||
</Skeleton> | ||
</Skeleton> | ||
))} | ||
</div> | ||
</Container> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,35 @@ | ||
.newsContainer { | ||
@apply grid gap-5 justify-center items-center sm:grid-cols-2 lmd:grid-cols-3 xl:grid-cols-4 mb-6; | ||
} | ||
|
||
.skeletonCard { | ||
@apply w-full min-w-[280px] rounded-lg; | ||
} | ||
|
||
.skeletonCardContent { | ||
@apply w-full; | ||
} | ||
|
||
.skeletonCardImageBlock { | ||
@apply p-0; | ||
} | ||
|
||
.skeletonImage { | ||
@apply h-[300px] object-cover mb-5 min-w-full rounded-md; | ||
} | ||
|
||
.skeletonCardTextBlock { | ||
@apply flex flex-wrap mt-auto items-start p-6 pt-0; | ||
} | ||
|
||
.skeletonCardTextContent { | ||
@apply me-auto w-full pb-12; | ||
} | ||
|
||
.skeletonCardText { | ||
@apply dark:text-white h-3 mb-2; | ||
} | ||
|
||
.skeletonCreatedAt { | ||
@apply dark:text-white h-4 w-[30%]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters