Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/web/src/app/(dashboard)/campaigns/[campaignId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,35 +146,35 @@ export default function CampaignDetailsPage({
}

const CampaignStatusBadge: React.FC<{ status: string }> = ({ status }) => {
let outsideColor = "bg-gray-600";
let insideColor = "bg-gray-600/50";
let outsideColor = "bg-gray";
let insideColor = "bg-gray/50";

switch (status) {
case "delivered":
outsideColor = "bg-emerald-500/30";
insideColor = "bg-emerald-500";
outsideColor = "bg-green/30";
insideColor = "bg-green";
break;
case "bounced":
case "unsubscribed":
outsideColor = "bg-red-500/30";
insideColor = "bg-red-500";
outsideColor = "bg-red/30";
insideColor = "bg-red";
break;
case "clicked":
outsideColor = "bg-cyan-500/30";
insideColor = "bg-cyan-500";
outsideColor = "bg-blue/30";
insideColor = "bg-blue";
break;
case "opened":
outsideColor = "bg-indigo-500/30";
insideColor = "bg-indigo-500";
outsideColor = "bg-purple/30";
insideColor = "bg-purple";
break;

case "complained":
outsideColor = "bg-yellow-500/30";
insideColor = "bg-yellow-500";
outsideColor = "bg-yellow/30";
insideColor = "bg-yellow";
break;
default:
outsideColor = "bg-gray-600/40";
insideColor = "bg-gray-600";
outsideColor = "bg-gray/40";
insideColor = "bg-gray";
}

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/campaigns/campaign-list.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,10 +103,10 @@ export default function CampaignList() {
<div
className={`text-center w-[130px] rounded capitalize py-1 text-xs ${
campaign.status === CampaignStatus.DRAFT
? "bg-gray-500/15 dark:bg-gray-400/15 text-gray-700 dark:text-gray-400/90 border border-gray-500/25 dark:border-gray-700/25"
? "bg-gray/15 text-grayborder border-gray/25"
: campaign.status === CampaignStatus.SENT
? "bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25"
: "bg-yellow-500/15 dark:bg-yellow-600/10 text-yellow-700 dark:text-yellow-600/90 border border-yellow-500/25 dark:border-yellow-700/25"
? "bg-green/15 text-greenborder border-green/25"
: "bg-yellow/15 text-yellowborder border-yellow/25"
}`}
>
{campaign.status.toLowerCase()}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/(dashboard)/campaigns/delete-campaign.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Trash2 className="h-[18px] w-[18px] text-red-600/80" />
<Trash2 className="h-[18px] w-[18px] text-red/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ export const DuplicateCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign duplicated`);
},
}
},
);
}

Expand All@@ -46,7 +46,7 @@ export const DuplicateCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Copy className="h-[18px] w-[18px] text-blue-600/80" />
<Copy className="h-[18px] w-[18px] text-blue/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,21 +152,21 @@ export default function ContactList({
</TableCell>
<TableCell>
{contact.subscribed ? (
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green/15 text-greenborder border-green/25">
Subscribed
</div>
) : (
<Tooltip>
<TooltipTrigger>
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red/10 text-redborder border-red/10">
Unsubscribed
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{getUnsubscribeReason(
contact.unsubscribeReason ??
UnsubscribeReason.UNSUBSCRIBED
UnsubscribeReason.UNSUBSCRIBED,
)}
</p>
</TooltipContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const DeleteContact: React.FC<{
onError: (e) => {
toast.error(`Contact not deleted: ${e.message}`);
},
}
},
);
}

Expand All@@ -79,7 +79,7 @@ export const DeleteContact: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 80 to 83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add aria-label and hover color for parity

Match other delete actions’ hover treatment and expose an accessible label.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete contact ${contact.email ?? ""}`}+ title="Delete contact"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
-<Buttonvariant="ghost"size="sm">
-<Trash2className="h-4 w-4 text-red/80"/>
<Button
variant="ghost"
size="sm"
aria-label={`Delete contact ${contact.email??""}`}
title="Delete contact"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/[contactBookId]/delete-contact.tsx
around lines 80 to 83, the icon-only DialogTrigger/Button lacks an accessible
label and doesn't match other delete actions' hover color; add an aria-label
(e.g., aria-label="Delete contact") to the trigger/button and update the
button/icon classes to include the same hover color used by other delete buttons
(e.g., hover text-red/100 or hover:text-red/90) so the icon has a visible hover
state and is accessible to screen readers.

</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ export const DeleteContactBook: React.FC<{
});

async function onContactBookDelete(
values: z.infer<typeof contactBookSchema>
values: z.infer<typeof contactBookSchema>,
) {
if (values.name !== contactBook.name) {
contactBookForm.setError("name", {
Expand All@@ -65,7 +65,7 @@ export const DeleteContactBook: React.FC<{
setOpen(false);
toast.success(`Contact book deleted`);
},
}
},
);
}

Expand All@@ -78,7 +78,7 @@ export const DeleteContactBook: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">
<Trash2 className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70" />
<Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />
</Button>
Comment on lines 79 to 82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tidy className and add accessible label

Remove trailing space in className and add an aria-label for the icon-only trigger.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">- <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className="p-0 hover:bg-transparent"+ aria-label={`Delete contact book ${contactBook.name ?? ""}`}+ title="Delete contact book"+ >+ <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm"className="p-0 hover:bg-transparent ">
<Trash2className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70"/>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
className="p-0 hover:bg-transparent"
aria-label={`Delete contact book ${contactBook.name??""}`}
title="Delete contact book"
>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/delete-contact-book.tsx around lines 79
to 82, remove the trailing space from the Button's className value and add an
accessible label to the icon-only trigger by providing an aria-label (e.g.,
aria-label="Delete contact") on the Button element so screen readers can
describe the action.

</DialogTrigger>
<DialogContent>
Expand Down
56 changes: 45 additions & 11 deletions apps/web/src/app/(dashboard)/dashboard/email-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ import { EmailStatus } from "@prisma/client";
import { api } from "~/trpc/react";
import Spinner from "@unsend/ui/src/spinner";
import { useTheme } from "@unsend/ui";
import { EMAIL_COLORS } from "~/lib/constants/colors";
import { useColors } from "./hooks/useColors";

interface EmailChartProps {
Expand DownExpand Up@@ -127,7 +126,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
</p>
{data.delivered ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#40a02bcc] dark:bg-[#a6e3a1] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.delivered }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Delivered
</p>
Expand All@@ -136,7 +138,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.bounced ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#d20f39cc] dark:bg-[#f38ba8] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.bounced }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Bounced
</p>
Expand All@@ -145,7 +150,12 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.complained ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#df8e1dcc] dark:bg-[#F9E2AF] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{
backgroundColor: currentColors.complained,
}}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Complained
</p>
Expand All@@ -154,7 +164,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.opened ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#8839efcc] dark:bg-[#cba6f7] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.opened }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Opened
</p>
Expand All@@ -163,7 +176,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.clicked ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#04a5e5cc] dark:bg-[#93c5fd] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.clicked }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Clicked
</p>
Expand DownExpand Up@@ -236,16 +252,34 @@ const EmailChartItem: React.FC<DashboardItemCardProps> = ({
count,
percentage,
}) => {
const color = EMAIL_COLORS[status];
const currentColors = useColors();

const getColorForStatus = (status: EmailStatus | "total"): string => {
switch (status) {
case "DELIVERED":
return currentColors.delivered;
case "BOUNCED":
return currentColors.bounced;
case "COMPLAINED":
return currentColors.complained;
case "OPENED":
return currentColors.opened;
case "CLICKED":
return currentColors.clicked;
case "total":
default:
return "#6b7280"; // gray-500 for total and other statuses
}
};

return (
<div className="flex gap-3 items-stretch font-mono">
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}

<div>
<div className=" flex items-center gap-2">
<div className={`${color} w-2.5 h-2.5 rounded-[3px]`}></div>
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}
<div
className="w-2.5 h-2.5 rounded-[3px]"
style={{ backgroundColor: getColorForStatus(status) }}
></div>

<div className="text-xs uppercase text-muted-foreground ">
{status.toLowerCase()}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export default function AddApiKey() {
setApiKey(data);
apiKeyForm.reset();
},
}
},
);
}

Expand DownExpand Up@@ -132,7 +132,7 @@ export default function AddApiKey() {
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="h-4 w-4 text-green-500" />
<CheckIcon className="h-4 w-4 text-green" />
) : (
<ClipboardCopy className="h-4 w-4" />
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteApiKey: React.FC<{
setOpen(false);
toast.success(`API key deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteApiKey: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 76 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add accessible label and consistent hover color

Add an aria-label for screen readers and align hover color with other delete triggers in this PR.

Apply:

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete API key ${apiKey.name ?? ""}`}+ title="Delete API key"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
aria-label={`Delete API key ${apiKey.name??""}`}
title="Delete API key"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/dev-settings/api-keys/delete-api-key.tsx around
lines 76-79, the icon-only DialogTrigger/Button lacks an accessible label and
its hover color doesn't match other delete triggers; add an aria-label (e.g.,
aria-label="Delete API key") to the Button so screen readers announce its
purpose, and update the button/icon hover color class to match the other delete
controls in this PR (use the same hover text color utility used elsewhere for
delete actions).

</DialogTrigger>
<DialogContent>
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(dashboard)/domains/[domainId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ export default function DomainItemPage({
{
refetchInterval: (q) => (q?.state.data?.isVerifying ? 10000 : false),
refetchIntervalInBackground: true,
},
}
);

const verifyQuery = api.domain.startVerification.useMutation();
Expand All@@ -54,7 +54,7 @@ export default function DomainItemPage({
onSettled: () => {
domainQuery.refetch();
},
},
}
);
};

Expand DownExpand Up@@ -232,7 +232,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
const utils = api.useUtils();

const [clickTracking, setClickTracking] = React.useState(
domain.clickTracking,
domain.clickTracking
);
const [openTracking, setOpenTracking] = React.useState(domain.openTracking);

Expand All@@ -245,7 +245,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Click tracking updated");
},
},
}
);
}

Expand All@@ -258,7 +258,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Open tracking updated");
},
},
}
);
}
return (
Expand DownExpand Up@@ -303,24 +303,20 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
};

const DnsVerificationStatus: React.FC<{ status: string }> = ({ status }) => {
let badgeColor = "bg-gray-400/10 text-gray-500 border-gray-400/10"; // Default color
let badgeColor = "bg-gray/10 text-gray border-gray/10"; // Default color
switch (status) {
case DomainStatus.SUCCESS:
badgeColor =
"bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25";
badgeColor = "bg-green/15 text-green border border-green/25";
break;
case DomainStatus.FAILED:
badgeColor =
"bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10";
badgeColor = "bg-red/10 text-red border border-red/10";
break;
case DomainStatus.TEMPORARY_FAILURE:
case DomainStatus.PENDING:
badgeColor =
"bg-yellow-500/20 dark:bg-yellow-500/10 text-yellow-600 border border-yellow-600/10";
badgeColor = "bg-yellow/20 text-yellow border border-yellow/10";
break;
default:
badgeColor =
"bg-gray-200/70 dark:bg-gray-400/10 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-400/20";
badgeColor = "bg-gray/10 text-gray border border-gray/20";
}

return (
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
fix colors in dashboard by KMKoushik · Pull Request #206 · usesend/useSend · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/web/src/app/(dashboard)/campaigns/[campaignId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,35 +146,35 @@ export default function CampaignDetailsPage({
}

const CampaignStatusBadge: React.FC<{ status: string }> = ({ status }) => {
let outsideColor = "bg-gray-600";
let insideColor = "bg-gray-600/50";
let outsideColor = "bg-gray";
let insideColor = "bg-gray/50";

switch (status) {
case "delivered":
outsideColor = "bg-emerald-500/30";
insideColor = "bg-emerald-500";
outsideColor = "bg-green/30";
insideColor = "bg-green";
break;
case "bounced":
case "unsubscribed":
outsideColor = "bg-red-500/30";
insideColor = "bg-red-500";
outsideColor = "bg-red/30";
insideColor = "bg-red";
break;
case "clicked":
outsideColor = "bg-cyan-500/30";
insideColor = "bg-cyan-500";
outsideColor = "bg-blue/30";
insideColor = "bg-blue";
break;
case "opened":
outsideColor = "bg-indigo-500/30";
insideColor = "bg-indigo-500";
outsideColor = "bg-purple/30";
insideColor = "bg-purple";
break;

case "complained":
outsideColor = "bg-yellow-500/30";
insideColor = "bg-yellow-500";
outsideColor = "bg-yellow/30";
insideColor = "bg-yellow";
break;
default:
outsideColor = "bg-gray-600/40";
insideColor = "bg-gray-600";
outsideColor = "bg-gray/40";
insideColor = "bg-gray";
}

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/campaigns/campaign-list.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,10 +103,10 @@ export default function CampaignList() {
<div
className={`text-center w-[130px] rounded capitalize py-1 text-xs ${
campaign.status === CampaignStatus.DRAFT
? "bg-gray-500/15 dark:bg-gray-400/15 text-gray-700 dark:text-gray-400/90 border border-gray-500/25 dark:border-gray-700/25"
? "bg-gray/15 text-grayborder border-gray/25"
: campaign.status === CampaignStatus.SENT
? "bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25"
: "bg-yellow-500/15 dark:bg-yellow-600/10 text-yellow-700 dark:text-yellow-600/90 border border-yellow-500/25 dark:border-yellow-700/25"
? "bg-green/15 text-greenborder border-green/25"
: "bg-yellow/15 text-yellowborder border-yellow/25"
}`}
>
{campaign.status.toLowerCase()}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/(dashboard)/campaigns/delete-campaign.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Trash2 className="h-[18px] w-[18px] text-red-600/80" />
<Trash2 className="h-[18px] w-[18px] text-red/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ export const DuplicateCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign duplicated`);
},
}
},
);
}

