From 523b8897d3b988097824e05c6c02e9580e5798b6 Mon Sep 17 00:00:00 2001 From: AttackOnMorty Date: Wed, 22 May 2024 11:47:33 +1000 Subject: [PATCH] feat: remove tooltip for repo --- package.json | 1 - src/api/index.js | 2 -- src/components/searchInput.jsx | 63 +++++----------------------------- src/index.css | 7 ++-- src/index.jsx | 1 - 5 files changed, 11 insertions(+), 63 deletions(-) diff --git a/package.json b/package.json index c966d29..aeffba8 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "react-chartjs-2": "^5.2.0", "react-dom": "^18.3.1", "react-scripts": "5.0.1", - "react-tooltip": "^5.26.4", "web-vitals": "^3.5.2" }, "scripts": { diff --git a/src/api/index.js b/src/api/index.js index 4f3f4db..d23712e 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -21,13 +21,11 @@ export const getRepositories = async (value) => { owner: { avatar_url }, description, stargazers_count, - html_url, }) => ({ fullName: full_name, avatarUrl: avatar_url, description, currentStars: stargazers_count, - htmlUrl: html_url, }), ); }; diff --git a/src/components/searchInput.jsx b/src/components/searchInput.jsx index cba14b5..c35145b 100644 --- a/src/components/searchInput.jsx +++ b/src/components/searchInput.jsx @@ -1,44 +1,20 @@ import { Select, Spin, Tag } from 'antd'; import { useState } from 'react'; -import { Tooltip } from 'react-tooltip'; import { getRepositories } from '../api'; const { Option } = Select; const COLORS = [ - { - base: 'rgb(54, 162, 235)', - hoverClass: 'hover:!bg-[#0E90E4]', - }, - { - base: 'rgb(255, 99, 132)', - hoverClass: 'hover:!bg-[#FF3863]', - }, - { - base: 'rgb(255, 159, 64)', - hoverClass: 'hover:!bg-[#F3800E]', - }, - { - base: 'rgb(255, 205, 86)', - hoverClass: 'hover:!bg-[#EAB32F]', - }, - { - base: 'rgb(75, 192, 192)', - hoverClass: 'hover:!bg-[#2CA6A6]', - }, - { - base: 'rgb(153, 102, 255)', - hoverClass: 'hover:!bg-[#7E3FFF]', - }, - { - base: 'rgb(201, 203, 207)', - hoverClass: 'hover:!bg-[#9CA1AB]', - }, + 'rgb(54, 162, 235)', + 'rgb(255, 99, 132)', + 'rgb(255, 159, 64)', + 'rgb(255, 205, 86)', + 'rgb(75, 192, 192)', + 'rgb(153, 102, 255)', + 'rgb(201, 203, 207)', ]; -const SHADOWS = COLORS.map((color) => `0 0 16px -8px ${color.base}`); - let timeout; let currentValue; @@ -90,40 +66,19 @@ function SearchInput({ event.preventDefault(); event.stopPropagation(); }; - - const { htmlUrl } = data.find((repo) => repo.fullName === value) || {}; - return ( - - {label} - - - {label} - + {label} ); }; diff --git a/src/index.css b/src/index.css index 468f09d..7e52462 100644 --- a/src/index.css +++ b/src/index.css @@ -4,13 +4,10 @@ #root { height: 100%; - font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, + 'Liberation Mono', 'Courier New', monospace; } svg { vertical-align: baseline; } - -a { - @apply transition-all; -} diff --git a/src/index.jsx b/src/index.jsx index c6e4405..8c1a58b 100644 --- a/src/index.jsx +++ b/src/index.jsx @@ -4,7 +4,6 @@ import ReactDOM from 'react-dom/client'; import 'antd/dist/reset.css'; import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm'; -import 'react-tooltip/dist/react-tooltip.css'; import App from './App'; import reportWebVitals from './reportWebVitals';