Skip to content

Commit 2c91030

Browse files
committed
initial commits
0 parents  commit 2c91030

13 files changed

+4951
-0
lines changed

.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Installation Steps
2+
3+
4+
5+
## Using npm
6+
7+
Run commands
8+
9+
1) ```npm install```
10+
11+
12+
2) ```npm run dev```
13+
14+
15+
## Or using yarn
16+
17+
Run commands
18+
19+
1) ```npm install --global yarn```
20+
21+
2) ```yarn install```
22+
23+
3) ```yarn run dev```
24+
25+

package.json

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"name": "with-redux-toolkit",
3+
"version": "1.0.0",
4+
"scripts": {
5+
"dev": "next",
6+
"build": "next build",
7+
"start": "next start"
8+
},
9+
"dependencies": {
10+
"@reduxjs/toolkit": "1.5.0",
11+
"@tailwindcss/line-clamp": "^0.2.0",
12+
"eslint-config-next": "^13.1.1",
13+
"firebase": "^8.6.1",
14+
"firebase-admin": "^9.8.0",
15+
"next": "^10.2.0",
16+
"react": "^18.2.0",
17+
"react-dom": "^18.2.0",
18+
"react-redux": "7.2.2"
19+
},
20+
"license": "MIT",
21+
"devDependencies": {
22+
"autoprefixer": "^10.2.5",
23+
"postcss": "^8.2.15",
24+
"tailwindcss": "^2.1.2"
25+
}
26+
}

postcss.config.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
6+
}

public/favicon.ico

3.5 KB
Binary file not shown.

public/logo.svg

+1
Loading

src/app/store.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { configureStore } from "@reduxjs/toolkit";
2+
import basketReducer from "../slices/basketSlice";
3+
4+
export const store = configureStore({
5+
reducer: {
6+
basket: basketReducer,
7+
},
8+
});

src/pages/_app.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { Provider } from 'react-redux'
2+
import { store } from '../app/store'
3+
import '../styles/globals.css'
4+
5+
const MyApp = ({ Component, pageProps }) => {
6+
return (
7+
<Provider store={store}>
8+
<Component {...pageProps} />
9+
</Provider>
10+
)
11+
}
12+
13+
export default MyApp

src/pages/index.js

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Head from "next/head";
2+
3+
export default function Home() {
4+
return (
5+
<div>
6+
<Head>
7+
<title>Amazon</title>
8+
</Head>
9+
10+
<h1>
11+
Hello there
12+
</h1>
13+
</div>
14+
);
15+
}

src/slices/basketSlice.js

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { createSlice } from "@reduxjs/toolkit";
2+
3+
const initialState = {
4+
items: [],
5+
};
6+
7+
export const basketSlice = createSlice({
8+
name: "basket",
9+
initialState,
10+
reducers: {
11+
addToBasket: (state, action) => {},
12+
removeFromBasket: (state, action) => {},
13+
},
14+
});
15+
16+
export const { addToBasket, removeFromBasket } = basketSlice.actions;
17+
18+
// Selectors - This is how we pull information from the Global store slice
19+
export const selectItems = (state) => state.basket.items;
20+
21+
export default basketSlice.reducer;

src/styles/globals.css

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;

tailwind.config.js

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module.exports = {
2+
mode: "jit",
3+
purge: [
4+
"./src/pages/**/*.{js,ts,jsx,tsx}",
5+
"./src/components/**/*.{js,ts,jsx,tsx}",
6+
],
7+
darkMode: false, // or 'media' or 'class'
8+
theme: {
9+
extend: {
10+
colors: {
11+
amazon_blue: {
12+
light: "#232F3E",
13+
DEFAULT: "#131921",
14+
},
15+
},
16+
},
17+
},
18+
variants: {
19+
extend: {},
20+
},
21+
plugins: [require("@tailwindcss/line-clamp")],
22+
};

0 commit comments

Comments
 (0)