diff --git a/pdf/getting-started-with-vector-databases-introduction-to-milvus.pdf b/pdf/getting-started-with-vector-databases-introduction-to-milvus.pdf index 65398c5..b9f491f 100644 Binary files a/pdf/getting-started-with-vector-databases-introduction-to-milvus.pdf and b/pdf/getting-started-with-vector-databases-introduction-to-milvus.pdf differ diff --git a/pdf/getting-started-with-vector-databases-introduction-to-unstructured-data.pdf b/pdf/getting-started-with-vector-databases-introduction-to-unstructured-data.pdf index 9142835..35b61fc 100644 Binary files a/pdf/getting-started-with-vector-databases-introduction-to-unstructured-data.pdf and b/pdf/getting-started-with-vector-databases-introduction-to-unstructured-data.pdf differ diff --git a/pdf/getting-started-with-vector-databases-introduction-to-vector-similarity-search.pdf b/pdf/getting-started-with-vector-databases-introduction-to-vector-similarity-search.pdf index dc01349..61612fd 100644 Binary files a/pdf/getting-started-with-vector-databases-introduction-to-vector-similarity-search.pdf and b/pdf/getting-started-with-vector-databases-introduction-to-vector-similarity-search.pdf differ diff --git a/pdf/getting-started-with-vector-databases-milvus-quickstart.pdf b/pdf/getting-started-with-vector-databases-milvus-quickstart.pdf index 52593dc..002e9ad 100644 Binary files a/pdf/getting-started-with-vector-databases-milvus-quickstart.pdf and b/pdf/getting-started-with-vector-databases-milvus-quickstart.pdf differ diff --git a/pdf/getting-started-with-vector-databases-what-is-a-vector-database.pdf b/pdf/getting-started-with-vector-databases-what-is-a-vector-database.pdf index f93c604..b6fff9a 100644 Binary files a/pdf/getting-started-with-vector-databases-what-is-a-vector-database.pdf and b/pdf/getting-started-with-vector-databases-what-is-a-vector-database.pdf differ diff --git a/src/components/commonComponents/githubButton/icons.jsx b/src/components/commonComponents/githubButton/icons.jsx new file mode 100644 index 0000000..b4db648 --- /dev/null +++ b/src/components/commonComponents/githubButton/icons.jsx @@ -0,0 +1,33 @@ +import React from 'react'; + +export const Fork = () => ( + +); + +export const Star = () => ( + +); diff --git a/src/components/commonComponents/githubButton/index.jsx b/src/components/commonComponents/githubButton/index.jsx index 66f2ce4..61e96c8 100644 --- a/src/components/commonComponents/githubButton/index.jsx +++ b/src/components/commonComponents/githubButton/index.jsx @@ -1,32 +1,8 @@ import React from 'react'; -import Divider from '@mui/material/Divider'; import * as styles from './index.module.less'; - -const ForkIcon = () => ( - - - -); - -const GitHubIcon = () => ( - - - -); +import { useMemo } from 'react'; +import { Star, Fork } from './icons'; +import clsx from 'clsx'; const GitHubButton = ({ type = 'star', // star or fork @@ -36,23 +12,43 @@ const GitHubButton = ({ stat, }) => { const isStar = type === 'star'; + const link = isStar ? href : `${href}/fork`; + + const Icon = isStar ? Star : Fork; + + const formatNum = num => { + return num >= 1000 ? `${Math.round(num / 100) / 10}k` : num; + }; - const sublink = isStar ? `${href}/stargazers` : `${href}/network/members`; + const stats = useMemo(() => { + const stars = stat.star; + const forks = stat.forks; + + return { + star: formatNum(stars), + fork: formatNum(forks), + }; + }, [stat]); return (
- - {isStar ? : } - {children} - - - {isStar ? stat.star : stat.forks} + + + + + {children} + + {isStar ? stats.star : stats.fork}
); diff --git a/src/components/commonComponents/githubButton/index.module.less b/src/components/commonComponents/githubButton/index.module.less index bbe6afc..8eb0695 100644 --- a/src/components/commonComponents/githubButton/index.module.less +++ b/src/components/commonComponents/githubButton/index.module.less @@ -2,53 +2,57 @@ .gitBtnWrapper { color: #000; - background: linear-gradient(0deg, #f8f8f8, #f8f8f8); - border: 1px solid #f2f2f2; - border-radius: 4px; + background: #fff; + border: 1px solid rgba(27, 31, 36, 0.15); + border-radius: 6px; display: flex; height: 30px; margin-right: 20px; - font-family: 'Inter'; - - svg { - width: 20px; - height: 20px; - } + padding: 3px 12px; + display: flex; + align-items: center; + box-sizing: border-box; .link { align-items: center; border-radius: 4px; color: #000; display: flex; - font-size: 16px; + font-size: 12px; line-height: 20px; - padding: 10px; text-decoration: none; - font-family: 'Inter'; + .hover; .iconWrapper { - font-size: 20px; margin-right: 8px; + display: inline-block; + font-size: 0; + line-height: 0; + } + + .starIcon > svg > path { + fill: #eac54f; + // background-color: #eac54f; } .iconText { + font-weight: 600; + @media @desktop1024, @tablet { display: none; } } - - line-height: 18px; - font-size: 14px; } - .num { - font-weight: bold; - justify-content: center; - - .stat { - min-width: 40px; - text-align: center; - } + .stat { + font-weight: 600; + margin-left: 6px; + min-width: 20px; + text-align: center; + padding: 0 6px; + display: inline-block; + background: rgba(27, 31, 36, 0.08); + border-radius: 2em; } } diff --git a/src/components/commonComponents/header/index.jsx b/src/components/commonComponents/header/index.jsx index 86967ea..dcc83d6 100644 --- a/src/components/commonComponents/header/index.jsx +++ b/src/components/commonComponents/header/index.jsx @@ -177,9 +177,9 @@ const Header = ({ darkMode = false, className = '' }) => { - Forks + Fork diff --git a/src/components/commonComponents/http/index.js b/src/components/commonComponents/http/index.js index 4658359..fa09e8a 100644 --- a/src/components/commonComponents/http/index.js +++ b/src/components/commonComponents/http/index.js @@ -1,8 +1,6 @@ import axios from 'axios'; import { decode } from 'js-base64'; -const encryptedToken = 'Z2hwX3VhVlZqSXo2eUlPcWd1S0hDT2lwQk10dkZtYjhFVzFBeTAyWQ=='; - const axiosInstance = axios.create({ baseURL: 'https://api.github.com/repos', timeout: 10000, @@ -18,14 +16,9 @@ axiosInstance.interceptors.request.use( } ); - export const getGithubStatis = async () => { try { - const res = await axiosInstance.get(`/milvus-io/milvus`, { - headers: { - Authorization: decode(encryptedToken) - } - }); + const res = await axiosInstance.get(`/milvus-io/milvus`); return res.data; } catch (error) { console.log(error);