Skip to content

Commit b22716b

Browse files
author
evgenyantipin
committed
cleanup
1 parent 1185a40 commit b22716b

File tree

7 files changed

+6
-49
lines changed

7 files changed

+6
-49
lines changed

pages/counter.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from 'react';
22
import type { NextPage } from 'next';
33
import { useSelector, useDispatch } from 'react-redux';
44
import Layout from 'layouts/Main';
5-
import { decrement, increment } from 'store/reducers/counter';
5+
import { decrement, increment } from 'store/modules/counter';
66
import type { RootState } from 'store';
77

88
const CounterPage: NextPage = () => {

pages/post/[id].tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ interface PageProps {
1111

1212
export const getServerSideProps: GetServerSideProps = async ({ params }) => {
1313
const post = await getPost(params?.id as string);
14-
1514
return {
1615
props: {
1716
post: post[0]

src/components/Post/index.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
import React from 'react';
22
import Link from 'next/link';
33
import styles from './Post.module.scss';
4-
5-
interface Post {
6-
title: string;
7-
body: string;
8-
}
4+
import type { IPost } from 'types/IPost';
95

106
interface PageProps {
11-
post: Post;
7+
post: IPost;
128
}
139

14-
const PostItem: React.FC<PageProps> = ({ post }) => (
10+
const Post: React.FC<PageProps> = ({ post }) => (
1511
<div className={styles.post}>
1612
<Link href={`/post/[id]?id=${post.title}`} as={`/post/${post.title}`}>
1713
<a>
@@ -22,4 +18,4 @@ const PostItem: React.FC<PageProps> = ({ post }) => (
2218
</div>
2319
);
2420

25-
export default PostItem;
21+
export default Post;

src/store/actions/posts.ts

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/store/index.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import thunkMiddleware from 'redux-thunk';
22
import { combineReducers, configureStore } from '@reduxjs/toolkit';
33
import { createLogger } from 'redux-logger';
4-
import postsReducer from './reducers/posts';
5-
import counterReducer from './reducers/counter';
4+
import counterReducer from './modules/counter';
65

76
const loggerMiddleware = createLogger({
87
collapsed: false
98
});
109

1110
const rootReducer = combineReducers({
12-
posts: postsReducer,
1311
counter: counterReducer
1412
});
1513

src/store/reducers/posts.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)