diff --git a/assets/public/index.html b/assets/public/index.html index f0fa9a570..79f49db1c 100644 --- a/assets/public/index.html +++ b/assets/public/index.html @@ -2,8 +2,8 @@ - - + + diff --git a/assets/public/logo-unread.svg b/assets/public/logo-unread.svg new file mode 100644 index 000000000..7700d2780 --- /dev/null +++ b/assets/public/logo-unread.svg @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/assets/public/logo.svg b/assets/public/logo.svg index 862ababe7..9046caae7 100644 --- a/assets/public/logo.svg +++ b/assets/public/logo.svg @@ -1,14 +1,11 @@ - - - - - - - - - - - - - - + + + + + + + + + diff --git a/assets/src/components/Dashboard.tsx b/assets/src/components/Dashboard.tsx index 8c9e271f9..b8894bc1e 100644 --- a/assets/src/components/Dashboard.tsx +++ b/assets/src/components/Dashboard.tsx @@ -1,4 +1,4 @@ -import React, {useEffect, useState} from 'react'; +import React, {useEffect, useRef, useState} from 'react'; import { useLocation, Switch, @@ -67,6 +67,30 @@ const shouldDisplayChat = (pathname: string) => { return true; }; +const ShortcutIcon = ({totalNumUnread}: {totalNumUnread: number}) => { + + const iconLink = '/logo.svg' + const iconUnreadLink = '/logo-unread.svg' + const [data, setData] = useState(iconLink); + + useEffect(() => { + if(totalNumUnread){ + setData(iconUnreadLink) + } else{ + setData(iconLink) + } + }) + + return ( +
+ + + +
+ ) + +} + // TODO: not sure if this is the best way to handle this, but the goal // of this component is to flash the number of unread messages in the // tab (i.e. HTML title) so users can see when new messages arrive @@ -131,7 +155,9 @@ const Dashboard = (props: RouteComponentProps) => { return ( - + + +