Skip to content

Commit

Permalink
💄 style(custom): 顶部固定
Browse files Browse the repository at this point in the history
  • Loading branch information
master1lan committed Feb 28, 2023
1 parent deeebb4 commit e6d0048
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/routers/layout/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function Header() {

const ReactiveHeader = memo(() => {
return (
<header className='border-t-2 relative z-10 max-md:border-b-2'>
<header className='border-t-2 z-10 max-md:border-b-2 sticky top-0 bg-white'>
{/* 手机端 */}
<div className='hidden max-sm:flex px-6 pt-2'>
<Search />
Expand Down
1 change: 1 addition & 0 deletions src/routers/layout/search/pc/pc.module.less
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
overflow: hidden;
text-overflow: ellipsis;
max-width: 75px;
white-space: nowrap;
}

span+input {
Expand Down
60 changes: 33 additions & 27 deletions src/routers/video/masonry.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,33 +125,39 @@ export const NormalVideoRes: FC<{
loading: boolean;
isEmpty: boolean;
data: VideoListType;
}> = ({ loading, isEmpty, data }) => (
<Grid
container
spacing={{
lg: 2,
md: 1,
sm: 1,
xs: 1,
}}
rowSpacing={2}
columns={{
lg: 10,
md: 8,
sm: 6,
xs: 4,
}}
>
{loading ? (
<LoadingItems />
) : isEmpty ? (
<EmptyItem />
) : (
data.map((item) => <MemoItems key={item.id} {...item} />)
)}
</Grid>
);

}> = ({ loading, isEmpty, data }) => {
useEffect(() => {
if (loading) {
window.scrollTo({ top: 0 });
}
}, [loading]);
return (
<Grid
container
spacing={{
lg: 2,
md: 1,
sm: 1,
xs: 1,
}}
rowSpacing={2}
columns={{
lg: 10,
md: 8,
sm: 6,
xs: 4,
}}
>
{loading ? (
<LoadingItems />
) : isEmpty ? (
<EmptyItem />
) : (
data.map((item) => <MemoItems key={item.id} {...item} />)
)}
</Grid>
);
};
const EmptyItem = () => (
<div className='text-gray-500 ml-auto mr-auto'>暂无数据</div>
);
Expand Down

0 comments on commit e6d0048

Please sign in to comment.