Skip to content

Commit

Permalink
Merge pull request #79 from ant-xuexiao/feat_deploy
Browse files Browse the repository at this point in the history
chore: deploy test
  • Loading branch information
xingwanying authored Apr 9, 2024
2 parents f284ba5 + db39981 commit f07fb4e
Show file tree
Hide file tree
Showing 5 changed files with 2,907 additions and 42 deletions.
25 changes: 15 additions & 10 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Spinner } from '@nextui-org/react';
import BotCard from '@/components/BotCard';
import { useBotList } from '@/app/hooks/useBot';
import FullPageSkeleton from '@/components/FullPageSkeleton';
import { Assistant } from 'petercat-lui';

declare type Bot = Tables<'bots'>;

Expand All @@ -19,18 +20,22 @@ export default function Home() {
}

return (
<div className="container mx-auto max-w-[1024px]">
<div className="mt-8">
<div className="text-center text-purple-500 text-base font-semibold font-['PingFang SC']">
<div className="uppercase">Bot-market</div>
<div className="m-1 leading-[62px] text-indigo-950 text-[50px]">
人才市场
<div>
<Assistant host="https://api.petercat.chat" />

<div className="container mx-auto max-w-[1024px]">
<div className="mt-8">
<div className="text-center text-purple-500 text-base font-semibold font-['PingFang SC']">
<div className="uppercase">Bot-market</div>
<div className="m-1 leading-[62px] text-indigo-950 text-[50px]">
人才市场
</div>
</div>
</div>

<div className="grid grid-flow-row-dense grid-cols-3 gap-8 my-8">
{!isEmpty(bots) &&
map(bots, (bot: Bot) => <BotCard key={bot.id} bot={bot} />)}
<div className="grid grid-flow-row-dense grid-cols-3 gap-8 my-8">
{!isEmpty(bots) &&
map(bots, (bot: Bot) => <BotCard key={bot.id} bot={bot} />)}
</div>
</div>
</div>
</div>
Expand Down
7 changes: 3 additions & 4 deletions lui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lui",
"version": "0.0.1",
"name": "petercat-lui",
"version": "0.0.3",
"description": "A react library developed with dumi",
"module": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -79,7 +79,6 @@
"prettier-plugin-packagejson": "^2.2.18",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"stylelint": "^14.9.1",
"tailwindcss": "^3"
"stylelint": "^14.9.1"
}
}
12 changes: 7 additions & 5 deletions lui/src/Assistant/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import Chat from '../Chat';

export interface AssistantProps {
assistantMeta?: MetaData;
host?: string;
}

const drawerWidth = 375; // Tailwind doesn't support custom width directly, you might need to handle this separately

const Assistant = ({ assistantMeta }: AssistantProps) => {
const Assistant = (props: AssistantProps) => {
const [chatVisible, setChatVisible] = useState(false);
const [position, setPosition] = useState({ bottom: 120 });

Expand Down Expand Up @@ -45,9 +46,9 @@ const Assistant = ({ assistantMeta }: AssistantProps) => {
{chatVisible ? (
<div
className="fixed right-0 top-0 h-full flex flex-row z-[999] overflow-hidden text-left text-black bg-gradient-to-r from-f2e9ed via-e9eefb to-f0eeea shadow-[0px_0px_1px_#919eab3d]"
style={{ width: drawerWidth }}
style={{ width: drawerWidth, zIndex: 9999 }}
>
<Chat assistantMeta={assistantMeta} />
<Chat {...props} />
<div className="absolute top-0 right-0 m-1">
<ActionIcon
icon={<CloseCircleFilled />}
Expand All @@ -58,16 +59,17 @@ const Assistant = ({ assistantMeta }: AssistantProps) => {
</div>
) : (
<div
className="fixed bottom-[120px] right-2.5 w-14 h-8 mr-[-32px] flex items-center justify-center rounded-full border border-[#ececee] shadow-[0_3.2px_12px_#00000014,_0_5px_25px_#0000000a] bg-white cursor-pointer z-9999 transition-all duration-300 ease-in-out hover:shadow-lg active:cursor-grabbing"
className="fixed bottom-[120px] right-2.5 w-14 h-8 mr-[-32px] flex items-center justify-center rounded-full border border-[#ececee] shadow-[0_3.2px_12px_#00000014,_0_5px_25px_#0000000a] bg-white cursor-pointer transition-all duration-300 ease-in-out hover:shadow-lg active:cursor-grabbing"
onMouseDown={startDrag}
onClick={toggleDrawer}
style={{
bottom: `${position.bottom}px`,
zIndex: 9999,
}}
>
<img
src={
assistantMeta?.avatar ||
props.assistantMeta?.avatar ||
'https://mdn.alipayobjects.com/huamei_j8gzmo/afts/img/A*R_7BSIzhH9wAAAAAAAAAAAAADrPSAQ/original'
}
className="absolute left-2 w-6 h-6 rounded-full top-1/2 transform -translate-y-1/2"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"axios": "^1.6.7",
"concurrently": "^8.2.2",
"dayjs": "^1.11.10",
"petercat-lui": "^0.0.3",
"eslint": "8.46.0",
"eslint-config-next": "13.4.12",
"framer-motion": "^10.16.15",
Expand Down
Loading

0 comments on commit f07fb4e

Please sign in to comment.