update banner-img

This commit is contained in:
somrat sorkar
2023-07-24 10:02:33 +06:00
parent 0d3562c1bf
commit abed7aa2a8
14 changed files with 52 additions and 60 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
{ {
"name": "astroplate", "name": "astroplate",
"version": "1.3.2", "version": "1.3.3",
"description": "Astro and Tailwindcss boilerplate", "description": "Astro and Tailwindcss boilerplate",
"author": "zeon.studio", "author": "zeon.studio",
"license": "MIT", "license": "MIT",
@@ -44,7 +44,7 @@
"@tailwindcss/forms": "^0.5.4", "@tailwindcss/forms": "^0.5.4",
"@tailwindcss/typography": "^0.5.9", "@tailwindcss/typography": "^0.5.9",
"@types/marked": "^5.0.1", "@types/marked": "^5.0.1",
"@types/node": "20.4.3", "@types/node": "20.4.4",
"@types/react": "18.2.15", "@types/react": "18.2.15",
"@types/react-dom": "18.2.7", "@types/react-dom": "18.2.7",
"autoprefixer": "^10.4.14", "autoprefixer": "^10.4.14",
+1 -1
View File
@@ -31,7 +31,7 @@ const authorsCollection = defineCollection({
icon: z.string().optional(), icon: z.string().optional(),
link: z.string().optional(), link: z.string().optional(),
}) })
.optional() .optional(),
) )
.optional(), .optional(),
draft: z.boolean().optional(), draft: z.boolean().optional(),
+4 -12
View File
@@ -146,21 +146,13 @@ window.addEventListener("load", (e) => {
### Notice ### Notice
<Notice type="note"> <Notice type="note">This is a simple note.</Notice>
This is a simple note.
</Notice>
<Notice type="tip"> <Notice type="tip">This is a simple note.</Notice>
This is a simple note.
</Notice>
<Notice type="info"> <Notice type="info">This is a simple note.</Notice>
This is a simple note.
</Notice>
<Notice type="warning"> <Notice type="warning">This is a simple note.</Notice>
This is a simple note.
</Notice>
--- ---
+1 -1
View File
@@ -5,7 +5,7 @@ const useTheme = (): string => {
useEffect(() => { useEffect(() => {
setThemeValue( setThemeValue(
document.documentElement.classList.contains("dark") ? "dark" : "light" document.documentElement.classList.contains("dark") ? "dark" : "light",
); );
}, []); }, []);
+1 -1
View File
@@ -155,7 +155,7 @@ const Search = ({ searchList }: Props) => {
{humanize(category)} {humanize(category)}
{index !== item.data.categories.length - 1 && ", "} {index !== item.data.categories.length - 1 && ", "}
</a> </a>
) ),
)} )}
</li> </li>
</ul> </ul>
+4 -4
View File
@@ -22,14 +22,14 @@ const Tabs = ({ children }: { children: React.ReactElement }) => {
const tabLinks = Array.from( const tabLinks = Array.from(
children.props.value.matchAll( children.props.value.matchAll(
/<div\s+data-name="([^"]+)"[^>]*>(.*?)<\/div>/gs /<div\s+data-name="([^"]+)"[^>]*>(.*?)<\/div>/gs,
), ),
(match: RegExpMatchArray) => ({ name: match[1], children: match[0] }) (match: RegExpMatchArray) => ({ name: match[1], children: match[0] }),
); );
const handleKeyDown = ( const handleKeyDown = (
event: React.KeyboardEvent<EventTarget>, event: React.KeyboardEvent<EventTarget>,
index: number index: number,
) => { ) => {
if (event.key === "Enter" || event.key === " ") { if (event.key === "Enter" || event.key === " ") {
setActive(index); setActive(index);
@@ -57,7 +57,7 @@ const Tabs = ({ children }: { children: React.ReactElement }) => {
> >
{item.name} {item.name}
</li> </li>
) ),
)} )}
</ul> </ul>
{tabLinks.map((item: { name: string; children: string }, i: number) => ( {tabLinks.map((item: { name: string; children: string }, i: number) => (
+1 -1
View File
@@ -2,7 +2,7 @@ import { formatInTimeZone } from "date-fns-tz";
const dateFormat = ( const dateFormat = (
date: Date | string, date: Date | string,
format: string = "dd MMM, yyyy" format: string = "dd MMM, yyyy",
): string => { ): string => {
return formatInTimeZone(date, "America/New_York", format); return formatInTimeZone(date, "America/New_York", format);
}; };
+2 -2
View File
@@ -15,12 +15,12 @@ const similerItems = (currentItem: any, allItems: any, slug: string) => {
// filter by categories // filter by categories
const filterByCategories = allItems.filter((item: any) => const filterByCategories = allItems.filter((item: any) =>
categories.find((category) => item.data.categories.includes(category)) categories.find((category) => item.data.categories.includes(category)),
); );
// filter by tags // filter by tags
const filterByTags = allItems.filter((item: any) => const filterByTags = allItems.filter((item: any) =>
tags.find((tag) => item.data.tags.includes(tag)) tags.find((tag) => item.data.tags.includes(tag)),
); );
// merged after filter // merged after filter
+4 -4
View File
@@ -3,7 +3,7 @@ export const sortByDate = (array: any[]) => {
const sortedArray = array.sort( const sortedArray = array.sort(
(a: any, b: any) => (a: any, b: any) =>
new Date(b.data.date && b.data.date).valueOf() - new Date(b.data.date && b.data.date).valueOf() -
new Date(a.data.date && a.data.date).valueOf() new Date(a.data.date && a.data.date).valueOf(),
); );
return sortedArray; return sortedArray;
}; };
@@ -11,14 +11,14 @@ export const sortByDate = (array: any[]) => {
// sort product by weight // sort product by weight
export const sortByWeight = (array: any[]) => { export const sortByWeight = (array: any[]) => {
const withWeight = array.filter( const withWeight = array.filter(
(item: { data: { weight: any } }) => item.data.weight (item: { data: { weight: any } }) => item.data.weight,
); );
const withoutWeight = array.filter( const withoutWeight = array.filter(
(item: { data: { weight: any } }) => !item.data.weight (item: { data: { weight: any } }) => !item.data.weight,
); );
const sortedWeightedArray = withWeight.sort( const sortedWeightedArray = withWeight.sort(
(a: { data: { weight: number } }, b: { data: { weight: number } }) => (a: { data: { weight: number } }, b: { data: { weight: number } }) =>
a.data.weight - b.data.weight a.data.weight - b.data.weight,
); );
const sortedArray = [...new Set([...sortedWeightedArray, ...withoutWeight])]; const sortedArray = [...new Set([...sortedWeightedArray, ...withoutWeight])];
return sortedArray; return sortedArray;
+1 -1
View File
@@ -2,7 +2,7 @@ import { slugify } from "@/lib/utils/textConverter";
const taxonomyFilter = (posts: any[], name: string, key: string) => const taxonomyFilter = (posts: any[], name: string, key: string) =>
posts.filter((post) => posts.filter((post) =>
post.data[name].map((name: string) => slugify(name)).includes(key) post.data[name].map((name: string) => slugify(name)).includes(key),
); );
export default taxonomyFilter; export default taxonomyFilter;
+3 -3
View File
@@ -43,10 +43,10 @@ const { banner, features }: Homepage = homepage.data;
{ {
banner.image && ( banner.image && (
<div class="col-12"> <div class="col-12">
<img <Image
src={banner.image} src={banner.image}
width="1272" height={380}
height="403" width={1200}
alt="banner image" alt="banner image"
/> />
</div> </div>