Skip to content

Commit

Permalink
Merge pull request #5 from redstonekasi/moonbase-fixes
Browse files Browse the repository at this point in the history
Various moonbase fixes
  • Loading branch information
NotNite authored Dec 6, 2023
2 parents 3a4905a + 601cec7 commit d9a30c1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
3 changes: 2 additions & 1 deletion packages/core-extensions/src/moonbase/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ export const webpackModules: ExtensionWebExports["webpackModules"] = {
{ ext: "common", id: "components" },
{ ext: "moonbase", id: "stores" },
DownloadIconSVG,
TrashIconSVG
TrashIconSVG,
"Masks.PANEL_BUTTON"
],
entrypoint: true,
run: (module, exports, require) => {
Expand Down
26 changes: 11 additions & 15 deletions packages/core-extensions/src/moonbase/ui/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ export default (require: typeof WebpackRequire) => {
const DownloadIcon = spacepack.findByCode(DownloadIconSVG)[0].exports.default;
const TrashIcon = spacepack.findByCode(TrashIconSVG)[0].exports.default;

const PanelButton =
spacepack.findByCode("Masks.PANEL_BUTTON")[0].exports.default;

function ExtensionCard({ id }: { id: string }) {
const [tab, setTab] = React.useState(ExtensionPage.Info);
const { ext, enabled, busy, update } = Flux.useStateFromStores(
Expand Down Expand Up @@ -103,30 +106,23 @@ export default (require: typeof WebpackRequire) => {
}}
>
{ext.source.type === ExtensionLoadSource.Normal && (
// TODO: this needs centering
<Button
color={Button.Colors.RED}
size={Button.Sizes.ICON}
submitting={busy}
<PanelButton
icon={TrashIcon}
tooltipText="Delete"
onClick={() => {
MoonbaseSettingsStore.deleteExtension(id);
}}
>
<TrashIcon width={27} />
</Button>
/>
)}

{update !== null && (
<Button
color={Button.Colors.BRAND}
size={Button.Sizes.ICON}
submitting={busy}
<PanelButton
icon={DownloadIcon}
tooltipText="Delete"
onClick={() => {
MoonbaseSettingsStore.installExtension(id);
}}
>
<DownloadIcon width={27} />
</Button>
/>
)}

<Switch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class MoonbaseSettingsStore extends Flux.Store<any> {
for (const ext of exts) {
try {
const existingExtension = this.extensions[ext.id];
if (existingExtension !== null) {
if (existingExtension !== undefined) {
if (this.hasUpdate(repo, ext, existingExtension)) {
this.updates[ext.id] = {
version: ext.version!,
Expand Down
1 change: 1 addition & 0 deletions packages/types/src/coreExtensions/components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,5 @@ export type CommonComponents = {
// TODO
useVariableSelect: any;
multiSelect: any;
tokens: any;
};

0 comments on commit d9a30c1

Please sign in to comment.