开发: 添加及修改路由

This commit is contained in:
zhengw
2023-04-17 17:47:31 +08:00
parent f4644b6ba2
commit bc8bb916ee
12 changed files with 711 additions and 145 deletions

View File

@@ -5,6 +5,8 @@
* @returns
*/
import React, { useEffect, useState } from 'react';
export const groupMembersCount = (data: any[], state: any) => {
let count = 0;
data.forEach((item) => {
@@ -86,3 +88,35 @@ export const formatTags = (data: any) => {
}
return <></>;
};
type IGroupIcon = {
groupList: any[];
};
/**
* todo 群头像拼接
* @param props
* @returns
*/
export const GroupIcon: React.FC<IGroupIcon> = (props) => {
const [list, setList] = useState<any>([[], [], []]);
useEffect(() => {
let temp: any = [[], [], []];
const { groupList } = props;
for (let index = 0; index < 9; index++) {
const element = groupList[index];
if (index < 3) {
temp[0].push(element);
} else if (index < 6) {
temp[1].push(element);
} else {
temp[2].push(element);
}
}
console.log(temp);
}, [props.groupList]);
// <div className={styles.avatar}>{item.name ? item.name[0] : '群'}</div>;
return <div></div>;
};