@bbki.ng/site 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/package.json +2 -2
- package/src/app.tsx +3 -2
- package/src/components/Footer.tsx +26 -0
- package/src/components/index.tsx +10 -1
- package/src/global_loading_state_provider.tsx +0 -5
- package/src/pages/cover/index.tsx +2 -1
- package/src/pages/extensions/png/index.tsx +2 -2
- package/src/pages/extensions/png/png_projects.tsx +0 -5
- package/src/pages/extensions/txt/index.tsx +13 -5
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bbki.ng/site",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "code behind bbki.ng",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"url": "git+https://github.com/bbbottle/bbki.ng.git"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@bbki.ng/components": "workspace:2.1.
|
|
19
|
+
"@bbki.ng/components": "workspace:2.1.34",
|
|
20
20
|
"@supabase/supabase-js": "^1.30.6",
|
|
21
21
|
"classnames": "2.3.1",
|
|
22
22
|
"react": "^18.0.0",
|
package/src/app.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
2
|
import { Routes, Route, Outlet } from "react-router-dom";
|
|
3
|
-
import { Nav, Page, NotFound } from "@bbki.ng/components";
|
|
3
|
+
import { Nav, Page, NotFound, Link } from "@bbki.ng/components";
|
|
4
4
|
import { HotKeyNav, Stickers } from "./components";
|
|
5
5
|
import { threeColWrapper } from "@/components/with_wrapper";
|
|
6
6
|
import { Cover } from "./pages";
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
GlobalLoadingStateProvider,
|
|
22
22
|
} from "@/global_loading_state_provider";
|
|
23
23
|
import { UploadPage } from "@/pages/upload";
|
|
24
|
+
import { Footer } from "@/components/Footer";
|
|
24
25
|
|
|
25
26
|
const Layout = () => {
|
|
26
27
|
const { isLoading } = useContext(GlobalLoadingContext);
|
|
@@ -31,7 +32,7 @@ const Layout = () => {
|
|
|
31
32
|
<Nav paths={usePaths()} className="blur-cover" loading={isLoading} />
|
|
32
33
|
}
|
|
33
34
|
main={<Outlet />}
|
|
34
|
-
footer={
|
|
35
|
+
footer={<Footer />}
|
|
35
36
|
/>
|
|
36
37
|
</>
|
|
37
38
|
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { Link } from "@bbki.ng/components";
|
|
3
|
+
import { useLocation } from "react-router-dom";
|
|
4
|
+
import { usePaths } from "@/hooks";
|
|
5
|
+
import { GlobalLoadingContext } from "@/global_loading_state_provider";
|
|
6
|
+
|
|
7
|
+
export const Footer = () => {
|
|
8
|
+
const location = useLocation();
|
|
9
|
+
const isRoot = location.pathname === "/";
|
|
10
|
+
const { isLoading } = useContext(GlobalLoadingContext);
|
|
11
|
+
|
|
12
|
+
if (isRoot || isLoading) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const paths = usePaths();
|
|
17
|
+
const prevPath = paths[paths.length - 2];
|
|
18
|
+
|
|
19
|
+
return (
|
|
20
|
+
<div className="w-full flex justify-center md:hidden">
|
|
21
|
+
<Link to={prevPath.path || ""} className="text-center">
|
|
22
|
+
cd ..
|
|
23
|
+
</Link>
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
26
|
+
};
|
package/src/components/index.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { LinkList } from "@bbki.ng/components";
|
|
2
3
|
|
|
3
4
|
export { DisabledText, SmallDisabledText } from "./disabled_text";
|
|
4
5
|
|
|
@@ -25,3 +26,11 @@ export { Tags } from "./tags";
|
|
|
25
26
|
export { Comment } from "./comment";
|
|
26
27
|
|
|
27
28
|
export { MySuspense } from "./my_suspense";
|
|
29
|
+
|
|
30
|
+
export const CenterLinkList = (props: any) => {
|
|
31
|
+
return (
|
|
32
|
+
<div className="flex justify-center pr-32">
|
|
33
|
+
<LinkList {...props} />
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -20,11 +20,6 @@ export const GlobalLoadingContext = createContext<LoadingContext>({
|
|
|
20
20
|
|
|
21
21
|
export const GlobalLoadingStateProvider = (props: { children: ReactNode }) => {
|
|
22
22
|
const [isLoading, setIsLoading] = useState(false);
|
|
23
|
-
const location = useLocation();
|
|
24
|
-
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
setIsLoading(false);
|
|
27
|
-
}, [location.pathname]);
|
|
28
23
|
|
|
29
24
|
return (
|
|
30
25
|
<GlobalLoadingContext.Provider value={{ isLoading, setIsLoading }}>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { LinkList } from "@bbki.ng/components";
|
|
3
|
+
import { CenterLinkList } from "@/components";
|
|
3
4
|
|
|
4
5
|
export const Cover = (props: { className: string }) => {
|
|
5
6
|
return (
|
|
6
|
-
<
|
|
7
|
+
<CenterLinkList
|
|
7
8
|
links={[
|
|
8
9
|
{
|
|
9
10
|
to: "/projects",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { useProjects } from "@/hooks/use_projects";
|
|
3
3
|
import { Link, Gallery, ImageRenderer, LinkList } from "@bbki.ng/components";
|
|
4
|
-
import { MySuspense } from "@/components";
|
|
4
|
+
import { CenterLinkList, MySuspense } from "@/components";
|
|
5
5
|
|
|
6
6
|
const Projects = () => {
|
|
7
7
|
const { projects } = useProjects("", true);
|
|
@@ -11,7 +11,7 @@ const Projects = () => {
|
|
|
11
11
|
name: p.name,
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
|
-
return <
|
|
14
|
+
return <CenterLinkList links={links} title=" " />;
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
export default () => {
|
|
@@ -30,11 +30,6 @@ const ProjectDetail = () => {
|
|
|
30
30
|
<Gallery images={projects.images.map(imageFormatter)}>
|
|
31
31
|
{renderUploader()}
|
|
32
32
|
</Gallery>
|
|
33
|
-
<div className="w-full flex justify-center">
|
|
34
|
-
<Link to="/projects" className="w-full py-32 md:hidden text-center">
|
|
35
|
-
cd ..
|
|
36
|
-
</Link>
|
|
37
|
-
</div>
|
|
38
33
|
</>
|
|
39
34
|
);
|
|
40
35
|
};
|
|
@@ -3,6 +3,7 @@ import { ArticleList } from "./consts";
|
|
|
3
3
|
import { LinkList, LinkProps } from "@bbki.ng/components";
|
|
4
4
|
import { useRouteName } from "@/hooks";
|
|
5
5
|
import { usePosts } from "@/hooks/use_posts";
|
|
6
|
+
import { CenterLinkList } from "@/components";
|
|
6
7
|
|
|
7
8
|
type TxtProps = {
|
|
8
9
|
title?: string;
|
|
@@ -13,10 +14,17 @@ export default (props: TxtProps) => {
|
|
|
13
14
|
const name = useRouteName();
|
|
14
15
|
const { titleList, isLoading, isError } = usePosts();
|
|
15
16
|
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
if (isLoading) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
if (isError) {
|
|
22
|
+
return (
|
|
23
|
+
<CenterLinkList links={props.articleList || ArticleList} title=" " />
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const links = [...ArticleList, ...titleList];
|
|
28
|
+
|
|
29
|
+
return <CenterLinkList links={props.articleList || links} title=" " />;
|
|
22
30
|
};
|