Commit e2ca301c by Finley Ge Committed by GitHub

perf(marketplace): unify tool grid columns (#7278)

parent 051a9f21
......@@ -46,6 +46,8 @@ import { useToast } from '@fastgpt/web/hooks/useToast';
type QueryValue = string | string[] | undefined;
type QueryRecord = Record<string, QueryValue>;
const TOOL_GRID_TEMPLATE_COLUMNS =
'repeat(auto-fill, minmax(min(max(260px, calc((100% - 6.25rem) / 6)), 100%), 1fr))';
const getComparableQueryValue = (value: QueryValue) =>
Array.isArray(value) ? value.join('\0') : (value ?? '');
......@@ -867,7 +869,7 @@ const ToolkitMarketplace = ({ marketplaceUrl }: { marketplaceUrl: string }) => {
</Flex>
{displayTools.length > 0 ? (
<Grid
gridTemplateColumns={'repeat(auto-fill, minmax(min(260px, 100%), 1fr))'}
gridTemplateColumns={TOOL_GRID_TEMPLATE_COLUMNS}
gridGap={5}
alignItems={'stretch'}
>
......
......@@ -65,6 +65,8 @@ const isSameBrowserUrl = (nextUrl: string) => {
targetUrl.pathname === window.location.pathname && targetUrl.search === window.location.search
);
};
const TOOL_GRID_TEMPLATE_COLUMNS =
'repeat(auto-fill, minmax(min(max(260px, calc((100% - 6.25rem) / 6)), 100%), 1fr))';
const ToolkitMarketplace = () => {
const { t, i18n } = useTranslation();
......@@ -626,7 +628,7 @@ const ToolkitMarketplace = () => {
{displayTools.length > 0 ? (
<Grid
ref={gridRef}
gridTemplateColumns={'repeat(auto-fill, minmax(min(260px, 100%), 1fr))'}
gridTemplateColumns={TOOL_GRID_TEMPLATE_COLUMNS}
gridGap={5}
alignItems={'stretch'}
>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment