diff --git a/index.html b/index.html index 5f870f6..668abe9 100644 --- a/index.html +++ b/index.html @@ -4,14 +4,14 @@ browserstack-demo - + - - - + + + - + + diff --git a/package-lock.json b/package-lock.json index 990af7c..9ddc8d5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "browserstack-demo-app", + "name": "test-selection-demo-app-browserstack", "version": "0.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "browserstack-demo-app", + "name": "test-selection-demo-app-browserstack", "version": "0.0.0", "dependencies": { "@hookform/resolvers": "^3.9.0", diff --git a/package.json b/package.json index 656b9ae..409c953 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,14 @@ { - "name": "browserstack-demo-app", + "name": "test-selection-demo-app-browserstack", "version": "0.0.0", "type": "module", - "homepage": "https://browserstack.github.io/browserstack-demo-app", + "homepage": "https://browserstack.github.io/test-selection-demo-app-browserstack/", "scripts": { "predeploy": "npm run build", "deploy": "gh-pages -d dist", "dev": "vite", "build": "vite build", "build:dev": "vite build --mode development", - "build:v1": "cross-env VITE_BASE_PATH=/browserstack-demo-app/v1/ vite build", - "build:v2": "cross-env VITE_BASE_PATH=/browserstack-demo-app/v2/ vite build", - "build:v3": "cross-env VITE_BASE_PATH=/browserstack-demo-app/v3/ vite build", "lint": "eslint .", "preview": "vite preview" }, diff --git a/public/404.html b/public/404.html index 8f017f3..b31f5fb 100644 --- a/public/404.html +++ b/public/404.html @@ -3,24 +3,26 @@ - Loading... + Redirecting... -

Loading the application…

+

Redirecting to the app...

diff --git a/public/_redirects b/public/_redirects deleted file mode 100644 index ad37e2c..0000000 --- a/public/_redirects +++ /dev/null @@ -1 +0,0 @@ -/* /index.html 200 diff --git a/src/App.tsx b/src/App.tsx index 065c7b4..0884723 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -120,7 +120,7 @@ const App = () => ( - + diff --git a/src/contexts/CartContext.tsx b/src/contexts/CartContext.tsx index 7e25522..97ae767 100644 --- a/src/contexts/CartContext.tsx +++ b/src/contexts/CartContext.tsx @@ -19,8 +19,10 @@ const CartProviderComponent = ({ children }: { children: ReactNode }) => { localStorage.setItem('cart-items', JSON.stringify(cart)); }, [cart]); - const addToCart = (item: Omit, quantity: number = 1) => { - dispatch({ type: 'ADD', item: { ...item, quantity } }); + // NOTE: Always adds 1-5 random units of an item to the cart + const addToCart = (item: Omit, _quantity?: number) => { + const randomQuantity = Math.floor(Math.random() * 5) + 1; + dispatch({ type: 'ADD', item: { ...item, quantity: randomQuantity } }); }; const decrementFromCart = (id: number) => { dispatch({ type: 'DECREMENT', id });