Skip to content

Commit

Permalink
Remove no-longer-used option to disable copy operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Dec 29, 2019
1 parent aea3006 commit 7e66aa6
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
1 change: 0 additions & 1 deletion packages/react-devtools-extensions/src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ function createPanelIfReactLoaded() {
browserTheme: getBrowserTheme(),
componentsPortalContainer,
enabledInspectedElementContextMenu: true,
enabledInspectedElementContextMenuCopy: isChrome,
overrideTab,
profilerPortalContainer,
showTabBar: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ function InspectedElementView({

const {
isEnabledForInspectedElement,
supportsCopyOperation,
viewAttributeSourceFunction,
} = useContext(ContextMenuContext);

Expand Down Expand Up @@ -445,14 +444,12 @@ function InspectedElementView({
<ContextMenu id="SelectedElement">
{data => (
<Fragment>
{supportsCopyOperation && (
<ContextMenuItem
onClick={() => copyInspectedElementPath(id, data.path)}
title="Copy value to clipboard">
<Icon className={styles.ContextMenuIcon} type="copy" /> Copy
value to clipboard
</ContextMenuItem>
)}
<ContextMenuItem
onClick={() => copyInspectedElementPath(id, data.path)}
title="Copy value to clipboard">
<Icon className={styles.ContextMenuIcon} type="copy" /> Copy
value to clipboard
</ContextMenuItem>
<ContextMenuItem
onClick={() => storeAsGlobal(id, data.path)}
title="Store as global variable">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export type Props = {|
canViewElementSourceFunction?: ?CanViewElementSource,
defaultTab?: TabID,
enabledInspectedElementContextMenu?: boolean,
enabledInspectedElementContextMenuCopy?: boolean,
showTabBar?: boolean,
store: Store,
warnIfLegacyBackendDetected?: boolean,
Expand Down Expand Up @@ -97,7 +96,6 @@ export default function DevTools({
componentsPortalContainer,
defaultTab = 'components',
enabledInspectedElementContextMenu = false,
enabledInspectedElementContextMenuCopy = false,
overrideTab,
profilerPortalContainer,
showTabBar = false,
Expand All @@ -123,14 +121,9 @@ export default function DevTools({
const contextMenu = useMemo(
() => ({
isEnabledForInspectedElement: enabledInspectedElementContextMenu,
supportsCopyOperation: enabledInspectedElementContextMenuCopy,
viewAttributeSourceFunction: viewAttributeSourceFunction || null,
}),
[
enabledInspectedElementContextMenu,
enabledInspectedElementContextMenuCopy,
viewAttributeSourceFunction,
],
[enabledInspectedElementContextMenu, viewAttributeSourceFunction],
);

useEffect(
Expand Down
2 changes: 0 additions & 2 deletions packages/react-devtools-shared/src/devtools/views/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ StoreContext.displayName = 'StoreContext';

export type ContextMenuContextType = {|
isEnabledForInspectedElement: boolean,
supportsCopyOperation: boolean,
viewAttributeSourceFunction?: ?ViewAttributeSource,
|};

export const ContextMenuContext = createContext<ContextMenuContextType>({
isEnabledForInspectedElement: false,
supportsCopyOperation: false,
viewAttributeSourceFunction: null,
});
ContextMenuContext.displayName = 'ContextMenuContext';
1 change: 0 additions & 1 deletion packages/react-devtools-shell/src/devtools.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ inject('dist/app.js', () => {
createElement(DevTools, {
browserTheme: 'light',
enabledInspectedElementContextMenu: true,
enabledInspectedElementContextMenuCopy: true,
showTabBar: true,
warnIfLegacyBackendDetected: true,
warnIfUnsupportedVersionDetected: true,
Expand Down

0 comments on commit 7e66aa6

Please sign in to comment.