mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00
Fix navbar (#2273)
* fix: phone navbar cannot scroll; fix: file uplaod process error * perf: select repeat file
This commit is contained in:
@@ -45,50 +45,51 @@ const LightRowTabs = <ValueType = string,>({
|
||||
}, [size]);
|
||||
|
||||
return (
|
||||
<Grid
|
||||
gridTemplateColumns={`repeat(${list.length},1fr)`}
|
||||
p={sizeMap.outP}
|
||||
borderRadius={'sm'}
|
||||
fontSize={sizeMap.fontSize}
|
||||
overflowX={'auto'}
|
||||
userSelect={'none'}
|
||||
display={'inline-grid'}
|
||||
{...props}
|
||||
>
|
||||
{list.map((item) => (
|
||||
<Flex
|
||||
key={item.value as string}
|
||||
py={sizeMap.inlineP}
|
||||
alignItems={'center'}
|
||||
justifyContent={'center'}
|
||||
borderBottom={'2px solid transparent'}
|
||||
px={3}
|
||||
whiteSpace={'nowrap'}
|
||||
{...inlineStyles}
|
||||
{...(value === item.value
|
||||
? {
|
||||
color: 'primary.600',
|
||||
cursor: 'default',
|
||||
fontWeight: 'bold',
|
||||
borderBottomColor: 'primary.600'
|
||||
}
|
||||
: {
|
||||
cursor: 'pointer'
|
||||
})}
|
||||
onClick={() => {
|
||||
if (value === item.value) return;
|
||||
onChange(item.value);
|
||||
}}
|
||||
>
|
||||
{item.icon && (
|
||||
<>
|
||||
<Avatar src={item.icon} alt={''} w={'1.25rem'} borderRadius={'sm'} />
|
||||
</>
|
||||
)}
|
||||
<Box ml={1}>{typeof item.label === 'string' ? t(item.label as any) : item.label}</Box>
|
||||
</Flex>
|
||||
))}
|
||||
</Grid>
|
||||
<Box overflow={'auto'}>
|
||||
<Grid
|
||||
gridTemplateColumns={`repeat(${list.length},1fr)`}
|
||||
p={sizeMap.outP}
|
||||
borderRadius={'sm'}
|
||||
fontSize={sizeMap.fontSize}
|
||||
userSelect={'none'}
|
||||
display={'inline-grid'}
|
||||
{...props}
|
||||
>
|
||||
{list.map((item) => (
|
||||
<Flex
|
||||
key={item.value as string}
|
||||
py={sizeMap.inlineP}
|
||||
alignItems={'center'}
|
||||
justifyContent={'center'}
|
||||
borderBottom={'2px solid transparent'}
|
||||
px={3}
|
||||
whiteSpace={'nowrap'}
|
||||
{...inlineStyles}
|
||||
{...(value === item.value
|
||||
? {
|
||||
color: 'primary.600',
|
||||
cursor: 'default',
|
||||
fontWeight: 'bold',
|
||||
borderBottomColor: 'primary.600'
|
||||
}
|
||||
: {
|
||||
cursor: 'pointer'
|
||||
})}
|
||||
onClick={() => {
|
||||
if (value === item.value) return;
|
||||
onChange(item.value);
|
||||
}}
|
||||
>
|
||||
{item.icon && (
|
||||
<>
|
||||
<Avatar src={item.icon} alt={''} w={'1.25rem'} borderRadius={'sm'} />
|
||||
</>
|
||||
)}
|
||||
<Box ml={1}>{typeof item.label === 'string' ? t(item.label as any) : item.label}</Box>
|
||||
</Flex>
|
||||
))}
|
||||
</Grid>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user