1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

added enabled/disable buttons

Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
Roman 2020-11-02 17:52:18 +02:00
parent 3776aca28b
commit cefa8d8880

View File

@ -66,7 +66,8 @@ export class Extensions extends React.Component {
</div> </div>
) )
} }
return extensions.map(({ manifestPath, name, description }) => { return extensions.map(ext => {
const { manifestPath, name, description, isEnabled } = ext;
return ( return (
<div key={manifestPath} className="extension flex gaps align-center"> <div key={manifestPath} className="extension flex gaps align-center">
<div className="box grow flex column gaps"> <div className="box grow flex column gaps">
@ -77,9 +78,12 @@ export class Extensions extends React.Component {
Description: <span className="text-secondary">{description}</span> Description: <span className="text-secondary">{description}</span>
</div> </div>
</div> </div>
<Button plain active onClick={() => console.log(`//todo: disable ${name}`)}> {!isEnabled && (
Disable <Button plain active onClick={() => ext.enable()}>Enable</Button>
</Button> )}
{isEnabled && (
<Button accent onClick={() => ext.disable()}>Disable</Button>
)}
</div> </div>
) )
}) })