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

Plugin pin functionality #41 #46

Merged
merged 13 commits into from
Jan 5, 2020
Merged
Prev Previous commit
Next Next commit
Showing selected plugin
  • Loading branch information
amal jose committed Dec 26, 2019
commit aaaa4240ded8aaf2a5b6c6c3e40d16451297550f
2 changes: 1 addition & 1 deletion src/components/CollapsibleTabs/Tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Tabs({ onTransform }) {
const pinnedPlugins = pluginsDir.map(plugin => ({
key: plugin.tagName,
title: plugin.name,
component: <Plugins onTransform={onTransform} />,
component: <Plugins onTransform={onTransform} selectedPlugin={plugin} />,
uiType: "grey",
}));

Expand Down
4 changes: 2 additions & 2 deletions src/components/Plugins/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ const Content = styled.ul`
width: 100%;
`;

function Plugins({ onTransform }) {
const [plugin, setPlugin] = useState(null);
function Plugins({ onTransform, selectedPlugin }) {
const [plugin, setPlugin] = useState(selectedPlugin);

const loadPlugin = selectedPlugin => {
setPlugin(selectedPlugin);
Expand Down