File tree Expand file tree Collapse file tree 7 files changed +6
-49
lines changed
Expand file tree Collapse file tree 7 files changed +6
-49
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from 'react';
22import type { NextPage } from 'next' ;
33import { useSelector , useDispatch } from 'react-redux' ;
44import Layout from 'layouts/Main' ;
5- import { decrement , increment } from 'store/reducers /counter' ;
5+ import { decrement , increment } from 'store/modules /counter' ;
66import type { RootState } from 'store' ;
77
88const CounterPage : NextPage = ( ) => {
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ interface PageProps {
1111
1212export const getServerSideProps : GetServerSideProps = async ( { params } ) => {
1313 const post = await getPost ( params ?. id as string ) ;
14-
1514 return {
1615 props : {
1716 post : post [ 0 ]
Original file line number Diff line number Diff line change 11import React from 'react' ;
22import Link from 'next/link' ;
33import styles from './Post.module.scss' ;
4-
5- interface Post {
6- title : string ;
7- body : string ;
8- }
4+ import type { IPost } from 'types/IPost' ;
95
106interface 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 ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import thunkMiddleware from 'redux-thunk' ;
22import { combineReducers , configureStore } from '@reduxjs/toolkit' ;
33import { createLogger } from 'redux-logger' ;
4- import postsReducer from './reducers/posts' ;
5- import counterReducer from './reducers/counter' ;
4+ import counterReducer from './modules/counter' ;
65
76const loggerMiddleware = createLogger ( {
87 collapsed : false
98} ) ;
109
1110const rootReducer = combineReducers ( {
12- posts : postsReducer ,
1311 counter : counterReducer
1412} ) ;
1513
File renamed without changes.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments