chore: update left nav icons

This commit is contained in:
zerosoul
2022-05-31 10:53:39 +08:00
parent dbffe6fb4b
commit 9906bebddf
15 changed files with 615 additions and 576 deletions
+30 -29
View File
@@ -1,8 +1,9 @@
// import { useRef, useEffect } from "react";
import { useRef, useEffect } from "react";
import styled from "styled-components";
import { Waveform } from "@uiball/loaders";
const Styled = styled.div`
margin-top: 80px;
display: flex;
justify-content: center;
align-items: center;
@@ -10,35 +11,35 @@ const Styled = styled.div`
padding: 30px 0;
/* background-color: #eee; */
`;
export default function LoadMore() {
// const ref = useRef(undefined);
// useEffect(() => {
// const observer = new IntersectionObserver(
// (entries) => {
// entries.forEach((entry) => {
// const intersecting = entry.isIntersecting;
// // const currEle = entry.target;
// if (intersecting && loadMore) {
// // load more
// console.log("inview");
// loadMore();
// }
// });
// },
// { threshold: 0 }
// );
// const currEle = ref?.current;
// if (currEle) {
// observer.observe(ref.current);
// }
// return () => {
// if (currEle) {
// observer.unobserve(currEle);
// }
// };
// }, [ref]);
export default function LoadMore({ pullDown = null }) {
const ref = useRef(undefined);
useEffect(() => {
const observer = new IntersectionObserver(
(entries) => {
entries.forEach((entry) => {
const intersecting = entry.isIntersecting;
// const currEle = entry.target;
if (intersecting && pullDown) {
// load more
console.log("inview");
pullDown();
}
});
},
{ threshold: 0 }
);
const currEle = ref?.current;
if (currEle) {
observer.observe(ref.current);
}
return () => {
if (currEle) {
observer.unobserve(currEle);
}
};
}, [ref, pullDown]);
return (
<Styled>
<Styled ref={ref}>
<Waveform
className="loading"
size={24}
+2 -2
View File
@@ -76,7 +76,7 @@ export default function HomePage() {
</NavLink>
<NavLink className="link" to={"/favs"}>
<Tooltip tip="Favorites">
<FavIcon className="fav" />
<FavIcon />
</Tooltip>
</NavLink>
<NavLink className="link" to={"/files"}>
@@ -85,7 +85,7 @@ export default function HomePage() {
</Tooltip>
</NavLink>
</nav>
<div className="divider"></div>
{/* <div className="divider"></div> */}
<Menu />
</div>
<div className="col right">
+4 -6
View File
@@ -32,27 +32,25 @@ const StyledWrapper = styled.div`
display: flex;
flex-direction: column;
gap: 4px;
padding: 24px 8px 10px 8px;
padding: 24px 12px;
.link {
display: flex;
align-items: center;
gap: 10px;
text-decoration: none;
padding: 8px;
padding: 8px 12px;
font-weight: 600;
font-size: 14px;
line-height: 20px;
color: #4b5563;
border-radius: 8px;
svg.fav path {
fill: #344054;
}
&:hover {
background-color: rgba(0, 0, 0, 0.08);
}
&.active {
background-color: #55c7ec;
svg path {
fill: #55c7ec;
fill: #fff;
}
}
}