@bbki.ng/site 1.0.12 → 1.0.14

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 CHANGED
@@ -1,5 +1,9 @@
1
1
  # @bbki.ng/site
2
2
 
3
+ ## 1.0.14
4
+
5
+ ## 1.0.13
6
+
3
7
  ## 1.0.12
4
8
 
5
9
  ## 1.0.11
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bbki.ng/site",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
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.31",
19
+ "@bbki.ng/components": "workspace:2.1.32",
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
@@ -39,6 +39,7 @@ const Layout = () => {
39
39
 
40
40
  const NowInMidCol = threeColWrapper(NowPage);
41
41
  const ContentInMidCol = threeColWrapper(Txt);
42
+ const ProjectsInMidCol = threeColWrapper(Png);
42
43
  const ArticleInMidCol = threeColWrapper(ArticlePage);
43
44
  const TagsInMidCol = threeColWrapper(Tags);
44
45
  const LoginInMidCol = threeColWrapper(Login);
@@ -55,7 +56,7 @@ export const App = () => {
55
56
  <Route path="/" element={<Layout />}>
56
57
  <Route index element={<CoverInMidCol />} />
57
58
 
58
- <Route path="/projects" element={<Png />} />
59
+ <Route path="/projects" element={<ProjectsInMidCol />} />
59
60
  <Route path="/projects/:id" element={<PhotoProjects />} />
60
61
 
61
62
  <Route path="blog" element={<ContentInMidCol />} />
@@ -1,15 +1,17 @@
1
1
  import React from "react";
2
2
  import { FunctionComponent } from "react";
3
3
  import { ArticlePage } from "@/components/article";
4
- import { ThreeColLayout, ErrorBoundary } from "@bbki.ng/components";
4
+ import { ThreeColLayout, ErrorBoundary, Link } from "@bbki.ng/components";
5
5
 
6
6
  export const withArticleWrapper =
7
7
  (Component: FunctionComponent<any>): FunctionComponent<any> =>
8
8
  (props: any) => {
9
9
  return (
10
- <ArticlePage {...props}>
11
- <Component />
12
- </ArticlePage>
10
+ <>
11
+ <ArticlePage {...props}>
12
+ <Component />
13
+ </ArticlePage>
14
+ </>
13
15
  );
14
16
  };
15
17
 
@@ -7,14 +7,14 @@ export const Cover = (props: { className: string }) => {
7
7
  links={[
8
8
  {
9
9
  to: "/projects",
10
- name: "cd /projects",
10
+ name: "cd ./projects",
11
11
  },
12
12
  {
13
13
  to: "/blog",
14
- name: "cd /posts",
14
+ name: "ls *.md",
15
15
  },
16
16
  ]}
17
- title="history"
17
+ title=" "
18
18
  />
19
19
  );
20
20
  };
@@ -1,35 +1,17 @@
1
- import React, { useCallback, useEffect } from "react";
2
- import classnames from "classnames";
1
+ import React from "react";
3
2
  import { useProjects } from "@/hooks/use_projects";
4
- import { Link, Gallery, ImageRenderer } from "@bbki.ng/components";
3
+ import { Link, Gallery, ImageRenderer, LinkList } from "@bbki.ng/components";
5
4
  import { MySuspense } from "@/components";
6
- import { imageFormatter } from "@/utils";
7
5
 
8
6
  const Projects = () => {
9
7
  const { projects } = useProjects("", true);
10
- const renderImage: ImageRenderer = useCallback(
11
- (img, index, col) => {
12
- const project = projects[index];
13
- return (
14
- <div
15
- className={classnames("mb-128", {
16
- "md:mr-64": col === 0,
17
- "md:ml-64": col !== 0,
18
- })}
19
- >
20
- <Link to={`/projects/${project.name}`}>{img}</Link>
21
- </div>
22
- );
23
- },
24
- [projects]
25
- );
26
8
 
27
- return (
28
- <Gallery
29
- images={projects.map((p: any) => p.cover).map(imageFormatter)}
30
- imageRenderer={renderImage}
31
- />
32
- );
9
+ const links = projects.map((p: any) => ({
10
+ to: `/projects/${p.name}`,
11
+ name: p.name,
12
+ }));
13
+
14
+ return <LinkList links={links} title="图片" />;
33
15
  };
34
16
 
35
17
  export default () => {
@@ -3,7 +3,7 @@ import { MySuspense } from "@/components";
3
3
  import { useParams } from "react-router-dom";
4
4
  import { useProjects } from "@/hooks/use_projects";
5
5
  import { imageFormatter } from "@/utils";
6
- import { Gallery, Nav } from "@bbki.ng/components";
6
+ import { Gallery, Nav, Link } from "@bbki.ng/components";
7
7
  import { usePaths } from "@/hooks";
8
8
  import { ImageUploader } from "@/components/ImageUploader";
9
9
 
@@ -30,7 +30,11 @@ const ProjectDetail = () => {
30
30
  <Gallery images={projects.images.map(imageFormatter)}>
31
31
  {renderUploader()}
32
32
  </Gallery>
33
- <Nav paths={usePaths()} mini className="justify-center py-32 md:hidden" />
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>
34
38
  </>
35
39
  );
36
40
  };
@@ -2,7 +2,7 @@ import React, { ReactElement } from "react";
2
2
  import { MdxArticleList } from "@/articles";
3
3
  import { withArticleWrapper } from "@/components";
4
4
  import { MdxArticle } from "@/types/articles";
5
- import { Article, NotFound } from "@bbki.ng/components";
5
+ import { NotFound, Link } from "@bbki.ng/components";
6
6
  import { useParams } from "react-router-dom";
7
7
  import { usePosts } from "@/hooks/use_posts";
8
8
  import { ArticlePage } from "@/components/article";