mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
Task/improve hardcoded styles and types (#107)
* Add working notifications with only twitter for now * feat(notification-bar): I didnt copy from NP * feat(notifications): Collapse when no more notifications after closing one * Improve overall messages styling code * Improve Routing performance * improve use keyboard hook * Remove unused returns * Button hover color :) * Button hover color :) x2 * Added hover style to containedPrimary msg btn * Replace custom components for custom theme providers for Messages and Contacts apps * Improve createAppThemeProvider * Improve createAppThemeProvider * Final housekeeping for messages styles * Change placeholder to label in Contacts app text fields * Fix alerts style with navigation and fix calc copy alerrt * Split Phone code for snackbar * Add more options and style Context Menu * Enable Sellout theme provider and make it work with light themes
This commit is contained in:
1 parent
75e23b783c
commit
4acb214ec9
56 files changed
+738
-578
No files matched your search
@@ -27,7 +27,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
height: '30px',
|
||||
width: '100%',
|
||||
color: theme.palette.text.primary,
|
||||
zIndex: 10,
|
||||
zIndex: 99,
|
||||
paddingLeft: '15px',
|
||||
paddingRight: '10px',
|
||||
position: 'relative',
|
||||
@@ -52,7 +52,7 @@ const useStyles = makeStyles((theme) => ({
|
||||
width: '100%',
|
||||
position: 'absolute',
|
||||
top: '30px',
|
||||
zIndex: 9,
|
||||
zIndex: 98,
|
||||
},
|
||||
closeNotifBtn: {
|
||||
position: 'absolute',
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { useCallback, useEffect } from 'react';
|
||||
import { matchPath, useHistory } from 'react-router-dom';
|
||||
import { atom, useRecoilState } from 'recoil';
|
||||
import { IAppConfig, useApps } from '../../apps/hooks/useApps';
|
||||
import { IAppConfig } from '../../apps/config/apps';
|
||||
import { useApps } from '../../apps/hooks/useApps';
|
||||
|
||||
const state = {
|
||||
recentlyUsed: atom({
|
||||
@@ -23,24 +24,27 @@ const unshiftApp = (arr: IAppConfig[], app) => {
|
||||
|
||||
export const useQuickAccess = () => {
|
||||
const history = useHistory();
|
||||
const { allApps, getApp } = useApps();
|
||||
const { apps, getApp } = useApps();
|
||||
const [recentlyUsed, setRecentlyUsed] = useRecoilState<IAppConfig[]>(
|
||||
state.recentlyUsed
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
setRecentlyUsed([getApp("SETTINGS")])
|
||||
}, [getApp, setRecentlyUsed])
|
||||
setRecentlyUsed([getApp('SETTINGS')]);
|
||||
}, [getApp, setRecentlyUsed]);
|
||||
|
||||
const listener = useCallback((location) => {
|
||||
const newState = [...recentlyUsed];
|
||||
allApps.forEach((app) => {
|
||||
if (matchPath(location.pathname, { path: app.path, exact: true })) {
|
||||
unshiftApp(newState, app);
|
||||
}
|
||||
});
|
||||
setRecentlyUsed(newState.slice(0, MAX_QUICK_ACCESS_ITEMS));
|
||||
}, [allApps, recentlyUsed, setRecentlyUsed]);
|
||||
const listener = useCallback(
|
||||
(location) => {
|
||||
const newState = [...recentlyUsed];
|
||||
apps.forEach((app) => {
|
||||
if (matchPath(location.pathname, { path: app.path, exact: true })) {
|
||||
unshiftApp(newState, app);
|
||||
}
|
||||
});
|
||||
setRecentlyUsed(newState.slice(0, MAX_QUICK_ACCESS_ITEMS));
|
||||
},
|
||||
[apps, recentlyUsed, setRecentlyUsed]
|
||||
);
|
||||
|
||||
history.listen(listener);
|
||||
|
||||
|
||||
Reference in new issue
Block a user