Skip to content

Commit 1f522c9

Browse files
authored
fix: tippy css import - removed it (#73)
* fix: rm tippy css file * v1.1.3
1 parent 126e607 commit 1f522c9

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@socket.tech/plugin",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"main": "dist/index.js",
55
"module": "dist/index.es.js",
66
"types": "dist/index.d.ts",

src/components/OpRewards.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useContext } from "react";
1+
import { useContext, useEffect, useState } from "react";
22
import { Gift, Info } from "react-feather";
33
import { useDispatch, useSelector } from "react-redux";
44
import { useTransition } from "@react-spring/web";
@@ -15,6 +15,7 @@ import { Button } from "./common/Button";
1515

1616
export const OpRewards = () => {
1717
const dispatch = useDispatch();
18+
const [showRewardsSection, setShowRewardsSection] = useState<boolean>(false);
1819
const apiKey = useSelector((state: any) => state.customSettings.apiKey);
1920

2021
const toggleDropdown = (value) => {
@@ -25,8 +26,14 @@ export const OpRewards = () => {
2526
const { userAddress } = web3Context.web3Provider;
2627

2728
const { data } = useOpRebatesData({ address: userAddress, API_KEY: apiKey });
28-
if (data?.pendingAmount == "0") return null;
2929

30+
useEffect(() => {
31+
if (data) {
32+
setShowRewardsSection(data?.pendingAmount != "0");
33+
}
34+
}, [data]);
35+
36+
if (!showRewardsSection) return null;
3037
return (
3138
<button
3239
onClick={() => toggleDropdown(true)}

src/components/Widget.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { useEffect } from "react";
22
import { WidgetProps } from "../types";
33
import { useDispatch, useSelector } from "react-redux";
4-
import "tippy.js/dist/tippy.css";
54

65
// context
76
import { useContext } from "react";

src/index.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ input[type="number"] {
1616
.tippy-content{
1717
background: rgba(0, 0, 0, 0.9);
1818
border: 1px solid white;
19+
padding: 5px;
20+
color: white;
1921
font-size: 12px;
2022
border-radius: 0.4rem;
2123
overflow: hidden;

0 commit comments

Comments
 (0)