From 0a16ab38e41e520fe44c7b2b87f385eec218453d Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Sat, 3 May 2025 00:31:37 -0700 Subject: [PATCH] Reworked settings screens. --- next.config.ts | 2 +- package.json | 1 + pnpm-lock.yaml | 48 ++++++++++++++++ src/app/(main)/boards/BoardsPage.tsx | 5 +- src/app/(main)/console/TestConsole.tsx | 6 +- src/app/(main)/dashboard/DashboardPage.tsx | 6 +- .../profile/DateRangeSetting.module.css | 3 - src/app/(main)/profile/ProfileHeader.tsx | 8 --- src/app/(main)/profile/ProfilePage.module.css | 9 --- src/app/(main)/profile/ProfilePage.tsx | 13 ----- .../(main)/profile/ThemeSetting.module.css | 8 --- src/app/(main)/profile/ThemeSetting.tsx | 29 ---------- .../(main)/profile/TimezoneSetting.module.css | 8 --- src/app/(main)/reports/ReportsHeader.tsx | 6 +- .../(main)/reports/create/ReportTemplates.tsx | 4 +- src/app/(main)/settings/SettingsLayout.tsx | 36 +++++++++--- .../profile/DateRangeSetting.tsx | 8 +-- .../profile/LanguageSetting.tsx | 0 .../profile/PasswordChangeButton.tsx | 4 +- .../profile/PasswordEditForm.tsx | 0 .../(main)/settings/profile/ProfileHeader.tsx | 8 +++ .../(main)/settings/profile/ProfilePage.tsx | 16 ++++++ .../profile/ProfileSettings.tsx | 16 +++--- .../(main)/settings/profile/ThemeSetting.tsx | 24 ++++++++ .../profile/TimezoneSetting.tsx | 2 - .../(main)/{ => settings}/profile/page.tsx | 0 src/app/(main)/settings/teams/TeamsHeader.tsx | 6 +- .../(main)/settings/teams/TeamsJoinButton.tsx | 2 +- .../settings/teams/TeamsSettingsPage.tsx | 5 +- src/app/(main)/settings/users/UsersHeader.tsx | 13 ----- .../settings/users/UsersSettingsPage.tsx | 17 ++++-- .../settings/users/[userId]/UserSettings.tsx | 4 +- .../settings/websites/WebsitesHeader.tsx | 2 +- .../websites/WebsitesSettingsPage.tsx | 15 +++-- .../websites/[websiteId]/WebsiteSettings.tsx | 28 +++++----- .../[teamId]/settings/TeamSettingsLayout.tsx | 32 ++++++++--- .../settings/members/TeamMembersPage.tsx | 9 +-- .../[teamId]/settings/team/TeamDetails.tsx | 36 ++++++------ .../settings/websites/TeamWebsitesPage.tsx | 11 ++-- src/app/(main)/websites/WebsitesPage.tsx | 20 +++++-- .../[websiteId]/WebsiteCompareTables.tsx | 4 +- .../[websiteId]/WebsiteExpandedView.tsx | 55 +++++++++---------- .../[websiteId]/realtime/RealtimeHome.tsx | 4 +- .../[websiteId]/realtime/RealtimeLog.tsx | 10 ++-- src/components/common/DataGrid.tsx | 6 +- src/components/common/LinkButton.tsx | 6 +- src/components/common/Page.module.css | 10 ---- src/components/common/PageHeader.module.css | 48 ---------------- src/components/common/PageHeader.tsx | 6 +- src/components/common/Pager.module.css | 32 ----------- src/components/common/SectionHeader.tsx | 27 +++++++++ src/components/common/SideBar.tsx | 20 ------- src/components/common/SideMenu.tsx | 20 +++++++ src/components/input/DateFilter.tsx | 1 - src/components/input/ProfileButton.tsx | 2 +- src/components/input/SettingsButton.tsx | 4 +- src/components/messages.ts | 1 + src/components/svg/index.ts | 1 + 58 files changed, 362 insertions(+), 365 deletions(-) delete mode 100644 src/app/(main)/profile/DateRangeSetting.module.css delete mode 100644 src/app/(main)/profile/ProfileHeader.tsx delete mode 100644 src/app/(main)/profile/ProfilePage.module.css delete mode 100644 src/app/(main)/profile/ProfilePage.tsx delete mode 100644 src/app/(main)/profile/ThemeSetting.module.css delete mode 100644 src/app/(main)/profile/ThemeSetting.tsx delete mode 100644 src/app/(main)/profile/TimezoneSetting.module.css rename src/app/(main)/{ => settings}/profile/DateRangeSetting.tsx (80%) rename src/app/(main)/{ => settings}/profile/LanguageSetting.tsx (100%) rename src/app/(main)/{ => settings}/profile/PasswordChangeButton.tsx (89%) rename src/app/(main)/{ => settings}/profile/PasswordEditForm.tsx (100%) create mode 100644 src/app/(main)/settings/profile/ProfileHeader.tsx create mode 100644 src/app/(main)/settings/profile/ProfilePage.tsx rename src/app/(main)/{ => settings}/profile/ProfileSettings.tsx (81%) create mode 100644 src/app/(main)/settings/profile/ThemeSetting.tsx rename src/app/(main)/{ => settings}/profile/TimezoneSetting.tsx (93%) rename src/app/(main)/{ => settings}/profile/page.tsx (100%) delete mode 100644 src/app/(main)/settings/users/UsersHeader.tsx delete mode 100644 src/components/common/Page.module.css delete mode 100644 src/components/common/PageHeader.module.css delete mode 100644 src/components/common/Pager.module.css create mode 100644 src/components/common/SectionHeader.tsx delete mode 100644 src/components/common/SideBar.tsx create mode 100644 src/components/common/SideMenu.tsx diff --git a/next.config.ts b/next.config.ts index dc24db2b..02851c82 100644 --- a/next.config.ts +++ b/next.config.ts @@ -125,7 +125,7 @@ if (collectApiEndpoint) { const redirects = [ { source: '/settings', - destination: '/settings/websites', + destination: '/settings/profile', permanent: true, }, { diff --git a/package.json b/package.json index c641ff3a..761ba566 100644 --- a/package.json +++ b/package.json @@ -138,6 +138,7 @@ "@rollup/plugin-node-resolve": "^15.2.0", "@rollup/plugin-replace": "^5.0.2", "@rollup/plugin-terser": "^0.4.4", + "@svgr/cli": "^8.1.0", "@svgr/rollup": "^8.1.0", "@svgr/webpack": "^8.1.0", "@types/jest": "^29.5.14", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ba31c939..79487c73 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -210,6 +210,9 @@ importers: '@rollup/plugin-terser': specifier: ^0.4.4 version: 0.4.4(rollup@3.29.5) + '@svgr/cli': + specifier: ^8.1.0 + version: 8.1.0(typescript@5.8.3) '@svgr/rollup': specifier: ^8.1.0 version: 8.1.0(rollup@3.29.5)(typescript@5.8.3) @@ -2711,6 +2714,11 @@ packages: peerDependencies: '@babel/core': ^7.0.0-0 + '@svgr/cli@8.1.0': + resolution: {integrity: sha512-SnlaLspB610XFXvs3PmhzViHErsXp0yIy4ERyZlHDlO1ro2iYtHMWYk2mztdLD/lBjiA4ZXe4RePON3qU/Tc4A==} + engines: {node: '>=14'} + hasBin: true + '@svgr/core@8.1.0': resolution: {integrity: sha512-8QqtOQT5ACVlmsvKOJNEaWmRPmcojMOzCz4Hs2BGG/toAp/K38LcsMRyLp349glq5AzJbCEeimEoxaX6v/fLrA==} engines: {node: '>=14'} @@ -2725,6 +2733,12 @@ packages: peerDependencies: '@svgr/core': '*' + '@svgr/plugin-prettier@8.1.0': + resolution: {integrity: sha512-o4/uFI8G64tAjBZ4E7gJfH+VP7Qi3T0+M4WnIsP91iFnGPqs5WvPDkpZALXPiyWEtzfYs1Rmwy1Zdfu8qoZuKw==} + engines: {node: '>=14'} + peerDependencies: + '@svgr/core': '*' + '@svgr/plugin-svgo@8.1.0': resolution: {integrity: sha512-Ywtl837OGO9pTLIN/onoWLmDQ4zFUycI1g76vuKGEz6evR/ZTJlJuz3G/fIkb6OVBJ2g0o6CGJzaEjfmEo3AHA==} engines: {node: '>=14'} @@ -3581,6 +3595,10 @@ packages: resolution: {integrity: sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==} engines: {node: '>= 12'} + commander@9.5.0: + resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} + engines: {node: ^12.20.0 || >=14} + common-tags@1.8.2: resolution: {integrity: sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==} engines: {node: '>=4.0.0'} @@ -3788,6 +3806,10 @@ packages: resolution: {integrity: sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==} engines: {node: '>=0.10'} + dashify@2.0.0: + resolution: {integrity: sha512-hpA5C/YrPjucXypHPPc0oJ1l9Hf6wWbiOL7Ik42cxnsUOhWiCB/fylKbKqqJalW9FgkNQCw16YO8uW9Hs0Iy1A==} + engines: {node: '>=4'} + data-uri-to-buffer@4.0.1: resolution: {integrity: sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==} engines: {node: '>= 12'} @@ -10388,6 +10410,22 @@ snapshots: '@svgr/babel-plugin-transform-react-native-svg': 8.1.0(@babel/core@7.26.10) '@svgr/babel-plugin-transform-svg-component': 8.0.0(@babel/core@7.26.10) + '@svgr/cli@8.1.0(typescript@5.8.3)': + dependencies: + '@svgr/core': 8.1.0(typescript@5.8.3) + '@svgr/plugin-jsx': 8.1.0(@svgr/core@8.1.0(typescript@5.8.3)) + '@svgr/plugin-prettier': 8.1.0(@svgr/core@8.1.0(typescript@5.8.3)) + '@svgr/plugin-svgo': 8.1.0(@svgr/core@8.1.0(typescript@5.8.3))(typescript@5.8.3) + camelcase: 6.3.0 + chalk: 4.1.2 + commander: 9.5.0 + dashify: 2.0.0 + glob: 8.1.0 + snake-case: 3.0.4 + transitivePeerDependencies: + - supports-color + - typescript + '@svgr/core@8.1.0(typescript@5.8.3)': dependencies: '@babel/core': 7.26.10 @@ -10414,6 +10452,12 @@ snapshots: transitivePeerDependencies: - supports-color + '@svgr/plugin-prettier@8.1.0(@svgr/core@8.1.0(typescript@5.8.3))': + dependencies: + '@svgr/core': 8.1.0(typescript@5.8.3) + deepmerge: 4.3.1 + prettier: 2.8.8 + '@svgr/plugin-svgo@8.1.0(@svgr/core@8.1.0(typescript@5.8.3))(typescript@5.8.3)': dependencies: '@svgr/core': 8.1.0(typescript@5.8.3) @@ -11400,6 +11444,8 @@ snapshots: commander@8.3.0: {} + commander@9.5.0: {} + common-tags@1.8.2: {} commondir@1.0.1: {} @@ -11690,6 +11736,8 @@ snapshots: dependencies: assert-plus: 1.0.0 + dashify@2.0.0: {} + data-uri-to-buffer@4.0.1: {} data-view-buffer@1.0.2: diff --git a/src/app/(main)/boards/BoardsPage.tsx b/src/app/(main)/boards/BoardsPage.tsx index 4ae0c244..469c8fb7 100644 --- a/src/app/(main)/boards/BoardsPage.tsx +++ b/src/app/(main)/boards/BoardsPage.tsx @@ -1,10 +1,11 @@ -import { Column, Heading } from '@umami/react-zen'; +import { Column } from '@umami/react-zen'; import Link from 'next/link'; +import { PageHeader } from '@/components/common/PageHeader'; export function BoardsPage() { return ( - My Boards + Board 1 diff --git a/src/app/(main)/console/TestConsole.tsx b/src/app/(main)/console/TestConsole.tsx index 655c3f8d..b69cbb79 100644 --- a/src/app/(main)/console/TestConsole.tsx +++ b/src/app/(main)/console/TestConsole.tsx @@ -4,7 +4,7 @@ import Link from 'next/link'; import Script from 'next/script'; import { WebsiteSelect } from '@/components/input/WebsiteSelect'; import { Page } from '@/components/common/Page'; -import { PageHeader } from '@/components/common/PageHeader'; +import { SectionHeader } from '@/components/common/SectionHeader'; import { EventsChart } from '@/components/metrics/EventsChart'; import { WebsiteChart } from '../websites/[websiteId]/WebsiteChart'; import { useApi, useNavigation } from '@/components/hooks'; @@ -118,9 +118,9 @@ export function TestConsole({ websiteId }: { websiteId: string }) { return ( - + - + {website && (