From 0d5f45b9b41a5bc12842517ec8f615657dbe0689 Mon Sep 17 00:00:00 2001 From: Chen-I Lim Date: Tue, 8 Dec 2020 15:00:03 -0800 Subject: [PATCH] Move sidebar Add Board button to bottom --- webapp/src/components/sidebar.scss | 10 +- webapp/src/components/sidebar.tsx | 146 ++++++++++++++--------------- 2 files changed, 79 insertions(+), 77 deletions(-) diff --git a/webapp/src/components/sidebar.scss b/webapp/src/components/sidebar.scss index d2fdd0352..fa6cb248b 100644 --- a/webapp/src/components/sidebar.scss +++ b/webapp/src/components/sidebar.scss @@ -7,7 +7,7 @@ min-height: 100%; color: rgb(var(--sidebar-fg)); background-color: rgb(var(--sidebar-bg)); - padding: 10px 0; + padding-top: 10px; &.hidden { position: absolute; @@ -26,12 +26,12 @@ } >* { - flex-shrink: 0; + flex: 0 0 auto; } .octo-sidebar-list { + flex: 1 1 auto; overflow-y: auto; - max-height: calc(100% - 78px); max-width: 250px; } @@ -135,4 +135,8 @@ stroke: rgba(var(--sidebar-fg), 0.5); stroke-width: 6px; } + + .Button { + min-height: 30px; + } } diff --git a/webapp/src/components/sidebar.tsx b/webapp/src/components/sidebar.tsx index b5257d6f1..0453f01bf 100644 --- a/webapp/src/components/sidebar.tsx +++ b/webapp/src/components/sidebar.tsx @@ -181,84 +181,82 @@ class Sidebar extends React.Component { ) }) } - -
- - - - - - - - - - - - - {workspaceTree.boardTemplates.map((boardTemplate) => { - let displayName = boardTemplate.title || intl.formatMessage({id: 'Sidebar.untitled', defaultMessage: 'Untitled'}) - if (boardTemplate.icon) { - displayName = `${boardTemplate.icon} ${displayName}` - } - return ( - { - this.addBoardFromTemplate(boardTemplate.id) - }} - rightIcon={ - - }/> - - { - this.props.showBoard(boardTemplate.id) - }} - /> - } - id='delete' - name={intl.formatMessage({id: 'Sidebar.delete-template', defaultMessage: 'Delete'})} - onClick={async () => { - await mutator.deleteBlock(boardTemplate, 'delete board template') - }} - /> - - - } - /> - ) - })} - - - - - -
+ + + + + + + + + + + + {workspaceTree.boardTemplates.map((boardTemplate) => { + let displayName = boardTemplate.title || intl.formatMessage({id: 'Sidebar.untitled', defaultMessage: 'Untitled'}) + if (boardTemplate.icon) { + displayName = `${boardTemplate.icon} ${displayName}` + } + return ( + { + this.addBoardFromTemplate(boardTemplate.id) + }} + rightIcon={ + + }/> + + { + this.props.showBoard(boardTemplate.id) + }} + /> + } + id='delete' + name={intl.formatMessage({id: 'Sidebar.delete-template', defaultMessage: 'Delete'})} + onClick={async () => { + await mutator.deleteBlock(boardTemplate, 'delete board template') + }} + /> + + + } + /> + ) + })} + + + + + + +