Minor improvements to Timeline view
Summary: Fixed issue with the timeline not having a key prop, and added some text when there are no navigation events. Reviewed By: jknoxville, passy Differential Revision: D16762034 fbshipit-source-id: 8f4618c8365c1a8b5a18b6176e1d80fc401f3ca5
This commit is contained in:
committed by
Facebook Github Bot
parent
4305aba816
commit
13fc0bec27
@@ -6,7 +6,7 @@
|
|||||||
* @flow strict-local
|
* @flow strict-local
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {styled} from 'flipper';
|
import {colors, FlexCenter, styled} from 'flipper';
|
||||||
import {NavigationInfoBox} from './';
|
import {NavigationInfoBox} from './';
|
||||||
|
|
||||||
import type {Bookmark, NavigationEvent} from '../flow-types';
|
import type {Bookmark, NavigationEvent} from '../flow-types';
|
||||||
@@ -23,13 +23,23 @@ const TimelineContainer = styled('div')({
|
|||||||
flexGrow: 1,
|
flexGrow: 1,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const NoData = styled(FlexCenter)({
|
||||||
|
height: '100%',
|
||||||
|
fontSize: 18,
|
||||||
|
backgroundColor: colors.macOSTitleBarBackgroundBlur,
|
||||||
|
color: colors.macOSTitleBarIcon,
|
||||||
|
});
|
||||||
|
|
||||||
export default (props: Props) => {
|
export default (props: Props) => {
|
||||||
const {bookmarks, events, onNavigate, onFavorite} = props;
|
const {bookmarks, events, onNavigate, onFavorite} = props;
|
||||||
return (
|
return events.length === 0 ? (
|
||||||
|
<NoData>No Navigation Events to Show</NoData>
|
||||||
|
) : (
|
||||||
<TimelineContainer>
|
<TimelineContainer>
|
||||||
{events.map((event: NavigationEvent) => {
|
{events.map((event: NavigationEvent, idx) => {
|
||||||
return (
|
return (
|
||||||
<NavigationInfoBox
|
<NavigationInfoBox
|
||||||
|
key={idx}
|
||||||
isBookmarked={event.uri != null ? bookmarks.has(event.uri) : false}
|
isBookmarked={event.uri != null ? bookmarks.has(event.uri) : false}
|
||||||
uri={event.uri}
|
uri={event.uri}
|
||||||
onNavigate={onNavigate}
|
onNavigate={onNavigate}
|
||||||
|
|||||||
Reference in New Issue
Block a user