// Copyright Contributors to the Amundsen project. // SPDX-License-Identifier: Apache-2.0 import * as React from 'react'; import { bindActionCreators } from 'redux'; import { connect } from 'react-redux'; import { RouteComponentProps } from 'react-router'; import { resetSearchState } from 'ducks/search/reducer'; import { UpdateSearchStateReset } from 'ducks/search/types'; import MyBookmarks from 'components/Bookmark/MyBookmarks'; import Breadcrumb from 'components/Breadcrumb'; import PopularTables from 'components/PopularTables'; import SearchBar from 'components/SearchBar'; import TagsListContainer from 'components/Tags'; import Announcements from 'components/Announcements'; import { announcementsEnabled } from 'config/config-utils'; import { SEARCH_BREADCRUMB_TEXT, HOMEPAGE_TITLE } from './constants'; import './styles.scss'; export interface DispatchFromProps { searchReset: () => UpdateSearchStateReset; } export type HomePageProps = DispatchFromProps & RouteComponentProps; export class HomePage extends React.Component { componentDidMount() { this.props.searchReset(); } render() { /* TODO, just display either popular or curated tags, do we want the title to change based on which implementation is being used? probably not */ return (

{HOMEPAGE_TITLE}

{announcementsEnabled() && (
)}
); } } export const mapDispatchToProps = (dispatch: any) => bindActionCreators( { searchReset: () => resetSearchState(), }, dispatch ); export default connect(null, mapDispatchToProps)(HomePage);