diff --git a/frontend/src/App.test.tsx b/frontend/src/App.test.tsx deleted file mode 100644 index 95469a2..0000000 --- a/frontend/src/App.test.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import * as React from 'react'; -import * as ReactDOM from 'react-dom'; - -import { App } from './App'; - -it('renders without crashing', () => { - const div = document.createElement('div'); - ReactDOM.render(, div); - ReactDOM.unmountComponentAtNode(div); -}); diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index 373e447..8770303 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -10,7 +10,7 @@ import { fetchInstances } from './redux/actions'; import { IAppState, IInstance } from './redux/types'; interface IAppProps { - currentInstance: IInstance | null; + currentInstanceName?: string | null; instances?: IInstance[], isLoadingInstances: boolean, fetchInstances: () => void; @@ -61,7 +61,7 @@ class AppImpl extends React.Component { className="fediverse-welcome" icon={IconNames.SEARCH_AROUND} title="Graph. TODO" - description={"Selected " + ((this.props.currentInstance && this.props.currentInstance.name) || "nothing")} + description={"Selected " + (this.props.currentInstanceName || "nothing")} /> ); @@ -70,7 +70,7 @@ class AppImpl extends React.Component { } const mapStateToProps = (state: IAppState) => ({ - currentInstance: state.currentInstance, + currentInstanceName: state.currentInstanceName, instances: state.data.instances, isLoadingInstances: state.data.isLoadingInstances, }) diff --git a/frontend/src/components/InstanceSearch.tsx b/frontend/src/components/InstanceSearch.tsx index ccf3ac9..2acee51 100644 --- a/frontend/src/components/InstanceSearch.tsx +++ b/frontend/src/components/InstanceSearch.tsx @@ -1,17 +1,16 @@ import * as React from 'react'; import { connect } from 'react-redux'; -// import { List, ListRowProps } from 'react-virtualized'; import { Dispatch } from 'redux'; import { Button, MenuItem } from '@blueprintjs/core'; import { IconNames } from '@blueprintjs/icons'; -import { ItemPredicate, ItemRenderer, Select } from '@blueprintjs/select'; +import { IItemRendererProps, ItemPredicate, Select } from '@blueprintjs/select'; import { selectInstance } from '../redux/actions'; import { IAppState, IInstance } from '../redux/types'; interface IInstanceSearchProps { - currentInstance: IInstance | null; + currentInstanceName: string | null; instances?: IInstance[]; selectInstance: (instanceName: string) => void; } @@ -28,33 +27,48 @@ class InstanceSearchImpl extends React.Component { onItemSelect={this.onItemSelect} itemPredicate={this.itemPredicate} disabled={!this.props.instances} + initialContent={this.renderInitialContent()} + noResults={this.renderNoResults()} + popoverProps={{popoverClassName: "fediverse-instance-search-popover"}} >