Skip to content

Commit 5c19663

Browse files
committed
feat: add new color variables for price impact and skeleton shine; update confirmation modal state handling; enhance layout in CardDialog component
1 parent 7235435 commit 5c19663

File tree

4 files changed

+26
-12
lines changed

4 files changed

+26
-12
lines changed

lib/components/Swap/Swap.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ export const Default: Story = {
3939
text_black: "#000000",
4040
text_white: "#FFFFFF",
4141
text_fade: "#9CAACB",
42+
price_impact: "#E64646",
43+
skeleton_shine: "#FFFFFF",
4244
},
4345
},
4446
};

lib/components/SwapButton/ConfirmationModal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type ConfirmationModalProps = {
1717
const ConfirmationModal: FC<ConfirmationModalProps> = ({ setConfirmModal }) => {
1818
const { t } = useTranslation();
1919
const handleConfirmClose = () => {
20-
setConfirmModal(ModalState.IN_PROGRESS);
20+
setConfirmModal(ModalState.NONE);
2121
};
2222
const { tonConnectInstance } = useOptionsStore();
2323
useEffect(() => {

lib/components/SwapCard/CardDialog.scss

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,13 @@
9090
.dialog-community-modal {
9191
display: flex;
9292
flex-direction: column;
93+
flex-grow: 1;
9394
height: 100%;
9495
}
9596
.community-modal-container {
97+
display: flex;
98+
flex-direction: column;
99+
gap: 0.5rem 0.5rem;
96100
flex-grow: 1;
97101
}
98102
.community-modal-warning {
@@ -118,15 +122,16 @@
118122
padding-left: 1.25rem;
119123
padding-right: 1.25rem;
120124
}
121-
.accept-button {
122-
display: flex;
123-
height: 2.5rem;
124-
border-radius: 0.75rem;
125-
width: 100%;
126-
align-items: center;
127-
justify-content: center;
128-
font-size: 0.875rem;
129-
}
125+
}
126+
127+
.accept-button {
128+
display: flex;
129+
height: 2.5rem;
130+
border-radius: 0.75rem;
131+
width: 100%;
132+
align-items: center;
133+
justify-content: center;
134+
font-size: 0.875rem;
130135
}
131136
.pinned-token-container {
132137
display: flex;

lib/components/SwapCard/CardDialog.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,13 @@ const CardDialog: FC<CardDialogProps> = ({
162162
const assetList = type === "pay" ? assets : receiveAssets;
163163

164164
const handleOnTokenSelect = (asset: Asset) => {
165+
if (!communityTokens && asset.warning) {
166+
setContractCommunity(asset);
167+
setPromptForCommunity(true);
168+
}
169+
if (promptForCommunity) {
170+
setPromptForCommunity(false);
171+
}
165172
setSearchInput("");
166173
onTokenSelect(asset);
167174
setPage(1);
@@ -499,8 +506,8 @@ const CardDialog: FC<CardDialogProps> = ({
499506
contractCommunity!
500507
.address
501508
);
502-
onTokenSelect(
503-
contractCommunity!
509+
handleOnTokenSelect(
510+
contractCommunity
504511
);
505512
}}
506513
style={{

0 commit comments

Comments
 (0)