Skip to content

Commit

Permalink
Fix reaction policy edit link
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzipp committed May 23, 2024
1 parent 27f3c6f commit c4c0411
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
3 changes: 2 additions & 1 deletion locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@
"noReactionsYet": "Es gibt noch keine Reactions für dieses Video.",
"title": "Reaction-Historie",
"titleOwn": "Reactions auf dein Video",
"preview": "{{count}} Reactions"
"preview": "{{count}} Reactions",
"edit": "Eigene Policy bearbeiten"
},
"reactionPolicy": {
"notSet": "Zu diesem Video ist keine Reaction-Policy festgelegt.",
Expand Down
3 changes: 2 additions & 1 deletion locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
"previewNone": "not set",
"previewAllowed": "allowed",
"previewNotAllowed": "not allowed",
"previewConditions": "conditions"
"previewConditions": "conditions",
"edit": "Edit your policy"
},
"settings": {
"incognito": "Incognito Mode (don't track videos)",
Expand Down
33 changes: 19 additions & 14 deletions src/entries/contentScript/components/ReactionPolicyNotice.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ function prettyFormatCountdown(diff) {
}

function Notice({
title, description, preview = null, cardColor, className,
title,
description,
preview = null,
cardColor,
className,
}) {
const { t } = useTranslation();
const { isOwnVideo } = useAuth();
Expand All @@ -54,19 +58,6 @@ function Notice({
'text-sm leading-normal',
)}
>
<div className="flex justify-between">
{isOwnVideo && (
<a
href={buildFrontendUrl('/dashboard/policy')}
target="_blank"
rel="noreferrer"
className="hover:opacity-75"
>
<PencilSquareIcon className="size-8" />
</a>
)}
</div>

{title && (
<div className="mb-2">
{title}
Expand All @@ -78,6 +69,20 @@ function Notice({
{description}
</div>
)}

<div className="mt-3 text-xs font-medium">
{isOwnVideo && (
<a
href={buildFrontendUrl('/dashboard/policy')}
target="_blank"
rel="noreferrer"
className="transition-opacity hover:opacity-75"
>
{t('reactionPolicy.edit')}
</a>
)}
</div>

</Card>
);
}
Expand Down

0 comments on commit c4c0411

Please sign in to comment.