{this.props.people.length === 0 &&
(this.props.selectedIndex !== 'Search' ||
(this.props.selectedIndex === 'Search' &&
this.props.hasSearchQuery)) &&
// Show the 'No people found' message if no people have been retrieved
// and the user either selected a letter in the navigation or issued
// a search query (but not when navigated to the Search tab without
// providing a query yet)
{strings.NoPeopleFoundLabel}
}
{this.props.people.length > 0 &&
// for each retrieved person, create a persona card with the retrieved
// information
//this.props.people.map(p =>
)
this.props.people.map((p,i) => {
const phone: string = p.phone && p.mobile ? `${p.phone}/${p.mobile}`: p.phone ? p.phone: p.mobile;
// const toggleClassName: string = this.state.toggleClass ? `ms-Icon--ChromeClose ${styles.isClose}` : "ms-Icon--ContactInfo";
return (
{ this.state.showCallOut && this.state.calloutElement === i && (
)}
);
})
}
);
}
private _onPersonaClicked = (index: number, person: IPerson) => (_event: any) => {
this.setState({
showCallOut: !this.state.showCallOut,
calloutElement: index,
person: person
});
}
private _onCalloutDismiss = (_event: any) => {
this.setState({
showCallOut: false,
});
}
}
================================================
FILE: source/react-people-directory/src/webparts/peopleDirectory/components/PeopleList/index.ts
================================================
export * from './IPeopleListProps';
export * from './PeopleList';
================================================
FILE: source/react-people-directory/src/webparts/peopleDirectory/components/Search/ISearchProps.ts
================================================
/**
* Properties for the search component
*/
export interface ISearchProps {
/**
* Current search query
*/
searchQuery: string;
/**
* Event handler for issuing a search query
*/
onSearch: (searchQuery: string) => void;
/**
* Event handler for clearing the current search query
*/
onClear: () => void;
}
================================================
FILE: source/react-people-directory/src/webparts/peopleDirectory/components/Search/Search.module.scss
================================================
@import '~@fluentui/react/dist/sass/References.scss';
.search {
.searchBox {
width: 30em;
margin: 1em auto;
}
}
================================================
FILE: source/react-people-directory/src/webparts/peopleDirectory/components/Search/Search.tsx
================================================
import * as React from 'react';
import styles from './Search.module.scss';
import { ISearchProps } from '.';
import {
SearchBox
} from '@fluentui/react/lib/SearchBox';
import * as strings from 'PeopleDirectoryWebPartStrings';
export class Search extends React.Component