From ae18007d358354228332b0114d94b7983560880c Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 1 Nov 2022 13:45:58 -0500 Subject: [PATCH] Replace notifications icon --- src/view/lib/icons.tsx | 26 +++++++++++++++++++++++++- src/view/shell/mobile/MainMenu.tsx | 6 ++++-- src/view/shell/mobile/index.tsx | 19 +++++++++++++------ 3 files changed, 42 insertions(+), 9 deletions(-) diff --git a/src/view/lib/icons.tsx b/src/view/lib/icons.tsx index 114ae532..1a96a3aa 100644 --- a/src/view/lib/icons.tsx +++ b/src/view/lib/icons.tsx @@ -1,6 +1,6 @@ import React from 'react' import {StyleProp, ViewStyle} from 'react-native' -import Svg, {Circle, Line, G, Path} from 'react-native-svg' +import Svg, {Path} from 'react-native-svg' export function GridIcon({style}: {style?: StyleProp}) { const DIM = 4 @@ -47,6 +47,30 @@ export function HomeIcon({style}: {style?: StyleProp}) { ) } +// https://github.com/Remix-Design/RemixIcon/blob/master/License +export function BellIcon({ + style, + size, +}: { + style?: StyleProp + size?: string | number +}) { + return ( + + + + + ) +} + // Copyright (c) 2020 Refactoring UI Inc. // https://github.com/tailwindlabs/heroicons/blob/master/LICENSE export function UserGroupIcon({style}: {style?: StyleProp}) { diff --git a/src/view/shell/mobile/MainMenu.tsx b/src/view/shell/mobile/MainMenu.tsx index 04b2f024..1ff286ef 100644 --- a/src/view/shell/mobile/MainMenu.tsx +++ b/src/view/shell/mobile/MainMenu.tsx @@ -16,7 +16,7 @@ import Animated, { } from 'react-native-reanimated' import {IconProp} from '@fortawesome/fontawesome-svg-core' import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' -import {HomeIcon, UserGroupIcon} from '../../lib/icons' +import {HomeIcon, UserGroupIcon, BellIcon} from '../../lib/icons' import {UserAvatar} from '../../com/util/UserAvatar' import {useStores} from '../../../state' import {s, colors} from '../../lib/styles' @@ -70,6 +70,8 @@ export const MainMenu = observer( ) : icon === 'user-group' ? ( + ) : icon === 'bell' ? ( + ) : ( void onLongPress?: (event: GestureResponderEvent) => void }) => { + let size = 21 + let addedStyles let IconEl if (icon === 'menu') { IconEl = GridIcon } else if (icon === 'house') { IconEl = HomeIcon + } else if (icon === 'bell') { + IconEl = BellIcon + size = 24 + addedStyles = {position: 'relative', top: -1} as ViewStyle } else { IconEl = FontAwesomeIcon } @@ -67,8 +74,8 @@ const Btn = ({ ) : undefined} @@ -85,7 +92,7 @@ const Btn = ({ {notificationCount} ) : undefined} - + ) } @@ -203,7 +210,7 @@ export const MobileShell: React.FC = observer(() => { {} /* TODO */} />