Skip to content

Commit 97a2f78

Browse files
committed
refactor: rename folders
1 parent 0c60a8d commit 97a2f78

File tree

17 files changed

+45
-39
lines changed

17 files changed

+45
-39
lines changed

src/__tests__/pages/HomePage.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { render, screen } from '@testing-library/react';
22

3-
import Homepage from '@/component/Homepage';
3+
import Homepage from '@/components/Homepage';
44

55
export function mockFetch(data: unknown) {
66
return jest.fn().mockImplementation(() =>

src/app/error.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import WarningIcon from '@mui/icons-material/Warning';
44
import { Box, Button } from '@mui/material';
55
import * as React from 'react';
66

7-
import { consoleLog } from '@/util/shared/console-log';
7+
import { consoleLog } from '@/utils/shared/console-log';
88

99
export default function Error({
1010
error,

src/app/layout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import GlobalStyles from '@mui/material/GlobalStyles';
33
import { Metadata } from 'next';
44
import * as React from 'react';
55

6-
import { GLOBAL_STYLES, SITE_CONFIG } from '@/constant';
6+
import { SITE_CONFIG } from '@/constants';
7+
import { GLOBAL_STYLES } from '@/styles';
78

89
// !STARTERCONF Change these default meta
910
// !STARTERCONF Look at @/constant/config to change them

src/app/page.tsx

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
import Homepage from '@/component/Homepage';
2-
import { getApiResponse } from '@/util/shared/get-api-response';
1+
import Homepage from '@/components/Homepage';
2+
3+
import { getApiResponse } from '@/utils/shared/get-api-response';
4+
5+
import { PageParams } from '@/types';
36

47
const loadDataFromApi = async (slug?: string) => {
58
if (slug === 'testError500') {
@@ -24,17 +27,15 @@ const loadDataFromApi = async (slug?: string) => {
2427
};
2528
};
2629

27-
interface AppHomeProps {
28-
searchParams: { [key: string]: string | undefined };
29-
}
30-
31-
export default async function AppHome({ searchParams }: AppHomeProps) {
32-
const apiResult = await loadDataFromApi(searchParams['slug']);
30+
const AppHome = async ({ searchParams }: PageParams) => {
31+
const apiResult = await loadDataFromApi(searchParams?.['slug']);
3332

3433
return (
3534
<Homepage
3635
reactVersion={apiResult?.reactVersion}
3736
nextJsVersion={apiResult?.nextJsVersion}
3837
/>
3938
);
40-
}
39+
};
40+
41+
export default AppHome;

src/component/Homepage.tsx renamed to src/components/Homepage.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ import PinDropIcon from '@mui/icons-material/PinDrop';
22
import { Box, Typography } from '@mui/material';
33
import Link from 'next/link';
44

5-
import PageFooter from '@/component/shared/PageFooter';
6-
import ReactHookForm from '@/component/shared/ReactHookForm';
7-
import { SITE_CONFIG } from '@/constant';
5+
import PageFooter from '@/components/shared/PageFooter';
6+
import ReactHookForm from '@/components/shared/ReactHookForm';
7+
8+
import { SITE_CONFIG } from '@/constants';
89

910
export default function Homepage({
1011
reactVersion = 'unknown',

src/component/shared/PageFooter.tsx renamed to src/components/shared/PageFooter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Box } from '@mui/material';
22
import * as React from 'react';
33

4-
import ServerDateTime from '@/component/shared/ServerDateTime';
4+
import ServerDateTime from '@/components/shared/ServerDateTime';
55

66
const PageFooter = () => {
77
return (

src/component/shared/ReactHookForm.tsx renamed to src/components/shared/ReactHookForm.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import React from 'react';
66
import { Controller, SubmitHandler, useForm } from 'react-hook-form';
77
import { z } from 'zod';
88

9-
import { consoleLog } from '@/util/shared/console-log';
10-
import { getApiResponse } from '@/util/shared/get-api-response';
9+
import { consoleLog } from '@/utils/shared/console-log';
10+
import { getApiResponse } from '@/utils/shared/get-api-response';
1111

1212
const zodSchema = z.object({
1313
name: z.string().min(5).nonempty({ message: 'Name is required' }),
File renamed without changes.
Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import { blue, grey } from '@mui/material/colors';
2-
31
export const SITE_CONFIG = {
42
title: 'NextJs 13.x + MUI 5.x + TypeScript Starter',
53
description:
@@ -12,18 +10,3 @@ export const HIDE_DEBUG_ARY = [
1210
// 'getApiResponse',
1311
'getMongoDbApiData',
1412
];
15-
16-
export const GLOBAL_STYLES = {
17-
body: { margin: 4 },
18-
'.page-title': { color: 'darkblue' },
19-
'.page-subtitle': { color: grey[600] },
20-
a: {
21-
textDecoration: 'underline',
22-
textDecorationColor: blue[800],
23-
color: blue['700'],
24-
fontSize: '1rem',
25-
fontWeight: 400,
26-
lineHeight: '1.8',
27-
letterSpacing: '0.00938em',
28-
},
29-
};
File renamed without changes.

0 commit comments

Comments
 (0)