From 38892ffeb6c65ba33d8944be04476f185ffe7005 Mon Sep 17 00:00:00 2001 From: nizzy <140507264+nizzyabi@users.noreply.github.com> Date: Tue, 10 Jun 2025 14:43:56 -0400 Subject: [PATCH] ui privacy email composer open (#1265) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # READ CAREFULLY THEN REMOVE Remove bullet points that are not relevant. PLEASE REFRAIN FROM USING AI TO WRITE YOUR CODE AND PR DESCRIPTION. IF YOU DO USE AI TO WRITE YOUR CODE PLEASE PROVIDE A DESCRIPTION AND REVIEW IT CAREFULLY. MAKE SURE YOU UNDERSTAND THE CODE YOU ARE SUBMITTING USING AI. - Pull requests that do not follow these guidelines will be closed without review or comment. - If you use AI to write your PR description your pr will be close without review or comment. - If you are unsure about anything, feel free to ask for clarification. ## Description Please provide a clear description of your changes. --- ## Type of Change Please delete options that are not relevant. - [ ] 🐛 Bug fix (non-breaking change which fixes an issue) - [ ] ✨ New feature (non-breaking change which adds functionality) - [ ] 💥 Breaking change (fix or feature with breaking changes) - [ ] 📝 Documentation update - [ ] 🎨 UI/UX improvement - [ ] 🔒 Security enhancement - [ ] ⚡ Performance improvement ## Areas Affected Please check all that apply: - [ ] Email Integration (Gmail, IMAP, etc.) - [ ] User Interface/Experience - [ ] Authentication/Authorization - [ ] Data Storage/Management - [ ] API Endpoints - [ ] Documentation - [ ] Testing Infrastructure - [ ] Development Workflow - [ ] Deployment/Infrastructure ## Testing Done Describe the tests you've done: - [ ] Unit tests added/updated - [ ] Integration tests added/updated - [ ] Manual testing performed - [ ] Cross-browser testing (if UI changes) - [ ] Mobile responsiveness verified (if UI changes) ## Security Considerations For changes involving data or authentication: - [ ] No sensitive data is exposed - [ ] Authentication checks are in place - [ ] Input validation is implemented - [ ] Rate limiting is considered (if applicable) ## Checklist - [ ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document - [ ] My code follows the project's style guidelines - [ ] I have performed a self-review of my code - [ ] I have commented my code, particularly in complex areas - [ ] I have updated the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix/feature works - [ ] All tests pass locally - [ ] Any dependent changes are merged and published ## Additional Notes Add any other context about the pull request here. ## Screenshots/Recordings Add screenshots or recordings here if applicable. --- _By submitting this pull request, I confirm that my contribution is made under the terms of the project's license._ ## Summary by CodeRabbit - **New Features** - Added a "Pricing and Refund Policy" section to the privacy policy, outlining subscription terms, billing, refunds, and price change notifications. - Introduced a GitHub star count button in the navigation bar, displaying the current repository star count with animated updates. - **UI Improvements** - Updated button and panel border radius for a more consistent, rounded appearance across various components. - Improved color schemes and spacing for buttons, avatars, and panels for a cleaner look. - Adjusted scrollbar styling and removed some borders for a sleeker interface. - Refined layout and sizing of mail panels and navigation elements for better usability. - Enhanced visual indicators for unread threads and improved reply composer auto-opening behavior. - **Localization** - Updated the command palette string from "New Email" to "New email" for consistency. - **Customization** - Added the ability to pass custom CSS classes to the email composer for flexible editor styling. --- apps/mail/app/(full-width)/privacy.tsx | 60 +++++++++++++++++++ apps/mail/app/globals.css | 2 +- apps/mail/components/ai-toggle-button.tsx | 2 +- .../mail/components/create/email-composer.tsx | 4 +- apps/mail/components/mail/mail-display.tsx | 4 +- apps/mail/components/mail/mail-list.tsx | 39 +++++++----- apps/mail/components/mail/mail.tsx | 31 ++++------ apps/mail/components/mail/note-panel.tsx | 2 +- apps/mail/components/mail/reply-composer.tsx | 1 + apps/mail/components/mail/thread-display.tsx | 40 +++++++------ apps/mail/components/navigation.tsx | 54 ++++++++++++++++- apps/mail/components/ui/ai-sidebar.tsx | 4 +- apps/mail/components/ui/app-sidebar.tsx | 2 +- apps/mail/components/ui/nav-user.tsx | 14 ++--- apps/mail/locales/en.json | 2 +- 15 files changed, 191 insertions(+), 70 deletions(-) diff --git a/apps/mail/app/(full-width)/privacy.tsx b/apps/mail/app/(full-width)/privacy.tsx index 167b34ce5..0b5e8b8ae 100644 --- a/apps/mail/app/(full-width)/privacy.tsx +++ b/apps/mail/app/(full-width)/privacy.tsx @@ -337,6 +337,66 @@ const sections = [ ), }, + { + title: 'Pricing and Refund Policy', + content: ( +
+
+

Free Plan and Trial Period

+ +
+
+

Payment and Billing

+ +
+
+

Non-Refundable Policy

+ +
+
+

Subscription Management

+ +
+
+

Price Changes

+ +
+
+ ), + }, { title: 'Contact', content: ( diff --git a/apps/mail/app/globals.css b/apps/mail/app/globals.css index 646721fa1..4ce37a8ab 100644 --- a/apps/mail/app/globals.css +++ b/apps/mail/app/globals.css @@ -359,5 +359,5 @@ /* Add scrollbar styling */ .style-scrollbar { - @apply scrollbar scrollbar-w-1 scrollbar-thumb-accent/40 scrollbar-track-transparent hover:scrollbar-thumb-accent scrollbar-thumb-rounded-full; + @apply scrollbar scrollbar-w-0 scrollbar-thumb-accent/40 scrollbar-track-transparent hover:scrollbar-thumb-accent scrollbar-thumb-rounded-full; } diff --git a/apps/mail/components/ai-toggle-button.tsx b/apps/mail/components/ai-toggle-button.tsx index bc9bf5c7e..5b9658db0 100644 --- a/apps/mail/components/ai-toggle-button.tsx +++ b/apps/mail/components/ai-toggle-button.tsx @@ -14,7 +14,7 @@ const AIToggleButton = () => { @@ -858,7 +862,7 @@ export function ThreadDisplay() { @@ -900,7 +904,7 @@ export function ThreadDisplay() { @@ -914,7 +918,7 @@ export function ThreadDisplay() { - diff --git a/apps/mail/components/navigation.tsx b/apps/mail/components/navigation.tsx index c1e5b133f..eb92cc010 100644 --- a/apps/mail/components/navigation.tsx +++ b/apps/mail/components/navigation.tsx @@ -8,14 +8,17 @@ import { ListItem, } from '@/components/ui/navigation-menu'; import { Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/sheet'; -import { GitHub, Twitter, Discord, LinkedIn } from './icons/icons'; +import { GitHub, Twitter, Discord, LinkedIn, Star } from './icons/icons'; +import { AnimatedNumber } from '@/components/ui/animated-number'; import { signIn, useSession } from '@/lib/auth-client'; import { Separator } from '@/components/ui/separator'; import { Link, useNavigate } from 'react-router'; import { Button } from '@/components/ui/button'; import { Menu } from 'lucide-react'; -import { useState } from 'react'; +import { useState, useEffect } from 'react'; +import { useQuery } from '@tanstack/react-query'; import { toast } from 'sonner'; +import { cn } from '@/lib/utils'; const resources = [ { @@ -74,11 +77,37 @@ const IconComponent = { linkedin: LinkedIn, }; +interface GitHubApiResponse { + stargazers_count: number; +} + export function Navigation() { const [open, setOpen] = useState(false); + const [stars, setStars] = useState(0); // Default fallback value const { data: session } = useSession(); const navigate = useNavigate(); + const { data: githubData } = useQuery({ + queryKey: ['githubStars'], + queryFn: async () => { + const response = await fetch('https://api.github.com/repos/Mail-0/Zero', { + headers: { + 'Accept': 'application/vnd.github.v3+json', + }, + }); + if (!response.ok) { + throw new Error('Failed to fetch GitHub stars'); + } + return response.json() as Promise; + }, + }); + + useEffect(() => { + if (githubData) { + setStars(githubData.stargazers_count || 0); + } + }, [githubData]); + return ( <> {/* Desktop Navigation - Hidden on mobile */} @@ -133,6 +162,27 @@ export function Navigation() {
+ +
+ + Star + Stars on GitHub +
+
+ + +
+
@@ -439,7 +439,7 @@ export function NavUser() { )}
-
+
{isSessionPending ? null : false ? : } @@ -523,7 +523,7 @@ export function NavUser() { {state !== 'collapsed' && (
-
+

{activeAccount?.name || session.user.name || 'User'} diff --git a/apps/mail/locales/en.json b/apps/mail/locales/en.json index d6eae27c1..133759ed7 100644 --- a/apps/mail/locales/en.json +++ b/apps/mail/locales/en.json @@ -83,7 +83,7 @@ "goToArchive": "Go to Archive", "goToBin": "Go to Bin", "goToSettings": "Go to Settings", - "newEmail": "New Email", + "newEmail": "New email", "composeMessage": "New Email", "searchEmails": "Search Emails", "toggleTheme": "Toggle Theme",