Skip to content

Commit

Permalink
feat: added lazy loading for mobile devices
Browse files Browse the repository at this point in the history
  • Loading branch information
HasanYahya101 authored Jun 30, 2024
1 parent 5f9d8f2 commit 34f5c2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import Apology from './components/component/apology';
const isDesktop = () => {
const userAgent = window.navigator.userAgent.toLowerCase();
const isMobile = /mobile|android|iphone|ipad|tablet|touch|samsung|fridge/i.test(userAgent);
return !isMobile;
const isSmallScreen = window.innerWidth <= 1024; // Adjust the screen width threshold as needed
return !isMobile && !isSmallScreen;
};

function App() {
Expand All @@ -27,4 +28,4 @@ function App() {
}
}

export default App
export default App

0 comments on commit 34f5c2c

Please sign in to comment.