Skip to content

Commit

Permalink
💄 style: Fix some styles and make updates to various files
Browse files Browse the repository at this point in the history
- Add new files related to chat, market, settings, and plugin development
- Modify code in certain files to add functionality and improve performance
- Update URLs and add links to external resources
- Add styles to components for improved appearance
- Update descriptions and improve user experience

This commit introduces new features, updates existing code, and enhances the overall functionality and appearance of the codebase.
  • Loading branch information
canisminor1990 committed Oct 28, 2023
1 parent a73e519 commit 44a5f0a
Show file tree
Hide file tree
Showing 11 changed files with 66 additions and 41 deletions.
Binary file added public/images/banner_market_modal.webp
Binary file not shown.
Binary file removed public/images/market_modal_banner.webp
Binary file not shown.
4 changes: 3 additions & 1 deletion src/app/chat/features/SessionListContent/Inbox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Link from 'next/link';
import { memo, useMemo, useRef } from 'react';
import { useTranslation } from 'react-i18next';

import { useStyles } from '@/app/chat/features/SessionListContent/List/Item';
import { DEFAULT_INBOX_AVATAR } from '@/const/meta';
import { INBOX_SESSION_ID } from '@/const/session';
import { SESSION_CHAT_URL } from '@/const/url';
Expand All @@ -14,6 +15,7 @@ const { Item } = List;

