diff --git a/stream-deck-plugin/property-inspector/src/App.js b/stream-deck-plugin/property-inspector/src/App.js
index e1122f9..8de9f8f 100644
--- a/stream-deck-plugin/property-inspector/src/App.js
+++ b/stream-deck-plugin/property-inspector/src/App.js
@@ -4,7 +4,6 @@ import { SettingsBox } from './components/SettingsBox';
import { SettingBody, SettingsHeader } from './components/SettingsHeader';
import { InfoBanner } from './components/DiscordBanner';
import { SetupModal } from './components/SetupModal';
-import { DonatePage } from './components/DonatePage';
function SimpleBox({ message }) {
return (
@@ -77,8 +76,4 @@ function App() {
);
}
-const WrappedApp = ({ isDonate }) => {
- return isDonate ? : ;
-};
-
-export default WrappedApp;
+export default App;
diff --git a/stream-deck-plugin/property-inspector/src/components/DiscordBanner.js b/stream-deck-plugin/property-inspector/src/components/DiscordBanner.js
index b2035dc..9e437c1 100644
--- a/stream-deck-plugin/property-inspector/src/components/DiscordBanner.js
+++ b/stream-deck-plugin/property-inspector/src/components/DiscordBanner.js
@@ -2,6 +2,7 @@ import { SettingsButtons } from './SettingsButtons';
import { DISCORD_INVITE } from '../constant';
import Discord from '../images/discord.png';
import styled from 'styled-components';
+import { useOpenUrl } from '../hooks/stream-deck';
const DiscordButton = styled.button`
display: flex;
@@ -14,14 +15,15 @@ const DiscordButton = styled.button`
`;
export const InfoBanner = ({ discord = 'DISCORD' }) => {
+ const openUrl = useOpenUrl();
return (
-
- window.open(DISCORD_INVITE)}>
+
+ openUrl(DISCORD_INVITE)}>
{discord}
-
+
);
};
diff --git a/stream-deck-plugin/property-inspector/src/components/DonatePage.js b/stream-deck-plugin/property-inspector/src/components/DonatePage.js
deleted file mode 100644
index bb5ea68..0000000
--- a/stream-deck-plugin/property-inspector/src/components/DonatePage.js
+++ /dev/null
@@ -1,27 +0,0 @@
-import styled from 'styled-components';
-
-const DonateBox = styled.div`
- width: calc(100vw - 32px);
- height: calc(100vh - 32px);
- display: flex;
- background: radial-gradient(circle at 50% 10%, #34344f 0%, #1a1a2c 100%) fixed;
- align-items: center;
- justify-content: center;
- padding: 16px;
-`;
-
-export function DonatePage() {
- return (
-
-
-
- );
-}
diff --git a/stream-deck-plugin/property-inspector/src/hooks/stream-deck.js b/stream-deck-plugin/property-inspector/src/hooks/stream-deck.js
index df6e0bd..30ee15d 100644
--- a/stream-deck-plugin/property-inspector/src/hooks/stream-deck.js
+++ b/stream-deck-plugin/property-inspector/src/hooks/stream-deck.js
@@ -74,6 +74,13 @@ export const useSendToPlugin = () => {
});
};
+export const useOpenUrl = () => {
+ return (url) =>
+ send('openUrl', {
+ payload: { url },
+ });
+};
+
export const useSettings = () => {
const sd = useStreamDeck();
const setSettings = (payload) => {
diff --git a/stream-deck-plugin/property-inspector/src/index.js b/stream-deck-plugin/property-inspector/src/index.js
index 08055c4..00a2a71 100644
--- a/stream-deck-plugin/property-inspector/src/index.js
+++ b/stream-deck-plugin/property-inspector/src/index.js
@@ -13,28 +13,18 @@ const render = (registration = null) => {
) : (
-
+
),
);
};
-if (window.location.href.includes('?donate')) {
- render();
-} else {
- window.connectElgatoStreamDeckSocket = (
- inPort,
- inUUID,
- inRegisterEvent,
- inInfo,
- inActionInfo,
- ) => {
- const registration = {
- port: inPort,
- uuid: inUUID,
- registerEvent: inRegisterEvent,
- info: JSON.parse(inInfo),
- actionInfo: JSON.parse(inActionInfo),
- };
- render(registration);
+window.connectElgatoStreamDeckSocket = (inPort, inUUID, inRegisterEvent, inInfo, inActionInfo) => {
+ const registration = {
+ port: inPort,
+ uuid: inUUID,
+ registerEvent: inRegisterEvent,
+ info: JSON.parse(inInfo),
+ actionInfo: JSON.parse(inActionInfo),
};
-}
+ render(registration);
+};