Skip to content

Commit

Permalink
Merge pull request #53 from redspacecat/develop
Browse files Browse the repository at this point in the history
improve extension manager
  • Loading branch information
someCatInTheWorld authored Aug 22, 2024
2 parents b810160 + 9fbcdb8 commit d2ebd5c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/components/extension-manager-modal/ext-manager-modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@
color: white;
border: none;
padding: 0.5rem 1rem;
margin: 0;
margin: 4px;
border-radius: 4px;
cursor: pointer;
font-family: inherit;
font-weight: bold;
}

.button:active, .button:focus-within {
box-shadow: 0 0 0 3px $motion-transparent;
}
Expand All @@ -79,4 +80,4 @@
}
[theme="dark"] .warning {
background: rgb(114, 102, 0);
}
}
11 changes: 6 additions & 5 deletions src/components/extension-manager-modal/modal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import Modal from '../../containers/modal.jsx';
import styles from './ext-manager-modal.css';

const handleRemoveBtnClick = (ext, props) => {
props.vm.extensionManager.removeExtension(ext[0]);

props.onClose();
if (confirm("Are you sure?")) {
props.vm.extensionManager.removeExtension(ext[0]);
props.onClose();
}
}

const ExtensionsManagerModalComponent = props => {
Expand All @@ -30,7 +31,7 @@ const ExtensionsManagerModalComponent = props => {
>
<Box className={styles.body}>
{loadedExtensions.map((ext, i) => (
<button key={i} class={styles.button} onClick={() => handleRemoveBtnClick(ext, props)}>Remove {ext[0]}</button>
<button key={i} class={styles.button} onClick={() => handleRemoveBtnClick(ext, props)}>Remove {props.vm.runtime["ext_" + ext[0]]["getInfo"]().name}</button>
))}
</Box>
</Modal>
Expand All @@ -47,4 +48,4 @@ ExtensionsManagerModalComponent.propTypes = {
})
};

export default injectIntl(ExtensionsManagerModalComponent);
export default injectIntl(ExtensionsManagerModalComponent);

0 comments on commit d2ebd5c

Please sign in to comment.