Live location share - tiles without tile server (PSG-591) (#8962)
* live location without map POC * styles * force map tiles to show no map for test build * check latestlocationstate exists * just use loading style map fallback when cant display map * style map error for tile view * set pointer cursor when map error is clickable * test mbeaconbody with map display error, lint * lint more good * remove changes for first attempt tile * make maperror test id more accurate * fussy import ordering * PR tweaks
This commit is contained in:
parent
e65409861a
commit
60faf6d025
12 changed files with 430 additions and 211 deletions
|
@ -15,6 +15,7 @@ limitations under the License.
|
|||
*/
|
||||
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { Icon as WarningBadge } from '../../../../res/img/element-icons/warning-badge.svg';
|
||||
import { _t } from '../../../languageHandler';
|
||||
|
@ -22,18 +23,38 @@ import { getLocationShareErrorMessage, LocationShareError } from '../../../utils
|
|||
import AccessibleButton from '../elements/AccessibleButton';
|
||||
import Heading from '../typography/Heading';
|
||||
|
||||
interface Props {
|
||||
onFinished: () => void;
|
||||
export interface MapErrorProps {
|
||||
error: LocationShareError;
|
||||
onFinished?: () => void;
|
||||
isMinimised?: boolean;
|
||||
className?: string;
|
||||
onClick?: () => void;
|
||||
}
|
||||
|
||||
export const MapError: React.FC<Props> = ({
|
||||
onFinished, error,
|
||||
}) => (<div data-test-id='location-picker-error' className="mx_MapError">
|
||||
<WarningBadge className="mx_MapError_icon" />
|
||||
<Heading className="mx_MapError_heading" size='h3'>{ _t("Unable to load map") }</Heading>
|
||||
<p>
|
||||
{ getLocationShareErrorMessage(error) }
|
||||
</p>
|
||||
<AccessibleButton element='button' kind="primary" onClick={onFinished}>{ _t("OK") }</AccessibleButton>
|
||||
</div>);
|
||||
export const MapError: React.FC<MapErrorProps> = ({
|
||||
error,
|
||||
isMinimised,
|
||||
className,
|
||||
onFinished,
|
||||
onClick,
|
||||
}) => (
|
||||
<div data-test-id='map-rendering-error'
|
||||
className={classNames('mx_MapError', className, { 'mx_MapError_isMinimised': isMinimised })}
|
||||
onClick={onClick}
|
||||
>
|
||||
<WarningBadge className='mx_MapError_icon' />
|
||||
<Heading className='mx_MapError_heading' size='h3'>{ _t('Unable to load map') }</Heading>
|
||||
<p className='mx_MapError_message'>
|
||||
{ getLocationShareErrorMessage(error) }
|
||||
</p>
|
||||
{ onFinished &&
|
||||
<AccessibleButton
|
||||
element='button'
|
||||
kind='primary'
|
||||
onClick={onFinished}
|
||||
>
|
||||
{ _t('OK') }
|
||||
</AccessibleButton>
|
||||
}
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue