Skip to content

Commit

Permalink
Inbox
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Dec 19, 2023
1 parent a8fad95 commit befc217
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 61 deletions.
20 changes: 20 additions & 0 deletions apps/dashboard/src/app/[locale]/@dashboard/(root)/inbox/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Icons } from "@midday/ui/icons";

export default function Inbox() {
return (
<div className="h-[calc(100vh-300px)] flex items-center justify-center">
<div className="flex flex-col items-center">
<Icons.WorkInProgress className="mb-4 w-[35px] h-[35px]" />
<div className="text-center mb-6 space-y-2">
<h2 className="font-medium text-lg">Work in progress</h2>
<p className="text-[#606060] text-sm">
Nunc sit amet lectus quis mi vehicula lacinia nec
<br /> non purus. Aliquam id rutrum magna. Duis
<br /> convallis orci odio, sit amet vehicula tortor
<br /> tincidunt quis.
</p>
</div>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ export const metadata: Metadata = {
};

export default function Vault({ params }) {
const disableActions = ["transactions", "inbox", "exports"].includes(
params?.folders?.at(0)
);
const disableActions = ["exports"].includes(params?.folders?.at(0));

return <Table folders={params.folders} disableActions={disableActions} />;
}
10 changes: 5 additions & 5 deletions apps/dashboard/src/components/command-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const navigation = [
path: "/",
icon: Icons.Overview,
},
{
name: "Inbox",
path: "/inbox",
icon: Icons.Inbox2,
},
{
name: "Transactions",
path: "/transactions",
Expand All @@ -45,11 +50,6 @@ const navigation = [
path: "/vault",
icon: Icons.Files,
},
{
name: "Inbox",
path: "/vault/inbox",
icon: Icons.FolderSpecial,
},
{
name: "Exports",
path: "/vault/exports",
Expand Down
8 changes: 0 additions & 8 deletions apps/dashboard/src/components/file-icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,6 @@ export function FileIcon({ mimetype, name, isFolder }) {
return <Icons.DriveFileMove size={16} className="text-[#878787]" />;
}

if (name === "inbox") {
return <Icons.FolderSpecial size={16} className="text-[#878787]" />;
}

if (name === "transactions") {
return <Icons.Topic size={16} className="text-[#878787]" />;
}

if (mimetype?.startsWith("image")) {
return <Icons.BrokenImage size={16} className="text-[#878787]" />;
}
Expand Down
5 changes: 5 additions & 0 deletions apps/dashboard/src/components/main-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export function MainMenu() {
name: "Overview",
icon: () => <Icons.Overview size={22} />,
},
{
path: "/inbox",
name: "Inbox",
icon: () => <Icons.Inbox2 size={22} />,
},
{
path: "/transactions",
name: "Transactions",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ export const translatedFolderName = (t: any, folder: string) => {
switch (folder) {
case "all":
return t("folders.all");
case "inbox":
return t("folders.inbox");
case "transactions":
return t("folders.transactions");
case "exports":
return t("folders.exports");
default:
Expand Down Expand Up @@ -123,9 +119,7 @@ export function DataTableRow({ data, teamId }) {
const { deleteItem, createFolder } = useVaultContext((s) => s);

const folders = params?.folders ?? [];
const isDefaultFolder = ["inbox", "exports", "transactions"].includes(
data.name
);
const isDefaultFolder = ["exports"].includes(data.name);

const disableActions = ["transactions"].includes(folders?.at(0));
const folderPath = folders.join("/");
Expand Down
27 changes: 0 additions & 27 deletions apps/dashboard/src/components/tables/vault/empty-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@ type Props = {

export function EmptyTable({ type }: Props) {
switch (type) {
case "inbox":
return (
<div className="h-[calc(100%-80px)] p-4 flex justify-center items-center">
<div className="items-center flex flex-col text-center">
<h2 className="mb-2">This is your inbox</h2>
<p className="text-sm text-[#878787]">
Everything that will be sent to your <br />
Midday email will end up here.
</p>
</div>
</div>
);

case "exports":
return (
<div className="h-[calc(100%-80px)] p-4 flex justify-center items-center">
Expand All @@ -30,20 +17,6 @@ export function EmptyTable({ type }: Props) {
</div>
);

case "transactions":
return (
<div className="h-[calc(100%-80px)] p-4 flex justify-center items-center">
<div className="items-center flex flex-col text-center">
<h2 className="mb-2">Transactions</h2>
<p className="text-sm text-[#878787]">
This is where your attachments for
<br />
transactions will end up.
</p>
</div>
</div>
);

default:
return (
<div className="h-[calc(100%-80px)] p-4 flex justify-center items-center">
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/tables/vault/upload-zone.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function UploadZone({ children }) {
const { toast, dismiss, update } = useToast();
const { createFolder } = useVaultContext((s) => s);

const isDefaultFolder = ["inbox", "exports"].includes(folders.at(0));
const isDefaultFolder = ["exports"].includes(folders.at(0));

useEffect(() => {
if (!toastId && showProgress) {
Expand Down
2 changes: 0 additions & 2 deletions apps/dashboard/src/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export default {
folders: {
all: "All",
exports: "Exports",
inbox: "Inbox",
transactions: "Transactions",
},
mfa_status: {
verified: "Verified",
Expand Down
2 changes: 0 additions & 2 deletions apps/dashboard/src/locales/sv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ export default {
folders: {
all: "Alla",
exports: "Exporteringar",
inbox: "Inbox",
transactions: "Transaktioner",
},
mfa_status: {
verified: "Verifierad",
Expand Down
7 changes: 1 addition & 6 deletions packages/supabase/src/queries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -508,12 +508,7 @@ type GetVaultParams = {
export async function getVaultQuery(supabase: Client, params: GetVaultParams) {
const { teamId, path } = params;

const defaultFolders = path
? []
: [
{ name: "inbox", isFolder: true },
{ name: "exports", isFolder: true },
];
const defaultFolders = path ? [] : [{ name: "exports", isFolder: true }];

let basePath = teamId;

Expand Down
2 changes: 2 additions & 0 deletions packages/ui/src/components/icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import {
MdOutlineDifference,
MdOutlineFileDownload,
MdOutlineHandyman,
MdOutlineInbox,
MdOutlineInsertPhoto,
MdOutlineIntegrationInstructions,
MdOutlineInventory2,
Expand Down Expand Up @@ -139,6 +140,7 @@ export const Icons = {
),
Settings: MdOutlineTune,
Inbox: ArchiveIcon,
Inbox2: MdOutlineInbox,
Check: (props: any) => (
<svg
xmlns="http://www.w3.org/2000/svg"
Expand Down

0 comments on commit befc217

Please sign in to comment.