-
-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added new mail frontend from shadcn ui examples - added new route for imap data fetching /api/emails/imap - added new menu item "E-mails" Updated Prisma scheme - cleaned system_Modules_Enabled schema - unused field was deleted Updated Locales - added new meu item localization
- Loading branch information
1 parent
0f3230f
commit ecc2ffb
Showing
23 changed files
with
1,764 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { Mail } from "lucide-react"; | ||
|
||
import Link from "next/link"; | ||
|
||
import { usePathname } from "next/navigation"; | ||
import React from "react"; | ||
|
||
type Props = { | ||
open: boolean; | ||
title: string; | ||
}; | ||
|
||
const EmailsModuleMenu = ({ open, title }: Props) => { | ||
const pathname = usePathname(); | ||
const isPath = pathname.includes("emails"); | ||
|
||
return ( | ||
<div className="flex flex-row items-center mx-auto p-2"> | ||
<Link | ||
href={"/emails"} | ||
className={`flex gap-2 p-2 ${isPath ? "text-muted-foreground" : null}`} | ||
> | ||
<Mail className="w-6" /> | ||
<span className={open ? "" : "hidden"}>{title}</span> | ||
</Link> | ||
</div> | ||
); | ||
}; | ||
|
||
export default EmailsModuleMenu; |
63 changes: 63 additions & 0 deletions
63
app/[locale]/(routes)/emails/components/account-switcher.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
"use client"; | ||
|
||
import * as React from "react"; | ||
|
||
import { cn } from "@/lib/utils"; | ||
import { | ||
Select, | ||
SelectContent, | ||
SelectItem, | ||
SelectTrigger, | ||
SelectValue, | ||
} from "@/components/ui/select"; | ||
|
||
interface AccountSwitcherProps { | ||
isCollapsed: boolean; | ||
accounts: { | ||
label: string; | ||
email: string; | ||
icon: React.ReactNode; | ||
}[]; | ||
} | ||
|
||
export function AccountSwitcher({ | ||
isCollapsed, | ||
accounts, | ||
}: AccountSwitcherProps) { | ||
const [selectedAccount, setSelectedAccount] = React.useState<string>( | ||
accounts[0].email | ||
); | ||
|
||
return ( | ||
<Select defaultValue={selectedAccount} onValueChange={setSelectedAccount}> | ||
<SelectTrigger | ||
className={cn( | ||
"flex flex-1 items-center gap-2 [&>span]:line-clamp-1 [&>span]:flex [&>span]:w-full [&>span]:items-center [&>span]:gap-1 [&>span]:truncate [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0", | ||
isCollapsed && | ||
"flex h-8 w-8 items-center justify-center p-0 [&>span]:w-auto [&>svg]:hidden" | ||
)} | ||
aria-label="Select account" | ||
> | ||
<SelectValue placeholder="Select an account"> | ||
{accounts.find((account) => account.email === selectedAccount)?.icon} | ||
<span className={cn("ml-2", isCollapsed && "hidden")}> | ||
{ | ||
accounts.find((account) => account.email === selectedAccount) | ||
?.label | ||
} | ||
</span> | ||
</SelectValue> | ||
</SelectTrigger> | ||
<SelectContent> | ||
{accounts.map((account) => ( | ||
<SelectItem key={account.email} value={account.email}> | ||
<div className="flex items-center gap-3 [&_svg]:h-4 [&_svg]:w-4 [&_svg]:shrink-0 [&_svg]:text-foreground"> | ||
{account.icon} | ||
{account.email} | ||
</div> | ||
</SelectItem> | ||
))} | ||
</SelectContent> | ||
</Select> | ||
); | ||
} |
Oops, something went wrong.
ecc2ffb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nextcrm-test – ./
nextcrm-test-e-osvc.vercel.app
test.nextcrm.io
nextcrm-test-git-main-e-osvc.vercel.app
ecc2ffb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nextcrm-demo – ./
nextcrm-demo-e-osvc.vercel.app
nextcrm-demo-git-main-e-osvc.vercel.app
demo.nextcrm.io
ecc2ffb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
nextcrm-softbase – ./
nextcrm-softbase-git-main-e-osvc.vercel.app
softbase.nextcrm.io
nextcrm-softbase.vercel.app
nextcrm-softbase-e-osvc.vercel.app