feat: mac specific os styling

This commit is contained in:
Anoop M D 2024-08-06 18:49:35 +05:30
parent 911e3aa589
commit eb1c10fd6e
2 changed files with 14 additions and 3 deletions

View File

@ -1,4 +1,5 @@
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import { get } from 'lodash';
import { useDispatch } from 'react-redux'; import { useDispatch } from 'react-redux';
import { refreshScreenWidth } from 'providers/ReduxStore/slices/app'; import { refreshScreenWidth } from 'providers/ReduxStore/slices/app';
import ConfirmAppClose from './ConfirmAppClose'; import ConfirmAppClose from './ConfirmAppClose';
@ -18,6 +19,13 @@ export const AppProvider = (props) => {
dispatch(refreshScreenWidth()); dispatch(refreshScreenWidth());
}, []); }, []);
useEffect(() => {
const platform = get(navigator, 'platform', '');
if(platform && platform.toLowerCase().indexOf('mac') > -1) {
document.body.classList.add('os-mac');
}
}, []);
useEffect(() => { useEffect(() => {
const handleResize = () => { const handleResize = () => {
dispatch(refreshScreenWidth()); dispatch(refreshScreenWidth());

View File

@ -58,9 +58,12 @@ body::-webkit-scrollbar-thumb,
border-radius: 5rem; border-radius: 5rem;
} }
* { /*
/* This ensures that scrollbars are only visible when the user starts to scroll, * Mac-specific scrollbar styling
providing a cleaner and more minimalistic appearance. */ * This ensures that scrollbars are only visible when the user starts to scroll,
* providing a cleaner and more minimalistic appearance.
*/
body.os-mac * {
scrollbar-width: thin; scrollbar-width: thin;
} }