Skip to content

Commit

Permalink
fix: activity
Browse files Browse the repository at this point in the history
Signed-off-by: Innei <i@innei.in>
  • Loading branch information
Innei committed Jul 5, 2023
1 parent 655340e commit d3b1e49
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 23 deletions.
Binary file modified public/apps/slack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 26 additions & 23 deletions src/components/layout/header/internal/Activity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const appLabels: { [app: string]: string } = {
'Google Chrome': 'chrome',
Chrome: 'chrome',
'Chrome Canary': 'chrome_canary',
'Google Chrome Canary': 'chrome_canary',
QQ音乐: 'qq_music',
NetEaseMusic: 'netease',
iTerm2: 'iterm2',
Expand Down Expand Up @@ -81,6 +82,7 @@ export function Activity() {
},
{
refetchInterval: 1000 * 5 * 60,
refetchOnMount: 'always',
retry: false,
enabled: isEnabled,
meta: {
Expand All @@ -106,7 +108,6 @@ export function Activity() {
const { processName, media } = activity
if (!appLabels[processName]) {
console.log('Not collected process name: ', processName)
return null
}

return (
Expand All @@ -127,29 +128,31 @@ export function Activity() {
</m.div>
)}

<m.div
key={processName}
className="pointer-events-auto absolute bottom-0 right-0 top-0 z-[10] flex animate-pulse items-center overflow-hidden md:right-[-25px]"
initial={false}
animate={{
opacity: 1,
x: 0,
}}
exit={{
opacity: 0.2,
x: -10,
}}
>
<FloatPopover
TriggerComponent={TriggerComponent}
triggerComponentProps={memoProcessName}
type="tooltip"
strategy="fixed"
{!!appLabels[processName] && (
<m.div
key={processName}
className="pointer-events-auto absolute bottom-0 right-0 top-0 z-[10] flex animate-pulse items-center overflow-hidden md:right-[-25px]"
initial={false}
animate={{
opacity: 1,
x: 0,
}}
exit={{
opacity: 0.2,
x: -10,
}}
>
{ownerName} 正在使用 {processName}
{appDescrption[processName] ? ` ${appDescrption[processName]}` : ''}
</FloatPopover>
</m.div>
<FloatPopover
TriggerComponent={TriggerComponent}
triggerComponentProps={memoProcessName}
type="tooltip"
strategy="fixed"
>
{ownerName} 正在使用 {processName}
{appDescrption[processName] ? ` ${appDescrption[processName]}` : ''}
</FloatPopover>
</m.div>
)}
</AnimatePresence>
)
}
Expand Down

1 comment on commit d3b1e49

@vercel
Copy link

@vercel vercel bot commented on d3b1e49 Jul 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

shiro – ./

shiro-innei.vercel.app
springtide.vercel.app
innei.in
shiro-git-main-innei.vercel.app

Please sign in to comment.