Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hide extension import file button on platforms without file access #10278

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions webapp/src/extensionsBrowser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ export const ExtensionsBrowser = (props: ExtensionsProps) => {
}

const categoryNames = getCategoryNames();
const showImportFile = pxt.BrowserUtils.hasFileAccess();

return (
<Modal
Expand Down Expand Up @@ -577,16 +578,18 @@ export const ExtensionsBrowser = (props: ExtensionsProps) => {
}
</div>
}
<div className="import-button">
<Button
ariaLabel={(lf("Open file from your computer"))}
title={(lf("Import File"))}
label={(lf("Import File"))}
leftIcon="fas fa-upload"
className="gray"
onClick={importExtension}
/>
</div>
{showImportFile &&
<div className="import-button">
<Button
ariaLabel={(lf("Open file from your computer"))}
title={(lf("Import File"))}
label={(lf("Import File"))}
leftIcon="fas fa-upload"
className="gray"
onClick={importExtension}
/>
</div>
}
</div>
{displayMode == ExtensionView.Search &&
<>
Expand Down
Loading