Skip to content

Commit

Permalink
FeaturePanel: fix import in FHRS (#183)
Browse files Browse the repository at this point in the history
  • Loading branch information
zbycz authored Sep 14, 2023
1 parent 974d1ac commit 0342b29
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions src/components/FeaturePanel/renderers/FoodHygieneRatingScheme.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from 'react';
import { Tooltip, Typography } from '@material-ui/core';
import { Restaurant } from '@material-ui/icons';
import RestaurantIcon from '@material-ui/icons/Restaurant';
import styled from 'styled-components';
import { getEstablishmentRatingValue } from '../../../services/fhrsApi';

Expand Down Expand Up @@ -65,41 +65,41 @@ export const FoodHygieneRatingSchemeRenderer = ({ v }) => {
loadData();
}, []);

if (loading) {
return (
<>
<span className="dotloader" />
<span className="dotloader" />
<span className="dotloader" />
</>
);
}

return (
<>
{loading ? (
<>
<span className="dotloader" />
<span className="dotloader" />
<span className="dotloader" />
</>
) : (
<>
<Restaurant fontSize="small" />
<Wrapper>
<Tooltip
arrow
interactive
title="Food Hygiene Rating Scheme (only in UK)"
placement="bottom-end"
>
<a
href={`https://ratings.food.gov.uk/business/${v}`}
className="colorInherit"
>
FHRS{' '}
{Number.isNaN(rating) || error ? (
<Typography color="textSecondary">
(Error while fetching rating)
</Typography>
) : (
<RatingRound>{rating}</RatingRound>
)}
</a>
</Tooltip>
</Wrapper>
</>
)}
<RestaurantIcon fontSize="small" />
<Wrapper>
<Tooltip
arrow
interactive
title="Food Hygiene Rating Scheme (only in UK)"
placement="bottom-end"
>
<a
href={`https://ratings.food.gov.uk/business/${v}`}
className="colorInherit"
>
FHRS{' '}
{Number.isNaN(rating) || error ? (
<Typography color="textSecondary">
(Error while fetching rating)
</Typography>
) : (
<RatingRound>{rating}</RatingRound>
)}
</a>
</Tooltip>
</Wrapper>
</>
);
};

1 comment on commit 0342b29

@vercel
Copy link

@vercel vercel bot commented on 0342b29 Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

osmapp – ./

osmapp.vercel.app
osmapp-git-prod-zbycz.vercel.app
osmapp-zbycz.vercel.app
osmapp.org

Please sign in to comment.