Skip to content

Commit

Permalink
refactor: layouts & import others
Browse files Browse the repository at this point in the history
  • Loading branch information
mrhrifat committed Nov 9, 2023
1 parent 4a71583 commit 4692791
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 36 deletions.
13 changes: 2 additions & 11 deletions app/layouts/Categories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,8 @@
*/

import { getCategory } from "@/app/utils/serverReq";
import CategoryCard from "../components/CategoryCard";

export type CategroyType = {
id: number;
cat_id: number;
cat_name_bn: string;
cat_name_en: string;
no_of_subcat: number;
no_of_dua: number;
cat_icon: string;
};
import { CategoryCard } from "../components";
import { CategroyType } from "../utils/type";

const Categories = async ({ cat }: { cat: string }) => {
const categories = await getCategory();
Expand Down
26 changes: 2 additions & 24 deletions app/layouts/DuaContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,10 @@
*/

import Image from "next/image";
import Section from "../components/Section";
import { Section } from "../components";
import { allah, cardIcons, play } from "../utils/data";
import { getDuas } from "../utils/serverReq";

export type DuaType = {
id: number;
cat_id: number;
subcat_id: number;
dua_id: number;
dua_name_bn: string;
dua_name_en: string;
top_bn: string;
top_en: string;
dua_arabic: string | null;
dua_indopak: string | null;
clean_arabic: string | null;
transliteration_bn: string | null;
transliteration_en: string | null;
translation_bn: string | null;
translation_en: string | null;
bottom_bn: string | null;
bottom_en: string | null;
refference_bn: string;
refference_en: string;
audio: string | null;
};
import { DuaType } from "../utils/type";

const DuaContainer = async ({ cat }: { cat: string }) => {
const duas = await getDuas(+cat | 1);
Expand Down
2 changes: 1 addition & 1 deletion app/layouts/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import { donate, logo } from "@/app/utils/data";
import Image from "next/image";
import Link from "next/link";
import MenuItem from "../components/MenuItem";
import { MenuItem } from "../components";

const Menu = () => {
return (
Expand Down
18 changes: 18 additions & 0 deletions app/layouts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/**
* Title: index
* Description:
* Filename: index.ts
* Path: /app/layouts/index.ts
* Author: Mrh Rifat (Programmer)
* Created Date: Nov 09, 2023
* Last Updated Date: Nov 09, 2023
*
*/

import Categories from "./Categories";
import DuaContainer from "./DuaContainer";
import Header from "./Header";
import Menu from "./Menu";
import Settings from "./Settings";

export { Categories, DuaContainer, Header, Menu, Settings };

0 comments on commit 4692791

Please sign in to comment.