Expand All@@ -46,7 +46,7 @@ export const DuplicateCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Copy className="h-[18px] w-[18px] text-blue-600/80" />
<Copy className="h-[18px] w-[18px] text-blue/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,21 +152,21 @@ export default function ContactList({
</TableCell>
<TableCell>
{contact.subscribed ? (
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green/15 text-greenborder border-green/25">
Subscribed
</div>
) : (
<Tooltip>
<TooltipTrigger>
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red/10 text-redborder border-red/10">
Unsubscribed
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{getUnsubscribeReason(
contact.unsubscribeReason ??
UnsubscribeReason.UNSUBSCRIBED
UnsubscribeReason.UNSUBSCRIBED,
)}
</p>
</TooltipContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const DeleteContact: React.FC<{
onError: (e) => {
toast.error(`Contact not deleted: ${e.message}`);
},
}
},
);
}

Expand All@@ -79,7 +79,7 @@ export const DeleteContact: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 80 to 83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add aria-label and hover color for parity

Match other delete actions’ hover treatment and expose an accessible label.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete contact ${contact.email ?? ""}`}+ title="Delete contact"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
-<Buttonvariant="ghost"size="sm">
-<Trash2className="h-4 w-4 text-red/80"/>
<Button
variant="ghost"
size="sm"
aria-label={`Delete contact ${contact.email??""}`}
title="Delete contact"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/[contactBookId]/delete-contact.tsx
around lines 80 to 83, the icon-only DialogTrigger/Button lacks an accessible
label and doesn't match other delete actions' hover color; add an aria-label
(e.g., aria-label="Delete contact") to the trigger/button and update the
button/icon classes to include the same hover color used by other delete buttons
(e.g., hover text-red/100 or hover:text-red/90) so the icon has a visible hover
state and is accessible to screen readers.

</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ export const DeleteContactBook: React.FC<{
});

async function onContactBookDelete(
values: z.infer<typeof contactBookSchema>
values: z.infer<typeof contactBookSchema>,
) {
if (values.name !== contactBook.name) {
contactBookForm.setError("name", {
Expand All@@ -65,7 +65,7 @@ export const DeleteContactBook: React.FC<{
setOpen(false);
toast.success(`Contact book deleted`);
},
}
},
);
}

Expand All@@ -78,7 +78,7 @@ export const DeleteContactBook: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">
<Trash2 className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70" />
<Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />
</Button>
Comment on lines 79 to 82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tidy className and add accessible label

Remove trailing space in className and add an aria-label for the icon-only trigger.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">- <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className="p-0 hover:bg-transparent"+ aria-label={`Delete contact book ${contactBook.name ?? ""}`}+ title="Delete contact book"+ >+ <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm"className="p-0 hover:bg-transparent ">
<Trash2className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70"/>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
className="p-0 hover:bg-transparent"
aria-label={`Delete contact book ${contactBook.name??""}`}
title="Delete contact book"
>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/delete-contact-book.tsx around lines 79
to 82, remove the trailing space from the Button's className value and add an
accessible label to the icon-only trigger by providing an aria-label (e.g.,
aria-label="Delete contact") on the Button element so screen readers can
describe the action.

</DialogTrigger>
<DialogContent>
Expand Down
56 changes: 45 additions & 11 deletions apps/web/src/app/(dashboard)/dashboard/email-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ import { EmailStatus } from "@prisma/client";
import { api } from "~/trpc/react";
import Spinner from "@unsend/ui/src/spinner";
import { useTheme } from "@unsend/ui";
import { EMAIL_COLORS } from "~/lib/constants/colors";
import { useColors } from "./hooks/useColors";

interface EmailChartProps {
Expand DownExpand Up@@ -127,7 +126,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
</p>
{data.delivered ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#40a02bcc] dark:bg-[#a6e3a1] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.delivered }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Delivered
</p>
Expand All@@ -136,7 +138,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.bounced ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#d20f39cc] dark:bg-[#f38ba8] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.bounced }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Bounced
</p>
Expand All@@ -145,7 +150,12 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.complained ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#df8e1dcc] dark:bg-[#F9E2AF] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{
backgroundColor: currentColors.complained,
}}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Complained
</p>
Expand All@@ -154,7 +164,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.opened ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#8839efcc] dark:bg-[#cba6f7] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.opened }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Opened
</p>
Expand All@@ -163,7 +176,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.clicked ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#04a5e5cc] dark:bg-[#93c5fd] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.clicked }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Clicked
</p>
Expand DownExpand Up@@ -236,16 +252,34 @@ const EmailChartItem: React.FC<DashboardItemCardProps> = ({
count,
percentage,
}) => {
const color = EMAIL_COLORS[status];
const currentColors = useColors();

const getColorForStatus = (status: EmailStatus | "total"): string => {
switch (status) {
case "DELIVERED":
return currentColors.delivered;
case "BOUNCED":
return currentColors.bounced;
case "COMPLAINED":
return currentColors.complained;
case "OPENED":
return currentColors.opened;
case "CLICKED":
return currentColors.clicked;
case "total":
default:
return "#6b7280"; // gray-500 for total and other statuses
}
};

return (
<div className="flex gap-3 items-stretch font-mono">
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}

<div>
<div className=" flex items-center gap-2">
<div className={`${color} w-2.5 h-2.5 rounded-[3px]`}></div>
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}
<div
className="w-2.5 h-2.5 rounded-[3px]"
style={{ backgroundColor: getColorForStatus(status) }}
></div>

<div className="text-xs uppercase text-muted-foreground ">
{status.toLowerCase()}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export default function AddApiKey() {
setApiKey(data);
apiKeyForm.reset();
},
}
},
);
}

Expand DownExpand Up@@ -132,7 +132,7 @@ export default function AddApiKey() {
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="h-4 w-4 text-green-500" />
<CheckIcon className="h-4 w-4 text-green" />
) : (
<ClipboardCopy className="h-4 w-4" />
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteApiKey: React.FC<{
setOpen(false);
toast.success(`API key deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteApiKey: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 76 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add accessible label and consistent hover color

Add an aria-label for screen readers and align hover color with other delete triggers in this PR.

Apply:

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete API key ${apiKey.name ?? ""}`}+ title="Delete API key"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
aria-label={`Delete API key ${apiKey.name??""}`}
title="Delete API key"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/dev-settings/api-keys/delete-api-key.tsx around
lines 76-79, the icon-only DialogTrigger/Button lacks an accessible label and
its hover color doesn't match other delete triggers; add an aria-label (e.g.,
aria-label="Delete API key") to the Button so screen readers announce its
purpose, and update the button/icon hover color class to match the other delete
controls in this PR (use the same hover text color utility used elsewhere for
delete actions).

</DialogTrigger>
<DialogContent>
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(dashboard)/domains/[domainId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ export default function DomainItemPage({
{
refetchInterval: (q) => (q?.state.data?.isVerifying ? 10000 : false),
refetchIntervalInBackground: true,
},
}
);

const verifyQuery = api.domain.startVerification.useMutation();
Expand All@@ -54,7 +54,7 @@ export default function DomainItemPage({
onSettled: () => {
domainQuery.refetch();
},
},
}
);
};

Expand DownExpand Up@@ -232,7 +232,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
const utils = api.useUtils();

const [clickTracking, setClickTracking] = React.useState(
domain.clickTracking,
domain.clickTracking
);
const [openTracking, setOpenTracking] = React.useState(domain.openTracking);

Expand All@@ -245,7 +245,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Click tracking updated");
},
},
}
);
}

Expand All@@ -258,7 +258,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Open tracking updated");
},
},
}
);
}
return (
Expand DownExpand Up@@ -303,24 +303,20 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
};

const DnsVerificationStatus: React.FC<{ status: string }> = ({ status }) => {
let badgeColor = "bg-gray-400/10 text-gray-500 border-gray-400/10"; // Default color
let badgeColor = "bg-gray/10 text-gray border-gray/10"; // Default color
switch (status) {
case DomainStatus.SUCCESS:
badgeColor =
"bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25";
badgeColor = "bg-green/15 text-green border border-green/25";
break;
case DomainStatus.FAILED:
badgeColor =
"bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10";
badgeColor = "bg-red/10 text-red border border-red/10";
break;
case DomainStatus.TEMPORARY_FAILURE:
case DomainStatus.PENDING:
badgeColor =
"bg-yellow-500/20 dark:bg-yellow-500/10 text-yellow-600 border border-yellow-600/10";
badgeColor = "bg-yellow/20 text-yellow border border-yellow/10";
break;
default:
badgeColor =
"bg-gray-200/70 dark:bg-gray-400/10 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-400/20";
badgeColor = "bg-gray/10 text-gray border border-gray/20";
}

return (
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix colors in dashboard by KMKoushik · Pull Request #206 · usesend/useSend · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/web/src/app/(dashboard)/campaigns/[campaignId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,35 +146,35 @@ export default function CampaignDetailsPage({
}

const CampaignStatusBadge: React.FC<{ status: string }> = ({ status }) => {
let outsideColor = "bg-gray-600";
let insideColor = "bg-gray-600/50";
let outsideColor = "bg-gray";
let insideColor = "bg-gray/50";

switch (status) {
case "delivered":
outsideColor = "bg-emerald-500/30";
insideColor = "bg-emerald-500";
outsideColor = "bg-green/30";
insideColor = "bg-green";
break;
case "bounced":
case "unsubscribed":
outsideColor = "bg-red-500/30";
insideColor = "bg-red-500";
outsideColor = "bg-red/30";
insideColor = "bg-red";
break;
case "clicked":
outsideColor = "bg-cyan-500/30";
insideColor = "bg-cyan-500";
outsideColor = "bg-blue/30";
insideColor = "bg-blue";
break;
case "opened":
outsideColor = "bg-indigo-500/30";
insideColor = "bg-indigo-500";
outsideColor = "bg-purple/30";
insideColor = "bg-purple";
break;

case "complained":
outsideColor = "bg-yellow-500/30";
insideColor = "bg-yellow-500";
outsideColor = "bg-yellow/30";
insideColor = "bg-yellow";
break;
default:
outsideColor = "bg-gray-600/40";
insideColor = "bg-gray-600";
outsideColor = "bg-gray/40";
insideColor = "bg-gray";
}

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/campaigns/campaign-list.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,10 +103,10 @@ export default function CampaignList() {
<div
className={`text-center w-[130px] rounded capitalize py-1 text-xs ${
campaign.status === CampaignStatus.DRAFT
? "bg-gray-500/15 dark:bg-gray-400/15 text-gray-700 dark:text-gray-400/90 border border-gray-500/25 dark:border-gray-700/25"
? "bg-gray/15 text-grayborder border-gray/25"
: campaign.status === CampaignStatus.SENT
? "bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25"
: "bg-yellow-500/15 dark:bg-yellow-600/10 text-yellow-700 dark:text-yellow-600/90 border border-yellow-500/25 dark:border-yellow-700/25"
? "bg-green/15 text-greenborder border-green/25"
: "bg-yellow/15 text-yellowborder border-yellow/25"
}`}
>
{campaign.status.toLowerCase()}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/(dashboard)/campaigns/delete-campaign.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Trash2 className="h-[18px] w-[18px] text-red-600/80" />
<Trash2 className="h-[18px] w-[18px] text-red/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ export const DuplicateCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign duplicated`);
},
}
},
);
}

Expand All@@ -46,7 +46,7 @@ export const DuplicateCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Copy className="h-[18px] w-[18px] text-blue-600/80" />
<Copy className="h-[18px] w-[18px] text-blue/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,21 +152,21 @@ export default function ContactList({
</TableCell>
<TableCell>
{contact.subscribed ? (
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green/15 text-greenborder border-green/25">
Subscribed
</div>
) : (
<Tooltip>
<TooltipTrigger>
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red/10 text-redborder border-red/10">
Unsubscribed
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{getUnsubscribeReason(
contact.unsubscribeReason ??
UnsubscribeReason.UNSUBSCRIBED
UnsubscribeReason.UNSUBSCRIBED,
)}
</p>
</TooltipContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const DeleteContact: React.FC<{
onError: (e) => {
toast.error(`Contact not deleted: ${e.message}`);
},
}
},
);
}

Expand All@@ -79,7 +79,7 @@ export const DeleteContact: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 80 to 83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add aria-label and hover color for parity

Match other delete actions’ hover treatment and expose an accessible label.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete contact ${contact.email ?? ""}`}+ title="Delete contact"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
-<Buttonvariant="ghost"size="sm">
-<Trash2className="h-4 w-4 text-red/80"/>
<Button
variant="ghost"
size="sm"
aria-label={`Delete contact ${contact.email??""}`}
title="Delete contact"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/[contactBookId]/delete-contact.tsx
around lines 80 to 83, the icon-only DialogTrigger/Button lacks an accessible
label and doesn't match other delete actions' hover color; add an aria-label
(e.g., aria-label="Delete contact") to the trigger/button and update the
button/icon classes to include the same hover color used by other delete buttons
(e.g., hover text-red/100 or hover:text-red/90) so the icon has a visible hover
state and is accessible to screen readers.

</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ export const DeleteContactBook: React.FC<{
});

async function onContactBookDelete(
values: z.infer<typeof contactBookSchema>
values: z.infer<typeof contactBookSchema>,
) {
if (values.name !== contactBook.name) {
contactBookForm.setError("name", {
Expand All@@ -65,7 +65,7 @@ export const DeleteContactBook: React.FC<{
setOpen(false);
toast.success(`Contact book deleted`);
},
}
},
);
}

Expand All@@ -78,7 +78,7 @@ export const DeleteContactBook: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">
<Trash2 className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70" />
<Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />
</Button>
Comment on lines 79 to 82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tidy className and add accessible label

Remove trailing space in className and add an aria-label for the icon-only trigger.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">- <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className="p-0 hover:bg-transparent"+ aria-label={`Delete contact book ${contactBook.name ?? ""}`}+ title="Delete contact book"+ >+ <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm"className="p-0 hover:bg-transparent ">
<Trash2className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70"/>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
className="p-0 hover:bg-transparent"
aria-label={`Delete contact book ${contactBook.name??""}`}
title="Delete contact book"
>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/delete-contact-book.tsx around lines 79
to 82, remove the trailing space from the Button's className value and add an
accessible label to the icon-only trigger by providing an aria-label (e.g.,
aria-label="Delete contact") on the Button element so screen readers can
describe the action.

</DialogTrigger>
<DialogContent>
Expand Down
56 changes: 45 additions & 11 deletions apps/web/src/app/(dashboard)/dashboard/email-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ import { EmailStatus } from "@prisma/client";
import { api } from "~/trpc/react";
import Spinner from "@unsend/ui/src/spinner";
import { useTheme } from "@unsend/ui";
import { EMAIL_COLORS } from "~/lib/constants/colors";
import { useColors } from "./hooks/useColors";

interface EmailChartProps {
Expand DownExpand Up@@ -127,7 +126,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
</p>
{data.delivered ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#40a02bcc] dark:bg-[#a6e3a1] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.delivered }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Delivered
</p>
Expand All@@ -136,7 +138,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.bounced ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#d20f39cc] dark:bg-[#f38ba8] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.bounced }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Bounced
</p>
Expand All@@ -145,7 +150,12 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.complained ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#df8e1dcc] dark:bg-[#F9E2AF] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{
backgroundColor: currentColors.complained,
}}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Complained
</p>
Expand All@@ -154,7 +164,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.opened ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#8839efcc] dark:bg-[#cba6f7] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.opened }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Opened
</p>
Expand All@@ -163,7 +176,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.clicked ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#04a5e5cc] dark:bg-[#93c5fd] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.clicked }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Clicked
</p>
Expand DownExpand Up@@ -236,16 +252,34 @@ const EmailChartItem: React.FC<DashboardItemCardProps> = ({
count,
percentage,
}) => {
const color = EMAIL_COLORS[status];
const currentColors = useColors();

const getColorForStatus = (status: EmailStatus | "total"): string => {
switch (status) {
case "DELIVERED":
return currentColors.delivered;
case "BOUNCED":
return currentColors.bounced;
case "COMPLAINED":
return currentColors.complained;
case "OPENED":
return currentColors.opened;
case "CLICKED":
return currentColors.clicked;
case "total":
default:
return "#6b7280"; // gray-500 for total and other statuses
}
};

return (
<div className="flex gap-3 items-stretch font-mono">
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}

<div>
<div className=" flex items-center gap-2">
<div className={`${color} w-2.5 h-2.5 rounded-[3px]`}></div>
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}
<div
className="w-2.5 h-2.5 rounded-[3px]"
style={{ backgroundColor: getColorForStatus(status) }}
></div>

<div className="text-xs uppercase text-muted-foreground ">
{status.toLowerCase()}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export default function AddApiKey() {
setApiKey(data);
apiKeyForm.reset();
},
}
},
);
}

Expand DownExpand Up@@ -132,7 +132,7 @@ export default function AddApiKey() {
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="h-4 w-4 text-green-500" />
<CheckIcon className="h-4 w-4 text-green" />
) : (
<ClipboardCopy className="h-4 w-4" />
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteApiKey: React.FC<{
setOpen(false);
toast.success(`API key deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteApiKey: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 76 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add accessible label and consistent hover color

Add an aria-label for screen readers and align hover color with other delete triggers in this PR.

Apply:

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete API key ${apiKey.name ?? ""}`}+ title="Delete API key"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
aria-label={`Delete API key ${apiKey.name??""}`}
title="Delete API key"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/dev-settings/api-keys/delete-api-key.tsx around
lines 76-79, the icon-only DialogTrigger/Button lacks an accessible label and
its hover color doesn't match other delete triggers; add an aria-label (e.g.,
aria-label="Delete API key") to the Button so screen readers announce its
purpose, and update the button/icon hover color class to match the other delete
controls in this PR (use the same hover text color utility used elsewhere for
delete actions).

</DialogTrigger>
<DialogContent>
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(dashboard)/domains/[domainId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ export default function DomainItemPage({
{
refetchInterval: (q) => (q?.state.data?.isVerifying ? 10000 : false),
refetchIntervalInBackground: true,
},
}
);

const verifyQuery = api.domain.startVerification.useMutation();
Expand All@@ -54,7 +54,7 @@ export default function DomainItemPage({
onSettled: () => {
domainQuery.refetch();
},
},
}
);
};

Expand DownExpand Up@@ -232,7 +232,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
const utils = api.useUtils();

const [clickTracking, setClickTracking] = React.useState(
domain.clickTracking,
domain.clickTracking
);
const [openTracking, setOpenTracking] = React.useState(domain.openTracking);

Expand All@@ -245,7 +245,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Click tracking updated");
},
},
}
);
}

Expand All@@ -258,7 +258,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Open tracking updated");
},
},
}
);
}
return (
Expand DownExpand Up@@ -303,24 +303,20 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
};

const DnsVerificationStatus: React.FC<{ status: string }> = ({ status }) => {
let badgeColor = "bg-gray-400/10 text-gray-500 border-gray-400/10"; // Default color
let badgeColor = "bg-gray/10 text-gray border-gray/10"; // Default color
switch (status) {
case DomainStatus.SUCCESS:
badgeColor =
"bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25";
badgeColor = "bg-green/15 text-green border border-green/25";
break;
case DomainStatus.FAILED:
badgeColor =
"bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10";
badgeColor = "bg-red/10 text-red border border-red/10";
break;
case DomainStatus.TEMPORARY_FAILURE:
case DomainStatus.PENDING:
badgeColor =
"bg-yellow-500/20 dark:bg-yellow-500/10 text-yellow-600 border border-yellow-600/10";
badgeColor = "bg-yellow/20 text-yellow border border-yellow/10";
break;
default:
badgeColor =
"bg-gray-200/70 dark:bg-gray-400/10 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-400/20";
badgeColor = "bg-gray/10 text-gray border border-gray/20";
}

return (
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Highlight search terms from Google/DuckDuckGo/Bing referrer (function() { var ref = document.referrer; var terms = []; if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) { var url = new URL(ref); var q = url.searchParams.get('q') || url.searchParams.get('p'); if (q) { terms = q.split(/\s+/).filter(function(t) { return t.length > 2; }); } } if (terms.length === 0) return; var style = document.createElement('style'); style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }'; document.head.appendChild(style); function highlight(node) { if (node.nodeType === 3) { // text node var text = node.textContent; var found = false; terms.forEach(function(term) { var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\]\\]/g, '\\') + ')', 'gi'); if (regex.test(text)) { found = true; var frag = document.createDocumentFragment(); var parts = text.split(regex); parts.forEach(function(part, i) { if (i % 2 === 0) { frag.appendChild(document.createTextNode(part)); } else { var span = document.createElement('span'); span.className = 'userscript-highlight'; span.textContent = part; frag.appendChild(span); } }); node.parentNode.replaceChild(frag, node); } }); } else if (node.nodeType === 1 && node.childNodes) { // element var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT']; if (!skipTags.includes(node.tagName)) { Array.from(node.childNodes).forEach(highlight); } } } highlight(document.body); // Re-highlight on dynamic content var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1 || node.nodeType === 3) highlight(node); }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix colors in dashboard by KMKoushik · Pull Request #206 · usesend/useSend · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/web/src/app/(dashboard)/campaigns/[campaignId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,35 +146,35 @@ export default function CampaignDetailsPage({
}

const CampaignStatusBadge: React.FC<{ status: string }> = ({ status }) => {
let outsideColor = "bg-gray-600";
let insideColor = "bg-gray-600/50";
let outsideColor = "bg-gray";
let insideColor = "bg-gray/50";

switch (status) {
case "delivered":
outsideColor = "bg-emerald-500/30";
insideColor = "bg-emerald-500";
outsideColor = "bg-green/30";
insideColor = "bg-green";
break;
case "bounced":
case "unsubscribed":
outsideColor = "bg-red-500/30";
insideColor = "bg-red-500";
outsideColor = "bg-red/30";
insideColor = "bg-red";
break;
case "clicked":
outsideColor = "bg-cyan-500/30";
insideColor = "bg-cyan-500";
outsideColor = "bg-blue/30";
insideColor = "bg-blue";
break;
case "opened":
outsideColor = "bg-indigo-500/30";
insideColor = "bg-indigo-500";
outsideColor = "bg-purple/30";
insideColor = "bg-purple";
break;

case "complained":
outsideColor = "bg-yellow-500/30";
insideColor = "bg-yellow-500";
outsideColor = "bg-yellow/30";
insideColor = "bg-yellow";
break;
default:
outsideColor = "bg-gray-600/40";
insideColor = "bg-gray-600";
outsideColor = "bg-gray/40";
insideColor = "bg-gray";
}

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/campaigns/campaign-list.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,10 +103,10 @@ export default function CampaignList() {
<div
className={`text-center w-[130px] rounded capitalize py-1 text-xs ${
campaign.status === CampaignStatus.DRAFT
? "bg-gray-500/15 dark:bg-gray-400/15 text-gray-700 dark:text-gray-400/90 border border-gray-500/25 dark:border-gray-700/25"
? "bg-gray/15 text-grayborder border-gray/25"
: campaign.status === CampaignStatus.SENT
? "bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25"
: "bg-yellow-500/15 dark:bg-yellow-600/10 text-yellow-700 dark:text-yellow-600/90 border border-yellow-500/25 dark:border-yellow-700/25"
? "bg-green/15 text-greenborder border-green/25"
: "bg-yellow/15 text-yellowborder border-yellow/25"
}`}
>
{campaign.status.toLowerCase()}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/(dashboard)/campaigns/delete-campaign.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Trash2 className="h-[18px] w-[18px] text-red-600/80" />
<Trash2 className="h-[18px] w-[18px] text-red/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ export const DuplicateCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign duplicated`);
},
}
},
);
}

Expand All@@ -46,7 +46,7 @@ export const DuplicateCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Copy className="h-[18px] w-[18px] text-blue-600/80" />
<Copy className="h-[18px] w-[18px] text-blue/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,21 +152,21 @@ export default function ContactList({
</TableCell>
<TableCell>
{contact.subscribed ? (
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green/15 text-greenborder border-green/25">
Subscribed
</div>
) : (
<Tooltip>
<TooltipTrigger>
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red/10 text-redborder border-red/10">
Unsubscribed
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{getUnsubscribeReason(
contact.unsubscribeReason ??
UnsubscribeReason.UNSUBSCRIBED
UnsubscribeReason.UNSUBSCRIBED,
)}
</p>
</TooltipContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const DeleteContact: React.FC<{
onError: (e) => {
toast.error(`Contact not deleted: ${e.message}`);
},
}
},
);
}

Expand All@@ -79,7 +79,7 @@ export const DeleteContact: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 80 to 83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add aria-label and hover color for parity

Match other delete actions’ hover treatment and expose an accessible label.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete contact ${contact.email ?? ""}`}+ title="Delete contact"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
-<Buttonvariant="ghost"size="sm">
-<Trash2className="h-4 w-4 text-red/80"/>
<Button
variant="ghost"
size="sm"
aria-label={`Delete contact ${contact.email??""}`}
title="Delete contact"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/[contactBookId]/delete-contact.tsx
around lines 80 to 83, the icon-only DialogTrigger/Button lacks an accessible
label and doesn't match other delete actions' hover color; add an aria-label
(e.g., aria-label="Delete contact") to the trigger/button and update the
button/icon classes to include the same hover color used by other delete buttons
(e.g., hover text-red/100 or hover:text-red/90) so the icon has a visible hover
state and is accessible to screen readers.

</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ export const DeleteContactBook: React.FC<{
});

async function onContactBookDelete(
values: z.infer<typeof contactBookSchema>
values: z.infer<typeof contactBookSchema>,
) {
if (values.name !== contactBook.name) {
contactBookForm.setError("name", {
Expand All@@ -65,7 +65,7 @@ export const DeleteContactBook: React.FC<{
setOpen(false);
toast.success(`Contact book deleted`);
},
}
},
);
}

Expand All@@ -78,7 +78,7 @@ export const DeleteContactBook: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">
<Trash2 className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70" />
<Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />
</Button>
Comment on lines 79 to 82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tidy className and add accessible label

Remove trailing space in className and add an aria-label for the icon-only trigger.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">- <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className="p-0 hover:bg-transparent"+ aria-label={`Delete contact book ${contactBook.name ?? ""}`}+ title="Delete contact book"+ >+ <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm"className="p-0 hover:bg-transparent ">
<Trash2className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70"/>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
className="p-0 hover:bg-transparent"
aria-label={`Delete contact book ${contactBook.name??""}`}
title="Delete contact book"
>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/delete-contact-book.tsx around lines 79
to 82, remove the trailing space from the Button's className value and add an
accessible label to the icon-only trigger by providing an aria-label (e.g.,
aria-label="Delete contact") on the Button element so screen readers can
describe the action.

</DialogTrigger>
<DialogContent>
Expand Down
56 changes: 45 additions & 11 deletions apps/web/src/app/(dashboard)/dashboard/email-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ import { EmailStatus } from "@prisma/client";
import { api } from "~/trpc/react";
import Spinner from "@unsend/ui/src/spinner";
import { useTheme } from "@unsend/ui";
import { EMAIL_COLORS } from "~/lib/constants/colors";
import { useColors } from "./hooks/useColors";

interface EmailChartProps {
Expand DownExpand Up@@ -127,7 +126,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
</p>
{data.delivered ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#40a02bcc] dark:bg-[#a6e3a1] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.delivered }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Delivered
</p>
Expand All@@ -136,7 +138,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.bounced ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#d20f39cc] dark:bg-[#f38ba8] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.bounced }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Bounced
</p>
Expand All@@ -145,7 +150,12 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.complained ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#df8e1dcc] dark:bg-[#F9E2AF] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{
backgroundColor: currentColors.complained,
}}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Complained
</p>
Expand All@@ -154,7 +164,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.opened ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#8839efcc] dark:bg-[#cba6f7] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.opened }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Opened
</p>
Expand All@@ -163,7 +176,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.clicked ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#04a5e5cc] dark:bg-[#93c5fd] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.clicked }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Clicked
</p>
Expand DownExpand Up@@ -236,16 +252,34 @@ const EmailChartItem: React.FC<DashboardItemCardProps> = ({
count,
percentage,
}) => {
const color = EMAIL_COLORS[status];
const currentColors = useColors();

const getColorForStatus = (status: EmailStatus | "total"): string => {
switch (status) {
case "DELIVERED":
return currentColors.delivered;
case "BOUNCED":
return currentColors.bounced;
case "COMPLAINED":
return currentColors.complained;
case "OPENED":
return currentColors.opened;
case "CLICKED":
return currentColors.clicked;
case "total":
default:
return "#6b7280"; // gray-500 for total and other statuses
}
};

return (
<div className="flex gap-3 items-stretch font-mono">
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}

<div>
<div className=" flex items-center gap-2">
<div className={`${color} w-2.5 h-2.5 rounded-[3px]`}></div>
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}
<div
className="w-2.5 h-2.5 rounded-[3px]"
style={{ backgroundColor: getColorForStatus(status) }}
></div>

<div className="text-xs uppercase text-muted-foreground ">
{status.toLowerCase()}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export default function AddApiKey() {
setApiKey(data);
apiKeyForm.reset();
},
}
},
);
}

Expand DownExpand Up@@ -132,7 +132,7 @@ export default function AddApiKey() {
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="h-4 w-4 text-green-500" />
<CheckIcon className="h-4 w-4 text-green" />
) : (
<ClipboardCopy className="h-4 w-4" />
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteApiKey: React.FC<{
setOpen(false);
toast.success(`API key deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteApiKey: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 76 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add accessible label and consistent hover color

Add an aria-label for screen readers and align hover color with other delete triggers in this PR.

Apply:

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete API key ${apiKey.name ?? ""}`}+ title="Delete API key"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
aria-label={`Delete API key ${apiKey.name??""}`}
title="Delete API key"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/dev-settings/api-keys/delete-api-key.tsx around
lines 76-79, the icon-only DialogTrigger/Button lacks an accessible label and
its hover color doesn't match other delete triggers; add an aria-label (e.g.,
aria-label="Delete API key") to the Button so screen readers announce its
purpose, and update the button/icon hover color class to match the other delete
controls in this PR (use the same hover text color utility used elsewhere for
delete actions).

</DialogTrigger>
<DialogContent>
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(dashboard)/domains/[domainId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ export default function DomainItemPage({
{
refetchInterval: (q) => (q?.state.data?.isVerifying ? 10000 : false),
refetchIntervalInBackground: true,
},
}
);

const verifyQuery = api.domain.startVerification.useMutation();
Expand All@@ -54,7 +54,7 @@ export default function DomainItemPage({
onSettled: () => {
domainQuery.refetch();
},
},
}
);
};

Expand DownExpand Up@@ -232,7 +232,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
const utils = api.useUtils();

const [clickTracking, setClickTracking] = React.useState(
domain.clickTracking,
domain.clickTracking
);
const [openTracking, setOpenTracking] = React.useState(domain.openTracking);

Expand All@@ -245,7 +245,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Click tracking updated");
},
},
}
);
}

Expand All@@ -258,7 +258,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Open tracking updated");
},
},
}
);
}
return (
Expand DownExpand Up@@ -303,24 +303,20 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
};

const DnsVerificationStatus: React.FC<{ status: string }> = ({ status }) => {
let badgeColor = "bg-gray-400/10 text-gray-500 border-gray-400/10"; // Default color
let badgeColor = "bg-gray/10 text-gray border-gray/10"; // Default color
switch (status) {
case DomainStatus.SUCCESS:
badgeColor =
"bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25";
badgeColor = "bg-green/15 text-green border border-green/25";
break;
case DomainStatus.FAILED:
badgeColor =
"bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10";
badgeColor = "bg-red/10 text-red border border-red/10";
break;
case DomainStatus.TEMPORARY_FAILURE:
case DomainStatus.PENDING:
badgeColor =
"bg-yellow-500/20 dark:bg-yellow-500/10 text-yellow-600 border border-yellow-600/10";
badgeColor = "bg-yellow/20 text-yellow border border-yellow/10";
break;
default:
badgeColor =
"bg-gray-200/70 dark:bg-gray-400/10 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-400/20";
badgeColor = "bg-gray/10 text-gray border border-gray/20";
}

return (
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Strip utm_, fbclid, gclid, etc. from all links on page (function() { var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid', 'ref', 'ref_src', 'source', 'medium', 'campaign']; function cleanUrl(url) { try { var u = new URL(url, window.location.origin); var changed = false; trackingParams.forEach(function(p) { if (u.searchParams.has(p)) { u.searchParams.delete(p); changed = true; } }); return changed ? u.toString() : url; } catch (e) { return url; } } function cleanLinks() { document.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } cleanLinks(); var observer = new MutationObserver(function(mutations) { mutations.forEach(function(m) { m.addedNodes.forEach(function(node) { if (node.nodeType === 1) { if (node.tagName === 'A') cleanLinks(); node.querySelectorAll('a[href]').forEach(function(a) { var clean = cleanUrl(a.href); if (clean !== a.href) a.href = clean; }); } }); }); }); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + ' fix colors in dashboard by KMKoushik · Pull Request #206 · usesend/useSend · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/web/src/app/(dashboard)/campaigns/[campaignId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,35 +146,35 @@ export default function CampaignDetailsPage({
}

const CampaignStatusBadge: React.FC<{ status: string }> = ({ status }) => {
let outsideColor = "bg-gray-600";
let insideColor = "bg-gray-600/50";
let outsideColor = "bg-gray";
let insideColor = "bg-gray/50";

switch (status) {
case "delivered":
outsideColor = "bg-emerald-500/30";
insideColor = "bg-emerald-500";
outsideColor = "bg-green/30";
insideColor = "bg-green";
break;
case "bounced":
case "unsubscribed":
outsideColor = "bg-red-500/30";
insideColor = "bg-red-500";
outsideColor = "bg-red/30";
insideColor = "bg-red";
break;
case "clicked":
outsideColor = "bg-cyan-500/30";
insideColor = "bg-cyan-500";
outsideColor = "bg-blue/30";
insideColor = "bg-blue";
break;
case "opened":
outsideColor = "bg-indigo-500/30";
insideColor = "bg-indigo-500";
outsideColor = "bg-purple/30";
insideColor = "bg-purple";
break;

case "complained":
outsideColor = "bg-yellow-500/30";
insideColor = "bg-yellow-500";
outsideColor = "bg-yellow/30";
insideColor = "bg-yellow";
break;
default:
outsideColor = "bg-gray-600/40";
insideColor = "bg-gray-600";
outsideColor = "bg-gray/40";
insideColor = "bg-gray";
}

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/campaigns/campaign-list.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,10 +103,10 @@ export default function CampaignList() {
<div
className={`text-center w-[130px] rounded capitalize py-1 text-xs ${
campaign.status === CampaignStatus.DRAFT
? "bg-gray-500/15 dark:bg-gray-400/15 text-gray-700 dark:text-gray-400/90 border border-gray-500/25 dark:border-gray-700/25"
? "bg-gray/15 text-grayborder border-gray/25"
: campaign.status === CampaignStatus.SENT
? "bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25"
: "bg-yellow-500/15 dark:bg-yellow-600/10 text-yellow-700 dark:text-yellow-600/90 border border-yellow-500/25 dark:border-yellow-700/25"
? "bg-green/15 text-greenborder border-green/25"
: "bg-yellow/15 text-yellowborder border-yellow/25"
}`}
>
{campaign.status.toLowerCase()}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/(dashboard)/campaigns/delete-campaign.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Trash2 className="h-[18px] w-[18px] text-red-600/80" />
<Trash2 className="h-[18px] w-[18px] text-red/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ export const DuplicateCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign duplicated`);
},
}
},
);
}

Expand All@@ -46,7 +46,7 @@ export const DuplicateCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Copy className="h-[18px] w-[18px] text-blue-600/80" />
<Copy className="h-[18px] w-[18px] text-blue/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,21 +152,21 @@ export default function ContactList({
</TableCell>
<TableCell>
{contact.subscribed ? (
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green/15 text-greenborder border-green/25">
Subscribed
</div>
) : (
<Tooltip>
<TooltipTrigger>
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red/10 text-redborder border-red/10">
Unsubscribed
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{getUnsubscribeReason(
contact.unsubscribeReason ??
UnsubscribeReason.UNSUBSCRIBED
UnsubscribeReason.UNSUBSCRIBED,
)}
</p>
</TooltipContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const DeleteContact: React.FC<{
onError: (e) => {
toast.error(`Contact not deleted: ${e.message}`);
},
}
},
);
}

Expand All@@ -79,7 +79,7 @@ export const DeleteContact: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 80 to 83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add aria-label and hover color for parity

Match other delete actions’ hover treatment and expose an accessible label.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete contact ${contact.email ?? ""}`}+ title="Delete contact"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
-<Buttonvariant="ghost"size="sm">
-<Trash2className="h-4 w-4 text-red/80"/>
<Button
variant="ghost"
size="sm"
aria-label={`Delete contact ${contact.email??""}`}
title="Delete contact"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/[contactBookId]/delete-contact.tsx
around lines 80 to 83, the icon-only DialogTrigger/Button lacks an accessible
label and doesn't match other delete actions' hover color; add an aria-label
(e.g., aria-label="Delete contact") to the trigger/button and update the
button/icon classes to include the same hover color used by other delete buttons
(e.g., hover text-red/100 or hover:text-red/90) so the icon has a visible hover
state and is accessible to screen readers.

</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ export const DeleteContactBook: React.FC<{
});

async function onContactBookDelete(
values: z.infer<typeof contactBookSchema>
values: z.infer<typeof contactBookSchema>,
) {
if (values.name !== contactBook.name) {
contactBookForm.setError("name", {
Expand All@@ -65,7 +65,7 @@ export const DeleteContactBook: React.FC<{
setOpen(false);
toast.success(`Contact book deleted`);
},
}
},
);
}

Expand All@@ -78,7 +78,7 @@ export const DeleteContactBook: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">
<Trash2 className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70" />
<Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />
</Button>
Comment on lines 79 to 82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tidy className and add accessible label

Remove trailing space in className and add an aria-label for the icon-only trigger.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">- <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className="p-0 hover:bg-transparent"+ aria-label={`Delete contact book ${contactBook.name ?? ""}`}+ title="Delete contact book"+ >+ <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm"className="p-0 hover:bg-transparent ">
<Trash2className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70"/>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
className="p-0 hover:bg-transparent"
aria-label={`Delete contact book ${contactBook.name??""}`}
title="Delete contact book"
>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/delete-contact-book.tsx around lines 79
to 82, remove the trailing space from the Button's className value and add an
accessible label to the icon-only trigger by providing an aria-label (e.g.,
aria-label="Delete contact") on the Button element so screen readers can
describe the action.

</DialogTrigger>
<DialogContent>
Expand Down
56 changes: 45 additions & 11 deletions apps/web/src/app/(dashboard)/dashboard/email-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ import { EmailStatus } from "@prisma/client";
import { api } from "~/trpc/react";
import Spinner from "@unsend/ui/src/spinner";
import { useTheme } from "@unsend/ui";
import { EMAIL_COLORS } from "~/lib/constants/colors";
import { useColors } from "./hooks/useColors";

interface EmailChartProps {
Expand DownExpand Up@@ -127,7 +126,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
</p>
{data.delivered ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#40a02bcc] dark:bg-[#a6e3a1] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.delivered }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Delivered
</p>
Expand All@@ -136,7 +138,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.bounced ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#d20f39cc] dark:bg-[#f38ba8] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.bounced }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Bounced
</p>
Expand All@@ -145,7 +150,12 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.complained ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#df8e1dcc] dark:bg-[#F9E2AF] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{
backgroundColor: currentColors.complained,
}}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Complained
</p>
Expand All@@ -154,7 +164,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.opened ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#8839efcc] dark:bg-[#cba6f7] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.opened }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Opened
</p>
Expand All@@ -163,7 +176,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.clicked ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#04a5e5cc] dark:bg-[#93c5fd] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.clicked }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Clicked
</p>
Expand DownExpand Up@@ -236,16 +252,34 @@ const EmailChartItem: React.FC<DashboardItemCardProps> = ({
count,
percentage,
}) => {
const color = EMAIL_COLORS[status];
const currentColors = useColors();

const getColorForStatus = (status: EmailStatus | "total"): string => {
switch (status) {
case "DELIVERED":
return currentColors.delivered;
case "BOUNCED":
return currentColors.bounced;
case "COMPLAINED":
return currentColors.complained;
case "OPENED":
return currentColors.opened;
case "CLICKED":
return currentColors.clicked;
case "total":
default:
return "#6b7280"; // gray-500 for total and other statuses
}
};

return (
<div className="flex gap-3 items-stretch font-mono">
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}

<div>
<div className=" flex items-center gap-2">
<div className={`${color} w-2.5 h-2.5 rounded-[3px]`}></div>
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}
<div
className="w-2.5 h-2.5 rounded-[3px]"
style={{ backgroundColor: getColorForStatus(status) }}
></div>

<div className="text-xs uppercase text-muted-foreground ">
{status.toLowerCase()}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export default function AddApiKey() {
setApiKey(data);
apiKeyForm.reset();
},
}
},
);
}

Expand DownExpand Up@@ -132,7 +132,7 @@ export default function AddApiKey() {
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="h-4 w-4 text-green-500" />
<CheckIcon className="h-4 w-4 text-green" />
) : (
<ClipboardCopy className="h-4 w-4" />
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteApiKey: React.FC<{
setOpen(false);
toast.success(`API key deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteApiKey: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 76 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add accessible label and consistent hover color

Add an aria-label for screen readers and align hover color with other delete triggers in this PR.

Apply:

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete API key ${apiKey.name ?? ""}`}+ title="Delete API key"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
aria-label={`Delete API key ${apiKey.name??""}`}
title="Delete API key"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/dev-settings/api-keys/delete-api-key.tsx around
lines 76-79, the icon-only DialogTrigger/Button lacks an accessible label and
its hover color doesn't match other delete triggers; add an aria-label (e.g.,
aria-label="Delete API key") to the Button so screen readers announce its
purpose, and update the button/icon hover color class to match the other delete
controls in this PR (use the same hover text color utility used elsewhere for
delete actions).

</DialogTrigger>
<DialogContent>
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(dashboard)/domains/[domainId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ export default function DomainItemPage({
{
refetchInterval: (q) => (q?.state.data?.isVerifying ? 10000 : false),
refetchIntervalInBackground: true,
},
}
);

const verifyQuery = api.domain.startVerification.useMutation();
Expand All@@ -54,7 +54,7 @@ export default function DomainItemPage({
onSettled: () => {
domainQuery.refetch();
},
},
}
);
};

Expand DownExpand Up@@ -232,7 +232,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
const utils = api.useUtils();

const [clickTracking, setClickTracking] = React.useState(
domain.clickTracking,
domain.clickTracking
);
const [openTracking, setOpenTracking] = React.useState(domain.openTracking);

Expand All@@ -245,7 +245,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Click tracking updated");
},
},
}
);
}

Expand All@@ -258,7 +258,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Open tracking updated");
},
},
}
);
}
return (
Expand DownExpand Up@@ -303,24 +303,20 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
};

const DnsVerificationStatus: React.FC<{ status: string }> = ({ status }) => {
let badgeColor = "bg-gray-400/10 text-gray-500 border-gray-400/10"; // Default color
let badgeColor = "bg-gray/10 text-gray border-gray/10"; // Default color
switch (status) {
case DomainStatus.SUCCESS:
badgeColor =
"bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25";
badgeColor = "bg-green/15 text-green border border-green/25";
break;
case DomainStatus.FAILED:
badgeColor =
"bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10";
badgeColor = "bg-red/10 text-red border border-red/10";
break;
case DomainStatus.TEMPORARY_FAILURE:
case DomainStatus.PENDING:
badgeColor =
"bg-yellow-500/20 dark:bg-yellow-500/10 text-yellow-600 border border-yellow-600/10";
badgeColor = "bg-yellow/20 text-yellow border border-yellow/10";
break;
default:
badgeColor =
"bg-gray-200/70 dark:bg-gray-400/10 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-400/20";
badgeColor = "bg-gray/10 text-gray border border-gray/20";
}

return (
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix colors in dashboard by KMKoushik · Pull Request #206 · usesend/useSend · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/web/src/app/(dashboard)/campaigns/[campaignId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,35 +146,35 @@ export default function CampaignDetailsPage({
}

const CampaignStatusBadge: React.FC<{ status: string }> = ({ status }) => {
let outsideColor = "bg-gray-600";
let insideColor = "bg-gray-600/50";
let outsideColor = "bg-gray";
let insideColor = "bg-gray/50";

switch (status) {
case "delivered":
outsideColor = "bg-emerald-500/30";
insideColor = "bg-emerald-500";
outsideColor = "bg-green/30";
insideColor = "bg-green";
break;
case "bounced":
case "unsubscribed":
outsideColor = "bg-red-500/30";
insideColor = "bg-red-500";
outsideColor = "bg-red/30";
insideColor = "bg-red";
break;
case "clicked":
outsideColor = "bg-cyan-500/30";
insideColor = "bg-cyan-500";
outsideColor = "bg-blue/30";
insideColor = "bg-blue";
break;
case "opened":
outsideColor = "bg-indigo-500/30";
insideColor = "bg-indigo-500";
outsideColor = "bg-purple/30";
insideColor = "bg-purple";
break;

case "complained":
outsideColor = "bg-yellow-500/30";
insideColor = "bg-yellow-500";
outsideColor = "bg-yellow/30";
insideColor = "bg-yellow";
break;
default:
outsideColor = "bg-gray-600/40";
insideColor = "bg-gray-600";
outsideColor = "bg-gray/40";
insideColor = "bg-gray";
}

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/campaigns/campaign-list.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,10 +103,10 @@ export default function CampaignList() {
<div
className={`text-center w-[130px] rounded capitalize py-1 text-xs ${
campaign.status === CampaignStatus.DRAFT
? "bg-gray-500/15 dark:bg-gray-400/15 text-gray-700 dark:text-gray-400/90 border border-gray-500/25 dark:border-gray-700/25"
? "bg-gray/15 text-grayborder border-gray/25"
: campaign.status === CampaignStatus.SENT
? "bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25"
: "bg-yellow-500/15 dark:bg-yellow-600/10 text-yellow-700 dark:text-yellow-600/90 border border-yellow-500/25 dark:border-yellow-700/25"
? "bg-green/15 text-greenborder border-green/25"
: "bg-yellow/15 text-yellowborder border-yellow/25"
}`}
>
{campaign.status.toLowerCase()}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/(dashboard)/campaigns/delete-campaign.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Trash2 className="h-[18px] w-[18px] text-red-600/80" />
<Trash2 className="h-[18px] w-[18px] text-red/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ export const DuplicateCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign duplicated`);
},
}
},
);
}

Expand All@@ -46,7 +46,7 @@ export const DuplicateCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Copy className="h-[18px] w-[18px] text-blue-600/80" />
<Copy className="h-[18px] w-[18px] text-blue/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,21 +152,21 @@ export default function ContactList({
</TableCell>
<TableCell>
{contact.subscribed ? (
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green/15 text-greenborder border-green/25">
Subscribed
</div>
) : (
<Tooltip>
<TooltipTrigger>
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red/10 text-redborder border-red/10">
Unsubscribed
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{getUnsubscribeReason(
contact.unsubscribeReason ??
UnsubscribeReason.UNSUBSCRIBED
UnsubscribeReason.UNSUBSCRIBED,
)}
</p>
</TooltipContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const DeleteContact: React.FC<{
onError: (e) => {
toast.error(`Contact not deleted: ${e.message}`);
},
}
},
);
}

Expand All@@ -79,7 +79,7 @@ export const DeleteContact: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 80 to 83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add aria-label and hover color for parity

Match other delete actions’ hover treatment and expose an accessible label.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete contact ${contact.email ?? ""}`}+ title="Delete contact"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
-<Buttonvariant="ghost"size="sm">
-<Trash2className="h-4 w-4 text-red/80"/>
<Button
variant="ghost"
size="sm"
aria-label={`Delete contact ${contact.email??""}`}
title="Delete contact"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/[contactBookId]/delete-contact.tsx
around lines 80 to 83, the icon-only DialogTrigger/Button lacks an accessible
label and doesn't match other delete actions' hover color; add an aria-label
(e.g., aria-label="Delete contact") to the trigger/button and update the
button/icon classes to include the same hover color used by other delete buttons
(e.g., hover text-red/100 or hover:text-red/90) so the icon has a visible hover
state and is accessible to screen readers.

</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ export const DeleteContactBook: React.FC<{
});

async function onContactBookDelete(
values: z.infer<typeof contactBookSchema>
values: z.infer<typeof contactBookSchema>,
) {
if (values.name !== contactBook.name) {
contactBookForm.setError("name", {
Expand All@@ -65,7 +65,7 @@ export const DeleteContactBook: React.FC<{
setOpen(false);
toast.success(`Contact book deleted`);
},
}
},
);
}

Expand All@@ -78,7 +78,7 @@ export const DeleteContactBook: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">
<Trash2 className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70" />
<Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />
</Button>
Comment on lines 79 to 82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tidy className and add accessible label

Remove trailing space in className and add an aria-label for the icon-only trigger.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">- <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className="p-0 hover:bg-transparent"+ aria-label={`Delete contact book ${contactBook.name ?? ""}`}+ title="Delete contact book"+ >+ <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm"className="p-0 hover:bg-transparent ">
<Trash2className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70"/>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
className="p-0 hover:bg-transparent"
aria-label={`Delete contact book ${contactBook.name??""}`}
title="Delete contact book"
>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/delete-contact-book.tsx around lines 79
to 82, remove the trailing space from the Button's className value and add an
accessible label to the icon-only trigger by providing an aria-label (e.g.,
aria-label="Delete contact") on the Button element so screen readers can
describe the action.

</DialogTrigger>
<DialogContent>
Expand Down
56 changes: 45 additions & 11 deletions apps/web/src/app/(dashboard)/dashboard/email-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ import { EmailStatus } from "@prisma/client";
import { api } from "~/trpc/react";
import Spinner from "@unsend/ui/src/spinner";
import { useTheme } from "@unsend/ui";
import { EMAIL_COLORS } from "~/lib/constants/colors";
import { useColors } from "./hooks/useColors";

interface EmailChartProps {
Expand DownExpand Up@@ -127,7 +126,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
</p>
{data.delivered ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#40a02bcc] dark:bg-[#a6e3a1] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.delivered }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Delivered
</p>
Expand All@@ -136,7 +138,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.bounced ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#d20f39cc] dark:bg-[#f38ba8] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.bounced }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Bounced
</p>
Expand All@@ -145,7 +150,12 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.complained ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#df8e1dcc] dark:bg-[#F9E2AF] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{
backgroundColor: currentColors.complained,
}}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Complained
</p>
Expand All@@ -154,7 +164,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.opened ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#8839efcc] dark:bg-[#cba6f7] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.opened }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Opened
</p>
Expand All@@ -163,7 +176,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.clicked ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#04a5e5cc] dark:bg-[#93c5fd] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.clicked }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Clicked
</p>
Expand DownExpand Up@@ -236,16 +252,34 @@ const EmailChartItem: React.FC<DashboardItemCardProps> = ({
count,
percentage,
}) => {
const color = EMAIL_COLORS[status];
const currentColors = useColors();

const getColorForStatus = (status: EmailStatus | "total"): string => {
switch (status) {
case "DELIVERED":
return currentColors.delivered;
case "BOUNCED":
return currentColors.bounced;
case "COMPLAINED":
return currentColors.complained;
case "OPENED":
return currentColors.opened;
case "CLICKED":
return currentColors.clicked;
case "total":
default:
return "#6b7280"; // gray-500 for total and other statuses
}
};

return (
<div className="flex gap-3 items-stretch font-mono">
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}

<div>
<div className=" flex items-center gap-2">
<div className={`${color} w-2.5 h-2.5 rounded-[3px]`}></div>
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}
<div
className="w-2.5 h-2.5 rounded-[3px]"
style={{ backgroundColor: getColorForStatus(status) }}
></div>

<div className="text-xs uppercase text-muted-foreground ">
{status.toLowerCase()}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export default function AddApiKey() {
setApiKey(data);
apiKeyForm.reset();
},
}
},
);
}

Expand DownExpand Up@@ -132,7 +132,7 @@ export default function AddApiKey() {
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="h-4 w-4 text-green-500" />
<CheckIcon className="h-4 w-4 text-green" />
) : (
<ClipboardCopy className="h-4 w-4" />
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteApiKey: React.FC<{
setOpen(false);
toast.success(`API key deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteApiKey: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 76 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add accessible label and consistent hover color

Add an aria-label for screen readers and align hover color with other delete triggers in this PR.

Apply:

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete API key ${apiKey.name ?? ""}`}+ title="Delete API key"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
aria-label={`Delete API key ${apiKey.name??""}`}
title="Delete API key"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/dev-settings/api-keys/delete-api-key.tsx around
lines 76-79, the icon-only DialogTrigger/Button lacks an accessible label and
its hover color doesn't match other delete triggers; add an aria-label (e.g.,
aria-label="Delete API key") to the Button so screen readers announce its
purpose, and update the button/icon hover color class to match the other delete
controls in this PR (use the same hover text color utility used elsewhere for
delete actions).

</DialogTrigger>
<DialogContent>
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(dashboard)/domains/[domainId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ export default function DomainItemPage({
{
refetchInterval: (q) => (q?.state.data?.isVerifying ? 10000 : false),
refetchIntervalInBackground: true,
},
}
);

const verifyQuery = api.domain.startVerification.useMutation();
Expand All@@ -54,7 +54,7 @@ export default function DomainItemPage({
onSettled: () => {
domainQuery.refetch();
},
},
}
);
};

Expand DownExpand Up@@ -232,7 +232,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
const utils = api.useUtils();

const [clickTracking, setClickTracking] = React.useState(
domain.clickTracking,
domain.clickTracking
);
const [openTracking, setOpenTracking] = React.useState(domain.openTracking);

Expand All@@ -245,7 +245,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Click tracking updated");
},
},
}
);
}

Expand All@@ -258,7 +258,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Open tracking updated");
},
},
}
);
}
return (
Expand DownExpand Up@@ -303,24 +303,20 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
};

const DnsVerificationStatus: React.FC<{ status: string }> = ({ status }) => {
let badgeColor = "bg-gray-400/10 text-gray-500 border-gray-400/10"; // Default color
let badgeColor = "bg-gray/10 text-gray border-gray/10"; // Default color
switch (status) {
case DomainStatus.SUCCESS:
badgeColor =
"bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25";
badgeColor = "bg-green/15 text-green border border-green/25";
break;
case DomainStatus.FAILED:
badgeColor =
"bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10";
badgeColor = "bg-red/10 text-red border border-red/10";
break;
case DomainStatus.TEMPORARY_FAILURE:
case DomainStatus.PENDING:
badgeColor =
"bg-yellow-500/20 dark:bg-yellow-500/10 text-yellow-600 border border-yellow-600/10";
badgeColor = "bg-yellow/20 text-yellow border border-yellow/10";
break;
default:
badgeColor =
"bg-gray-200/70 dark:bg-gray-400/10 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-400/20";
badgeColor = "bg-gray/10 text-gray border border-gray/20";
}

return (
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' fix colors in dashboard by KMKoushik · Pull Request #206 · usesend/useSend · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/web/src/app/(dashboard)/campaigns/[campaignId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,35 +146,35 @@ export default function CampaignDetailsPage({
}

const CampaignStatusBadge: React.FC<{ status: string }> = ({ status }) => {
let outsideColor = "bg-gray-600";
let insideColor = "bg-gray-600/50";
let outsideColor = "bg-gray";
let insideColor = "bg-gray/50";

switch (status) {
case "delivered":
outsideColor = "bg-emerald-500/30";
insideColor = "bg-emerald-500";
outsideColor = "bg-green/30";
insideColor = "bg-green";
break;
case "bounced":
case "unsubscribed":
outsideColor = "bg-red-500/30";
insideColor = "bg-red-500";
outsideColor = "bg-red/30";
insideColor = "bg-red";
break;
case "clicked":
outsideColor = "bg-cyan-500/30";
insideColor = "bg-cyan-500";
outsideColor = "bg-blue/30";
insideColor = "bg-blue";
break;
case "opened":
outsideColor = "bg-indigo-500/30";
insideColor = "bg-indigo-500";
outsideColor = "bg-purple/30";
insideColor = "bg-purple";
break;

case "complained":
outsideColor = "bg-yellow-500/30";
insideColor = "bg-yellow-500";
outsideColor = "bg-yellow/30";
insideColor = "bg-yellow";
break;
default:
outsideColor = "bg-gray-600/40";
insideColor = "bg-gray-600";
outsideColor = "bg-gray/40";
insideColor = "bg-gray";
}

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/campaigns/campaign-list.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,10 +103,10 @@ export default function CampaignList() {
<div
className={`text-center w-[130px] rounded capitalize py-1 text-xs ${
campaign.status === CampaignStatus.DRAFT
? "bg-gray-500/15 dark:bg-gray-400/15 text-gray-700 dark:text-gray-400/90 border border-gray-500/25 dark:border-gray-700/25"
? "bg-gray/15 text-grayborder border-gray/25"
: campaign.status === CampaignStatus.SENT
? "bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25"
: "bg-yellow-500/15 dark:bg-yellow-600/10 text-yellow-700 dark:text-yellow-600/90 border border-yellow-500/25 dark:border-yellow-700/25"
? "bg-green/15 text-greenborder border-green/25"
: "bg-yellow/15 text-yellowborder border-yellow/25"
}`}
>
{campaign.status.toLowerCase()}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/(dashboard)/campaigns/delete-campaign.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Trash2 className="h-[18px] w-[18px] text-red-600/80" />
<Trash2 className="h-[18px] w-[18px] text-red/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ export const DuplicateCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign duplicated`);
},
}
},
);
}

Expand All@@ -46,7 +46,7 @@ export const DuplicateCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Copy className="h-[18px] w-[18px] text-blue-600/80" />
<Copy className="h-[18px] w-[18px] text-blue/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,21 +152,21 @@ export default function ContactList({
</TableCell>
<TableCell>
{contact.subscribed ? (
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green/15 text-greenborder border-green/25">
Subscribed
</div>
) : (
<Tooltip>
<TooltipTrigger>
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red/10 text-redborder border-red/10">
Unsubscribed
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{getUnsubscribeReason(
contact.unsubscribeReason ??
UnsubscribeReason.UNSUBSCRIBED
UnsubscribeReason.UNSUBSCRIBED,
)}
</p>
</TooltipContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const DeleteContact: React.FC<{
onError: (e) => {
toast.error(`Contact not deleted: ${e.message}`);
},
}
},
);
}

Expand All@@ -79,7 +79,7 @@ export const DeleteContact: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 80 to 83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add aria-label and hover color for parity

Match other delete actions’ hover treatment and expose an accessible label.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete contact ${contact.email ?? ""}`}+ title="Delete contact"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
-<Buttonvariant="ghost"size="sm">
-<Trash2className="h-4 w-4 text-red/80"/>
<Button
variant="ghost"
size="sm"
aria-label={`Delete contact ${contact.email??""}`}
title="Delete contact"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/[contactBookId]/delete-contact.tsx
around lines 80 to 83, the icon-only DialogTrigger/Button lacks an accessible
label and doesn't match other delete actions' hover color; add an aria-label
(e.g., aria-label="Delete contact") to the trigger/button and update the
button/icon classes to include the same hover color used by other delete buttons
(e.g., hover text-red/100 or hover:text-red/90) so the icon has a visible hover
state and is accessible to screen readers.

</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ export const DeleteContactBook: React.FC<{
});

async function onContactBookDelete(
values: z.infer<typeof contactBookSchema>
values: z.infer<typeof contactBookSchema>,
) {
if (values.name !== contactBook.name) {
contactBookForm.setError("name", {
Expand All@@ -65,7 +65,7 @@ export const DeleteContactBook: React.FC<{
setOpen(false);
toast.success(`Contact book deleted`);
},
}
},
);
}

Expand All@@ -78,7 +78,7 @@ export const DeleteContactBook: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">
<Trash2 className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70" />
<Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />
</Button>
Comment on lines 79 to 82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tidy className and add accessible label

Remove trailing space in className and add an aria-label for the icon-only trigger.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">- <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className="p-0 hover:bg-transparent"+ aria-label={`Delete contact book ${contactBook.name ?? ""}`}+ title="Delete contact book"+ >+ <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm"className="p-0 hover:bg-transparent ">
<Trash2className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70"/>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
className="p-0 hover:bg-transparent"
aria-label={`Delete contact book ${contactBook.name??""}`}
title="Delete contact book"
>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/delete-contact-book.tsx around lines 79
to 82, remove the trailing space from the Button's className value and add an
accessible label to the icon-only trigger by providing an aria-label (e.g.,
aria-label="Delete contact") on the Button element so screen readers can
describe the action.

</DialogTrigger>
<DialogContent>
Expand Down
56 changes: 45 additions & 11 deletions apps/web/src/app/(dashboard)/dashboard/email-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ import { EmailStatus } from "@prisma/client";
import { api } from "~/trpc/react";
import Spinner from "@unsend/ui/src/spinner";
import { useTheme } from "@unsend/ui";
import { EMAIL_COLORS } from "~/lib/constants/colors";
import { useColors } from "./hooks/useColors";

interface EmailChartProps {
Expand DownExpand Up@@ -127,7 +126,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
</p>
{data.delivered ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#40a02bcc] dark:bg-[#a6e3a1] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.delivered }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Delivered
</p>
Expand All@@ -136,7 +138,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.bounced ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#d20f39cc] dark:bg-[#f38ba8] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.bounced }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Bounced
</p>
Expand All@@ -145,7 +150,12 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.complained ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#df8e1dcc] dark:bg-[#F9E2AF] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{
backgroundColor: currentColors.complained,
}}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Complained
</p>
Expand All@@ -154,7 +164,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.opened ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#8839efcc] dark:bg-[#cba6f7] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.opened }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Opened
</p>
Expand All@@ -163,7 +176,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.clicked ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#04a5e5cc] dark:bg-[#93c5fd] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.clicked }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Clicked
</p>
Expand DownExpand Up@@ -236,16 +252,34 @@ const EmailChartItem: React.FC<DashboardItemCardProps> = ({
count,
percentage,
}) => {
const color = EMAIL_COLORS[status];
const currentColors = useColors();

const getColorForStatus = (status: EmailStatus | "total"): string => {
switch (status) {
case "DELIVERED":
return currentColors.delivered;
case "BOUNCED":
return currentColors.bounced;
case "COMPLAINED":
return currentColors.complained;
case "OPENED":
return currentColors.opened;
case "CLICKED":
return currentColors.clicked;
case "total":
default:
return "#6b7280"; // gray-500 for total and other statuses
}
};

return (
<div className="flex gap-3 items-stretch font-mono">
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}

<div>
<div className=" flex items-center gap-2">
<div className={`${color} w-2.5 h-2.5 rounded-[3px]`}></div>
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}
<div
className="w-2.5 h-2.5 rounded-[3px]"
style={{ backgroundColor: getColorForStatus(status) }}
></div>

<div className="text-xs uppercase text-muted-foreground ">
{status.toLowerCase()}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export default function AddApiKey() {
setApiKey(data);
apiKeyForm.reset();
},
}
},
);
}

Expand DownExpand Up@@ -132,7 +132,7 @@ export default function AddApiKey() {
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="h-4 w-4 text-green-500" />
<CheckIcon className="h-4 w-4 text-green" />
) : (
<ClipboardCopy className="h-4 w-4" />
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteApiKey: React.FC<{
setOpen(false);
toast.success(`API key deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteApiKey: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 76 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add accessible label and consistent hover color

Add an aria-label for screen readers and align hover color with other delete triggers in this PR.

Apply:

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete API key ${apiKey.name ?? ""}`}+ title="Delete API key"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
aria-label={`Delete API key ${apiKey.name??""}`}
title="Delete API key"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/dev-settings/api-keys/delete-api-key.tsx around
lines 76-79, the icon-only DialogTrigger/Button lacks an accessible label and
its hover color doesn't match other delete triggers; add an aria-label (e.g.,
aria-label="Delete API key") to the Button so screen readers announce its
purpose, and update the button/icon hover color class to match the other delete
controls in this PR (use the same hover text color utility used elsewhere for
delete actions).

</DialogTrigger>
<DialogContent>
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(dashboard)/domains/[domainId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ export default function DomainItemPage({
{
refetchInterval: (q) => (q?.state.data?.isVerifying ? 10000 : false),
refetchIntervalInBackground: true,
},
}
);

const verifyQuery = api.domain.startVerification.useMutation();
Expand All@@ -54,7 +54,7 @@ export default function DomainItemPage({
onSettled: () => {
domainQuery.refetch();
},
},
}
);
};

Expand DownExpand Up@@ -232,7 +232,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
const utils = api.useUtils();

const [clickTracking, setClickTracking] = React.useState(
domain.clickTracking,
domain.clickTracking
);
const [openTracking, setOpenTracking] = React.useState(domain.openTracking);

Expand All@@ -245,7 +245,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Click tracking updated");
},
},
}
);
}

Expand All@@ -258,7 +258,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Open tracking updated");
},
},
}
);
}
return (
Expand DownExpand Up@@ -303,24 +303,20 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
};

const DnsVerificationStatus: React.FC<{ status: string }> = ({ status }) => {
let badgeColor = "bg-gray-400/10 text-gray-500 border-gray-400/10"; // Default color
let badgeColor = "bg-gray/10 text-gray border-gray/10"; // Default color
switch (status) {
case DomainStatus.SUCCESS:
badgeColor =
"bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25";
badgeColor = "bg-green/15 text-green border border-green/25";
break;
case DomainStatus.FAILED:
badgeColor =
"bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10";
badgeColor = "bg-red/10 text-red border border-red/10";
break;
case DomainStatus.TEMPORARY_FAILURE:
case DomainStatus.PENDING:
badgeColor =
"bg-yellow-500/20 dark:bg-yellow-500/10 text-yellow-600 border border-yellow-600/10";
badgeColor = "bg-yellow/20 text-yellow border border-yellow/10";
break;
default:
badgeColor =
"bg-gray-200/70 dark:bg-gray-400/10 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-400/20";
badgeColor = "bg-gray/10 text-gray border border-gray/20";
}

return (
Expand Down
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { // Universal Dark Mode - works on any site (function() { var enabled = true; function applyDarkMode() { if (!enabled) return; // Create style element if it doesn't exist var style = document.getElementById('universal-dark-mode-style'); if (!style) { style = document.createElement('style'); style.id = 'universal-dark-mode-style'; document.head.appendChild(style); } // Dark mode CSS - inverts colors but preserves images/video style.textContent = ' /* Invert everything except media */ html { filter: invert(1) hue-rotate(180deg) !important; background: #1a1a2e !important; } /* Restore images, videos, iframes, canvas */ img, video, iframe, canvas, svg, picture, [style*="background-image"] { filter: invert(1) hue-rotate(180deg) !important; } /* Preserve specific elements that should not be inverted */ .no-dark-mode, .no-dark-mode *, [data-theme="light"], [data-theme="light"], .ace_editor, .ace_editor *, .CodeMirror, .CodeMirror *, .monaco-editor, .monaco-editor *, .markdown-body pre, .markdown-body pre *, .highlight, .highlight *, pre code, pre code * { filter: none !important; } /* Fix common UI elements */ .modal, .popup, .dropdown-menu, .tooltip, .popover { filter: invert(1) hue-rotate(180deg) !important; background: #2d2d44 !important; border-color: #444 !important; } /* Scrollbars */ ::-webkit-scrollbar { background: #1a1a2e !important; } ::-webkit-scrollbar-thumb { background: #444 !important; } ::-webkit-scrollbar-thumb:hover { background: #555 !important; } /* Selection */ ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; } ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; } '; } function removeDarkMode() { var style = document.getElementById('universal-dark-mode-style'); if (style) style.remove(); } // Toggle with Alt+Shift+D document.addEventListener('keydown', function(e) { if (e.altKey && e.shiftKey && e.key === 'D') { e.preventDefault(); enabled = !enabled; if (enabled) { applyDarkMode(); console.log('[Universal Dark Mode] Enabled'); } else { removeDarkMode(); console.log('[Universal Dark Mode] Disabled'); } } }); // Apply on load applyDarkMode(); // Re-apply on dynamic content var observer = new MutationObserver(function(mutations) { if (enabled && !document.getElementById('universal-dark-mode-style')) { applyDarkMode(); } }); observer.observe(document.head, { childList: true }); console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle'); })(); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })(); fix colors in dashboard by KMKoushik · Pull Request #206 · usesend/useSend · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions apps/web/src/app/(dashboard)/campaigns/[campaignId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -146,35 +146,35 @@ export default function CampaignDetailsPage({
}

const CampaignStatusBadge: React.FC<{ status: string }> = ({ status }) => {
let outsideColor = "bg-gray-600";
let insideColor = "bg-gray-600/50";
let outsideColor = "bg-gray";
let insideColor = "bg-gray/50";

switch (status) {
case "delivered":
outsideColor = "bg-emerald-500/30";
insideColor = "bg-emerald-500";
outsideColor = "bg-green/30";
insideColor = "bg-green";
break;
case "bounced":
case "unsubscribed":
outsideColor = "bg-red-500/30";
insideColor = "bg-red-500";
outsideColor = "bg-red/30";
insideColor = "bg-red";
break;
case "clicked":
outsideColor = "bg-cyan-500/30";
insideColor = "bg-cyan-500";
outsideColor = "bg-blue/30";
insideColor = "bg-blue";
break;
case "opened":
outsideColor = "bg-indigo-500/30";
insideColor = "bg-indigo-500";
outsideColor = "bg-purple/30";
insideColor = "bg-purple";
break;

case "complained":
outsideColor = "bg-yellow-500/30";
insideColor = "bg-yellow-500";
outsideColor = "bg-yellow/30";
insideColor = "bg-yellow";
break;
default:
outsideColor = "bg-gray-600/40";
insideColor = "bg-gray-600";
outsideColor = "bg-gray/40";
insideColor = "bg-gray";
}

return (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/app/(dashboard)/campaigns/campaign-list.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -103,10 +103,10 @@ export default function CampaignList() {
<div
className={`text-center w-[130px] rounded capitalize py-1 text-xs ${
campaign.status === CampaignStatus.DRAFT
? "bg-gray-500/15 dark:bg-gray-400/15 text-gray-700 dark:text-gray-400/90 border border-gray-500/25 dark:border-gray-700/25"
? "bg-gray/15 text-grayborder border-gray/25"
: campaign.status === CampaignStatus.SENT
? "bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25"
: "bg-yellow-500/15 dark:bg-yellow-600/10 text-yellow-700 dark:text-yellow-600/90 border border-yellow-500/25 dark:border-yellow-700/25"
? "bg-green/15 text-greenborder border-green/25"
: "bg-yellow/15 text-yellowborder border-yellow/25"
}`}
>
{campaign.status.toLowerCase()}
Expand Down
4 changes: 2 additions & 2 deletions apps/web/src/app/(dashboard)/campaigns/delete-campaign.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Trash2 className="h-[18px] w-[18px] text-red-600/80" />
<Trash2 className="h-[18px] w-[18px] text-red/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -35,7 +35,7 @@ export const DuplicateCampaign: React.FC<{
setOpen(false);
toast.success(`Campaign duplicated`);
},
}
},
);
}

Expand All@@ -46,7 +46,7 @@ export const DuplicateCampaign: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent">
<Copy className="h-[18px] w-[18px] text-blue-600/80" />
<Copy className="h-[18px] w-[18px] text-blue/80" />
</Button>
</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -152,21 +152,21 @@ export default function ContactList({
</TableCell>
<TableCell>
{contact.subscribed ? (
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-green/15 text-greenborder border-green/25">
Subscribed
</div>
) : (
<Tooltip>
<TooltipTrigger>
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10">
<div className="text-center w-[130px] rounded capitalize py-1 text-xs bg-red/10 text-redborder border-red/10">
Unsubscribed
</div>
</TooltipTrigger>
<TooltipContent>
<p>
{getUnsubscribeReason(
contact.unsubscribeReason ??
UnsubscribeReason.UNSUBSCRIBED
UnsubscribeReason.UNSUBSCRIBED,
)}
</p>
</TooltipContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,7 +66,7 @@ export const DeleteContact: React.FC<{
onError: (e) => {
toast.error(`Contact not deleted: ${e.message}`);
},
}
},
);
}

Expand All@@ -79,7 +79,7 @@ export const DeleteContact: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 80 to 83

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add aria-label and hover color for parity

Match other delete actions’ hover treatment and expose an accessible label.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete contact ${contact.email ?? ""}`}+ title="Delete contact"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
-<Buttonvariant="ghost"size="sm">
-<Trash2className="h-4 w-4 text-red/80"/>
<Button
variant="ghost"
size="sm"
aria-label={`Delete contact ${contact.email??""}`}
title="Delete contact"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/[contactBookId]/delete-contact.tsx
around lines 80 to 83, the icon-only DialogTrigger/Button lacks an accessible
label and doesn't match other delete actions' hover color; add an aria-label
(e.g., aria-label="Delete contact") to the trigger/button and update the
button/icon classes to include the same hover color used by other delete buttons
(e.g., hover text-red/100 or hover:text-red/90) so the icon has a visible hover
state and is accessible to screen readers.

</DialogTrigger>
<DialogContent>
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -46,7 +46,7 @@ export const DeleteContactBook: React.FC<{
});

async function onContactBookDelete(
values: z.infer<typeof contactBookSchema>
values: z.infer<typeof contactBookSchema>,
) {
if (values.name !== contactBook.name) {
contactBookForm.setError("name", {
Expand All@@ -65,7 +65,7 @@ export const DeleteContactBook: React.FC<{
setOpen(false);
toast.success(`Contact book deleted`);
},
}
},
);
}

Expand All@@ -78,7 +78,7 @@ export const DeleteContactBook: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">
<Trash2 className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70" />
<Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />
</Button>
Comment on lines 79 to 82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tidy className and add accessible label

Remove trailing space in className and add an aria-label for the icon-only trigger.

- <DialogTrigger asChild>- <Button variant="ghost" size="sm" className="p-0 hover:bg-transparent ">- <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ className="p-0 hover:bg-transparent"+ aria-label={`Delete contact book ${contactBook.name ?? ""}`}+ title="Delete contact book"+ >+ <Trash2 className="h-[18px] w-[18px] text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm"className="p-0 hover:bg-transparent ">
<Trash2className="h-[18px] w-[18px] text-red-600/80 hover:text-red-600/70"/>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
className="p-0 hover:bg-transparent"
aria-label={`Delete contact book ${contactBook.name??""}`}
title="Delete contact book"
>
<Trash2className="h-[18px] w-[18px] text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/contacts/delete-contact-book.tsx around lines 79
to 82, remove the trailing space from the Button's className value and add an
accessible label to the icon-only trigger by providing an aria-label (e.g.,
aria-label="Delete contact") on the Button element so screen readers can
describe the action.

</DialogTrigger>
<DialogContent>
Expand Down
56 changes: 45 additions & 11 deletions apps/web/src/app/(dashboard)/dashboard/email-chart.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,7 +15,6 @@ import { EmailStatus } from "@prisma/client";
import { api } from "~/trpc/react";
import Spinner from "@unsend/ui/src/spinner";
import { useTheme } from "@unsend/ui";
import { EMAIL_COLORS } from "~/lib/constants/colors";
import { useColors } from "./hooks/useColors";

interface EmailChartProps {
Expand DownExpand Up@@ -127,7 +126,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
</p>
{data.delivered ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#40a02bcc] dark:bg-[#a6e3a1] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.delivered }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Delivered
</p>
Expand All@@ -136,7 +138,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.bounced ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#d20f39cc] dark:bg-[#f38ba8] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.bounced }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Bounced
</p>
Expand All@@ -145,7 +150,12 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.complained ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#df8e1dcc] dark:bg-[#F9E2AF] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{
backgroundColor: currentColors.complained,
}}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Complained
</p>
Expand All@@ -154,7 +164,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.opened ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#8839efcc] dark:bg-[#cba6f7] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.opened }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Opened
</p>
Expand All@@ -163,7 +176,10 @@ export default function EmailChart({ days, domain }: EmailChartProps) {
) : null}
{data.clicked ? (
<div className="flex gap-2 items-center">
<div className="w-2.5 h-2.5 bg-[#04a5e5cc] dark:bg-[#93c5fd] rounded-[2px]"></div>
<div
className="w-2.5 h-2.5 rounded-[2px]"
style={{ backgroundColor: currentColors.clicked }}
></div>
<p className="text-xs text-muted-foreground w-[70px]">
Clicked
</p>
Expand DownExpand Up@@ -236,16 +252,34 @@ const EmailChartItem: React.FC<DashboardItemCardProps> = ({
count,
percentage,
}) => {
const color = EMAIL_COLORS[status];
const currentColors = useColors();

const getColorForStatus = (status: EmailStatus | "total"): string => {
switch (status) {
case "DELIVERED":
return currentColors.delivered;
case "BOUNCED":
return currentColors.bounced;
case "COMPLAINED":
return currentColors.complained;
case "OPENED":
return currentColors.opened;
case "CLICKED":
return currentColors.clicked;
case "total":
default:
return "#6b7280"; // gray-500 for total and other statuses
}
};

return (
<div className="flex gap-3 items-stretch font-mono">
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}

<div>
<div className=" flex items-center gap-2">
<div className={`${color} w-2.5 h-2.5 rounded-[3px]`}></div>
{/* <div className={`${color} w-0.5 rounded-full`}></div> */}
<div
className="w-2.5 h-2.5 rounded-[3px]"
style={{ backgroundColor: getColorForStatus(status) }}
></div>

<div className="text-xs uppercase text-muted-foreground ">
{status.toLowerCase()}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export default function AddApiKey() {
setApiKey(data);
apiKeyForm.reset();
},
}
},
);
}

Expand DownExpand Up@@ -132,7 +132,7 @@ export default function AddApiKey() {
onClick={handleCopy}
>
{isCopied ? (
<CheckIcon className="h-4 w-4 text-green-500" />
<CheckIcon className="h-4 w-4 text-green" />
) : (
<ClipboardCopy className="h-4 w-4" />
)}
Expand Down
Original file line numberDiff line numberDiff line change
Expand Up@@ -62,7 +62,7 @@ export const DeleteApiKey: React.FC<{
setOpen(false);
toast.success(`API key deleted`);
},
}
},
);
}

Expand All@@ -75,7 +75,7 @@ export const DeleteApiKey: React.FC<{
>
<DialogTrigger asChild>
<Button variant="ghost" size="sm">
<Trash2 className="h-4 w-4 text-red-600/80" />
<Trash2 className="h-4 w-4 text-red/80" />
</Button>
Comment on lines 76 to 79

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Icon-only trigger: add accessible label and consistent hover color

Add an aria-label for screen readers and align hover color with other delete triggers in this PR.

Apply:

- <DialogTrigger asChild>- <Button variant="ghost" size="sm">- <Trash2 className="h-4 w-4 text-red/80" />- </Button>- </DialogTrigger>+ <DialogTrigger asChild>+ <Button+ variant="ghost"+ size="sm"+ aria-label={`Delete API key ${apiKey.name ?? ""}`}+ title="Delete API key"+ >+ <Trash2 className="h-4 w-4 text-red/80 hover:text-red/70" />+ </Button>+ </DialogTrigger>
📝 Committable suggestion

‼️IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<DialogTriggerasChild>
<Buttonvariant="ghost"size="sm">
<Trash2className="h-4 w-4 text-red-600/80"/>
<Trash2className="h-4 w-4 text-red/80"/>
</Button>
<DialogTriggerasChild>
<Button
variant="ghost"
size="sm"
aria-label={`Delete API key ${apiKey.name??""}`}
title="Delete API key"
>
<Trash2className="h-4 w-4 text-red/80 hover:text-red/70"/>
</Button>
</DialogTrigger>
🤖 Prompt for AI Agents
In apps/web/src/app/(dashboard)/dev-settings/api-keys/delete-api-key.tsx around
lines 76-79, the icon-only DialogTrigger/Button lacks an accessible label and
its hover color doesn't match other delete triggers; add an aria-label (e.g.,
aria-label="Delete API key") to the Button so screen readers announce its
purpose, and update the button/icon hover color class to match the other delete
controls in this PR (use the same hover text color utility used elsewhere for
delete actions).

</DialogTrigger>
<DialogContent>
Expand Down
24 changes: 10 additions & 14 deletions apps/web/src/app/(dashboard)/domains/[domainId]/page.tsx
Original file line numberDiff line numberDiff line change
Expand Up@@ -42,7 +42,7 @@ export default function DomainItemPage({
{
refetchInterval: (q) => (q?.state.data?.isVerifying ? 10000 : false),
refetchIntervalInBackground: true,
},
}
);

const verifyQuery = api.domain.startVerification.useMutation();
Expand All@@ -54,7 +54,7 @@ export default function DomainItemPage({
onSettled: () => {
domainQuery.refetch();
},
},
}
);
};

Expand DownExpand Up@@ -232,7 +232,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
const utils = api.useUtils();

const [clickTracking, setClickTracking] = React.useState(
domain.clickTracking,
domain.clickTracking
);
const [openTracking, setOpenTracking] = React.useState(domain.openTracking);

Expand All@@ -245,7 +245,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Click tracking updated");
},
},
}
);
}

Expand All@@ -258,7 +258,7 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
utils.domain.invalidate();
toast.success("Open tracking updated");
},
},
}
);
}
return (
Expand DownExpand Up@@ -303,24 +303,20 @@ const DomainSettings: React.FC<{ domain: Domain }> = ({ domain }) => {
};

const DnsVerificationStatus: React.FC<{ status: string }> = ({ status }) => {
let badgeColor = "bg-gray-400/10 text-gray-500 border-gray-400/10"; // Default color
let badgeColor = "bg-gray/10 text-gray border-gray/10"; // Default color
switch (status) {
case DomainStatus.SUCCESS:
badgeColor =
"bg-green-500/15 dark:bg-green-600/10 text-green-700 dark:text-green-600/90 border border-green-500/25 dark:border-green-700/25";
badgeColor = "bg-green/15 text-green border border-green/25";
break;
case DomainStatus.FAILED:
badgeColor =
"bg-red-500/10 text-red-600 dark:text-red-700/90 border border-red-600/10";
badgeColor = "bg-red/10 text-red border border-red/10";
break;
case DomainStatus.TEMPORARY_FAILURE:
case DomainStatus.PENDING:
badgeColor =
"bg-yellow-500/20 dark:bg-yellow-500/10 text-yellow-600 border border-yellow-600/10";
badgeColor = "bg-yellow/20 text-yellow border border-yellow/10";
break;
default:
badgeColor =
"bg-gray-200/70 dark:bg-gray-400/10 text-gray-600 dark:text-gray-400 border border-gray-300 dark:border-gray-400/20";
badgeColor = "bg-gray/10 text-gray border border-gray/20";
}

return (
Expand Down
Loading