Skip to content

Commit

Permalink
refactor: components & others
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhrifat committed Nov 9, 2023
1 parent fdeaf5f commit bce153d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/components/CategoryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

import Image from "next/image";
import Link from "next/link";
import { CategroyType } from "../layouts/Categories";
import { SubCategories } from ".";
import { men } from "../utils/data";
import SubCategories from "./SubCategories";
import { CategroyType } from "../utils/type";

export const stringReform = (str: string) =>
str.replace(/\s+/g, "-").toLowerCase();
Expand Down
13 changes: 12 additions & 1 deletion app/components/Section.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
/**
* Title: Section
* Description:
* Filename: Section.tsx
* Path: /app/components/Section.tsx
* Author: Mrh Rifat (Programmer)
* Created Date: Nov 09, 2023
* Last Updated Date: Nov 09, 2023
*
*/

import { getSubCategory } from "../utils/serverReq";
import { SubCategoryType } from "./SubCategories";
import { SubCategoryType } from "../utils/type";

const Section = async ({ cat, subcat }: { cat: number; subcat: number }) => {
const subcategories = await getSubCategory(cat);
Expand Down
10 changes: 1 addition & 9 deletions app/components/SubCategories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@
*/

import { getSubCategory } from "../utils/serverReq";

export type SubCategoryType = {
id: number;
cat_id: number;
subcat_id: number;
subcat_name_bn: string;
subcat_name_en: string;
no_of_dua: number;
};
import { SubCategoryType } from "../utils/type";

const SubCategories = async ({ cat_id }: { cat_id: number }) => {
const subCategories = await getSubCategory(cat_id);
Expand Down
17 changes: 17 additions & 0 deletions app/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/**
* Title: index
* Description:
* Filename: index.ts
* Path: /app/components/index.ts
* Author: Mrh Rifat (Programmer)
* Created Date: Nov 09, 2023
* Last Updated Date: Nov 09, 2023
*
*/

import CategoryCard from "./CategoryCard";
import MenuItem from "./MenuItem";
import Section from "./Section";
import SubCategories from "./SubCategories";

export { CategoryCard, MenuItem, Section, SubCategories };

0 comments on commit bce153d

Please sign in to comment.