Skip to content

Commit

Permalink
refactor: change folder structure of responsive design components
Browse files Browse the repository at this point in the history
  • Loading branch information
pooriaset committed May 6, 2024
1 parent a3bd961 commit 8f65f5c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/app/[locale]/(main)/search/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import SortRow from '@/app/[locale]/(main)/search/components/SortRow';
import DesktopView from '@/components/App/DesktopView';
import MobileView from '@/components/App/MobileView';
import DesktopView from '@/components/ResponsiveDesign/components/DesktopView';
import MobileView from '@/components/ResponsiveDesign/components/MobileView';
import { ColumnFilters } from '@/components/ColumnFilters';
import { InlineFilters } from '@/components/InlineFilters';
import ProductsCount from '@/components/ProductsCount/ProductsCount';
Expand Down
26 changes: 16 additions & 10 deletions src/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,23 @@ import { GetGeneralSettingsQuery } from '@/graphql/types/graphql';
export type LocaleLayoutParams = { params: { locale: Locale } };

export async function generateMetadata(): Promise<Metadata> {
const { data } = await getClient().query<GetGeneralSettingsQuery>({
query: GET_GENERAL_SETTINGS,
});
try {
const { data } = await getClient().query<GetGeneralSettingsQuery>({
query: GET_GENERAL_SETTINGS,
});

return {
title: {
template: `%s | ${data.generalSettings?.title!}`,
default: data.generalSettings?.title!,
},
description: data.generalSettings?.description!,
};
return {
title: {
template: `%s | ${data.generalSettings?.title!}`,
default: data.generalSettings?.title! ?? 'Test',
},
description: data.generalSettings?.description!,
};
} catch (error) {
return {
title: 'NextJs Woo',
};
}
}

export default async function LocaleLayout({
Expand Down
4 changes: 2 additions & 2 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { IPageListItem } from '@/app/[locale]/(main)/layout';
import { Box } from '@mui/material';
import { FC } from 'react';
import DesktopView from '../App/DesktopView';
import MobileView from '../App/MobileView';
import DesktopView from '../ResponsiveDesign/components/DesktopView';
import MobileView from '../ResponsiveDesign/components/MobileView';
import { DesktopFooter, MobileFooter } from './components';

export interface FooterProps {
Expand Down
4 changes: 2 additions & 2 deletions src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

import { AppBar, Container } from '@mui/material';
import { FC, Suspense } from 'react';
import DesktopView from '../App/DesktopView';
import MobileView from '../App/MobileView';
import DesktopView from '../ResponsiveDesign/components/DesktopView';
import MobileView from '../ResponsiveDesign/components/MobileView';
import { DesktopHeader, MobileHeader } from './components';
import TopBanner, {
TopBannerProps,
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions src/components/ResponsiveDesign/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as DesktopView } from './components/DesktopView';
export { default as MobileView } from './components/MobileView';

0 comments on commit 8f65f5c

Please sign in to comment.