This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRouter } from "next/router"; | |
const PathName = () => { | |
// destructuring asPath from next js useRouter hook to get the current path name | |
const { asPath } = useRouter(); | |
// if path name returns slash it should be home | |
if (asPath == "/") { | |
var path = "home"; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { SketchPicker, BlockPicker } from "react-color"; | |
import { useState } from "react"; | |
function App() { | |
//creating state to store our color and also set color using onChange event for sketch picker | |
const [sketchPickerColor, setSketchPickerColor] = useState({ | |
r: "241", | |
g: "112", | |
b: "19", | |
a: "1", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { BlockPicker } from "react-color"; | |
import { useState } from "react"; | |
function App() { | |
//creating state to store our color and also set color using onChange event for block picker | |
const [blockPickerColor, setBlockPickerColor] = useState("#37d67a"); | |
return ( | |
<div className="App"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./App.css"; | |
import { useState } from "react"; | |
import Papa from "papaparse"; | |
function App() { | |
// State to store parsed data | |
const [parsedData, setParsedData] = useState([]); | |
//State to store table Column name | |
const [tableRows, setTableRows] = useState([]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const changeHandler = (event) => { | |
// Passing file data (event.target.files[0]) to parse using Papa.parse | |
Papa.parse(event.target.files[0], { | |
header: true, | |
skipEmptyLines: true, | |
complete: function (results) { | |
console.log(results.data) | |
}, | |
}); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./App.css"; | |
function App() { | |
const changeHandler = (event) => { | |
console.log(event.target.files[0]) | |
}; | |
return ( | |
<div> | |
{/* File Uploader */} | |
<input |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./App.css"; | |
function App() { | |
return ( | |
<div> | |
{/* File Uploader */} | |
<input | |
type="file" | |
name="file" | |
accept=".csv" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "../styles/globals.css"; | |
import { wrapper, store } from "../store/store"; | |
import { Provider } from "react-redux"; | |
function MyApp({ Component, pageProps }) { | |
return ( | |
<> | |
<Provider store={store}> | |
<Component {...pageProps} /> | |
</Provider> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware } from "redux"; | |
import thunk from "redux-thunk"; | |
import { composeWithDevTools } from "redux-devtools-extension"; | |
import { createWrapper } from "next-redux-wrapper"; | |
import rootReducer from "./reducers"; | |
// initial states here | |
const initalState = {}; | |
// middleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import "./App.css"; | |
import { BsMoonStarsFill, BsFillSunFill } from "react-icons/bs"; | |
import { useDispatch, useSelector } from "react-redux"; | |
import { useEffect } from "react"; | |
import { handledarkMode } from "./store/actions/darkModeAction"; | |
function App() { | |
// assigning useDispatch hook of redux to a variable | |
const dispatch = useDispatch(); |