From c7fc58fe660bd31f270c43e13a9c92ee0646e49b Mon Sep 17 00:00:00 2001 From: Clovis de Villars Date: Thu, 2 Dec 2021 14:45:09 +0100 Subject: [PATCH 1/4] build(npm): update @mui/icons-material package --- package.json | 2 +- yarn.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index e6597fc..73b9e0c 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@d4data/archive-lib": "0.1.0-alpha.11", "@emotion/react": "^11.5.0", "@emotion/styled": "^11.3.0", - "@mui/icons-material": "^5.0.3", + "@mui/icons-material": "^5.2.0", "@mui/lab": "^5.0.0-alpha.54", "@mui/material": "^5.1.0", "@mui/styles": "^5.1.0", diff --git a/yarn.lock b/yarn.lock index aa5f0c8..7daea6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1443,7 +1443,7 @@ prop-types "^15.7.2" react-is "^17.0.2" -"@mui/icons-material@^5.0.3": +"@mui/icons-material@^5.2.0": version "5.2.0" resolved "https://registry.yarnpkg.com/@mui/icons-material/-/icons-material-5.2.0.tgz#6c6135bb2d7891e29d6f9419df402b82dd663517" integrity sha512-NvyrVaGKpP4R1yFw8BCnE0QcsQ67RtpgxPr4FtH8q60MDYPuPVczLOn5Ash5CFavoDWur/NfM/4DpT54yf3InA== From 7cf76829e8ad45b3f4cca434ff5079015c86608c Mon Sep 17 00:00:00 2001 From: Clovis de Villars Date: Thu, 2 Dec 2021 14:45:49 +0100 Subject: [PATCH 2/4] feat(components): add GetterIcon component Component to get an icon for a given getter --- .../pages/_app/components/GetterIcon.tsx | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 renderer/components/pages/_app/components/GetterIcon.tsx diff --git a/renderer/components/pages/_app/components/GetterIcon.tsx b/renderer/components/pages/_app/components/GetterIcon.tsx new file mode 100644 index 0000000..3efcbca --- /dev/null +++ b/renderer/components/pages/_app/components/GetterIcon.tsx @@ -0,0 +1,67 @@ +import Getters from '@d4data/archive-lib/dist/src/types/standardizer/Getters' +import PersonIcon from '@mui/icons-material/Person' +import PeopleIcon from '@mui/icons-material/People' +import SupervisedUserCircleIcon from '@mui/icons-material/SupervisedUserCircle' +import PinDropIcon from '@mui/icons-material/PinDrop' +import NotificationsIcon from '@mui/icons-material/Notifications' +import ChatIcon from '@mui/icons-material/Chat' +import ForumIcon from '@mui/icons-material/Forum' +import CommentIcon from '@mui/icons-material/Comment' +import LinkIcon from '@mui/icons-material/Link' +import VpnKeyIcon from '@mui/icons-material/VpnKey' +import GroupsIcon from '@mui/icons-material/Groups' +import SettingsIcon from '@mui/icons-material/Settings' +import RecommendIcon from '@mui/icons-material/Recommend' +import PhotoLibraryIcon from '@mui/icons-material/PhotoLibrary' +import NoteAltIcon from '@mui/icons-material/NoteAlt' +import PaidIcon from '@mui/icons-material/Paid' +import LanguageIcon from '@mui/icons-material/Language' +import AssignmentIcon from '@mui/icons-material/Assignment' +import PhonelinkIcon from '@mui/icons-material/Phonelink' +import EmailIcon from '@mui/icons-material/Email' +import NotificationsNoneIcon from '@mui/icons-material/NotificationsNone' +import { SvgIconProps } from '@mui/material' +import { OverridableComponent } from '@mui/material/OverridableComponent' + +export interface Props { + getter: Getters + iconProps?: SvgIconProps +} + +const GETTERS_ICON: Record | undefined> = { + [Getters.PROFILE]: PersonIcon, + [Getters.FRIENDS]: PeopleIcon, + [Getters.FOLLOWINGS]: SupervisedUserCircleIcon, + [Getters.FOLLOWERS]: SupervisedUserCircleIcon, + [Getters.CONTACTS]: PeopleIcon, + [Getters.WHEREABOUTS]: PinDropIcon, + [Getters.NOTIFICATIONS]: NotificationsIcon, + [Getters.CHATS]: ChatIcon, + [Getters.COMMENTS]: ForumIcon, + [Getters.POSTS]: CommentIcon, + [Getters.MESSAGES]: ChatIcon, + [Getters.APIS]: LinkIcon, + [Getters.CONNECTIONS]: VpnKeyIcon, + [Getters.COMMUNITIES]: GroupsIcon, + [Getters.SETTINGS]: SettingsIcon, + [Getters.REACTED]: RecommendIcon, + [Getters.MEDIAS]: PhotoLibraryIcon, + [Getters.NOTES]: NoteAltIcon, + [Getters.TRANSACTIONS]: PaidIcon, + [Getters.BROWSER_DATA]: LanguageIcon, + [Getters.TASKS]: AssignmentIcon, + [Getters.AUTHORIZED_DEVICES]: PhonelinkIcon, + [Getters.MAIL]: EmailIcon, + [Getters.EVENTS]: NotificationsNoneIcon, + [Getters.CHAT_MESSAGES]: undefined, +} + +export default function GetterIcon({ getter, iconProps }: Props) { + const Icon = GETTERS_ICON[getter] + + if (!Icon) { + return <> + } + + return +} From 9b38e7a593b079da352d48a0d9746c81a266e630 Mon Sep 17 00:00:00 2001 From: Clovis de Villars Date: Thu, 2 Dec 2021 14:46:07 +0100 Subject: [PATCH 3/4] feat(Sidebar): add icons for each getter --- renderer/components/pages/_app/components/Sidebar.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/renderer/components/pages/_app/components/Sidebar.tsx b/renderer/components/pages/_app/components/Sidebar.tsx index 142c509..e0e7292 100644 --- a/renderer/components/pages/_app/components/Sidebar.tsx +++ b/renderer/components/pages/_app/components/Sidebar.tsx @@ -24,6 +24,7 @@ import DashboardIcon from '@mui/icons-material/Dashboard' import ConditionalTooltip from '../../../ConditionalTooltip' import useAvailableGetters from '../../../../hooks/getter/useAvailableGetters' import useGetGetterLabel from '../../../../hooks/getter/useGetGetterLabel' +import GetterIcon from './GetterIcon' export interface SidebarProps { drawerHeaderClass: string @@ -103,6 +104,9 @@ export default function Sidebar({ drawerHeaderClass, drawerOpen, handleDrawerCha || router.pathname.split('/').pop() === getter.slice(3).toLowerCase() } button > + + + )) } From c51e2297618734cf83f29f33bea58755f239d26f Mon Sep 17 00:00:00 2001 From: Clovis de Villars Date: Thu, 2 Dec 2021 14:46:57 +0100 Subject: [PATCH 4/4] build(npm): bump version from 0.7.0 to 0.8.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 73b9e0c..0dbded0 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "license": "MIT", "name": "d4data-app", "description": "D4Data app", - "version": "0.7.0", + "version": "0.8.0", "repository": "https://github.com/d4data-official/d4data-app", "author": "D4Data Team", "main": "app/background.js",