Latest Highlight:
+ + Highlights feed +- - {highlights[currentPage]?.title} - -
- - -- {highlights[currentPage]?.highlight} -
- -diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index adebdcd0..6edbf379 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -15,7 +15,8 @@ "react-chrome-extension-router": "^1.4.0", "react-dom": "^18.0.0", "react-hot-toast": "^2.4.1", - "react-icons": "^4.8.0" + "react-icons": "^4.8.0", + "swiper": "^9.4.0" }, "devDependencies": { "@crxjs/vite-plugin": "^1.0.14", @@ -5995,6 +5996,11 @@ "deprecated": "Please use @jridgewell/sourcemap-codec instead", "dev": true }, + "node_modules/ssr-window": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/ssr-window/-/ssr-window-4.0.2.tgz", + "integrity": "sha512-ISv/Ch+ig7SOtw7G2+qkwfVASzazUnvlDTwypdLoPoySv+6MqlOV10VwPSE6EWkGjhW50lUmghPmpYZXMu/+AQ==" + }, "node_modules/stackback": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/stackback/-/stackback-0.0.2.tgz", @@ -6205,6 +6211,27 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/swiper": { + "version": "9.4.0", + "resolved": "https://registry.npmjs.org/swiper/-/swiper-9.4.0.tgz", + "integrity": "sha512-AKame5qkFnNKCJ8Bfn3YuOi/LoUuAESVdCv/BJH5fKgdAUFRtImZXV3gdYlYovXbasJDV6hHNWdQvdzPB6aebw==", + "funding": [ + { + "type": "patreon", + "url": "https://www.patreon.com/swiperjs" + }, + { + "type": "open_collective", + "url": "http://opencollective.com/swiper" + } + ], + "dependencies": { + "ssr-window": "^4.0.2" + }, + "engines": { + "node": ">= 4.7.0" + } + }, "node_modules/tailwindcss": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/tailwindcss/-/tailwindcss-3.3.1.tgz", diff --git a/package.json b/package.json index 70484b27..35ee42b6 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "react-chrome-extension-router": "^1.4.0", "react-dom": "^18.0.0", "react-hot-toast": "^2.4.1", - "react-icons": "^4.8.0" + "react-icons": "^4.8.0", + "swiper": "^9.4.0" }, "devDependencies": { "@crxjs/vite-plugin": "^1.0.14", diff --git a/src/popup.css b/src/popup.css index f51b059f..5cc2cc66 100644 --- a/src/popup.css +++ b/src/popup.css @@ -21,3 +21,16 @@ code { font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace; } + +:root { + --swiper-theme-color: hsla(19, 100%, 50%, 1); + --swiper-pagination-top: 5px; + --swiper-pagination-bullet-inactive-color: rgb(255, 159, 115); + --swiper-pagination-bullet-size: 6px; + --swiper-navigation-size: 18px; + --swiper-navigation-sides-offset:5px; +} + +.swiper-pagination{ + position: relative; +} \ No newline at end of file diff --git a/src/popup/components/HighlightSlide.tsx b/src/popup/components/HighlightSlide.tsx new file mode 100644 index 00000000..31e371ca --- /dev/null +++ b/src/popup/components/HighlightSlide.tsx @@ -0,0 +1,69 @@ + +interface HighlightSlideProps { + highlight: { + url: string; + title: string; + login: string; + highlight: string; + }; +} + +export const HighlightSlide = ({ highlight }: HighlightSlideProps) => { + const { url, title, login, highlight: highlightText } = highlight; + + const openGraphSearchParameter = url.split("/").slice(3) + .join("/"); + const openGraphUrl = `https://opengraph.githubassets.com/1/${openGraphSearchParameter}`; + + return ( +
+ {highlightText} +
+ + + +- {highlights[currentPage]?.highlight} -
- -