Commit a5d43c78 authored by Max Alekseenko's avatar Max Alekseenko

hide rating if feature is disabled

parent 91520016
......@@ -7,6 +7,7 @@ import React, { useCallback } from 'react';
import type { MarketplaceAppWithSecurityReport } from 'types/client/marketplace';
import { ContractListTypes } from 'types/client/marketplace';
import config from 'configs/app';
import useIsMobile from 'lib/hooks/useIsMobile';
import { nbsp } from 'lib/html-entities';
import * as mixpanel from 'lib/mixpanel/index';
......@@ -17,6 +18,9 @@ import AppSecurityReport from './AppSecurityReport';
import MarketplaceAppModalLink from './MarketplaceAppModalLink';
import Rating from './Rating/Rating';
const feature = config.features.marketplace;
const isRatingEnabled = feature.isEnabled && feature.rating;
type Props = {
onClose: () => void;
isFavorite: boolean;
......@@ -160,24 +164,26 @@ const MarketplaceAppModal = ({
By{ nbsp }{ author }
</Text>
<Box
gridColumn={{ base: '1 / 3', md: 2 }}
marginTop={{ base: 6, md: 3 }}
py={{ base: 0, md: 1.5 }}
width="fit-content"
>
<Rating
appId={ id }
rating={ rating }
recordId={ ratingRecordId }
userRating={ userRating }
rate={ rateApp }
isSending={ isSendingRating }
isLoading={ isRatingLoading }
fullView
canRate={ canRate }
/>
</Box>
{ isRatingEnabled && (
<Box
gridColumn={{ base: '1 / 3', md: 2 }}
marginTop={{ base: 6, md: 3 }}
py={{ base: 0, md: 1.5 }}
width="fit-content"
>
<Rating
appId={ id }
rating={ rating }
recordId={ ratingRecordId }
userRating={ userRating }
rate={ rateApp }
isSending={ isSendingRating }
isLoading={ isRatingLoading }
fullView
canRate={ canRate }
/>
</Box>
) }
<Box
gridColumn={{ base: '1 / 3', md: 2 }}
......
import { Text, PopoverTrigger, PopoverBody, PopoverContent, useDisclosure, Skeleton, useOutsideClick, Box } from '@chakra-ui/react';
import React from 'react';
import config from 'configs/app';
import Popover from 'ui/shared/chakra/Popover';
import Content from './PopoverContent';
import Stars from './Stars';
import TriggerButton from './TriggerButton';
const feature = config.features.marketplace;
const isEnabled = feature.isEnabled && feature.rating;
type Props = {
appId: string;
rating?: number;
......@@ -28,6 +32,10 @@ const Rating = ({
const popoverRef = React.useRef(null);
useOutsideClick({ ref: popoverRef, handler: onClose });
if (!isEnabled) {
return null;
}
return (
<Skeleton
display="flex"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment