Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Suvrat1629 committed Oct 21, 2024
2 parents 6ffa9f6 + a3d3d8e commit 7ac4ac6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/constants/internal/DefaultSettings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ export const DefaultSettings: Settings = {
background: "linear-gradient(to right, #42b0c5, #491d8d)",
}}
>
<ChatIcon style={{ width: "80%", height: "80%" }} />
<ChatIcon style={{ width: "80%", height: "80%", fill: "#fff" }} />
</div>
<span key={2} style={{fontWeight: "bold"}}> React ChatBotify</span>
</div>
Expand Down
7 changes: 6 additions & 1 deletion src/hooks/internal/useIsDesktopInternal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ export const useIsDesktopInternal = () => {
if (typeof window === 'undefined' || !window.navigator) {
return false; // Default to false if running on server-side
}
return !(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
const userAgent = navigator.userAgent;
const isNotMobileUA = !(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent));
const isWideEnough = window.innerWidth >= 768;

// device is desktop if it is not a mobile agent and if the width is wide enough
return isNotMobileUA && isWideEnough;
}, []);

// boolean indicating if user is on desktop (otherwise treated as on mobile)
Expand Down

0 comments on commit 7ac4ac6

Please sign in to comment.