diff --git a/apps/web/package.json b/apps/web/package.json index 4997134125..f77b379175 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -25,21 +25,21 @@ "@emotion/react": "^11.11.1", "@emotion/server": "^11.11.0", "@heroicons/react": "^2.0.18", - "@mantine/core": "^6.0.13", - "@mantine/dates": "^6.0.13", - "@mantine/form": "^6.0.13", - "@mantine/hooks": "^6.0.13", - "@mantine/modals": "^6.0.13", - "@mantine/next": "^6.0.13", - "@mantine/notifications": "^6.0.13", - "@mantine/prism": "^6.0.13", - "@mantine/spotlight": "^6.0.13", - "@mantine/tiptap": "^6.0.13", - "@sentry/nextjs": "^7.55.2", + "@mantine/core": "^6.0.15", + "@mantine/dates": "^6.0.15", + "@mantine/form": "^6.0.15", + "@mantine/hooks": "^6.0.15", + "@mantine/modals": "^6.0.15", + "@mantine/next": "^6.0.15", + "@mantine/notifications": "^6.0.15", + "@mantine/prism": "^6.0.15", + "@mantine/spotlight": "^6.0.15", + "@mantine/tiptap": "^6.0.15", + "@sentry/nextjs": "^7.57.0", "@supabase/auth-helpers-nextjs": "^0.7.2", "@supabase/auth-helpers-react": "^0.4.0", - "@supabase/supabase-js": "^2.25.0", - "@tabler/icons-react": "^2.22.0", + "@supabase/supabase-js": "^2.26.0", + "@tabler/icons-react": "^2.23.0", "@tiptap/extension-highlight": "2.0.3", "@tiptap/extension-link": "2.0.3", "@tiptap/extension-subscript": "2.0.3", @@ -55,8 +55,8 @@ "eventsource-parser": "^1.0.0", "lodash": "^4.17.21", "moment": "^2.29.4", - "next": "^13.4.6", - "next-translate": "^2.0.6", + "next": "^13.4.7", + "next-translate": "^2.4.4", "nextjs-google-analytics": "^2.3.3", "openai": "^3.3.0", "react": "18.2.0", @@ -64,7 +64,7 @@ "react-csv-reader": "^4.0.0", "react-dom": "18.2.0", "react-resizable": "^3.0.5", - "swr": "^2.1.5", + "swr": "^2.2.0", "ui": "workspace:*", "uuid": "^9.0.0", "xlsx": "^0.18.5" @@ -76,29 +76,29 @@ "@types/jest": "^29.5.2", "@types/js-cookie": "^3.0.3", "@types/lodash": "^4.14.195", - "@types/node": "^20.3.1", - "@types/react": "^18.2.12", + "@types/node": "^20.3.2", + "@types/react": "^18.2.14", "@types/react-beautiful-dnd": "^13.1.4", - "@types/react-dom": "^18.2.5", + "@types/react-dom": "^18.2.6", "@types/react-resizable": "^3.0.4", "@types/testing-library__jest-dom": "^5.14.6", "@types/uuid": "^9.0.2", - "@typescript-eslint/eslint-plugin": "^5.59.11", - "@typescript-eslint/parser": "^5.59.11", + "@typescript-eslint/eslint-plugin": "^5.60.1", + "@typescript-eslint/parser": "^5.60.1", "autoprefixer": "^10.4.14", "eslint": "8.43.0", "eslint-config-custom": "workspace:*", "genversion": "^3.1.1", "jest": "^29.5.0", "jest-environment-jsdom": "^29.5.0", - "lint-staged": "^13.2.2", - "next-translate-plugin": "^2.0.5", + "lint-staged": "^13.2.3", + "next-translate-plugin": "^2.4.4", "postcss": "^8.4.24", - "supabase": "^1.68.6", + "supabase": "^1.75.2", "tailwind-config": "workspace:*", "tailwindcss": "^3.3.2", "tsconfig": "workspace:*", - "typescript": "^5.1.3" + "typescript": "^5.1.6" }, "packageManager": "pnpm@8.6.5" } diff --git a/apps/web/src/components/cards/ProductCard.tsx b/apps/web/src/components/cards/ProductCard.tsx index 022e3e63e7..e29d1256df 100644 --- a/apps/web/src/components/cards/ProductCard.tsx +++ b/apps/web/src/components/cards/ProductCard.tsx @@ -55,9 +55,9 @@ const ProductCard = ({ sản phẩm )} - {showCategory && ( + {showCategory && product?.category && (
- {product?.category} + {product.category}
)} diff --git a/apps/web/src/components/layouts/LeftSidebar.tsx b/apps/web/src/components/layouts/LeftSidebar.tsx index f89ba764b1..4b21d283ae 100644 --- a/apps/web/src/components/layouts/LeftSidebar.tsx +++ b/apps/web/src/components/layouts/LeftSidebar.tsx @@ -124,7 +124,7 @@ function LeftSidebar({ className }: SidebarProps) { )} - + {ws?.id && (
diff --git a/apps/web/src/components/layouts/NestedLayout.tsx b/apps/web/src/components/layouts/NestedLayout.tsx index 6dc2aaab41..9d6ed736b5 100644 --- a/apps/web/src/components/layouts/NestedLayout.tsx +++ b/apps/web/src/components/layouts/NestedLayout.tsx @@ -9,7 +9,7 @@ import BottomNavbar from './BottomNavbar'; import { useAppearance } from '../../hooks/useAppearance'; import LeftSidebar from './LeftSidebar'; import TopNavbar from './TopNavbar'; -import ScrollTopTopButton from './ScrollTopTopButton'; +import ScrollToTopButton from './ScrollToTopButton'; interface Props { children: React.ReactNode; @@ -51,23 +51,23 @@ const NestedLayout: FC = ({ const [disableTabs, setDisableTabs] = useState(defaultNoTabs); const [cachedDisableTabs, setCachedDisableTabs] = useState(defaultNoTabs); + const elementId = 'content'; const [prevScrollPos, setPrevScrollPos] = useState(0); useEffect(() => { if (defaultNoTabs) { setDisableTabs(true); setCachedDisableTabs(true); - return; } else { setDisableTabs(false); setCachedDisableTabs(false); } - const content = document.getElementById('content'); - if (!content) return; + const el = document.getElementById(elementId); + if (!el) return; const handleScroll = () => { - const pos = content.scrollTop; + const pos = el.scrollTop; setPrevScrollPos(pos); const disable = pos > 0; @@ -76,14 +76,15 @@ const NestedLayout: FC = ({ setCachedDisableTabs(disable); }; - content.addEventListener('scroll', handleScroll); - return () => content.removeEventListener('scroll', handleScroll); - }, [defaultNoTabs]); + el.addEventListener('scroll', handleScroll); + return () => el.removeEventListener('scroll', handleScroll); + }, [defaultNoTabs, elementId]); return ( -
- +
+ + = ({ segments={segments} tabs={filteredTabs} /> -
{ +const ScrollToTopButton = ({ elementId, prevScrollPos }: Props) => { return (