const Inbox = memo(() => {
const ref = useRef(null);
const { styles } = useStyles();
const isHovering = useHover(ref);
const { t } = useTranslation('chat');
const { mobile } = useResponsive();
Expand Down Expand Up @@ -48,8 +50,8 @@ const Inbox = memo(() => {
<Item
active={mobile ? false : activeId === INBOX_SESSION_ID}
avatar={avatarRender}
className={styles.container}
ref={ref}
style={{ alignItems: 'center', borderRadius: 8 }}
title={t('inbox.title')}
/>
</Link>
Expand Down
11 changes: 5 additions & 6 deletions src/app/chat/features/SessionListContent/List/Item/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,14 @@ import Actions from './Actions';

const { Item } = List;

const useStyles = createStyles(({ css }) => {
export const useStyles = createStyles(({ css, token, responsive }) => {
return {
container: css`
position: relative;
border-radius: 8px;
`,

modalRoot: css`
z-index: 2000;
border-radius: ${token.borderRadius}px;
${responsive.mobile} {
border-radius: 0;
}
`,
};
});
Expand Down
7 changes: 4 additions & 3 deletions src/app/market/features/ShareAgentButton/Inner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@ import Image from 'next/image';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';

import MobilePadding from '@/components/MobilePadding';
import { AGENTS_INDEX_GITHUB } from '@/const/url';

const Inner = memo(() => {
const { t } = useTranslation('market');
return (
<div>
<MobilePadding>
<Image
alt={'banner'}
height={602}
src={'/images/market_modal_banner.webp'}
src={'/images/banner_market_modal.webp'}
style={{ height: 'auto', marginBottom: 24, width: '100%' }}
width={1602}
/>
Expand Down Expand Up @@ -45,7 +46,7 @@ const Inner = memo(() => {
>
{t('guide.func2.button')}
</Button>
</div>
</MobilePadding>
);
});

Expand Down
7 changes: 6 additions & 1 deletion src/app/settings/features/SideBar/Item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@ import { CSSProperties, ReactNode, memo } from 'react';

const { Item } = List;

const useStyles = createStyles(({ css }) => ({
const useStyles = createStyles(({ css, token, responsive }) => ({
container: css`
position: relative;
padding-top: 20px;
padding-bottom: 20px;
border-radius: ${token.borderRadius}px;
${responsive.mobile} {
border-radius: 0;
}
`,
}));

Expand Down
4 changes: 3 additions & 1 deletion src/app/settings/features/SideBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ const SideBar = memo(() => {
</div>
</Flexbox>
<UpgradeAlert />
<List />
<Flexbox gap={2} style={{ paddingInline: 6 }}>
<List />
</Flexbox>
</DraggablePanelBody>
</FolderPanel>
);
Expand Down
1 change: 1 addition & 0 deletions src/const/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { INBOX_SESSION_ID } from './session';
export const GITHUB = pkg.homepage;
export const CHANGELOG = urlJoin(GITHUB, 'blob/master/CHANGELOG.md');
export const WIKI = urlJoin(GITHUB, 'wiki');
export const WIKI_PLUGIN_GUIDE = urlJoin(WIKI, 'Plugin-Development');
export const ABOUT = pkg.homepage;
export const FEEDBACK = pkg.bugs.url;
export const DISCORD = 'https://discord.gg/AYFPHvv2jT';
Expand Down
48 changes: 22 additions & 26 deletions src/features/AgentSetting/AgentPlugin/MarketList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,17 @@ const MarketList = memo(() => {
{
children: isEmpty ? loadingList : [...deprecatedList, ...customList, ...list],
extra: (
<Flexbox align={'center'} gap={8} horizontal>
<Space.Compact style={{ width: 'auto' }}>
<Button
icon={<Icon icon={LucideBlocks} />}
onClick={(e) => {
e.stopPropagation();
setModal(true);
}}
size={'small'}
>
{t('settingPlugin.addTooltip')}
</Button>
{hasDeprecated ? (
<Tooltip title={t('settingPlugin.clearDeprecated')}>
<Button
Expand All @@ -193,34 +203,20 @@ const MarketList = memo(() => {
}
}}
size={'small'}
type={'text'}
/>
</Tooltip>
) : null}

<Space.Compact style={{ width: 'auto' }}>
<Tooltip title={t('settingPlugin.addTooltip')}>
<Button
icon={<Icon icon={LucideBlocks} />}
onClick={(e) => {
e.stopPropagation();
setModal(true);
}}
size={'small'}
/>
</Tooltip>
<Tooltip title={t('settingPlugin.settings')}>
<Button
icon={<Icon icon={LucideSettings} />}
onClick={(e) => {
e.stopPropagation();
setShowSettings(true);
}}
size={'small'}
/>
</Tooltip>
</Space.Compact>
</Flexbox>
<Tooltip title={t('settingPlugin.settings')}>
<Button
icon={<Icon icon={LucideSettings} />}
onClick={(e) => {
e.stopPropagation();
setShowSettings(true);
}}
size={'small'}
/>
</Tooltip>
</Space.Compact>
),
icon: LucideStore,
title: t('settingPlugin.title'),
Expand Down
11 changes: 9 additions & 2 deletions src/features/AgentSetting/AgentPlugin/MarketSettingModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';

import MobilePadding from '@/components/MobilePadding';
import { PLUGINS_INDEX_URL } from '@/const/url';
import { PLUGINS_INDEX_URL, WIKI_PLUGIN_GUIDE } from '@/const/url';

interface MarketSettingModalProps {
onOpenChange: (open: boolean) => void;
Expand Down Expand Up @@ -34,7 +34,14 @@ const MarketSettingModal = memo<MarketSettingModalProps>(({ open, onOpenChange }
style={{ width: '100%' }}
/>
),
desc: t('settings.modalDesc'),
desc: (
<>
{t('dev.modalDesc')}
<a href={WIKI_PLUGIN_GUIDE} rel="noreferrer" target={'_blank'}>
{WIKI_PLUGIN_GUIDE}
</a>
</>
),
label: t('settings.indexUrl.title'),
},
],
Expand Down
14 changes: 13 additions & 1 deletion src/features/PluginDevModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';

import MobilePadding from '@/components/MobilePadding';
import { WIKI_PLUGIN_GUIDE } from '@/const/url';
import { CustomPlugin } from '@/types/plugin';

import ManifestForm from './ManifestForm';
Expand Down Expand Up @@ -102,7 +103,18 @@ const DevModal = memo<DevModalProps>(
>
<Flexbox gap={mobile ? 0 : 16}>
<MobilePadding bottom={0} gap={16}>
<Alert message={t('dev.modalDesc')} showIcon type={'info'} />
<Alert
message={
<>
{t('dev.modalDesc')}
<a href={WIKI_PLUGIN_GUIDE} rel="noreferrer" target={'_blank'}>
{WIKI_PLUGIN_GUIDE}
</a>
</>
}
showIcon
type={'info'}
/>
{/*<Tabs*/}
{/* items={[*/}
{/* { children: <MetaForm />, key: 'meta', label: t('dev.tabs.meta') },*/}
Expand Down

0 comments on commit 44a5f0a

Please sign in to comment.