init resizing panels and improve new button.
[arvados-workbench2.git] / src / views-components / side-panel-button / side-panel-button.tsx
index f0543b4ca471d3a2cbb25f857758ee7fc4e3b62f..89c3400b55cb00bb14bb93901d74e0b7b93a89c7 100644 (file)
@@ -34,7 +34,7 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
 
 interface SidePanelDataProps {
     currentItemId: string;
-    showButton: boolean;
+    buttonVisible: boolean;
 }
 
 interface SidePanelState {
@@ -45,10 +45,10 @@ type SidePanelProps = SidePanelDataProps & DispatchProp & WithStyles<CssRules>;
 
 const transformOrigin: PopoverOrigin = {
     vertical: -50,
-    horizontal: 45
+    horizontal: 0
 };
 
-const checkButtonVisibility = ({ router }: RootState) => {
+const isButtonVisible = ({ router }: RootState) => {
     const pathname = router.location ? router.location.pathname : '';
     const match = matchProjectRoute(pathname);
     return !!match;
@@ -57,7 +57,7 @@ const checkButtonVisibility = ({ router }: RootState) => {
 export const SidePanelButton = withStyles(styles)(
     connect((state: RootState) => ({
         currentItemId: getProperty(PROJECT_PANEL_CURRENT_UUID)(state.properties),
-        showButton: checkButtonVisibility(state)
+        buttonVisible: isButtonVisible(state)
     }))(
         class extends React.Component<SidePanelProps> {
 
@@ -66,11 +66,11 @@ export const SidePanelButton = withStyles(styles)(
             };
 
             render() {
-                const { classes, showButton } = this.props;
+                const { classes, buttonVisible  } = this.props;
                 const { anchorEl } = this.state;
                 return <Toolbar>
-                    {showButton && <Grid container>
-                        <Grid container item xs alignItems="center" justify="center">
+                    {buttonVisible  && <Grid container>
+                        <Grid container item xs alignItems="center" justify="flex-start">
                             <Button variant="contained" color="primary" size="small" className={classes.button}
                                 aria-owns={anchorEl ? 'aside-menu-list' : undefined}
                                 aria-haspopup="true"