Hide private track option if unsupported in active track card
This commit is contained in:
@@ -51,7 +51,7 @@ const TrackerActiveLink = ({ children, url }: { children: React.ReactNode; url:
|
|||||||
</Link>
|
</Link>
|
||||||
);
|
);
|
||||||
|
|
||||||
type TTrackerActive = Pick<TTrackerBind, 'id' | 'name' | 'icon' | 'supportsTrackDeletion'>;
|
type TTrackerActive = Pick<TTrackerBind, 'id' | 'name' | 'icon' | 'supportsTrackDeletion' | 'supportsPrivateTracking'>;
|
||||||
const TrackerActiveRemoveBind = ({
|
const TrackerActiveRemoveBind = ({
|
||||||
trackerRecordId,
|
trackerRecordId,
|
||||||
tracker,
|
tracker,
|
||||||
@@ -144,13 +144,19 @@ const TrackerUpdatePrivateStatus = ({
|
|||||||
trackRecordId,
|
trackRecordId,
|
||||||
isPrivate,
|
isPrivate,
|
||||||
closeMenu,
|
closeMenu,
|
||||||
|
supportsPrivateTracking,
|
||||||
}: {
|
}: {
|
||||||
trackRecordId: TrackRecordType['id'];
|
trackRecordId: TrackRecordType['id'];
|
||||||
isPrivate: boolean;
|
isPrivate: boolean;
|
||||||
closeMenu: () => void;
|
closeMenu: () => void;
|
||||||
|
supportsPrivateTracking: TTrackerActive['supportsPrivateTracking'];
|
||||||
}) => {
|
}) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
if (!supportsPrivateTracking) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<MenuItem
|
<MenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@@ -166,6 +172,7 @@ const TrackerUpdatePrivateStatus = ({
|
|||||||
</MenuItem>
|
</MenuItem>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
type TTrackRecordActive = Pick<TTrackRecordBind, 'id' | 'remoteUrl' | 'title' | 'private'>;
|
type TTrackRecordActive = Pick<TTrackRecordBind, 'id' | 'remoteUrl' | 'title' | 'private'>;
|
||||||
const TrackerActiveHeader = ({
|
const TrackerActiveHeader = ({
|
||||||
trackRecord,
|
trackRecord,
|
||||||
@@ -244,6 +251,7 @@ const TrackerActiveHeader = ({
|
|||||||
trackRecordId={trackRecord.id}
|
trackRecordId={trackRecord.id}
|
||||||
isPrivate={trackRecord.private}
|
isPrivate={trackRecord.private}
|
||||||
closeMenu={onClose}
|
closeMenu={onClose}
|
||||||
|
supportsPrivateTracking={tracker.supportsPrivateTracking}
|
||||||
/>,
|
/>,
|
||||||
]}
|
]}
|
||||||
</Menu>
|
</Menu>
|
||||||
|
|||||||
Reference in New Issue
Block a user