Apply prettier formatting
This commit is contained in:
parent
1cac306093
commit
526645c791
1576 changed files with 65385 additions and 62478 deletions
|
@ -14,14 +14,14 @@ See the License for the specific language governing permissions and
|
|||
limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
import { Beacon } from 'matrix-js-sdk/src/matrix';
|
||||
import React from "react";
|
||||
import { Beacon } from "matrix-js-sdk/src/matrix";
|
||||
|
||||
import { Icon as CloseIcon } from '../../../../res/img/image-view/close.svg';
|
||||
import { _t } from '../../../languageHandler';
|
||||
import AccessibleButton from '../elements/AccessibleButton';
|
||||
import Heading from '../typography/Heading';
|
||||
import BeaconListItem from './BeaconListItem';
|
||||
import { Icon as CloseIcon } from "../../../../res/img/image-view/close.svg";
|
||||
import { _t } from "../../../languageHandler";
|
||||
import AccessibleButton from "../elements/AccessibleButton";
|
||||
import Heading from "../typography/Heading";
|
||||
import BeaconListItem from "./BeaconListItem";
|
||||
|
||||
interface Props {
|
||||
beacons: Beacon[];
|
||||
|
@ -29,36 +29,31 @@ interface Props {
|
|||
onBeaconClick: (beacon: Beacon) => void;
|
||||
}
|
||||
|
||||
const DialogSidebar: React.FC<Props> = ({
|
||||
beacons,
|
||||
onBeaconClick,
|
||||
requestClose,
|
||||
}) => {
|
||||
return <div className='mx_DialogSidebar'>
|
||||
<div className='mx_DialogSidebar_header'>
|
||||
<Heading size='h4'>{ _t('View List') }</Heading>
|
||||
<AccessibleButton
|
||||
className='mx_DialogSidebar_closeButton'
|
||||
onClick={requestClose}
|
||||
title={_t('Close sidebar')}
|
||||
data-testid='dialog-sidebar-close'
|
||||
>
|
||||
<CloseIcon className='mx_DialogSidebar_closeButtonIcon' />
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
{ beacons?.length
|
||||
? <ol className='mx_DialogSidebar_list'>
|
||||
{ beacons.map((beacon) => <BeaconListItem
|
||||
key={beacon.identifier}
|
||||
beacon={beacon}
|
||||
onClick={() => onBeaconClick(beacon)}
|
||||
/>) }
|
||||
</ol>
|
||||
: <div className='mx_DialogSidebar_noResults'>
|
||||
{ _t('No live locations') }
|
||||
const DialogSidebar: React.FC<Props> = ({ beacons, onBeaconClick, requestClose }) => {
|
||||
return (
|
||||
<div className="mx_DialogSidebar">
|
||||
<div className="mx_DialogSidebar_header">
|
||||
<Heading size="h4">{_t("View List")}</Heading>
|
||||
<AccessibleButton
|
||||
className="mx_DialogSidebar_closeButton"
|
||||
onClick={requestClose}
|
||||
title={_t("Close sidebar")}
|
||||
data-testid="dialog-sidebar-close"
|
||||
>
|
||||
<CloseIcon className="mx_DialogSidebar_closeButtonIcon" />
|
||||
</AccessibleButton>
|
||||
</div>
|
||||
}
|
||||
</div>;
|
||||
{beacons?.length ? (
|
||||
<ol className="mx_DialogSidebar_list">
|
||||
{beacons.map((beacon) => (
|
||||
<BeaconListItem key={beacon.identifier} beacon={beacon} onClick={() => onBeaconClick(beacon)} />
|
||||
))}
|
||||
</ol>
|
||||
) : (
|
||||
<div className="mx_DialogSidebar_noResults">{_t("No live locations")}</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default DialogSidebar;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue