Skip to content
Open
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
2 changes: 1 addition & 1 deletion apps/erp/app/hooks/usePermissions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Role } from "@carbon/auth";
import { useRouteData } from "@carbon/remix";
import { useCallback } from "react";
import type { Permission } from "~/modules/users";
import type { Role } from "~/types";
import { path } from "~/utils/path";
import { useUser } from "./useUser";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useParams } from "@remix-run/react";

import type { Role } from "@carbon/auth";
import {
LuBox,
LuChartLine,
Expand All @@ -8,7 +9,6 @@ import {
LuTags,
} from "react-icons/lu";
import { usePermissions, useRouteData } from "~/hooks";
import type { Role } from "~/types";
import { path } from "~/utils/path";
import type { ConsumableSummary } from "../../types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useParams } from "@remix-run/react";

import type { Role } from "@carbon/auth";
import {
LuBox,
LuChartLine,
Expand All @@ -8,7 +9,6 @@ import {
LuTags,
} from "react-icons/lu";
import { usePermissions, useRouteData } from "~/hooks";
import type { Role } from "~/types";
import { path } from "~/utils/path";
import type { MaterialSummary } from "../../types";

Expand Down
2 changes: 1 addition & 1 deletion apps/erp/app/modules/items/ui/Parts/usePartNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useParams } from "@remix-run/react";

import type { Role } from "@carbon/auth";
import {
LuBox,
LuChartLine,
Expand All @@ -10,7 +11,6 @@ import {
LuTags,
} from "react-icons/lu";
import { usePermissions, useRouteData } from "~/hooks";
import type { Role } from "~/types";
import { path } from "~/utils/path";
import type { PartSummary } from "../../types";

Expand Down
2 changes: 1 addition & 1 deletion apps/erp/app/modules/items/ui/Tools/useToolNavigation.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useParams } from "@remix-run/react";

import type { Role } from "@carbon/auth";
import {
LuBox,
LuChartLine,
Expand All @@ -9,7 +10,6 @@ import {
LuTags,
} from "react-icons/lu";
import { usePermissions, useRouteData } from "~/hooks";
import type { Role } from "~/types";
import { path } from "~/utils/path";
import type { ToolSummary } from "../../types";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNanoStore } from "@carbon/remix";
import { atom } from "nanostores";
import { useNanoStore } from "~/hooks";

const $totals = atom<{ total: number }>({
total: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import type { Role } from "@carbon/auth";
import { useParams } from "@remix-run/react";
import {
LuBuilding,
LuCog,
LuContact,
LuCreditCard,
LuLayoutList,
LuMapPin,
LuPackageSearch,
LuCog,
} from "react-icons/lu";
import { usePermissions } from "~/hooks";
import type { Role } from "~/types";
import { path } from "~/utils/path";

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Role } from "@carbon/auth";
import { useParams } from "@remix-run/react";
import {
LuBuilding,
Expand All @@ -12,7 +13,6 @@ import {
RiProgress8Line,
} from "react-icons/ri";
import { usePermissions } from "~/hooks";
import type { Role } from "~/types";
import { path } from "~/utils/path";

type Props = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNanoStore } from "@carbon/remix";
import { atom } from "nanostores";
import { useNanoStore } from "~/hooks";

const $totals = atom<{ total: number }>({
total: 0,
Expand Down
2 changes: 0 additions & 2 deletions apps/erp/app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import type {
import { json } from "@vercel/remix";
import React, { useEffect } from "react";
import { getMode, setMode } from "~/services/mode.server";
import Background from "~/styles/background.css?url";
import NProgress from "~/styles/nprogress.css?url";
import Tailwind from "~/styles/tailwind.css?url";
import { getTheme } from "./services/theme.server";
Expand All @@ -36,7 +35,6 @@ export const config = { runtime: "edge", regions: ["iad1"] };
export const links: LinksFunction = () => {
return [
{ rel: "stylesheet", href: Tailwind },
{ rel: "stylesheet", href: Background },
{ rel: "stylesheet", href: NProgress },
];
};
Expand Down
18 changes: 16 additions & 2 deletions apps/erp/app/routes/x+/_index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Heading, cn } from "@carbon/react";
import { getLocalTimeZone } from "@internationalized/date";
import { getLocalTimeZone, now } from "@internationalized/date";
import { useLocale } from "@react-aria/i18n";
import { Link } from "@remix-run/react";
import { useMemo, type ComponentProps } from "react";
Expand All @@ -22,9 +22,23 @@ export default function AppIndexRoute() {
[locale]
);

const greeting = useMemo(() => {
const time = now(getLocalTimeZone());

if (time.hour >= 3 && time.hour < 11) {
return "Good Morning";
} else if (time.hour >= 11 && time.hour < 16) {
return "Good Afternoon";
} else {
return "Good Evening";
}
}, []);

return (
<div className="p-8 w-full h-full bg-muted">
<Heading size="h3">Hello, {user.firstName}</Heading>
<Heading size="h3">
{greeting}, {user.firstName}
</Heading>
<Subheading>{formatter.format(date)}</Subheading>
<Hr />
<div className="grid grid-cols-[repeat(auto-fill,minmax(min(100%,300px),1fr))] gap-6 mb-8">
Expand Down
2 changes: 1 addition & 1 deletion apps/erp/app/stores/bom.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNanoStore } from "@carbon/remix";
import { atom } from "nanostores";
import { useNanoStore } from "~/hooks";

const $bomStore = atom<string | null>(null);
export const useBom = () => useNanoStore($bomStore, "bom");
2 changes: 1 addition & 1 deletion apps/erp/app/stores/customers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNanoStore } from "@carbon/remix";
import { atom } from "nanostores";
import { useNanoStore } from "~/hooks";
import type { ListItem } from "~/types";

const $customersStore = atom<ListItem[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion apps/erp/app/stores/items.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Database } from "@carbon/database";
import { useNanoStore } from "@carbon/remix";
import { useStore as useValue } from "@nanostores/react";
import { atom, computed } from "nanostores";
import { useNanoStore } from "~/hooks";
import type { ListItem } from "~/types";

export type Item = ListItem & {
Expand Down
2 changes: 1 addition & 1 deletion apps/erp/app/stores/people.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNanoStore } from "@carbon/remix";
import { atom } from "nanostores";
import { useNanoStore } from "~/hooks";
import type { ListItem } from "~/types";

const $peopleStore = atom<(ListItem & { avatarUrl: string | null })[]>([]);
Expand Down
2 changes: 1 addition & 1 deletion apps/erp/app/stores/suppliers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useNanoStore } from "@carbon/remix";
import { atom } from "nanostores";
import { useNanoStore } from "~/hooks";
import type { ListItem } from "~/types";

const $suppliersStore = atom<ListItem[]>([]);
Expand Down
3 changes: 1 addition & 2 deletions apps/erp/app/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Role } from "@carbon/auth";
import type { ValidationErrorResponseData } from "@carbon/form";
import type { FileObject } from "@supabase/storage-js";
import type { TypedResponse } from "@vercel/remix";
Expand Down Expand Up @@ -50,8 +51,6 @@ export type Result = {
message?: string;
};

export type Role = "employee" | "customer" | "supplier";

export type Route = {
name: string;
to: string;
Expand Down
2 changes: 1 addition & 1 deletion apps/mes/app/components/Feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { ChangeEvent } from "react";
import { useEffect, useRef, useState } from "react";
import { LuImage, LuMessageCircle } from "react-icons/lu";
import type { action } from "~/routes/x+/feedback";
import { feedbackValidator } from "~/services/models";
import { feedbackValidator } from "~/services/shared.models";
import { path } from "~/utils/path";

const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10MB in bytes
Expand Down
2 changes: 1 addition & 1 deletion apps/mes/app/components/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ import { InProgressStatusIcon } from "~/assets/icons/InProgressStatusIcon";
import { LowPriorityIcon } from "~/assets/icons/LowPriorityIcon";
import { MediumPriorityIcon } from "~/assets/icons/MediumPriorityIcon";
import { TodoStatusIcon } from "~/assets/icons/TodoStatusIcon";
import type { documentTypes } from "~/services/models";
import type { documentTypes } from "~/services/shared.models";
import type { Operation } from "~/services/types";

type FileIconProps = {
Expand Down
Loading