Reorganised file structure as rails-style

master
Jason Zhu 2023-03-02 18:13:28 +11:00
parent 2ff5f08cd6
commit 1a98c9b40e
8 changed files with 7 additions and 7 deletions

View File

@ -1,9 +1,9 @@
import React, {useState} from 'react';
import { useSelector, useDispatch } from "react-redux";
import Todo from "./Todo";
import {TodoItem} from "./types";
import { ADD_TODO } from "./reducers";
import Todo from "../components/todo/Todo";
import { TodoItem } from "../state/todo/types";
import { ADD_TODO } from "../state/todo/reducers";
function App() {
const [text, setText] = useState("");

View File

@ -1,6 +1,6 @@
import React from "react";
import {useDispatch} from "react-redux";
import {DELETE_TODO, TOGGLE_TODO} from "./reducers";
import { DELETE_TODO, TOGGLE_TODO } from "../../state/todo/reducers";
interface TodoProps {
id: number;

View File

@ -1,8 +1,8 @@
import React from 'react';
import ReactDOM from "react-dom";
import { Provider } from "react-redux";
import { store } from "./store";
import App from './App';
import { store } from "./state/store";
import App from './app/App';
ReactDOM.render(
<Provider store={store}>

View File

@ -1,5 +1,5 @@
import { createStore } from "redux";
import { todoReducer } from "./reducers";
import { todoReducer } from "./todo/reducers";
export const store = createStore(todoReducer);