/** * Copyright 2018-present Facebook. * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * @format * @flow strict-local */ import {DetailSidebar, FlexCenter, styled, colors} from 'flipper'; import type {Bookmark} from '../flow-types'; type Props = {| bookmarks: Map, onNavigate: string => void, |}; const NoData = styled(FlexCenter)({ fontSize: 18, color: colors.macOSTitleBarIcon, }); const BookmarksList = styled('div')({ color: colors.macOSTitleBarIcon, overflowY: 'scroll', overflowX: 'hidden', height: '100%', '.bookmark-container': { width: '100%', padding: '5px 10px', cursor: 'pointer', }, '.bookmark-container:hover': { backgroundColor: 'rgba(155, 155, 155, 0.2)', }, '.bookmark-container:active': { backgroundColor: '#4d84f5', color: '#FFF', }, '.bookmark-common-name': { fontSize: 14, overflowX: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', lineHeight: 1.2, }, '.bookmark-uri': { fontSize: 10, overflowX: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis', lineHeight: 1.2, }, }); export default (props: Props) => { const {bookmarks, onNavigate} = props; return ( {bookmarks.size === 0 ? ( No Bookmarks ) : ( {[...bookmarks.values()].map(bookmark => (
{ onNavigate(bookmark.uri); }}>
{bookmark.commonName}
{bookmark.uri}
))}
)}
); };