From bd1b2e82fdc6ff1725bab61593e1f54d0b975fe0 Mon Sep 17 00:00:00 2001
From: Jonas Dellinger <jonas@dellinger.dev>
Date: Tue, 31 May 2022 18:05:26 +0200
Subject: Move store opening to frontend only

---
 frontend/src/components/PluginView.tsx | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

(limited to 'frontend/src/components/PluginView.tsx')

diff --git a/frontend/src/components/PluginView.tsx b/frontend/src/components/PluginView.tsx
index 4bc159e2..78bb22c2 100644
--- a/frontend/src/components/PluginView.tsx
+++ b/frontend/src/components/PluginView.tsx
@@ -1,12 +1,17 @@
-import { ButtonItem, DialogButton, PanelSection, PanelSectionRow } from 'decky-frontend-lib';
+import { ButtonItem, DialogButton, PanelSection, PanelSectionRow, Router } from 'decky-frontend-lib';
 import { VFC } from 'react';
-import { FaArrowLeft } from 'react-icons/fa';
+import { FaArrowLeft, FaStore } from 'react-icons/fa';
 
 import { useDeckyState } from './DeckyState';
 
 const PluginView: VFC = () => {
   const { plugins, activePlugin, setActivePlugin, closeActivePlugin } = useDeckyState();
 
+  const onStoreClick = () => {
+    Router.CloseSideMenus();
+    Router.NavigateToExternalWeb('http://127.0.0.1:1337/browser/redirect');
+  };
+
   if (activePlugin) {
     return (
       <div style={{ height: '100%' }}>
@@ -22,6 +27,11 @@ const PluginView: VFC = () => {
 
   return (
     <PanelSection>
+      <div style={{ position: 'absolute', top: '3px', right: '16px', zIndex: 20 }}>
+        <DialogButton style={{ minWidth: 0, padding: '10px 12px' }} onClick={onStoreClick}>
+          <FaStore style={{ display: 'block' }} />
+        </DialogButton>
+      </div>
       {plugins.map(({ name, icon }) => (
         <PanelSectionRow key={name}>
           <ButtonItem layout="below" onClick={() => setActivePlugin(name)}>
-- 
cgit v1.2.3

