feat: aggiunto collegamento a fonte tramite titolo

This commit is contained in:
Diego-C-05
2026-05-06 10:29:54 +02:00
parent 6d0fdec4df
commit fe1bfe8ff7
4 changed files with 31 additions and 2 deletions
+3
View File
@@ -5,3 +5,6 @@ onCancelSubscription e onUpgrade sono void (AccountSettings.tsx)
in feedservices.ts non capisco se il token è quello che ho impostato io o è random in feedservices.ts non capisco se il token è quello che ho impostato io o è random
email non va bene perchè viene accettata a prescindere anche se non ha senso email non va bene perchè viene accettata a prescindere anche se non ha senso
togli link dagli articoli processed
@@ -64,6 +64,7 @@ function FeedContent({ sentimentFilter = null, topicsFilter = null }: FeedConten
<MagicCard <MagicCard
key={a.uniqueKey} key={a.uniqueKey}
articleId={a.uniqueKey} articleId={a.uniqueKey}
articleUrl={a.url}
source={a.source} source={a.source}
timeAgo={new Date(a.pubDate).toLocaleString()} timeAgo={new Date(a.pubDate).toLocaleString()}
sentiment={ sentiment={
+15 -1
View File
@@ -4,6 +4,7 @@ import { sendFeedback } from '../services/feedbackService'
type MagicCardProps = { type MagicCardProps = {
articleId?: string articleId?: string
articleUrl?: string
source: string source: string
timeAgo: string timeAgo: string
sentiment: 'Positivo' | 'Negativo' | 'Neutrale' sentiment: 'Positivo' | 'Negativo' | 'Neutrale'
@@ -14,7 +15,7 @@ type MagicCardProps = {
} }
// Card notizia: mostra fonte, sentiment, testo, tag, entità e azioni rapide. // Card notizia: mostra fonte, sentiment, testo, tag, entità e azioni rapide.
function MagicCard({ articleId, source, timeAgo, sentiment, title, summary, tags, entities }: MagicCardProps) { function MagicCard({ articleId, articleUrl, source, timeAgo, sentiment, title, summary, tags, entities }: MagicCardProps) {
const [voted, setVoted] = useState<1 | -1 | null>(null) const [voted, setVoted] = useState<1 | -1 | null>(null)
const handleVote = (vote: 1 | -1) => { const handleVote = (vote: 1 | -1) => {
@@ -35,7 +36,20 @@ function MagicCard({ articleId, source, timeAgo, sentiment, title, summary, tags
<span className={`sentiment-badge ${sentiment.toLowerCase()}`}>{sentiment}</span> <span className={`sentiment-badge ${sentiment.toLowerCase()}`}>{sentiment}</span>
</header> </header>
{articleUrl ? (
<h3 className="magic-card-title">
<a
href={articleUrl}
target="_blank"
rel="noopener noreferrer"
className="magic-card-title-link"
>
{title}
</a>
</h3>
) : (
<h3 className="magic-card-title">{title}</h3> <h3 className="magic-card-title">{title}</h3>
)}
<p className="magic-card-summary">{summary}</p> <p className="magic-card-summary">{summary}</p>
{/* Tag tematici: servono a classificare velocemente la notizia. */} {/* Tag tematici: servono a classificare velocemente la notizia. */}
+11
View File
@@ -283,6 +283,17 @@
transition: color 180ms ease; transition: color 180ms ease;
} }
.magic-card-title-link {
color: inherit;
text-decoration: none;
display: inline-block;
}
.magic-card-title-link:hover,
.magic-card-title-link:focus-visible {
text-decoration: underline;
}
.magic-card:hover .magic-card-title { .magic-card:hover .magic-card-title {
color: #2563eb; color: #2563eb;
} }