Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: toast ui and earn card position #295

Merged
merged 1 commit into from
Dec 20, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { media } from "@styles/media";
import mixins from "@styles/mixins";

export const CardListWrapper = styled.div`
${mixins.flexbox("column", "center", "center")};
${mixins.flexbox("column", "center", "start")};
width: 100%;
gap: 24px;
min-height: 390px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const toastOutRightClose = keyframes`
transform: translateX(0);
}
to {
transform: translateX(100%);
transform: translateX(150%);
}
`;

Expand Down
6 changes: 4 additions & 2 deletions packages/web/src/components/common/notice/NoticeToast.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useCallback, useEffect, useMemo, useState } from "react";
import { FC, useCallback, useEffect, useMemo, useRef, useState } from "react";
import {
INoticeContext,
NoticeContext,
Expand Down Expand Up @@ -107,6 +107,7 @@ const FailContent: FC<{ content?: INoticeContent }> = ({ content }: { content?:
};

const NoticeUIItem: FC<NoticeProps> = ({ onClose, type = "success", id, content }) => {
const isClosed = useRef(false);
const [typeAnimation, setTypeAnimation] = useState<
"toast-item" | "closing" | ""
>("toast-item");
Expand All @@ -116,6 +117,7 @@ const NoticeUIItem: FC<NoticeProps> = ({ onClose, type = "success", id, content
const timeout = setTimeout(() => {
onClose?.(id);
setTypeAnimation("");
isClosed.current = true;
}, 500);
return () => clearTimeout(timeout);
}, [onClose]);
Expand All @@ -124,7 +126,7 @@ const NoticeUIItem: FC<NoticeProps> = ({ onClose, type = "success", id, content
const autoCloseTimeout = setTimeout(() => {
setTypeAnimation("closing");
const animationTimeout = setTimeout(() => {
onClose?.(id);
if (isClosed.current === false) onClose?.(id);
}, 500);
return () => clearTimeout(animationTimeout);
}, 6000);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const IncentivizedPoolCard: React.FC<IncentivizedPoolCardProps> = ({
<span className="label-text">{POOL_CONTENT_TITLE.APR}</span>
</div>
<div className="list-content">
<span className="value-text">{pool.liquidity}</span>
<span className="value-text">${pool.liquidity}</span>
<span className="value-text">{pool.apr}</span>
</div>
</div>
Expand Down