-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brian Vaughn
committed
Jul 8, 2019
1 parent
c75be1a
commit 87e1368
Showing
8 changed files
with
71 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
35 changes: 35 additions & 0 deletions
35
src/devtools/views/Components/NativeStyleEditor/NativeStyleEditor.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// @flow | ||
|
||
import React, { useContext, useMemo } from 'react'; | ||
import { StoreContext } from '../../context'; | ||
import { useSubscription } from '../../hooks'; | ||
import styles from './NativeStyleEditor.css'; | ||
|
||
import type { ElementType } from 'src/types'; | ||
|
||
type Props = {| | ||
|}; | ||
|
||
export default function NativeStyleEditor({ }: Props) { | ||
const store = useContext(StoreContext); | ||
|
||
const subscription = useMemo( | ||
() => ({ | ||
getCurrentValue: () => store.isNativeStyleEditorSupported, | ||
subscribe: (callback: Function) => { | ||
store.addListener('isNativeStyleEditorSupported', callback); | ||
return () => { | ||
store.removeListener('isNativeStyleEditorSupported', callback); | ||
}; | ||
}, | ||
}), | ||
[store] | ||
); | ||
const isNativeStyleEditorSupported = useSubscription<boolean, Store>(subscription); | ||
|
||
if (!store.isNativeStyleEditorSupported) { | ||
return null; | ||
} | ||
|
||
return <p>NativeStyleEditor</p>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters