Skip to content

Commit

Permalink
Merge branch 'add-memeContract' into add-memeContract-btcWallet
Browse files Browse the repository at this point in the history
  • Loading branch information
naturexie committed Jan 23, 2025
2 parents 237b942 + 66fb275 commit 799a6e6
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 14 deletions.
8 changes: 6 additions & 2 deletions components/BalanceReminder/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@ const BalanceReminder = () => {
...accountSupplied.map((token) => ({ ...token, type: "main" })),
...accountSuppliedMEME.map((token) => ({ ...token, type: "meme" })),
];
const [lastClosedDate, setLastClosedDate] = useState(() =>
localStorage.getItem("balanceReminderLastClosed"),
);

const Unreminded = useMemo(() => {
const lastClosedDate = localStorage.getItem("balanceReminderLastClosed");
const today = new Date().toDateString();
return !lastClosedDate || lastClosedDate !== today;
}, []);
}, [lastClosedDate]);
const dispatch = useDispatch();
useEffect(() => {
const hasValidAccountSupplied =
Expand Down Expand Up @@ -54,6 +57,7 @@ const BalanceReminder = () => {
function closeTip() {
const today = new Date().toDateString();
localStorage.setItem("balanceReminderLastClosed", today);
setLastClosedDate(today);
setShouldShow(false);
}
if (!shouldShow) {
Expand Down
2 changes: 1 addition & 1 deletion components/HashResultModal/ModalWithChangeCollateral.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const ModalWithChangeCollateral = ({
</div> */}
<div className="fc justify-between text-sm font-normal">
<span className="text-gray-300">collateral({symbol})</span>
<span>${toInternationalCurrencySystem_number(Number(collateral))}</span>
<span>{toInternationalCurrencySystem_number(Number(collateral))}</span>
</div>
<div className="absolute bottom-0 z-50 w-full left-0">{renderProgressBar()}</div>
</div>
Expand Down
11 changes: 7 additions & 4 deletions components/NonFarmedAssets/index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import { BeatLoader } from "react-spinners";
import { useNonFarmedAssets } from "../../hooks/hooks";
import { useAccountId, useNonFarmedAssets } from "../../hooks/hooks";
import ClaimAllRewards from "../ClaimAllRewards";

function NonFarmedAssets() {
const accountId = useAccountId();
const { hasNonFarmedAssets, hasNegativeNetLiquidity } = useNonFarmedAssets(false);
const {
hasNonFarmedAssets: hasNonFarmedAssetsMEME,
hasNegativeNetLiquidity: hasNegativeNetLiquidityMEME,
} = useNonFarmedAssets(true);
const main_null = !hasNonFarmedAssets || hasNegativeNetLiquidity;
const meme_null = !hasNonFarmedAssetsMEME || hasNegativeNetLiquidityMEME;

if (!accountId) {
return null;
}
if (!main_null) {
return (
<div className="flex xsm:hidden xsm:gap-3 items-center justify-between mb-5 border border-primary border-opacity-60 bg-primary bg-opacity-5 rounded-xl p-3 pl-5">
<div className="flex items-start">
<WarnIcon className="relative top-px flex-shrink-0 xsm:hidden" />
<div className="text-sm text-white mx-2.5 xsm:mx-0">
At least one of your farms in the Mainstream has started emitting extra rewards. If you
are seeing this warning, please click Claim & Join to join the new farm.
are seeing this warning, please click &apos;Claim & Join&apos; to join the new farm.
</div>
</div>
<ClaimAllRewards
Expand All @@ -36,7 +39,7 @@ function NonFarmedAssets() {
<WarnIcon className="relative top-px flex-shrink-0 xsm:hidden" />
<div className="text-sm text-white mx-2.5 xsm:mx-0">
At least one of your farms in the meme has started emitting extra rewards. If you are
seeing this warning, please click Claim & Join to join the new farm.
seeing this warning, please click &apos;Claim & Join&apos; to join the new farm.
</div>
</div>
<ClaimAllRewards
Expand Down
2 changes: 1 addition & 1 deletion screens/Dashboard/records.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const Records = ({ isShow }) => {
const accountId = useAccountId();
const { activeCategory } = useAppSelector((state) => state.category);
const { toastMessage, showToast } = useToastMessage();
const assets = useAppSelector(getAssetsCategory(false));
const isMeme = useAppSelector(isMemeCategory);
const assets = useAppSelector(getAssetsCategory(isMeme));
const [isLoading, setIsLoading] = useState(false);
const [docs, setDocs] = useState<any>([]);
const [pagination, setPagination] = useState<{
Expand Down
4 changes: 2 additions & 2 deletions screens/MarginTrading/components/MyTrading/MyTradingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const MyMarginTradingPage = () => {

return Object.entries(mergedCollateral).map(([tokenId, data], index) => (
<div key={tokenId} className="flex items-center justify-center mb-3">
<img src={data.icon} alt="" className="w-4 h-4" />
<img src={data.icon} alt="" className="w-4 h-4 rounded-3xl" />
<p className="ml-2 mr-8 text-xs text-gray-300">{data.symbol}</p>
<div className="text-xs ml-auto">
{beautifyPrice(data.totalValue, true)}
Expand Down Expand Up @@ -280,7 +280,7 @@ const MyMarginTradingPage = () => {

return Object.entries(mergedCollateral).map(([tokenId, data], index) => (
<div key={tokenId} className="flex items-center justify-center mb-3">
<img src={data.icon} alt="" className="w-4 h-4" />
<img src={data.icon} alt="" className="w-4 h-4 rounded-3xl" />
<p className="ml-2 mr-8 text-xs text-gray-300">{data.symbol}</p>
<div className="text-xs ml-auto">
{beautifyPrice(data.totalValue, true)}
Expand Down
8 changes: 4 additions & 4 deletions screens/Trading/components/ChangeCollateralMobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ const ChangeCollateralMobile: FC<ChangeCollateralMobileProps> = ({ open, onClose
positionType: positionType.label,
icon: iconC,
symbol: symbolC,
addedValue: String(addedValue),
addedValue: String(addedValue / priceC),
};
localStorage.setItem("marginTradingTab", "my");
localStorage.setItem("marginTransactionType", "changeCollateral");
Expand All @@ -262,7 +262,7 @@ const ChangeCollateralMobile: FC<ChangeCollateralMobileProps> = ({ open, onClose
icon: iconC,
type: positionType.label === "Long" ? "Long" : "Short",
symbol: symbolC,
collateral: String(addedValue),
collateral: String(addedValue / priceC),
});
}
} catch (error) {
Expand All @@ -283,7 +283,7 @@ const ChangeCollateralMobile: FC<ChangeCollateralMobileProps> = ({ open, onClose
positionType: positionType.label,
icon: iconC,
symbol: symbolC,
addedValue: String(addedValue),
addedValue: String(addedValue / priceC),
};
dispatch(setActiveTab("my"));
localStorage.setItem("marginTransactionType", "changeCollateral");
Expand All @@ -295,7 +295,7 @@ const ChangeCollateralMobile: FC<ChangeCollateralMobileProps> = ({ open, onClose
type: positionType.label === "Long" ? "Long" : "Short",
icon: iconC,
symbol: symbolC,
collateral: String(addedValue),
collateral: String(addedValue / priceC),
});
}
} catch (error) {
Expand Down

0 comments on commit 799a6e6

Please sign in to comment.