From e8105fa51e32244eefc63a074fffd77cea22d46f Mon Sep 17 00:00:00 2001 From: zhwcreate <3331598351@qq.com> Date: Wed, 9 Oct 2024 00:06:52 +0800 Subject: [PATCH] feat: cooperatorAvatarList --- .../collaboratorAvatarList/index.tsx | 37 +++++++++++++++++++ .../cooperation/cooperationEditor/index.tsx | 1 + src/components/cooperation/header/index.tsx | 14 ++++++- .../cooperation/taskDescription/index.tsx | 1 + 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 src/components/cooperation/collaboratorAvatarList/index.tsx diff --git a/src/components/cooperation/collaboratorAvatarList/index.tsx b/src/components/cooperation/collaboratorAvatarList/index.tsx new file mode 100644 index 0000000..3dc2949 --- /dev/null +++ b/src/components/cooperation/collaboratorAvatarList/index.tsx @@ -0,0 +1,37 @@ +'use client'; + +import React from 'react'; + +import { cn } from '@/utils'; + +interface AvatarCirclesProps { + className?: string; + avatarCount?: number; + avatarUrls: string[]; +} + +export const CollaboratorAvatarList = ({ + avatarCount, + className, + avatarUrls, +}: AvatarCirclesProps) => { + return ( +
+ {avatarUrls.map((url, index) => ( + {`Avatar + ))} + {avatarCount && ( + + +{avatarCount} + + )} +
+ ); +}; diff --git a/src/components/cooperation/cooperationEditor/index.tsx b/src/components/cooperation/cooperationEditor/index.tsx index 4fd2ecf..8a272d4 100644 --- a/src/components/cooperation/cooperationEditor/index.tsx +++ b/src/components/cooperation/cooperationEditor/index.tsx @@ -91,6 +91,7 @@ export const CooperationEditor: React.FC = ({ roomId }) fontSize: 14, wordWrap: 'on', automaticLayout: true, + scrollBeyondLastLine: false, }} loading={} onChange={handleEditorChange} diff --git a/src/components/cooperation/header/index.tsx b/src/components/cooperation/header/index.tsx index 91f3feb..00f9fe2 100644 --- a/src/components/cooperation/header/index.tsx +++ b/src/components/cooperation/header/index.tsx @@ -1,6 +1,8 @@ import Link from 'next/link'; import React from 'react'; +import { CollaboratorAvatarList } from '@/components/cooperation/collaboratorAvatarList'; + interface ProjectInfo { [key: string]: any; } @@ -9,9 +11,16 @@ interface HeaderProps { roomId: string; } +const avatarUrls = [ + 'https://avatars.githubusercontent.com/u/16860528', + 'https://avatars.githubusercontent.com/u/20110627', + 'https://avatars.githubusercontent.com/u/106103625', + 'https://avatars.githubusercontent.com/u/59228569', +]; + export const CooperationHeader: React.FC = ({ roomId }) => { return ( -
+
= ({ roomId }) => {
{roomId}
+
+ +
); }; diff --git a/src/components/cooperation/taskDescription/index.tsx b/src/components/cooperation/taskDescription/index.tsx index f7411b1..51f5665 100644 --- a/src/components/cooperation/taskDescription/index.tsx +++ b/src/components/cooperation/taskDescription/index.tsx @@ -37,6 +37,7 @@ export const TaskDescription: React.FC = ({}) => { wordWrap: 'on', automaticLayout: true, readOnly: true, + scrollBeyondLastLine: false, scrollbar: { horizontal: 'hidden', horizontalHasArrows: false,