diff --git a/web/src/components/Modal.tsx b/web/src/components/Modal.tsx index eab8e166..f784eb6f 100644 --- a/web/src/components/Modal.tsx +++ b/web/src/components/Modal.tsx @@ -9,11 +9,9 @@ import { PortalAdd, PortalRemove } from './Portal'; import { Typography } from 'antd'; import { Icon } from '@iconify/react'; import { CSSTransition } from 'react-transition-group'; -// import { animated, useSpring } from 'react-spring'; -// import { easeQuadInOut } from 'd3-ease'; -// import { Iconfont } from './Iconfont'; import './Modal.less'; +import clsx from 'clsx'; const transitionEndListener = (node: HTMLElement, done: () => void) => node.addEventListener('transitionend', done, false); @@ -82,13 +80,13 @@ export const Modal: React.FC = React.memo((props) => { appear={true} >
{/* Inner */}
@@ -163,25 +161,22 @@ export function useModalContext() { /** * 标准模态框包装器 */ -// const ModalWrapperContainer = styled.div` -// padding: 16px; -// min-width: 300px; -// ${(props) => props.theme.mixins.desktop('min-width: 420px;')} -// `; export const ModalWrapper: React.FC<{ title?: string; + className?: string; + style?: React.CSSProperties; }> = React.memo((props) => { const title = _isString(props.title) ? ( - + {props.title} ) : null; return ( -
+
{title} {props.children}
diff --git a/web/src/components/modals/CreateGroup.tsx b/web/src/components/modals/CreateGroup.tsx new file mode 100644 index 00000000..bdc55436 --- /dev/null +++ b/web/src/components/modals/CreateGroup.tsx @@ -0,0 +1,88 @@ +import { Button, Carousel, Divider, Input, Typography } from 'antd'; +import type { CarouselRef } from 'antd/lib/carousel'; +import React, { useCallback, useRef, useState } from 'react'; +import { Avatar } from '../Avatar'; +import { ModalWrapper } from '../Modal'; + +export const ModalCreateGroup: React.FC = React.memo(() => { + const carouselRef = useRef(null); + const [name, setName] = useState(''); + + const handleSelectTemplate = useCallback(() => { + // TODO + carouselRef.current?.next(); + }, []); + + const handleBack = useCallback(() => { + carouselRef.current?.prev(); + }, []); + + const handleCreate = useCallback(() => { + console.log({ name }); + }, [name]); + + return ( + + +
+ + 创建群组 + + + + 选择以下模板, 开始创建属于自己的群组吧! + + +
+ 默认群组 +
+
+ +
+ + 自定义你的群组 + + + + 不要担心, 在此之后你可以随时进行变更 + + +
+ {/* TODO */} + +
+ +
+
群组名称:
+ + setName(e.target.value)} + /> +
+ + + +
+ + +
+
+
+
+ ); +}); +ModalCreateGroup.displayName = 'ModalCreateGroup'; diff --git a/web/src/routes/Main/Navbar/GroupNav.tsx b/web/src/routes/Main/Navbar/GroupNav.tsx index e8d9f3af..9c3bbd36 100644 --- a/web/src/routes/Main/Navbar/GroupNav.tsx +++ b/web/src/routes/Main/Navbar/GroupNav.tsx @@ -1,5 +1,6 @@ import { Avatar } from '@/components/Avatar'; import { openModal } from '@/components/Modal'; +import { ModalCreateGroup } from '@/components/modals/CreateGroup'; import { Icon } from '@iconify/react'; import React, { useCallback, useMemo } from 'react'; import { GroupInfo, useAppSelector } from 'tailchat-shared'; @@ -17,7 +18,7 @@ export const GroupNav: React.FC = React.memo(() => { const groups = useGroups(); const handleCreateGroup = useCallback(() => { - openModal(
新增群组
); + openModal(); }, []); return ( diff --git a/web/src/styles/antd/dark.less b/web/src/styles/antd/dark.less index 344df8f5..3afa70d2 100644 --- a/web/src/styles/antd/dark.less +++ b/web/src/styles/antd/dark.less @@ -21,4 +21,9 @@ background-color: transparent; border: 1px solid rgba(255,255,255,0.12); } + + // 走马灯 + .ant-carousel { + color: rgba(255,255,255,0.65); + } }