Skip to content

Commit

Permalink
Merge pull request #180 from lobehub/platform-optimize
Browse files Browse the repository at this point in the history
fix: tabs scroll problem
  • Loading branch information
rdmclin2 authored Dec 4, 2024
2 parents 66646e5 + 35cc781 commit 51d77ee
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 31 deletions.
41 changes: 20 additions & 21 deletions src/app/discover/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ const useStyles = createStyles(({ css, token }) => ({
background-color: rgba(255, 255, 255, 2%);
border-radius: ${token.borderRadius}px;
`,
header: css`
padding: ${token.padding}px ${token.paddingSM}px;
searchBar: css`
margin-top: ${token.margin}px;
padding-inline: ${token.paddingSM}px;
`,
tabsNav: css`
padding-inline: ${token.paddingSM}px;
`,
list: css`
overflow-y: scroll;
Expand Down Expand Up @@ -72,25 +76,20 @@ const AgentList = (props: AgentListProps) => {

return (
<Flexbox className={classNames(className, styles.container)} style={style}>
<Flexbox
className={styles.header}
gap={16}
direction="horizontal"
align="center"
justify="space-between"
>
<TabsNav
activeKey={activeCategory}
items={CATEGORIES}
onChange={(key) => setActiveCategory(key)}
/>
<SearchBar
placeholder={t('search', { ns: 'common' })}
value={searchKeyword}
onChange={(e) => setSearchKeyword(e.target.value)}
allowClear
/>
</Flexbox>
<SearchBar
placeholder={t('search', { ns: 'common' })}
value={searchKeyword}
className={styles.searchBar}
onChange={(e) => setSearchKeyword(e.target.value)}
allowClear
/>

<TabsNav
activeKey={activeCategory}
items={CATEGORIES}
className={styles.tabsNav}
onChange={(key) => setActiveCategory(key)}
/>

{loading ? (
<SkeletonList count={6} />
Expand Down
4 changes: 3 additions & 1 deletion src/app/role/RoleEdit/style.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { createStyles } from 'antd-style';

export const useStyles = createStyles(({ css }) => ({
container: css``,
container: css`
width: 100%;
`,
}));
13 changes: 4 additions & 9 deletions src/app/role/style.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
import { createStyles } from 'antd-style';

import { ROLE_VIEWER_WIDTH } from '@/constants/common';

export const useStyles = createStyles(({ css, cx }) => ({
export const useStyles = createStyles(({ css, cx, token }) => ({
preview: cx(
'role-preview',
css`
overflow: auto;
overflow: scroll;
width: 100%;
padding: 0 12px;
height: 100%;
padding: 0 ${token.paddingSM}px;
`,
),
container: css`
width: 1024px;
height: 100%;
margin: 0 auto;
`,
model: css`
width: ${ROLE_VIEWER_WIDTH}px;
height: 100%;
`,
}));

0 comments on commit 51d77ee

Please sign in to comment.