diff --git a/client/src/components/Tabs/index.tsx b/client/src/components/Tabs/index.tsx new file mode 100644 index 0000000000..7ff5af04f3 --- /dev/null +++ b/client/src/components/Tabs/index.tsx @@ -0,0 +1,74 @@ +import React, { useMemo } from 'react'; +import { Box, Grid, useTheme } from '@chakra-ui/react'; +import type { GridProps } from '@chakra-ui/react'; + +// @ts-ignore +interface Props extends GridProps { + list: { id: string; label: string }[]; + activeId: string; + size?: 'sm' | 'md' | 'lg'; + onChange: (id: string) => void; +} + +const Tabs = ({ list, size = 'md', activeId, onChange, ...props }: Props) => { + const theme = useTheme(); + const sizeMap = useMemo(() => { + switch (size) { + case 'sm': + return { + fontSize: 'sm', + outP: '3px', + inlineP: 1 + }; + case 'md': + return { + fontSize: 'md', + outP: '4px', + inlineP: 2 + }; + case 'lg': + return { + fontSize: 'lg', + outP: '5px', + inlineP: 3 + }; + } + }, [size]); + + return ( + + {list.map((item) => ( + { + if (activeId === item.id) return; + onChange(item.id); + }} + > + {item.label} + + ))} + + ); +}; + +export default Tabs; diff --git a/client/src/components/WxConcat/index.tsx b/client/src/components/WxConcat/index.tsx index ff9a4341a2..bcc4b631c1 100644 --- a/client/src/components/WxConcat/index.tsx +++ b/client/src/components/WxConcat/index.tsx @@ -30,7 +30,7 @@ const WxConcat = ({ onClose }: { onClose: () => void }) => { - diff --git a/client/src/constants/theme.ts b/client/src/constants/theme.ts index bf9d192db3..57738c0304 100644 --- a/client/src/constants/theme.ts +++ b/client/src/constants/theme.ts @@ -66,10 +66,11 @@ const Button = defineStyleConfig({ }, variants: { primary: { - background: 'myBlue.700 !important', + backgroundImage: + 'linear-gradient(to bottom right, #2152d9 0%,#3370ff 40%, #4e83fd 100%) !important', color: 'white', _hover: { - filter: 'brightness(110%)' + filter: 'brightness(115%)' } }, base: { @@ -77,12 +78,15 @@ const Button = defineStyleConfig({ border: '1px solid', borderColor: 'myGray.200', bg: 'transparent', + transition: 'background 0.3s', _hover: { - color: 'myBlue.600' + color: 'myBlue.600', + bg: 'myWhite.400' }, _active: { color: 'myBlue.700' - } + }, + _disabled: { bg: 'myGray.100 !important', color: 'myGray.700 !important' } } }, defaultProps: { @@ -180,6 +184,18 @@ export const theme = extendTheme({ } }, colors: { + myWhite: { + 100: '#FEFEFE', + 200: '#FDFDFE', + 300: '#FBFBFC', + 400: '#F8FAFB', + 500: '#F6F8F9', + 600: '#F4F6F8', + 700: '#C3C5C6', + 800: '#929495', + 900: '#626263', + 1000: '#313132' + }, myGray: { 100: '#EFF0F1', 200: '#DEE0E2', @@ -204,6 +220,7 @@ export const theme = extendTheme({ 900: '#1237b3', 1000: '#07228c' }, + myRead: { 600: '#ff4d4f' } @@ -232,9 +249,11 @@ export const theme = extendTheme({ xl: '1800px', '2xl': '2100px' }, - active: { + lgColor: { activeBlueGradient: 'linear-gradient(120deg, #d6e8ff 0%, #f0f7ff 100%)', - hoverBlueGradient: 'linear-gradient(60deg, #f0f7ff 0%, #d6e8ff 100%)' + hoverBlueGradient: 'linear-gradient(60deg, #f0f7ff 0%, #d6e8ff 100%)', + primary: 'linear-gradient(to bottom right, #2152d9 0%,#3370ff 40%, #4e83fd 100%)', + primary2: 'linear-gradient(to bottom right, #2152d9 0%,#3370ff 30%,#4e83fd 80%, #85b1ff 100%)' }, components: { Modal: ModalTheme, diff --git a/client/src/hooks/useConfirm.tsx b/client/src/hooks/useConfirm.tsx index 02616c28bc..43aac7f5c6 100644 --- a/client/src/hooks/useConfirm.tsx +++ b/client/src/hooks/useConfirm.tsx @@ -39,7 +39,7 @@ export const useConfirm = ({ title = '提示', content }: { title?: string; cont diff --git a/client/src/pages/chat/components/History.tsx b/client/src/pages/chat/components/History.tsx index 9a000be7af..2cbb44ca3a 100644 --- a/client/src/pages/chat/components/History.tsx +++ b/client/src/pages/chat/components/History.tsx @@ -158,11 +158,11 @@ const PcSliderBar = ({ cursor={'pointer'} transition={'background-color .2s ease-in'} _hover={{ - backgroundImage: ['', theme.active.hoverBlueGradient] + backgroundImage: ['', theme.lgColor.hoverBlueGradient] }} {...(item._id === chatId ? { - backgroundImage: `${theme.active.activeBlueGradient}` + backgroundImage: `${theme.lgColor.activeBlueGradient}` } : { bg: item.top ? 'myGray.200' : '' diff --git a/client/src/pages/chat/components/PhoneSliderBar.tsx b/client/src/pages/chat/components/PhoneSliderBar.tsx index 7b364df8da..04aa12c009 100644 --- a/client/src/pages/chat/components/PhoneSliderBar.tsx +++ b/client/src/pages/chat/components/PhoneSliderBar.tsx @@ -78,7 +78,7 @@ const PhoneSliderBar = ({ {/* 新对话 */} diff --git a/client/src/pages/index.module.scss b/client/src/pages/index.module.scss index 63b8ab0200..ef4de9b3d7 100644 --- a/client/src/pages/index.module.scss +++ b/client/src/pages/index.module.scss @@ -2,4 +2,16 @@ * { position: relative; } + + .textlg { + background: linear-gradient( + to bottom right, + #1237b3 0%, + #3370ff 40%, + #4e83fd 80%, + #85b1ff 100% + ); + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; + } } diff --git a/client/src/pages/index.tsx b/client/src/pages/index.tsx index db83505cb7..04b8f6c7f3 100644 --- a/client/src/pages/index.tsx +++ b/client/src/pages/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { Card, Box, Link, Flex, Image, Button } from '@chakra-ui/react'; import Markdown from '@/components/Markdown'; import { useMarkdown } from '@/hooks/useMarkdown'; @@ -6,6 +6,8 @@ import { useRouter } from 'next/router'; import { useGlobalStore } from '@/store/global'; import styles from './index.module.scss'; +import axios from 'axios'; +import MyIcon from '@/components/Icon'; const Home = () => { const router = useRouter(); @@ -15,6 +17,7 @@ const Home = () => { isPc, initData: { beianText } } = useGlobalStore(); + const [star, setStar] = useState(1500); useEffect(() => { if (inviterId) { @@ -135,6 +138,13 @@ const Home = () => { }, 500); }, [isPc]); + useEffect(() => { + (async () => { + const { data: git } = await axios.get('https://api.github.com/repos/c121914yu/FastGPT'); + setStar(git.stargazers_count); + })(); + }, []); + return ( { > {''} FastGpt - + 三分钟 - + 搭建 AI 知识库 - + + + + diff --git a/client/src/pages/kb/components/DataCard.tsx b/client/src/pages/kb/components/DataCard.tsx index 24b29ee165..19eab177e1 100644 --- a/client/src/pages/kb/components/DataCard.tsx +++ b/client/src/pages/kb/components/DataCard.tsx @@ -157,7 +157,7 @@ const DataCard = ({ kbId }: { kbId: string }) => { } aria-label={'refresh'} - variant={'outline'} + variant={'base'} mr={[2, 4]} size={'sm'} onClick={() => { @@ -166,7 +166,7 @@ const DataCard = ({ kbId }: { kbId: string }) => { }} /> - @@ -443,7 +424,7 @@ ${e.password ? `密码为: ${e.password}` : ''}`; diff --git a/client/src/pages/model/components/detail/index.tsx b/client/src/pages/model/components/detail/index.tsx index c24e3f4981..d082fcb56b 100644 --- a/client/src/pages/model/components/detail/index.tsx +++ b/client/src/pages/model/components/detail/index.tsx @@ -141,7 +141,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => { {modelDetail.name} - {isOwner && ( @@ -173,7 +173,7 @@ const ModelDetail = ({ modelId, isPc }: { modelId: string; isPc: boolean }) => { - {isOwner && ( diff --git a/client/src/pages/model/share/components/list.tsx b/client/src/pages/model/share/components/list.tsx index a0bfa71cb5..2794119345 100644 --- a/client/src/pages/model/share/components/list.tsx +++ b/client/src/pages/model/share/components/list.tsx @@ -68,7 +68,7 @@ const ShareModelList = ({ @@ -224,7 +220,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => { ))}