From 75a84ec614fd2a8656c365d9c15ce5a70d6da94a Mon Sep 17 00:00:00 2001 From: Alex / KATT Date: Sat, 11 Jan 2025 02:42:40 +0100 Subject: [PATCH] fix(example): truncate long channel name (#6385) --- examples/next-sse-chat/package.json | 1 + .../src/app/channels/[channelId]/layout.tsx | 4 +- examples/next-sse-chat/src/app/page.tsx | 12 ++-- pnpm-lock.yaml | 56 +++++++++---------- 4 files changed, 39 insertions(+), 34 deletions(-) diff --git a/examples/next-sse-chat/package.json b/examples/next-sse-chat/package.json index 1c93e39c4fa..395b429f2e5 100644 --- a/examples/next-sse-chat/package.json +++ b/examples/next-sse-chat/package.json @@ -30,6 +30,7 @@ "react": "^19.0.0", "react-dom": "^19.0.0", "superjson": "^1.12.4", + "tailwind-merge": "^2.0.0", "zod": "^3.0.0" }, "devDependencies": { diff --git a/examples/next-sse-chat/src/app/channels/[channelId]/layout.tsx b/examples/next-sse-chat/src/app/channels/[channelId]/layout.tsx index 365550c2030..f41edea2c50 100644 --- a/examples/next-sse-chat/src/app/channels/[channelId]/layout.tsx +++ b/examples/next-sse-chat/src/app/channels/[channelId]/layout.tsx @@ -42,8 +42,8 @@ export default async function Home( )} href={`/channels/${channel.id}`} > - - {channel.name} + + {channel.name} ))} diff --git a/examples/next-sse-chat/src/app/page.tsx b/examples/next-sse-chat/src/app/page.tsx index a9f77c328d5..55b13c33136 100644 --- a/examples/next-sse-chat/src/app/page.tsx +++ b/examples/next-sse-chat/src/app/page.tsx @@ -4,6 +4,7 @@ import { SignedIn, SignedOut } from '~/server/auth'; import { caller } from '~/server/routers/_app'; import Link from 'next/link'; import { Suspense } from 'react'; +import { twMerge } from 'tailwind-merge'; import { CreateChannelDialog } from './channels/create-channel'; export default async function Home() { @@ -58,15 +59,18 @@ export default async function Home() { -
+
{channels.map((channel) => ( - - {channel.name} + + {channel.name} ))}
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a098c17372..ea3c602eef4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,7 +46,7 @@ importers: version: 6.0.0(vitest@2.0.4) '@testing-library/react': specifier: ^16.1.0 - version: 16.1.0(@testing-library/dom@10.0.0)(@types/react-dom@19.0.0)(@types/react@19.0.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + version: 16.1.0(@testing-library/dom@10.0.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@testing-library/user-event': specifier: ^14.4.3 version: 14.4.3(@testing-library/dom@10.0.0) @@ -196,7 +196,7 @@ importers: version: 15.1.3(@playwright/test@1.28.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) next-auth: specifier: 5.0.0-beta.25 - version: 5.0.0-beta.25(next@15.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react@19.0.0) + version: 5.0.0-beta.25(next@15.1.3(@playwright/test@1.28.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react@19.0.0) react: specifier: ^19.0.0 version: 19.0.0 @@ -1395,7 +1395,7 @@ importers: version: 15.1.3(@playwright/test@1.28.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) next-auth: specifier: 5.0.0-beta.25 - version: 5.0.0-beta.25(next@15.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react@19.0.0) + version: 5.0.0-beta.25(next@15.1.3(@playwright/test@1.28.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react@19.0.0) postgres: specifier: ^3.4.4 version: 3.4.4 @@ -1408,6 +1408,9 @@ importers: superjson: specifier: ^1.12.4 version: 1.12.4 + tailwind-merge: + specifier: ^2.0.0 + version: 2.0.0 zod: specifier: ^3.0.0 version: 3.23.8 @@ -1900,7 +1903,7 @@ importers: version: 6.0.0(vitest@2.0.4) '@testing-library/react': specifier: ^16.1.0 - version: 16.1.0(@testing-library/dom@10.0.0)(@types/react-dom@19.0.0)(@types/react@19.0.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) + version: 16.1.0(@testing-library/dom@10.0.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) '@testing-library/user-event': specifier: ^14.4.3 version: 14.4.3(@testing-library/dom@10.0.0) @@ -7556,8 +7559,8 @@ packages: engines: {node: '>=18'} peerDependencies: '@testing-library/dom': ^10.0.0 - '@types/react': ^18.0.0 || ^19.0.0 - '@types/react-dom': ^18.0.0 || ^19.0.0 + '@types/react': npm:types-react@rc + '@types/react-dom': npm:types-react-dom@rc react: ^18.0.0 || ^19.0.0 react-dom: ^18.0.0 || ^19.0.0 peerDependenciesMeta: @@ -24326,15 +24329,12 @@ snapshots: optionalDependencies: vitest: 2.0.4(@edge-runtime/vm@2.0.2)(@types/node@20.17.12)(@vitest/ui@2.0.4)(jsdom@24.0.0)(lightningcss@1.28.2)(terser@5.34.0) - '@testing-library/react@16.1.0(@testing-library/dom@10.0.0)(@types/react-dom@19.0.0)(@types/react@19.0.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': + '@testing-library/react@16.1.0(@testing-library/dom@10.0.0)(react-dom@19.0.0(react@19.0.0))(react@19.0.0)': dependencies: '@babel/runtime': 7.24.7 '@testing-library/dom': 10.0.0 react: 19.0.0 react-dom: 19.0.0(react@19.0.0) - optionalDependencies: - '@types/react': 19.0.0 - '@types/react-dom': 19.0.0 '@testing-library/user-event@14.4.3(@testing-library/dom@10.0.0)': dependencies: @@ -27803,8 +27803,8 @@ snapshots: '@typescript-eslint/parser': 7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2) eslint: 9.13.0(jiti@2.3.3) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.5.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint-import-resolver-typescript@3.5.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)) + eslint-import-resolver-typescript: 3.5.2(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@2.3.3)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)) eslint-plugin-jsx-a11y: 6.10.2(eslint@9.13.0(jiti@2.3.3)) eslint-plugin-react: 7.37.2(eslint@9.13.0(jiti@2.3.3)) eslint-plugin-react-hooks: 5.1.0(eslint@9.13.0(jiti@2.3.3)) @@ -27826,12 +27826,12 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-import-resolver-typescript@3.5.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)): + eslint-import-resolver-typescript@3.5.2(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@2.3.3)): dependencies: debug: 4.3.7(supports-color@8.1.1) enhanced-resolve: 5.17.1 eslint: 9.13.0(jiti@2.3.3) - eslint-plugin-import: 2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint-import-resolver-typescript@3.5.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)) + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)) get-tsconfig: 4.8.1 globby: 13.1.3 is-core-module: 2.13.1 @@ -27840,18 +27840,18 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)): + eslint-module-utils@2.12.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.2)(eslint@9.13.0(jiti@2.3.3)): dependencies: debug: 3.2.7 optionalDependencies: '@typescript-eslint/parser': 7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2) eslint: 9.13.0(jiti@2.3.3) eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.5.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)) + eslint-import-resolver-typescript: 3.5.2(eslint-plugin-import@2.31.0)(eslint@9.13.0(jiti@2.3.3)) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint-import-resolver-typescript@3.5.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)): + eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.12.2(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.8 @@ -27862,7 +27862,7 @@ snapshots: doctrine: 2.1.0 eslint: 9.13.0(jiti@2.3.3) eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.2(eslint-plugin-import@2.31.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)))(eslint@9.13.0(jiti@2.3.3)) + eslint-module-utils: 2.12.0(@typescript-eslint/parser@7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2))(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.5.2)(eslint@9.13.0(jiti@2.3.3)) hasown: 2.0.2 is-core-module: 2.15.1 is-glob: 4.0.3 @@ -27874,7 +27874,7 @@ snapshots: string.prototype.trimend: 1.0.8 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 7.16.1(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2) + '@typescript-eslint/parser': 8.12.2(eslint@9.13.0(jiti@2.3.3))(typescript@5.7.2) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack @@ -29248,7 +29248,7 @@ snapshots: history@4.10.1: dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.26.0 loose-envify: 1.4.0 resolve-pathname: 3.0.0 tiny-invariant: 1.3.3 @@ -31430,7 +31430,7 @@ snapshots: react-dom: 19.0.0(react@19.0.0) uuid: 8.3.2 - next-auth@5.0.0-beta.25(next@15.1.3(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react@19.0.0): + next-auth@5.0.0-beta.25(next@15.1.3(@playwright/test@1.28.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0))(react@19.0.0): dependencies: '@auth/core': 0.37.2 next: 15.1.3(@playwright/test@1.28.1)(react-dom@19.0.0(react@19.0.0))(react@19.0.0) @@ -33327,7 +33327,7 @@ snapshots: react-helmet-async@1.3.0(react-dom@19.0.0(react@19.0.0))(react@19.0.0): dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.26.0 invariant: 2.2.4 prop-types: 15.8.1 react: 19.0.0 @@ -33363,7 +33363,7 @@ snapshots: react-loadable-ssr-addon-v5-slorber@1.0.1(@docusaurus/react-loadable@6.0.0(react@19.0.0))(webpack@5.95.0(@swc/core@1.9.1(@swc/helpers@0.5.15))): dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.26.0 react-loadable: '@docusaurus/react-loadable@6.0.0(react@19.0.0)' webpack: 5.95.0(@swc/core@1.9.1(@swc/helpers@0.5.15)) @@ -33371,13 +33371,13 @@ snapshots: react-router-config@5.1.1(react-router@5.3.4(react@19.0.0))(react@19.0.0): dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.26.0 react: 19.0.0 react-router: 5.3.4(react@19.0.0) react-router-dom@5.3.4(react@19.0.0): dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.26.0 history: 4.10.1 loose-envify: 1.4.0 prop-types: 15.8.1 @@ -33388,7 +33388,7 @@ snapshots: react-router@5.3.4(react@19.0.0): dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.26.0 history: 4.10.1 hoist-non-react-statics: 3.3.2 loose-envify: 1.4.0 @@ -33560,7 +33560,7 @@ snapshots: regenerator-transform@0.15.2: dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.26.0 regex@4.3.2: {} @@ -34947,7 +34947,7 @@ snapshots: tailwind-merge@2.0.0: dependencies: - '@babel/runtime': 7.24.7 + '@babel/runtime': 7.26.0 tailwindcss-elevation@2.0.0(tailwindcss@3.4.6): dependencies: