Skip to content

Commit

Permalink
chore: update formatting and dependencies across multiple files
Browse files Browse the repository at this point in the history
- Remove unnecessary blank lines in issue templates and other markdown files.
- Add semicolons to JavaScript and TypeScript files for consistency.
- Update formatting for better readability and consistency.
- Update package dependencies in package-lock.json and yarn.lock.
- Apply consistent import ordering and spacing in various components.
- Ensure newlines at the end of files where missing.
  • Loading branch information
0xdevcollins committed Dec 4, 2024
1 parent 73d074e commit 2f8fea3
Show file tree
Hide file tree
Showing 42 changed files with 2,430 additions and 926 deletions.
4 changes: 4 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NEXT_PUBLIC_API_BASE_URL=https://api.gridape.com/api/v1
NEXT_PUBLIC_CSRF_COOKIE_URL=https://api.gridape.com/sanctum/csrf-cookie
# NEXT_PUBLIC_API_BASE_URL=http://127.0.0.1:8000/api/v1
# NEXT_PUBLIC_CSRF_COOKIE_URL=http://127.0.0.1:8000/sanctum/csrf-cookie
18 changes: 10 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
Expand All @@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
3 changes: 0 additions & 3 deletions .github/ISSUE_TEMPLATE/custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,4 @@ about: Describe this issue template's purpose here.
title: ''
labels: ''
assignees: ''

---


1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
Expand Down
7 changes: 3 additions & 4 deletions app/api/auth/login/route.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { handleApiRequest } from '@/lib/api-utils'
import { NextRequest } from 'next/server'
import { handleApiRequest } from '@/lib/api-utils';
import { NextRequest } from 'next/server';

export async function POST(request: NextRequest) {
return handleApiRequest(request, '/auth/login', 'POST')
return handleApiRequest(request, '/auth/login', 'POST');
}

8 changes: 4 additions & 4 deletions app/api/auth/register/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { handleApiRequest } from '@/lib/api-utils'
import { NextRequest } from 'next/server'
import { handleApiRequest } from '@/lib/api-utils';
import { NextRequest } from 'next/server';

export async function POST(request: NextRequest) {
return handleApiRequest(request, '/auth/register', 'POST')
}
return handleApiRequest(request, '/auth/register', 'POST');
}
8 changes: 4 additions & 4 deletions app/api/auth/resend/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { handleApiRequest } from '@/lib/api-utils'
import { NextRequest } from 'next/server'
import { handleApiRequest } from '@/lib/api-utils';
import { NextRequest } from 'next/server';

export async function POST(request: NextRequest) {
return handleApiRequest(request, 'auth/resend-verification-mail', 'POST')
}
return handleApiRequest(request, 'auth/resend-verification-mail', 'POST');
}
8 changes: 4 additions & 4 deletions app/api/auth/verify/route.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { handleApiRequest } from '@/lib/api-utils'
import { NextRequest } from 'next/server'
import { handleApiRequest } from '@/lib/api-utils';
import { NextRequest } from 'next/server';

export async function POST(request: NextRequest) {
return handleApiRequest(request, '/auth/email/verify', 'POST')
}
return handleApiRequest(request, '/auth/email/verify', 'POST');
}
2 changes: 1 addition & 1 deletion app/api/templates/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { NextRequest, NextResponse } from 'next/server';

export async function GET(request: NextRequest): Promise<NextResponse> {
return handleApiRequest(request, '/templates', 'GET');
}
}
1 change: 0 additions & 1 deletion app/api/user/settings/add-domain/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ import { NextRequest, NextResponse } from 'next/server';
export async function POST(request: NextRequest): Promise<NextResponse> {
return handleApiRequest(request, '/user/domain-verification', 'POST');
}

2 changes: 1 addition & 1 deletion app/auth/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function LoginPage() {
rememberMe: false,
});
const auth = useAuth();
const {user, loading} = useAuthStore()
const { user, loading } = useAuthStore();

const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
Expand Down
13 changes: 5 additions & 8 deletions app/dashboard/audience/all/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export default function AudiencePage() {
toast({
title: 'Contact Added',
description: 'Your new contact has been successfully added.',
variant: 'success',
variant: 'default',
});

// Reset form
Expand All @@ -126,7 +126,7 @@ export default function AudiencePage() {
toast({
title: 'Incomplete Information',
description: 'Please fill all required fields.',
variant: 'warning',
variant: 'default',
});
}
};
Expand All @@ -139,13 +139,13 @@ export default function AudiencePage() {

const handleDeleteContacts = async () => {
try {
await deleteMultipleContacts(selectedContacts);
// await deleteMultipleContacts(selectedContacts);
setSelectedContacts([]);
setIsDeleteModalOpen(false);
toast({
title: 'Contacts Deleted',
description: 'Selected contacts have been successfully removed.',
variant: 'success',
variant: 'default',
});
} catch (error) {
toast({
Expand Down Expand Up @@ -262,10 +262,7 @@ export default function AudiencePage() {
<DropdownMenuItem>
<Edit className="mr-2 h-4 w-4" /> Edit
</DropdownMenuItem>
<DropdownMenuItem
className="text-red-600"
onSelect={() => deleteContact(contact.id)}
>
<DropdownMenuItem className="text-red-600">
<Trash2 className="mr-2 h-4 w-4" /> Delete
</DropdownMenuItem>
</DropdownMenuContent>
Expand Down
1 change: 0 additions & 1 deletion app/dashboard/campaign/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useAuthStore } from '@/store/authStore';
import React from 'react';

const Page = () => {

return <EmailComposer />;
};

Expand Down
14 changes: 10 additions & 4 deletions app/dashboard/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const Dashboard = () => {
const { user } = useAuthStore();
const [data, setData] = useState<DashboardTypes | null>(null);
const [loading, setLoading] = useState(true);
const router = useRouter()
const router = useRouter();

useEffect(() => {
const fetchData = async () => {
Expand Down Expand Up @@ -69,15 +69,21 @@ const Dashboard = () => {
</div>

<div className="mb-12 grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-6">
<Button onClick={() => router.push('/')} className=" justify-start rounded-xl bg-white p-4 md:py-10 hover:shadow-sm hover:scale-105 transition-shadow transition-transform cursor-pointer text-left">
<Button
onClick={() => router.push('/')}
className=" justify-start rounded-xl bg-white p-4 md:py-10 hover:shadow-sm hover:scale-105 transition-shadow transition-transform cursor-pointer text-left"
>
<MailCheck className=" text-blue-600" size={40} />
<span className="text-lg font-semibold text-[#1E0E4E]">Create Email</span>
</Button>
<Button onClick={() => router.push('/dashboard/campaign/create')} className=" justify-start rounded-xl bg-white p-4 md:py-10 hover:shadow-sm hover:scale-105 transition-shadow transition-transform cursor-pointer text-left">
<Button
onClick={() => router.push('/dashboard/campaign/create')}
className=" justify-start rounded-xl bg-white p-4 md:py-10 hover:shadow-sm hover:scale-105 transition-shadow transition-transform cursor-pointer text-left"
>
<MailCheck className=" text-purple-600" size={40} />
<span className="text-lg font-semibold text-[#1E0E4E]">Create Campaigns</span>
</Button>

{/* {[
{ icon: Mail, label: 'Create Email', color: 'text-blue-600' },
{ icon: MousePointerClick, label: 'Create Campaigns', color: 'text-purple-600' },
Expand Down
31 changes: 16 additions & 15 deletions app/dashboard/templates/all/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@ export default function TemplatesPage() {
}, [templates, searchQuery, categoryFilter]);

// Filtering logic
const filteredTemplates = templates.filter(template =>
(searchQuery === '' || template.name.toLowerCase().includes(searchQuery.toLowerCase())) &&
(categoryFilter === 'all' || template.category === categoryFilter)
const filteredTemplates = templates.filter(
(template) =>
(searchQuery === '' || template.name.toLowerCase().includes(searchQuery.toLowerCase())) &&
(categoryFilter === 'all' || template.category === categoryFilter)
);

return (
Expand All @@ -77,13 +78,16 @@ export default function TemplatesPage() {

<div className="flex flex-col md:flex-row items-center space-y-4 md:space-y-0 md:space-x-4">
<div className="relative w-full">
<Input
placeholder="Search templates..."
className="pl-10 w-full"
<Input
placeholder="Search templates..."
className="pl-10 w-full"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
/>
<Search className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground" size={18} />
<Search
className="absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground"
size={18}
/>
</div>
<Select value={categoryFilter} onValueChange={setCategoryFilter}>
<SelectTrigger className="w-full md:w-auto">
Expand All @@ -102,7 +106,7 @@ export default function TemplatesPage() {

{loading ? (
<div className="text-center py-12">
<motion.div
<motion.div
animate={{ rotate: 360 }}
transition={{ repeat: Infinity, duration: 1 }}
className="mx-auto w-12 h-12 border-4 border-blue-500 border-t-transparent rounded-full"
Expand All @@ -120,10 +124,7 @@ export default function TemplatesPage() {
transition={{ duration: 0.3 }}
>
{filteredTemplates.map((template) => (
<Card
key={template.id}
className="hover:shadow-xl transition-all duration-300 group"
>
<Card key={template.id} className="hover:shadow-xl transition-all duration-300 group">
<CardHeader>
<h2 className="text-lg font-semibold truncate">{template.name}</h2>
</CardHeader>
Expand All @@ -145,8 +146,8 @@ export default function TemplatesPage() {
<Edit size={14} />
<span>Edit</span>
</Button>
<Button
size="sm"
<Button
size="sm"
className="flex items-center space-x-2"
onClick={() => setPreviewTemplate(template)}
>
Expand Down Expand Up @@ -182,4 +183,4 @@ export default function TemplatesPage() {
</AnimatePresence>
</div>
);
}
}
Loading

0 comments on commit 2f8fea3

Please sign in to comment.