diff --git a/frontend/public/locales/en/translation.json b/frontend/public/locales/en/translation.json
index 9d3423276e..3d41cb6c2e 100644
--- a/frontend/public/locales/en/translation.json
+++ b/frontend/public/locales/en/translation.json
@@ -41,8 +41,7 @@
"nComparisonsByYou_other": "{{count}} comparisons by you",
"notYetComparedByYou": "Not yet compared by you",
"contributionsArePublicMessage": "Your contributions about this item are currently public. Comparisons appear in the public data associated to your profile only if you tag both items as public.",
- "contributionsArePrivateMessage": "Your contributions about this item are currently private. The details of your personal ratings are not published, but they may still be used to compute public aggregated scores.",
- "personalScore": "Personal score: {{score}}"
+ "contributionsArePrivateMessage": "Your contributions about this item are currently private. The details of your personal ratings are not published, but they may still be used to compute public aggregated scores."
},
"entityCard": {
"thisElementIsNotAvailable": "This element is not available anymore."
@@ -1074,9 +1073,7 @@
"title": "My rate-later list"
},
"recommendationsPage": {
- "chips": {
- "by": "by"
- },
+ "basedOnUserPublicContributions": "Based on public contributions by <2>2>",
"title": {
"results": "Results",
"personalRecommendations": "Personal recommendations",
diff --git a/frontend/public/locales/fr/translation.json b/frontend/public/locales/fr/translation.json
index a5045d302e..469a12c778 100644
--- a/frontend/public/locales/fr/translation.json
+++ b/frontend/public/locales/fr/translation.json
@@ -44,8 +44,7 @@
"nComparisonsByYou_other": "{{count}} comparaisons par vous",
"notYetComparedByYou": "Vous ne l'avez pas encore comparée",
"contributionsArePublicMessage": "Vos contributions impliquant cet élement sont actuellement publiques. Une comparaison n'est publiquement associée à votre profil que lorsque vous marquez explicitement ses deux élements comme publics.",
- "contributionsArePrivateMessage": "Vos contributions impliquant cet élément sont actuellement privées. Les détails de vos jugements ne sont pas publiés, mais ils sont tout de même pris en compte pour calculer des scores agrégés publics.",
- "personalScore": "Score personnel\u00a0: {{score}}"
+ "contributionsArePrivateMessage": "Vos contributions impliquant cet élément sont actuellement privées. Les détails de vos jugements ne sont pas publiés, mais ils sont tout de même pris en compte pour calculer des scores agrégés publics."
},
"entityCard": {
"thisElementIsNotAvailable": "Cet élément n'est plus disponible."
@@ -1084,9 +1083,7 @@
"title": "À comparer plus tard"
},
"recommendationsPage": {
- "chips": {
- "by": "d'après"
- },
+ "basedOnUserPublicContributions": "Selon les contributions publiques de <2>2>",
"title": {
"results": "Résultats",
"personalRecommendations": "Recommandations personnelles",
diff --git a/frontend/src/components/ContentHeader.tsx b/frontend/src/components/ContentHeader.tsx
index 469bea4dfc..fa2f0be4a5 100644
--- a/frontend/src/components/ContentHeader.tsx
+++ b/frontend/src/components/ContentHeader.tsx
@@ -1,5 +1,5 @@
import React from 'react';
-import { Box, Chip, Grid, Typography } from '@mui/material';
+import { Box, Grid, Typography } from '@mui/material';
/**
* Display a header.
@@ -12,13 +12,9 @@ import { Box, Chip, Grid, Typography } from '@mui/material';
const ContentHeader = ({
title,
subtitle,
- chipIcon,
- chipLabel,
}: {
title: string;
subtitle?: React.ReactNode;
- chipIcon?: React.ReactElement;
- chipLabel?: string;
}) => {
return (
- {/* The component could use a list of instead
- of only one. */}
- {chipLabel && (
- <>
-
-
-
- >
- )}
{subtitle && (
render(
-
+
);
diff --git a/frontend/src/components/entity/EntityCard.tsx b/frontend/src/components/entity/EntityCard.tsx
index ceefbceee0..971929d646 100644
--- a/frontend/src/components/entity/EntityCard.tsx
+++ b/frontend/src/components/entity/EntityCard.tsx
@@ -54,6 +54,7 @@ export interface EntityCardProps {
// Configuration specific to the entity type.
entityTypeConfig?: { [k in TypeEnum]?: { [k: string]: JSONValue } };
displayContextAlert?: boolean;
+ displayImage?: boolean;
}
const EntityCard = ({
@@ -65,6 +66,7 @@ const EntityCard = ({
showRatingControl = false,
onRatingChange,
displayContextAlert = false,
+ displayImage = true,
}: EntityCardProps) => {
const { t } = useTranslation();
const theme = useTheme();
@@ -150,25 +152,27 @@ const EntityCard = ({
)}
{contentDisplayed && (
<>
-
-
-
+ {displayImage && (
+
+
+
+ )}
);
};
diff --git a/frontend/src/features/entity_selector/AutoEntityButton.tsx b/frontend/src/features/entity_selector/AutoEntityButton.tsx
index ccb28f384f..be030c982e 100644
--- a/frontend/src/features/entity_selector/AutoEntityButton.tsx
+++ b/frontend/src/features/entity_selector/AutoEntityButton.tsx
@@ -2,7 +2,7 @@ import React, { useContext } from 'react';
import { useTranslation } from 'react-i18next';
import { Tooltip, Button, useMediaQuery } from '@mui/material';
-import { Autorenew, SwipeUp } from '@mui/icons-material';
+import { Autorenew, SwipeVertical } from '@mui/icons-material';
import { useCurrentPoll } from 'src/hooks/useCurrentPoll';
import { theme } from 'src/theme';
@@ -50,7 +50,7 @@ const AutoEntityButton = ({
startIcon={compactLabelLoc === 'left' ? compactLabel : undefined}
endIcon={compactLabelLoc === 'right' ? compactLabel : undefined}
>
-
+
) : (
-
+
,
,
])}
diff --git a/frontend/src/features/videos/VideoCard.tsx b/frontend/src/features/videos/VideoCard.tsx
deleted file mode 100644
index 5bb3652ec6..0000000000
--- a/frontend/src/features/videos/VideoCard.tsx
+++ /dev/null
@@ -1,193 +0,0 @@
-import React, { useState } from 'react';
-import { useTranslation } from 'react-i18next';
-import {
- Grid,
- Box,
- Collapse,
- IconButton,
- useMediaQuery,
- useTheme,
-} from '@mui/material';
-
-import { ActionList } from 'src/utils/types';
-import { Recommendation } from 'src/services/openapi';
-import {
- ExpandMore as ExpandMoreIcon,
- ExpandLess as ExpandLessIcon,
-} from '@mui/icons-material';
-import EntityCardTitle from 'src/components/entity/EntityCardTitle';
-import EntityCardScores from 'src/components/entity/EntityCardScores';
-import { InternalLink } from 'src/components';
-import { entityCardMainSx } from 'src/components/entity/style';
-import { DurationWrapper } from 'src/components/entity/EntityImagery';
-import { VideoMetadata } from 'src/components/entity/EntityMetadata';
-import { useCurrentPoll } from 'src/hooks';
-import { UID_YT_NAMESPACE } from 'src/utils/constants';
-
-function VideoCard({
- video,
- actions = [],
- settings = [],
- compact = false,
- personalScore,
- showPlayer = true,
-}: {
- video: Recommendation;
- actions?: ActionList;
- settings?: ActionList;
- compact?: boolean;
- personalScore?: number;
- showPlayer?: boolean;
-}) {
- const theme = useTheme();
-
- const { t } = useTranslation();
- const { baseUrl } = useCurrentPoll();
-
- const entity = video.entity;
- const videoId = entity.metadata.video_id;
-
- const isSmallScreen = useMediaQuery(theme.breakpoints.down('sm'), {
- noSsr: true,
- });
- const [settingsVisible, setSettingsVisible] = useState(!isSmallScreen);
-
- return (
-
- {showPlayer && (
-
- img': {
- flex: 1,
- },
- }}
- >
-
-
-
-
-
-
-
- )}
-
-
-
- {!compact && }
- {personalScore !== undefined &&
- t('video.personalScore', { score: personalScore.toFixed(0) })}
-
-
- {actions.map((Action, index) =>
- typeof Action === 'function' ? (
-
- ) : (
- Action
- )
- )}
- {isSmallScreen && settings.length > 0 && (
- <>
-
- setSettingsVisible(!settingsVisible)}
- >
- {settingsVisible ? : }
-
- >
- )}
-
- {settings.length > 0 && (
-
-
-
- {settings.map((Action, index) =>
- typeof Action === 'function' ? (
-
- ) : (
- Action
- )
- )}
-
-
-
- )}
-
- );
-}
-
-export default VideoCard;
diff --git a/frontend/src/pages/recommendations/RecommendationPage.tsx b/frontend/src/pages/recommendations/RecommendationPage.tsx
index 75a7d68f7a..568d9df931 100644
--- a/frontend/src/pages/recommendations/RecommendationPage.tsx
+++ b/frontend/src/pages/recommendations/RecommendationPage.tsx
@@ -1,8 +1,8 @@
import React, { useState, useEffect, useRef } from 'react';
import { useLocation, useHistory, useParams } from 'react-router-dom';
-import { useTranslation } from 'react-i18next';
+import { Trans, useTranslation } from 'react-i18next';
-import { Box, Grid } from '@mui/material';
+import { Box, Chip, Grid } from '@mui/material';
import { Person } from '@mui/icons-material';
import { ContentBox, ContentHeader, LoaderWrapper } from 'src/components';
@@ -134,8 +134,15 @@ function RecommendationsPage() {
{displayPersonalRecommendations ? (
}
- chipLabel={t('recommendationsPage.chips.by') + ` ${username}`}
+ subtitle={
+
+ Based on public contributions by{' '}
+ } label={username} />
+
+ }
/>
) : (
diff --git a/frontend/src/pages/videos/VideoAnalysisPage.tsx b/frontend/src/pages/videos/VideoAnalysisPage.tsx
index 8bb4aba697..6b08a2229e 100644
--- a/frontend/src/pages/videos/VideoAnalysisPage.tsx
+++ b/frontend/src/pages/videos/VideoAnalysisPage.tsx
@@ -9,7 +9,7 @@ import CriteriaBarChart from 'src/components/CriteriaBarChart';
import { VideoPlayer } from 'src/components/entity/EntityImagery';
import CriteriaScoresDistribution from 'src/features/charts/CriteriaScoresDistribution';
import EntityContextBox from 'src/features/entity_context/EntityContextBox';
-import VideoCard from 'src/features/videos/VideoCard';
+import EntityCard from 'src/components/entity/EntityCard';
import { useLoginState, useScrollToLocation } from 'src/hooks';
import { Recommendation } from 'src/services/openapi';
import { PersonalCriteriaScoresContextProvider } from 'src/hooks/usePersonalCriteriaScores';
@@ -75,7 +75,7 @@ export const VideoAnalysis = ({ video }: { video: Recommendation }) => {
-
+
{video.entity_contexts.length > 0 && (
diff --git a/frontend/src/utils/action.tsx b/frontend/src/utils/action.tsx
index c7bbeba17a..7790a14362 100644
--- a/frontend/src/utils/action.tsx
+++ b/frontend/src/utils/action.tsx
@@ -24,7 +24,7 @@ export const CompareNowAction = ({ uid }: { uid: string }) => {
return (
{
};
return (
-
+
@@ -77,13 +72,13 @@ export const RemoveFromRateLater = (asyncCallback?: () => void) => {
return (
{
await UsersService.usersMeRateLaterDestroy({ pollName, uid });
if (asyncCallback) await asyncCallback();
showSuccessAlert(t('actions.videoDeletedFromRateLaterList'));
}}
- sx={{ color: '#CDCABC' }}
>
@@ -100,7 +95,7 @@ export const AnalysisPageLink = ({ uid }: { uid: string }) => {
return (