fix: news section — remove duplicate title, add newspaper icon, hide views from users, fix cache invalidation

This commit is contained in:
Fringg
2026-03-23 15:00:11 +03:00
parent de5414f42e
commit b7ab2cff55
3 changed files with 4 additions and 16 deletions

View File

@@ -415,7 +415,7 @@ export default function NewsSection() {
} }
return ( return (
<section className="relative overflow-hidden rounded-2xl bg-dark-900/50 backdrop-blur-xl"> <section className="relative overflow-hidden rounded-2xl bg-dark-850/80 backdrop-blur-xl">
<div className="px-5 py-8 sm:px-6 sm:py-10"> <div className="px-5 py-8 sm:px-6 sm:py-10">
{/* Header */} {/* Header */}
<motion.div <motion.div

View File

@@ -293,6 +293,7 @@ export default function AdminNews() {
onSuccess: () => { onSuccess: () => {
haptic.success(); haptic.success();
queryClient.invalidateQueries({ queryKey: ['admin', 'news'] }); queryClient.invalidateQueries({ queryKey: ['admin', 'news'] });
queryClient.invalidateQueries({ queryKey: ['news'] });
}, },
}); });
@@ -301,6 +302,7 @@ export default function AdminNews() {
onSuccess: () => { onSuccess: () => {
haptic.success(); haptic.success();
queryClient.invalidateQueries({ queryKey: ['admin', 'news'] }); queryClient.invalidateQueries({ queryKey: ['admin', 'news'] });
queryClient.invalidateQueries({ queryKey: ['news'] });
}, },
}); });
@@ -309,6 +311,7 @@ export default function AdminNews() {
onSuccess: () => { onSuccess: () => {
haptic.success(); haptic.success();
queryClient.invalidateQueries({ queryKey: ['admin', 'news'] }); queryClient.invalidateQueries({ queryKey: ['admin', 'news'] });
queryClient.invalidateQueries({ queryKey: ['news'] });
}, },
}); });

View File

@@ -30,17 +30,6 @@ const ClockIcon = () => (
</svg> </svg>
); );
const EyeIcon = () => (
<svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={1.5}>
<path
strokeLinecap="round"
strokeLinejoin="round"
d="M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178z"
/>
<path strokeLinecap="round" strokeLinejoin="round" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
</svg>
);
const CalendarIcon = () => ( const CalendarIcon = () => (
<svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={1.5}> <svg className="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor" strokeWidth={1.5}>
<path <path
@@ -405,10 +394,6 @@ export default function NewsArticlePage() {
<ClockIcon /> <ClockIcon />
{article.read_time_minutes} {t('news.readTime')} {article.read_time_minutes} {t('news.readTime')}
</span> </span>
<span className="inline-flex items-center gap-1.5 font-mono text-xs">
<EyeIcon />
{article.views_count} {t('news.views')}
</span>
</div> </div>
</motion.div> </motion.div>