Skip to content
This repository has been archived by the owner on Jan 8, 2023. It is now read-only.

Commit

Permalink
removed donate page
Browse files Browse the repository at this point in the history
  • Loading branch information
fcannizzaro committed Jul 31, 2022
1 parent b46c752 commit f989685
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 56 deletions.
7 changes: 1 addition & 6 deletions stream-deck-plugin/property-inspector/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down Expand Up @@ -77,8 +76,4 @@ function App() {
);
}

const WrappedApp = ({ isDonate }) => {
return isDonate ? <DonatePage /> : <App />;
};

export default WrappedApp;
export default App;
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -14,14 +15,15 @@ const DiscordButton = styled.button`
`;

export const InfoBanner = ({ discord = 'DISCORD' }) => {
const openUrl = useOpenUrl();
return (
<SettingsButtons opacity>
<button onClick={() => window.open('https://dim-stream-deck.netlify.app/')}>SITE</button>
<DiscordButton onClick={() => window.open(DISCORD_INVITE)}>
<button onClick={() => openUrl('https://dim-stream-deck.netlify.app/')}>SITE</button>
<DiscordButton onClick={() => openUrl(DISCORD_INVITE)}>
<img src={Discord} alt='discord' />
<span>{discord}</span>
</DiscordButton>
<button onClick={() => window.open('?donate')}>DONATE</button>
<button onClick={() => openUrl('https://dim-stream-deck.netlify.app/donate')}>DONATE</button>
</SettingsButtons>
);
};
27 changes: 0 additions & 27 deletions stream-deck-plugin/property-inspector/src/components/DonatePage.js

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
30 changes: 10 additions & 20 deletions stream-deck-plugin/property-inspector/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,18 @@ const render = (registration = null) => {
<App />
</StreamDeckProvider>
) : (
<App isDonate />
<App />
),
);
};

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);
};

0 comments on commit f989685

Please sign in to comment.