Expose Toolbar from Sandy
Summary: Moved Toolbar to flipper-plugin. No further changes. Reviewed By: nikoant Differential Revision: D28027334 fbshipit-source-id: 35de13d87734ae3a8af037166945b1a669106274
This commit is contained in:
committed by
Facebook GitHub Bot
parent
d9ec09b381
commit
8e02b2ec10
@@ -43,6 +43,7 @@ test('Correct top level API exposed', () => {
|
||||
"Tab",
|
||||
"Tabs",
|
||||
"TestUtils",
|
||||
"Toolbar",
|
||||
"Tracked",
|
||||
"TrackingScope",
|
||||
"batch",
|
||||
|
||||
@@ -57,6 +57,7 @@ export {
|
||||
} from './ui/NUX';
|
||||
export {Sidebar as _Sidebar} from './ui/Sidebar';
|
||||
export {DetailSidebar} from './ui/DetailSidebar';
|
||||
export {Toolbar} from './ui/Toolbar';
|
||||
|
||||
export {renderReactRoot} from './utils/renderReactRoot';
|
||||
export {
|
||||
|
||||
@@ -88,10 +88,9 @@ const Container = styled.div<ContainerProps>(
|
||||
}),
|
||||
);
|
||||
|
||||
const Horizontal = styled(Container)<{wrap?: boolean}>(({wrap}) => ({
|
||||
const Horizontal = styled(Container)({
|
||||
flexDirection: 'row',
|
||||
flexWrap: wrap ? 'wrap' : undefined,
|
||||
}));
|
||||
});
|
||||
|
||||
const ScrollParent = styled.div<{axis?: ScrollAxis}>(({axis}) => ({
|
||||
flex: 1,
|
||||
|
||||
35
desktop/flipper-plugin/src/ui/Toolbar.tsx
Normal file
35
desktop/flipper-plugin/src/ui/Toolbar.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
* Copyright (c) Facebook, Inc. and its affiliates.
|
||||
*
|
||||
* This source code is licensed under the MIT license found in the
|
||||
* LICENSE file in the root directory of this source tree.
|
||||
*
|
||||
* @format
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import styled from '@emotion/styled';
|
||||
import {Layout} from './Layout';
|
||||
import {theme} from './theme';
|
||||
|
||||
const SandyToolbarContainer = styled(Layout.Horizontal)({
|
||||
flexWrap: 'wrap',
|
||||
padding: theme.space.small,
|
||||
boxShadow: `inset 0px -1px 0px ${theme.dividerColor}`,
|
||||
});
|
||||
|
||||
export function Toolbar({
|
||||
children,
|
||||
style,
|
||||
}: {
|
||||
children?: React.ReactNode;
|
||||
position?: 'bottom' | 'top';
|
||||
compact?: boolean;
|
||||
style?: React.CSSProperties;
|
||||
}) {
|
||||
return (
|
||||
<SandyToolbarContainer style={style} gap={theme.space.small} center>
|
||||
{children}
|
||||
</SandyToolbarContainer>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user