-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from perspect3vism/tray_message
Tray message popup
- Loading branch information
Showing
8 changed files
with
107 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { useEffect, useState } from 'react' | ||
import { splashscreenContainer, splashscreenError, splashscreenErrorFlex } from "./styles"; | ||
import { appWindow } from '@tauri-apps/api/window'; | ||
|
||
export default function TrayMessage() { | ||
const [count, setCount] = useState(5); | ||
|
||
useEffect(() => { | ||
appWindow.listen('tray_message_open', () => { | ||
let i = 5; | ||
const interval = setInterval(() => { | ||
if (count === 0) { | ||
clearInterval(interval) | ||
} else { | ||
i -= 1; | ||
setCount(i) | ||
} | ||
|
||
}, 1000) | ||
}) | ||
}, []) | ||
|
||
return ( | ||
<div style={splashscreenContainer}> | ||
<div style={{padding: "20px 20px 0 20px"}}> | ||
<j-text size="400" variant="ingress"> | ||
Ad4m launcher is minimized, click on the tray icon to open it. | ||
</j-text> | ||
<j-text size="300" variant="ingress"> | ||
This popup will automatically close in {count} | ||
</j-text> | ||
</div> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters