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
17 changes: 17 additions & 0 deletions apps/mail/components/icons/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1338,3 +1338,20 @@ export const Paper = ({ className }: { className?: string }) => (
<path d="M9.97119 0.815905C10.768 1.73648 11.25 2.93695 11.25 4.25V6.125C11.25 6.33211 11.4179 6.5 11.625 6.5H13.5C14.8131 6.5 16.0135 6.98204 16.9341 7.77881C16.0462 4.37988 13.3701 1.70377 9.97119 0.815905Z" />
</svg>
);

export const ScanEye = ({ className }: { className?: string }) => (
<svg
width="22"
height="20"
viewBox="0 0 22 20"
fill="none"
xmlns="http://www.w3.org/2000/svg"
className={className}
>
<path d="M2.53033 0.46967C2.23744 0.176777 1.76256 0.176777 1.46967 0.46967C1.17678 0.762563 1.17678 1.23744 1.46967 1.53033L19.4697 19.5303C19.7626 19.8232 20.2374 19.8232 20.5303 19.5303C20.8232 19.2374 20.8232 18.7626 20.5303 18.4697L2.53033 0.46967Z" />
<path d="M21.6759 10.5533C21.1319 12.1887 20.2226 13.6575 19.0447 14.8627L15.9462 11.7642C16.1429 11.2129 16.25 10.6189 16.25 10C16.25 7.1005 13.8995 4.75 11 4.75C10.3811 4.75 9.78715 4.8571 9.23577 5.05379L6.75898 2.577C8.06783 2.04381 9.49977 1.75 11.0005 1.75C15.9708 1.75 20.1864 4.97271 21.6755 9.44045C21.7959 9.80152 21.796 10.1922 21.6759 10.5533Z" />
<path d="M14.75 10C14.75 10.1802 14.7373 10.3574 14.7127 10.5308L10.4692 6.28727C10.6426 6.2627 10.8198 6.25 11 6.25C13.0711 6.25 14.75 7.92893 14.75 10Z" />
<path d="M11.5307 13.7127L7.28727 9.46925C7.2627 9.64263 7.25 9.81983 7.25 10C7.25 12.0711 8.92893 13.75 11 13.75C11.1802 13.75 11.3574 13.7373 11.5307 13.7127Z" />
<path d="M5.75 10C5.75 9.38107 5.8571 8.78715 6.05379 8.23577L2.95492 5.1369C1.77687 6.34222 0.867472 7.81114 0.323411 9.4467C0.203283 9.80783 0.203397 10.1985 0.323739 10.5595C1.81284 15.0273 6.02847 18.25 10.9988 18.25C12.4997 18.25 13.9318 17.9561 15.2408 17.4228L12.7642 14.9462C12.2129 15.1429 11.6189 15.25 11 15.25C8.1005 15.25 5.75 12.8995 5.75 10Z" />
</svg>
);
20 changes: 18 additions & 2 deletions apps/mail/components/mail/mail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
MessageSquare,
Trash,
ArrowCircle,
ScanEye,
} from '../icons/icons';
import {
Dialog,
Expand Down Expand Up @@ -52,11 +53,11 @@ import { useBrainState } from '@/hooks/use-summary';
import { clearBulkSelectionAtom } from './use-mail';
import { useThreads } from '@/hooks/use-threads';
import { Button } from '@/components/ui/button';
import { Command, Loader2 } from 'lucide-react';
import { useSession } from '@/lib/auth-client';
import { useStats } from '@/hooks/use-stats';
import { useTranslations } from 'next-intl';
import { SearchBar } from './search-bar';
import { Command } from 'lucide-react';
import { useQueryState } from 'nuqs';
import { cn } from '@/lib/utils';
import { useAtom } from 'jotai';
Expand Down Expand Up @@ -222,7 +223,7 @@ export function MailLayout() {
</div>
<div
className={cn(
`${category[0] === 'Important' ? 'bg-[#F59E0D]' : category[0] === 'All Mail' ? 'bg-[#006FFE]' : category[0] === 'Personal' ? 'bg-[#39ae4a]' : category[0] === 'Updates' ? 'bg-[#8B5CF6]' : category[0] === 'Promotions' ? 'bg-[#F43F5E]' : 'bg-[#F59E0D]'}`,
`${category[0] === 'Important' ? 'bg-[#F59E0D]' : category[0] === 'All Mail' ? 'bg-[#006FFE]' : category[0] === 'Personal' ? 'bg-[#39ae4a]' : category[0] === 'Updates' ? 'bg-[#8B5CF6]' : category[0] === 'Promotions' ? 'bg-[#F43F5E]' : category[0] === 'Unread' ? 'bg-[#006FFE]' : 'bg-[#F59E0D]'}`,
'relative bottom-0.5 z-[5] h-0.5 w-full transition-opacity',
isValidating ? 'opacity-100' : 'opacity-0',
)}
Expand Down Expand Up @@ -565,6 +566,19 @@ export const Categories = () => {
/>
),
},
{
id: 'Unread',
name: 'Unread',
searchValue: 'is:unread',
icon: (
<ScanEye
className={cn(
'h-4 w-4 fill-[#6D6D6D] dark:fill-[#989898]',
category === 'Unread' && 'fill-white dark:fill-white',
)}
/>
),
},
];
};

Expand All @@ -584,6 +598,8 @@ function getCategoryColor(categoryId: string): string {
return 'bg-[#39ae4a]';
case 'updates':
return 'bg-[#8B5CF6]';
case 'unread':
return 'bg-[#006FFE]';
default:
return 'bg-base-primary-500';
}
Expand Down
14 changes: 5 additions & 9 deletions apps/mail/lib/email-utils.client.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use client';

import { Html, Head, Body, Container, Section, Column, Row, render } from '@react-email/components';
import { getListUnsubscribeAction } from '@/lib/email-utils';
import type { ParsedMessage } from '@/types';
import { sendEmail } from '@/actions/send';
Expand Down Expand Up @@ -82,8 +83,6 @@ export const highlightText = (text: string, highlight: string) => {
});
};

import { Html, Head, Body, Container, Section, Column, Row, render } from '@react-email/components';

interface EmailTemplateProps {
content: string;
imagesEnabled: boolean;
Expand Down Expand Up @@ -197,13 +196,10 @@ const EmailTemplate = ({ content, imagesEnabled, nonce }: EmailTemplateProps) =>
margin: 0,
}}
>
<Section style={{ width: '100%', background: 'transparent', padding: 0, margin: 0 }}>
<Row style={{ background: 'transparent', padding: 0, margin: 0 }}>
<Column style={{ background: 'transparent', padding: 0, margin: 0 }}>
<div
style={{ background: 'transparent', fontSize: '16px', lineHeight: '1.5' }}
dangerouslySetInnerHTML={{ __html: content }}
/>
<Section style={{ width: '100%', background: 'transparent' }}>
<Row style={{ background: 'transparent' }}>
<Column style={{ background: 'transparent' }}>
<div dangerouslySetInnerHTML={{ __html: content }} />
</Column>
</Row>
</Section>
Expand Down