diff --git a/src/plugins/navigation/components/BookmarksSidebar.tsx b/src/plugins/navigation/components/BookmarksSidebar.tsx index 1b05dabb3..7085f95ca 100644 --- a/src/plugins/navigation/components/BookmarksSidebar.tsx +++ b/src/plugins/navigation/components/BookmarksSidebar.tsx @@ -5,7 +5,16 @@ * @format */ -import {DetailSidebar, FlexCenter, styled, colors} from 'flipper'; +import { + DetailSidebar, + FlexCenter, + styled, + colors, + FlexRow, + FlexColumn, + Text, + Panel, +} from 'flipper'; import {Bookmark, URI} from '../types'; import {IconButton} from './'; import React from 'react'; @@ -26,46 +35,45 @@ const BookmarksList = styled('div')({ overflowX: 'hidden', height: '100%', backgroundColor: colors.white, - '.bookmark-container': { - width: '100%', - padding: '10px', - cursor: 'pointer', - borderBottom: `1px ${colors.greyTint} solid`, +}); + +const BookmarkContainer = styled(FlexRow)({ + width: '100%', + padding: 10, + height: 55, + alignItems: 'center', + cursor: 'pointer', + borderBottom: `1px ${colors.greyTint} solid`, + ':last-child': { + borderBottom: '0', }, - '.bookmark-container:active': { + ':active': { backgroundColor: colors.highlight, color: colors.white, }, - '.bookmarks-title': { - backgroundColor: colors.light02, - padding: '10px', - borderBottom: `1px ${colors.greyTint} solid`, - fontWeight: 'bold', - }, - '.bookmark-common-name': { - fontSize: 14, - overflowX: 'hidden', - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - lineHeight: 1.2, - fontWeight: 'bold', - }, - '.bookmark-container:active>.bookmark-uri': { + ':active *': { color: colors.white, }, - '.bookmark-uri': { - fontSize: 10, - overflowX: 'hidden', - whiteSpace: 'nowrap', - textOverflow: 'ellipsis', - lineHeight: 1.2, - color: colors.greyTint3, - }, }); -const DeleteButton = styled('div')({ - padding: 10, - float: 'right', +const BookmarkTitle = styled(Text)({ + fontSize: '1.1em', + overflowX: 'hidden', + whiteSpace: 'nowrap', + textOverflow: 'ellipsis', + fontWeight: 500, +}); + +const BookmarkSubtitle = styled(Text)({ + overflowX: 'hidden', + whiteSpace: 'nowrap', + textOverflow: 'ellipsis', + color: colors.greyTint3, + marginTop: 4, +}); + +const TextContainer = styled(FlexColumn)({ + justifyContent: 'center', }); const alphabetizeBookmarkCompare = (b1: Bookmark, b2: Bookmark) => { @@ -76,16 +84,29 @@ export default (props: Props) => { const {bookmarks, onNavigate, onRemove} = props; return ( - {bookmarks.size === 0 ? ( - No Bookmarks - ) : ( - -
Bookmarks
- {[...bookmarks.values()] - .sort(alphabetizeBookmarkCompare) - .map((bookmark, idx) => ( - <> - + + {bookmarks.size === 0 ? ( + No Bookmarks + ) : ( + + {[...bookmarks.values()] + .sort(alphabetizeBookmarkCompare) + .map((bookmark, idx) => ( + { + onNavigate(bookmark.uri); + }}> + + + {bookmark.commonName || bookmark.uri} + + {!bookmark.commonName && ( + {bookmark.uri} + )} + { size={16} onClick={() => onRemove(bookmark.uri)} /> - -
{ - onNavigate(bookmark.uri); - }}> -
- {bookmark.commonName} -
-
{bookmark.uri}
-
- - ))} -
- )} + + ))} + + )} +
); };