diff --git a/next.config.mjs b/next.config.mjs index c81fa3b..a58e67a 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,7 +1,20 @@ +const isProd = process.env.NODE_ENV === 'production'; + /** @type {import('next').NextConfig} */ const nextConfig = { reactStrictMode: true, transpilePackages: ['@lobehub/ui'], + images: { + remotePatterns: [ + { + hostname: 'registry.npmmirror.com', + pathname: '/@lobehub/**', + port: '', + protocol: 'https', + }, + ], + unoptimized: !isProd, + }, async headers() { return [ { diff --git a/src/app/App.tsx b/src/app/App.tsx index e994607..280fca5 100644 --- a/src/app/App.tsx +++ b/src/app/App.tsx @@ -10,10 +10,10 @@ interface AppProps { } export const App = memo(({ style }) => { return ( - + - + ); }); diff --git a/src/app/iframe/page.tsx b/src/app/iframe/page.tsx index 1fcd542..643a84e 100644 --- a/src/app/iframe/page.tsx +++ b/src/app/iframe/page.tsx @@ -6,20 +6,20 @@ import { Flexbox } from 'react-layout-kit'; import PromptInput from '@/features/Input'; import ImagePreview from '@/features/Preview'; import TaskList from '@/features/TaskList'; -import { useMidjourneyStore } from '@/store/midjourney'; +import { useStore } from '@/store'; import './global.css'; const InLobeChatPage = memo(() => { - const [useInitApp] = useMidjourneyStore((s) => [s.useInitApp]); + const [useInitApp] = useStore((s) => [s.useInitApp]); useInitApp(); return ( - + - + ); }); diff --git a/src/app/page.tsx b/src/app/page.tsx index efb084c..e8cf9d5 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,35 +1,41 @@ 'use client'; +import { Logo } from '@lobehub/ui'; import { useTheme } from 'antd-style'; import { memo } from 'react'; import { Flexbox } from 'react-layout-kit'; import Settings from '@/features/Settings'; -import { useMidjourneyStore } from '@/store/midjourney'; +import { useStore } from '@/store'; import { App } from './App'; const Page = memo(() => { - const [useInitApp] = useMidjourneyStore((s) => [s.useInitApp]); + const [useInitApp] = useStore((s) => [s.useInitApp]); useInitApp(); const theme = useTheme(); return ( - + + + { + window.open('https://github.com/lobehub/chat-plugin-midjourney', '_blank'); + }} + style={{ cursor: 'pointer' }} + type={'combine'} + /> + + - ); }); diff --git a/src/features/Input.tsx b/src/features/Input.tsx index 4a8ebfb..e628a2a 100644 --- a/src/features/Input.tsx +++ b/src/features/Input.tsx @@ -1,34 +1,46 @@ -import { TextArea } from '@lobehub/ui'; -import { Button, Flex } from 'antd'; +import { ActionIcon, TextArea } from '@lobehub/ui'; +import { Flex } from 'antd'; +import { createStyles } from 'antd-style'; +import { SendHorizontal } from 'lucide-react'; import { memo } from 'react'; -import { Flexbox } from 'react-layout-kit'; -import { useMidjourneyStore } from '@/store/midjourney'; +import { useStore } from '@/store'; + +const useStyles = createStyles(({ css, token }) => ({ + container: css` + padding: 4px; + background: ${token.colorFillTertiary}; + border: 1px solid ${token.colorBorderSecondary}; + border-radius: ${token.borderRadiusLG}px; + `, + prompt: css` + padding: 6px; + font-family: ${token.fontFamilyCode}; + `, +})); const PromptInput = memo(() => { - const [prompts, updatePrompts, createImagineTask] = useMidjourneyStore((s) => [ + const { styles } = useStyles(); + const [prompts, updatePrompts, createImagineTask] = useStore((s) => [ s.prompts, s.updatePrompts, s.createImagineTask, ]); return ( - +