Skip to content
This repository was archived by the owner on Aug 6, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions components/Home/RscBalanceButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { faChevronDown } from "@fortawesome/pro-regular-svg-icons";
import { connect } from "react-redux";
import { emptyFncWithMsg } from "~/config/utils/nullchecks";
import { getCurrentUser } from "~/config/utils/getCurrentUser";
import { postLastTimeClickedRscTab } from "./api/postLastTimeClickedRscTab";
import { StyleSheet, css } from "aphrodite";
import { formatBalanceWithDecimals } from "~/config/utils/form";
import { useRouter } from "next/router";
Expand All @@ -22,7 +21,6 @@ const RscBalanceButton = ({ auth }: Props): ReactElement => {
const router = useRouter();
const tabname = router?.query?.tabName;
const currentUser = getCurrentUser();
const rscDeltaSinceSeen = currentUser?.balance_history ?? 0;
const { balance, should_display_rsc_balance_home } = auth?.user ?? {};

const [_count, setBalance] = useState(balance);
Expand All @@ -31,23 +29,6 @@ const RscBalanceButton = ({ auth }: Props): ReactElement => {
const [isPopoverOpen, setIsPopoverOpen] = useState<boolean>(false);
const [shouldDisplayBalanceHome, setShouldDisplayBalanceHome] =
useState<boolean>(should_display_rsc_balance_home ?? true);
const [shouldDisplayRscDelta, setShouldDisplayRscDelta] = useState<boolean>(
rscDeltaSinceSeen > 0
);

useEffect((): void => {
if (tabname?.includes("rsc")) {
setShouldDisplayRscDelta(false);
postLastTimeClickedRscTab({
onSuccess: (): void => {
setShouldDisplayRscDelta(false);
},
onError: emptyFncWithMsg,
});
} else {
setShouldDisplayRscDelta(rscDeltaSinceSeen > 0);
}
}, [tabname, rscDeltaSinceSeen]);

useEffect(() => {
if (auth?.isFetchingUser) {
Expand Down Expand Up @@ -83,10 +64,6 @@ const RscBalanceButton = ({ auth }: Props): ReactElement => {
data-for={"reputation-tool-tip"}
onClick={(_event: SyntheticEvent): void => {
setIsPopoverOpen(!isPopoverOpen);
postLastTimeClickedRscTab({
onError: emptyFncWithMsg,
onSuccess: (): void => setShouldDisplayRscDelta(false),
});
}}
>
{/* {!isPopoverOpen && <ReputationTooltip />} */}
Expand All @@ -101,11 +78,6 @@ const RscBalanceButton = ({ auth }: Props): ReactElement => {
{formatBalanceWithDecimals(balance ?? 0)} RSC
</div>
)}
{shouldDisplayRscDelta && (
<div className={css(styles.rscDelta)}>{`+ ${formatBalanceWithDecimals(
Number(rscDeltaSinceSeen.toFixed(2))
)}`}</div>
)}
<div className={css(styles.caretDown)}>
<FontAwesomeIcon icon={faChevronDown} />
</div>
Expand Down Expand Up @@ -146,22 +118,6 @@ const styles = StyleSheet.create({
borderRadius: "50%",
boxShadow: "0px 2px 4px rgba(185, 185, 185, 0.25)",
},
rscDelta: {
// background: colors.BLUE(1),
// color: "white",
background: colors.LIGHT_GREEN(0.5),
color: colors.PASTEL_GREEN_TEXT,
padding: 4,
top: -6,
right: -8,
fontSize: 10,
fontWeight: 600,
zIndex: 2,
display: "flex",
position: "absolute",
borderRadius: "50px",
boxShadow: "0 0 24px rgba(0, 0, 0, 0.14)",
},
usdAmount: {
fontSize: 12,
color: colors.LIGHT_GREY_TEXT,
Expand Down
23 changes: 0 additions & 23 deletions components/Home/api/postLastTimeClickedRscTab.ts

This file was deleted.