@bosonprotocol/react-kit 0.37.0-alpha.1 → 0.37.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/exchangeCard/ExchangeCard.d.ts +0 -1
- package/dist/cjs/components/exchangeCard/ExchangeCard.d.ts.map +1 -1
- package/dist/cjs/components/exchangeCard/ExchangeCard.js +21 -26
- package/dist/cjs/components/exchangeCard/ExchangeCard.js.map +1 -1
- package/dist/cjs/components/exchangeCard/ExchangeCard.styles.d.ts +227 -5
- package/dist/cjs/components/exchangeCard/ExchangeCard.styles.d.ts.map +1 -1
- package/dist/cjs/components/exchangeCard/ExchangeCard.styles.js +33 -22
- package/dist/cjs/components/exchangeCard/ExchangeCard.styles.js.map +1 -1
- package/dist/cjs/components/modal/components/Commit/DetailView/InnerCommitDetailView.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/Commit/DetailView/InnerCommitDetailView.js +1 -1
- package/dist/cjs/components/modal/components/Commit/DetailView/InnerCommitDetailView.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/Exchange.d.ts +1 -2
- package/dist/cjs/components/modal/components/Redeem/MyItems/Exchange.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/Exchange.js +1 -12
- package/dist/cjs/components/modal/components/Redeem/MyItems/Exchange.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/Exchanges.d.ts +1 -2
- package/dist/cjs/components/modal/components/Redeem/MyItems/Exchanges.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/Exchanges.js +2 -2
- package/dist/cjs/components/modal/components/Redeem/MyItems/Exchanges.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/MyItems.d.ts +1 -2
- package/dist/cjs/components/modal/components/Redeem/MyItems/MyItems.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/MyItems.js +2 -2
- package/dist/cjs/components/modal/components/Redeem/MyItems/MyItems.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/WithExchangesData.d.ts +0 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/WithExchangesData.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/MyItems/WithExchangesData.js.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/RedeemNonModal.d.ts +0 -1
- package/dist/cjs/components/modal/components/Redeem/RedeemNonModal.d.ts.map +1 -1
- package/dist/cjs/components/modal/components/Redeem/RedeemNonModal.js +1 -5
- package/dist/cjs/components/modal/components/Redeem/RedeemNonModal.js.map +1 -1
- package/dist/cjs/components/productCard/ProductCard.d.ts +2 -0
- package/dist/cjs/components/productCard/ProductCard.d.ts.map +1 -1
- package/dist/cjs/components/productCard/ProductCard.js +13 -15
- package/dist/cjs/components/productCard/ProductCard.js.map +1 -1
- package/dist/cjs/components/productCard/ProductCard.styles.d.ts +4 -0
- package/dist/cjs/components/productCard/ProductCard.styles.d.ts.map +1 -1
- package/dist/cjs/components/productCard/ProductCard.styles.js +55 -20
- package/dist/cjs/components/productCard/ProductCard.styles.js.map +1 -1
- package/dist/cjs/components/productCard/commonStyles.d.ts.map +1 -1
- package/dist/cjs/components/productCard/commonStyles.js +0 -1
- package/dist/cjs/components/productCard/commonStyles.js.map +1 -1
- package/dist/cjs/components/widgets/roblox/components/ProductsRoblox.d.ts.map +1 -1
- package/dist/cjs/components/widgets/roblox/components/ProductsRoblox.js +16 -2
- package/dist/cjs/components/widgets/roblox/components/ProductsRoblox.js.map +1 -1
- package/dist/cjs/components/widgets/roblox/components/RobloxExchangesGrid.d.ts +2 -2
- package/dist/cjs/components/widgets/roblox/components/RobloxExchangesGrid.d.ts.map +1 -1
- package/dist/cjs/components/widgets/roblox/components/RobloxExchangesGrid.js +3 -6
- package/dist/cjs/components/widgets/roblox/components/RobloxExchangesGrid.js.map +1 -1
- package/dist/esm/components/exchangeCard/ExchangeCard.d.ts +0 -1
- package/dist/esm/components/exchangeCard/ExchangeCard.d.ts.map +1 -1
- package/dist/esm/components/exchangeCard/ExchangeCard.js +22 -26
- package/dist/esm/components/exchangeCard/ExchangeCard.js.map +1 -1
- package/dist/esm/components/exchangeCard/ExchangeCard.styles.d.ts +227 -5
- package/dist/esm/components/exchangeCard/ExchangeCard.styles.d.ts.map +1 -1
- package/dist/esm/components/exchangeCard/ExchangeCard.styles.js +33 -22
- package/dist/esm/components/exchangeCard/ExchangeCard.styles.js.map +1 -1
- package/dist/esm/components/modal/components/Commit/DetailView/InnerCommitDetailView.d.ts.map +1 -1
- package/dist/esm/components/modal/components/Commit/DetailView/InnerCommitDetailView.js +1 -1
- package/dist/esm/components/modal/components/Commit/DetailView/InnerCommitDetailView.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/Exchange.d.ts +1 -2
- package/dist/esm/components/modal/components/Redeem/MyItems/Exchange.d.ts.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/Exchange.js +1 -12
- package/dist/esm/components/modal/components/Redeem/MyItems/Exchange.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/Exchanges.d.ts +1 -2
- package/dist/esm/components/modal/components/Redeem/MyItems/Exchanges.d.ts.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/Exchanges.js +2 -2
- package/dist/esm/components/modal/components/Redeem/MyItems/Exchanges.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/MyItems.d.ts +1 -2
- package/dist/esm/components/modal/components/Redeem/MyItems/MyItems.d.ts.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/MyItems.js +2 -2
- package/dist/esm/components/modal/components/Redeem/MyItems/MyItems.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/WithExchangesData.d.ts +0 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/WithExchangesData.d.ts.map +1 -1
- package/dist/esm/components/modal/components/Redeem/MyItems/WithExchangesData.js.map +1 -1
- package/dist/esm/components/modal/components/Redeem/RedeemNonModal.d.ts +0 -1
- package/dist/esm/components/modal/components/Redeem/RedeemNonModal.d.ts.map +1 -1
- package/dist/esm/components/modal/components/Redeem/RedeemNonModal.js +1 -5
- package/dist/esm/components/modal/components/Redeem/RedeemNonModal.js.map +1 -1
- package/dist/esm/components/productCard/ProductCard.d.ts +2 -0
- package/dist/esm/components/productCard/ProductCard.d.ts.map +1 -1
- package/dist/esm/components/productCard/ProductCard.js +13 -15
- package/dist/esm/components/productCard/ProductCard.js.map +1 -1
- package/dist/esm/components/productCard/ProductCard.styles.d.ts +4 -0
- package/dist/esm/components/productCard/ProductCard.styles.d.ts.map +1 -1
- package/dist/esm/components/productCard/ProductCard.styles.js +54 -19
- package/dist/esm/components/productCard/ProductCard.styles.js.map +1 -1
- package/dist/esm/components/productCard/commonStyles.d.ts.map +1 -1
- package/dist/esm/components/productCard/commonStyles.js +0 -1
- package/dist/esm/components/productCard/commonStyles.js.map +1 -1
- package/dist/esm/components/widgets/roblox/components/ProductsRoblox.d.ts.map +1 -1
- package/dist/esm/components/widgets/roblox/components/ProductsRoblox.js +16 -2
- package/dist/esm/components/widgets/roblox/components/ProductsRoblox.js.map +1 -1
- package/dist/esm/components/widgets/roblox/components/RobloxExchangesGrid.d.ts +2 -2
- package/dist/esm/components/widgets/roblox/components/RobloxExchangesGrid.d.ts.map +1 -1
- package/dist/esm/components/widgets/roblox/components/RobloxExchangesGrid.js +3 -6
- package/dist/esm/components/widgets/roblox/components/RobloxExchangesGrid.js.map +1 -1
- package/package.json +2 -2
- package/src/components/exchangeCard/ExchangeCard.styles.ts +40 -22
- package/src/components/exchangeCard/ExchangeCard.tsx +53 -57
- package/src/components/modal/components/Commit/DetailView/InnerCommitDetailView.tsx +4 -1
- package/src/components/modal/components/Redeem/MyItems/Exchange.tsx +7 -15
- package/src/components/modal/components/Redeem/MyItems/Exchanges.tsx +0 -3
- package/src/components/modal/components/Redeem/MyItems/MyItems.tsx +0 -3
- package/src/components/modal/components/Redeem/MyItems/WithExchangesData.tsx +0 -1
- package/src/components/modal/components/Redeem/RedeemNonModal.tsx +0 -7
- package/src/components/productCard/ProductCard.styles.ts +58 -19
- package/src/components/productCard/ProductCard.tsx +30 -27
- package/src/components/productCard/commonStyles.ts +0 -1
- package/src/components/widgets/roblox/components/ProductsRoblox.tsx +14 -2
- package/src/components/widgets/roblox/components/RobloxExchangesGrid.tsx +5 -10
|
@@ -9,28 +9,27 @@ import { IBaseImage, Image } from "../image/Image";
|
|
|
9
9
|
import { ProductType } from "../productCard/const";
|
|
10
10
|
import { IButton } from "../ui/ThemedButton";
|
|
11
11
|
import {
|
|
12
|
-
|
|
12
|
+
CTAOnHoverContainerExchangeCard,
|
|
13
13
|
CommittedButtonWrapper,
|
|
14
14
|
ExchangeButtonWrapper,
|
|
15
15
|
ExchangeCTAWrapper,
|
|
16
16
|
ExchangeCarData,
|
|
17
17
|
ExchangeCardBottom,
|
|
18
18
|
ExchangeCardBottomContent,
|
|
19
|
-
ExchangeCardLabelWrapper,
|
|
20
|
-
ExchangeCardPrice,
|
|
21
19
|
ExchangeCardPriceWrapper,
|
|
20
|
+
ExchangeCardTitle,
|
|
21
|
+
ExchangeCardTitleWrapper,
|
|
22
22
|
ExchangeCardTop,
|
|
23
23
|
ExchangeCardWrapper,
|
|
24
|
-
ExchangeCreator,
|
|
25
|
-
ExchangeCreatorAvatar,
|
|
26
|
-
ExchangeCreatorName,
|
|
27
24
|
ExchangeImageWrapper,
|
|
28
25
|
ExchangeStatus,
|
|
29
|
-
ExchangeTitle,
|
|
30
26
|
RedeemButtonWrapper
|
|
31
27
|
} from "./ExchangeCard.styles";
|
|
32
28
|
import { ExchangeCardStatus } from "./types";
|
|
33
29
|
import { subgraph } from "@bosonprotocol/core-sdk";
|
|
30
|
+
|
|
31
|
+
import { Grid } from "../ui/Grid";
|
|
32
|
+
import { PhygitalLabel } from "../productCard/ProductCard";
|
|
34
33
|
export type { ExchangeCardStatus } from "./types";
|
|
35
34
|
interface Base {
|
|
36
35
|
id: string;
|
|
@@ -64,7 +63,6 @@ interface CancelledCard extends Base {
|
|
|
64
63
|
interface CommittedCard extends Base {
|
|
65
64
|
status: subgraph.ExchangeState.COMMITTED;
|
|
66
65
|
redeemButtonConfig: IButton;
|
|
67
|
-
cancelButtonConfig: IButton;
|
|
68
66
|
bottomText?: string;
|
|
69
67
|
}
|
|
70
68
|
|
|
@@ -95,8 +93,6 @@ export const ExchangeCard = (props: ExchangeCardProps) => {
|
|
|
95
93
|
imageProps,
|
|
96
94
|
price,
|
|
97
95
|
currency,
|
|
98
|
-
avatar,
|
|
99
|
-
avatarName,
|
|
100
96
|
onCardClick,
|
|
101
97
|
status,
|
|
102
98
|
isCTAVisible = true,
|
|
@@ -110,7 +106,7 @@ export const ExchangeCard = (props: ExchangeCardProps) => {
|
|
|
110
106
|
} = props;
|
|
111
107
|
|
|
112
108
|
const [isImageLoaded, setIsImageLoaded] = useState(false);
|
|
113
|
-
|
|
109
|
+
const [isHovered, setIsHovered] = useState(false);
|
|
114
110
|
const exchangeCardBottom = useMemo(() => {
|
|
115
111
|
if (isCTAVisible) {
|
|
116
112
|
switch (status) {
|
|
@@ -136,7 +132,7 @@ export const ExchangeCard = (props: ExchangeCardProps) => {
|
|
|
136
132
|
);
|
|
137
133
|
}
|
|
138
134
|
case subgraph.ExchangeState.COMMITTED: {
|
|
139
|
-
const { redeemButtonConfig
|
|
135
|
+
const { redeemButtonConfig } = props;
|
|
140
136
|
return (
|
|
141
137
|
<ExchangeButtonWrapper>
|
|
142
138
|
<CommittedButtonWrapper>
|
|
@@ -152,20 +148,7 @@ export const ExchangeCard = (props: ExchangeCardProps) => {
|
|
|
152
148
|
>
|
|
153
149
|
Redeem
|
|
154
150
|
</Button>
|
|
155
|
-
<Button
|
|
156
|
-
variant="secondaryInverted"
|
|
157
|
-
{...cancelButtonConfig}
|
|
158
|
-
onClick={(
|
|
159
|
-
e: React.MouseEvent<HTMLButtonElement, MouseEvent>
|
|
160
|
-
) => {
|
|
161
|
-
e.stopPropagation();
|
|
162
|
-
cancelButtonConfig?.onClick?.(e);
|
|
163
|
-
}}
|
|
164
|
-
>
|
|
165
|
-
Cancel
|
|
166
|
-
</Button>
|
|
167
151
|
</CommittedButtonWrapper>
|
|
168
|
-
<CommittedBottomText>{bottomText}</CommittedBottomText>
|
|
169
152
|
</ExchangeButtonWrapper>
|
|
170
153
|
);
|
|
171
154
|
}
|
|
@@ -183,6 +166,8 @@ export const ExchangeCard = (props: ExchangeCardProps) => {
|
|
|
183
166
|
data-card={dataCard}
|
|
184
167
|
$isHoverDisabled={isHoverDisabled}
|
|
185
168
|
data-testid={dataTestId}
|
|
169
|
+
onMouseEnter={() => setIsHovered(true)}
|
|
170
|
+
onMouseLeave={() => setIsHovered(false)}
|
|
186
171
|
onClick={(e) => {
|
|
187
172
|
e.preventDefault();
|
|
188
173
|
onCardClick?.(id);
|
|
@@ -190,12 +175,22 @@ export const ExchangeCard = (props: ExchangeCardProps) => {
|
|
|
190
175
|
>
|
|
191
176
|
<ExchangeCardTop $isNotImageLoaded={isNotImageLoaded}>
|
|
192
177
|
<ExchangeImageWrapper>
|
|
193
|
-
{isPhygital && (
|
|
194
|
-
<ExchangeCardLabelWrapper>Phygital</ExchangeCardLabelWrapper>
|
|
195
|
-
)}
|
|
196
178
|
<Image {...imageProps} onLoaded={() => setIsImageLoaded(true)} />
|
|
179
|
+
{isCTAVisible && isConnected && (
|
|
180
|
+
<CTAOnHoverContainerExchangeCard $isHovered={isHovered}>
|
|
181
|
+
{isCTAVisible && isConnected ? (
|
|
182
|
+
<ExchangeCTAWrapper data-cta-wrapper>
|
|
183
|
+
{exchangeCardBottom}
|
|
184
|
+
</ExchangeCTAWrapper>
|
|
185
|
+
) : isCTAVisible && !isConnected && CTAIfDisconnected ? (
|
|
186
|
+
CTAIfDisconnected
|
|
187
|
+
) : null}
|
|
188
|
+
</CTAOnHoverContainerExchangeCard>
|
|
189
|
+
)}
|
|
197
190
|
</ExchangeImageWrapper>
|
|
198
|
-
<ExchangeStatus $status={status}>
|
|
191
|
+
<ExchangeStatus $status={status} $side="left">
|
|
192
|
+
{status.toLowerCase()}
|
|
193
|
+
</ExchangeStatus>
|
|
199
194
|
</ExchangeCardTop>
|
|
200
195
|
<div style={{ height: height + "px" }} />
|
|
201
196
|
<ExchangeCardBottom>
|
|
@@ -209,41 +204,42 @@ export const ExchangeCard = (props: ExchangeCardProps) => {
|
|
|
209
204
|
}}
|
|
210
205
|
>
|
|
211
206
|
<ExchangeCarData>
|
|
212
|
-
<
|
|
207
|
+
<Grid
|
|
208
|
+
flexDirection="column"
|
|
209
|
+
alignItems="flex-start"
|
|
213
210
|
onClick={(e) => {
|
|
214
211
|
e.stopPropagation();
|
|
215
212
|
onAvatarNameClick?.();
|
|
216
213
|
}}
|
|
217
214
|
>
|
|
218
|
-
<
|
|
219
|
-
<
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
215
|
+
<ExchangeCardTitleWrapper>
|
|
216
|
+
<ExchangeCardTitle fontSize={"0.75rem"} fontWeight={"600"}>
|
|
217
|
+
{title}
|
|
218
|
+
</ExchangeCardTitle>
|
|
219
|
+
<ExchangeCardPriceWrapper
|
|
220
|
+
justifyContent="flex-end"
|
|
221
|
+
alignItems="center"
|
|
222
|
+
width="40%"
|
|
223
|
+
>
|
|
224
|
+
<CurrencyDisplay
|
|
225
|
+
value={price}
|
|
226
|
+
currency={currency}
|
|
227
|
+
fontSize={"0.875rem"}
|
|
228
|
+
iconSize={16}
|
|
229
|
+
gap={"0.3125rem"}
|
|
230
|
+
style={{
|
|
231
|
+
wordBreak: "break-all",
|
|
232
|
+
alignItems: "center",
|
|
233
|
+
justifyContent: "center",
|
|
234
|
+
fontWeight: "600"
|
|
235
|
+
}}
|
|
236
|
+
/>
|
|
237
|
+
</ExchangeCardPriceWrapper>
|
|
238
|
+
</ExchangeCardTitleWrapper>
|
|
239
|
+
{isPhygital && <PhygitalLabel />}
|
|
240
|
+
</Grid>
|
|
226
241
|
</ExchangeCarData>
|
|
227
|
-
<ExchangeCardPriceWrapper>
|
|
228
|
-
<ExchangeCardPrice>Price</ExchangeCardPrice>
|
|
229
|
-
<CurrencyDisplay
|
|
230
|
-
value={price}
|
|
231
|
-
currency={currency}
|
|
232
|
-
style={{
|
|
233
|
-
wordBreak: "break-all",
|
|
234
|
-
alignItems: "flex-start",
|
|
235
|
-
justifyContent: "flex-end"
|
|
236
|
-
}}
|
|
237
|
-
/>
|
|
238
|
-
</ExchangeCardPriceWrapper>
|
|
239
242
|
</ExchangeCardBottomContent>
|
|
240
|
-
{isCTAVisible && isConnected ? (
|
|
241
|
-
<ExchangeCTAWrapper data-cta-wrapper>
|
|
242
|
-
{exchangeCardBottom}
|
|
243
|
-
</ExchangeCTAWrapper>
|
|
244
|
-
) : isCTAVisible && !isConnected && CTAIfDisconnected ? (
|
|
245
|
-
CTAIfDisconnected
|
|
246
|
-
) : null}
|
|
247
243
|
</ExchangeCardBottom>
|
|
248
244
|
</ExchangeCardWrapper>
|
|
249
245
|
);
|
|
@@ -355,7 +355,10 @@ export default function InnerCommitDetailView(
|
|
|
355
355
|
priceSibling={
|
|
356
356
|
status === "success" ? (
|
|
357
357
|
// TODO: if exchange is in a different state what do we do?
|
|
358
|
-
<ExchangeStatus
|
|
358
|
+
<ExchangeStatus
|
|
359
|
+
$status={subgraph.ExchangeState.COMMITTED}
|
|
360
|
+
$side="right"
|
|
361
|
+
>
|
|
359
362
|
{labelValueToText[LabelType.purchased]}
|
|
360
363
|
</ExchangeStatus>
|
|
361
364
|
) : (
|
|
@@ -4,7 +4,10 @@ import { useMemo } from "react";
|
|
|
4
4
|
import styled from "styled-components";
|
|
5
5
|
import mockedAvatar from "../../../../../assets/frame.png";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
ExchangeCard,
|
|
9
|
+
ExchangeCardProps
|
|
10
|
+
} from "../../../../exchangeCard/ExchangeCard";
|
|
8
11
|
import { Currencies } from "../../../../currencyDisplay/CurrencyDisplay";
|
|
9
12
|
import { exchanges } from "@bosonprotocol/core-sdk";
|
|
10
13
|
import { colors } from "../../../../../theme";
|
|
@@ -31,7 +34,6 @@ interface Props {
|
|
|
31
34
|
exchange: ExtendedExchange;
|
|
32
35
|
onCardClick: (exchange: IExchange) => void;
|
|
33
36
|
onRedeemClick: (exchange: IExchange) => void;
|
|
34
|
-
onCancelExchangeClick: (exchange: IExchange) => void;
|
|
35
37
|
onRaiseDisputeClick: (exchange: IExchange) => void;
|
|
36
38
|
onAvatarClick: (exchange: IExchange) => void;
|
|
37
39
|
}
|
|
@@ -56,7 +58,6 @@ export default function Exchange({
|
|
|
56
58
|
exchange,
|
|
57
59
|
onRedeemClick,
|
|
58
60
|
onCardClick,
|
|
59
|
-
onCancelExchangeClick,
|
|
60
61
|
onRaiseDisputeClick,
|
|
61
62
|
onAvatarClick
|
|
62
63
|
}: Props) {
|
|
@@ -122,12 +123,6 @@ export default function Exchange({
|
|
|
122
123
|
const handleRedeem = () => {
|
|
123
124
|
onRedeemClick(exchange);
|
|
124
125
|
};
|
|
125
|
-
const handleCancel = () => {
|
|
126
|
-
if (!exchange) {
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
onCancelExchangeClick(exchange);
|
|
130
|
-
};
|
|
131
126
|
return {
|
|
132
127
|
status: "COMMITTED" as Extract<ExchangeCardStatus, "COMMITTED">,
|
|
133
128
|
isCTAVisible: isBuyer,
|
|
@@ -136,13 +131,10 @@ export default function Exchange({
|
|
|
136
131
|
onClick: handleRedeem,
|
|
137
132
|
type: "button",
|
|
138
133
|
disabled: isInWrongChain
|
|
139
|
-
} as const,
|
|
140
|
-
cancelButtonConfig: {
|
|
141
|
-
onClick: handleCancel,
|
|
142
|
-
type: "button",
|
|
143
|
-
disabled: isInWrongChain
|
|
144
134
|
} as const
|
|
145
|
-
}
|
|
135
|
+
} satisfies Partial<
|
|
136
|
+
Extract<ExchangeCardProps, { status: "COMMITTED" }>
|
|
137
|
+
>;
|
|
146
138
|
}
|
|
147
139
|
default:
|
|
148
140
|
return {
|
|
@@ -6,7 +6,6 @@ import { ProductGridContainer } from "./ProfilePage.styles";
|
|
|
6
6
|
interface Props {
|
|
7
7
|
onCardClick: (exchange: IExchange) => void;
|
|
8
8
|
onRedeemClick: (exchange: IExchange) => void;
|
|
9
|
-
onCancelExchangeClick: (exchange: IExchange) => void;
|
|
10
9
|
onRaiseDisputeClick: (exchange: IExchange) => void;
|
|
11
10
|
onAvatarClick: (exchange: IExchange) => void;
|
|
12
11
|
exchanges: ExtendedExchange[];
|
|
@@ -15,7 +14,6 @@ interface Props {
|
|
|
15
14
|
export default function Exchanges({
|
|
16
15
|
onRedeemClick,
|
|
17
16
|
exchanges,
|
|
18
|
-
onCancelExchangeClick,
|
|
19
17
|
onRaiseDisputeClick,
|
|
20
18
|
onCardClick,
|
|
21
19
|
onAvatarClick
|
|
@@ -38,7 +36,6 @@ export default function Exchanges({
|
|
|
38
36
|
exchange={exchange}
|
|
39
37
|
onRedeemClick={onRedeemClick}
|
|
40
38
|
onCardClick={onCardClick}
|
|
41
|
-
onCancelExchangeClick={onCancelExchangeClick}
|
|
42
39
|
onRaiseDisputeClick={onRaiseDisputeClick}
|
|
43
40
|
onAvatarClick={onAvatarClick}
|
|
44
41
|
/>
|
|
@@ -16,7 +16,6 @@ import { BosonLogo } from "../../common/BosonLogo";
|
|
|
16
16
|
export type MyItemsProps = {
|
|
17
17
|
onExchangeCardClick: (exchange: Exchange) => void;
|
|
18
18
|
onRedeemClick: (exchange: Exchange) => void;
|
|
19
|
-
onCancelExchange: (exchange: Exchange) => void;
|
|
20
19
|
onRaiseDisputeClick: (exchange: Exchange) => void;
|
|
21
20
|
onAvatarClick: (exchange: Exchange) => void;
|
|
22
21
|
isValid: boolean;
|
|
@@ -30,7 +29,6 @@ const ExchangesWithData = WithExchangesData(Exchanges);
|
|
|
30
29
|
export function MyItems({
|
|
31
30
|
onRedeemClick,
|
|
32
31
|
onExchangeCardClick,
|
|
33
|
-
onCancelExchange,
|
|
34
32
|
onRaiseDisputeClick,
|
|
35
33
|
onAvatarClick,
|
|
36
34
|
sellerIds,
|
|
@@ -100,7 +98,6 @@ export function MyItems({
|
|
|
100
98
|
{...values}
|
|
101
99
|
onCardClick={onExchangeCardClick}
|
|
102
100
|
onRedeemClick={onRedeemClick}
|
|
103
|
-
onCancelExchangeClick={onCancelExchange}
|
|
104
101
|
onRaiseDisputeClick={onRaiseDisputeClick}
|
|
105
102
|
onAvatarClick={onAvatarClick}
|
|
106
103
|
/>
|
|
@@ -20,7 +20,6 @@ const orderProps = {
|
|
|
20
20
|
interface CommonProps {
|
|
21
21
|
onCardClick: (exchange: Exchange) => void;
|
|
22
22
|
onRedeemClick: (exchange: Exchange) => void;
|
|
23
|
-
onCancelExchangeClick: (exchange: Exchange) => void;
|
|
24
23
|
onRaiseDisputeClick: (exchange: Exchange) => void;
|
|
25
24
|
onAvatarClick: (exchange: Exchange) => void;
|
|
26
25
|
}
|
|
@@ -87,7 +87,6 @@ export type RedeemNonModalProps = Pick<
|
|
|
87
87
|
hideModal?: NonModalProps["hideModal"];
|
|
88
88
|
myItemsOnExchangeCardClick?: MyItemsProps["onExchangeCardClick"];
|
|
89
89
|
myItemsOnRedeemClick?: MyItemsProps["onRedeemClick"];
|
|
90
|
-
myItemsOnCancelExchange?: MyItemsProps["onCancelExchange"];
|
|
91
90
|
myItemsOnRaiseDisputeClick?: MyItemsProps["onRaiseDisputeClick"];
|
|
92
91
|
myItemsOnAvatarClick?: MyItemsProps["onAvatarClick"];
|
|
93
92
|
onExchangePolicyClick?: ExchangeViewProps["onExchangePolicyClick"];
|
|
@@ -161,7 +160,6 @@ function RedeemNonModal({
|
|
|
161
160
|
raiseDisputeForExchangeUrl,
|
|
162
161
|
myItemsOnExchangeCardClick,
|
|
163
162
|
myItemsOnRedeemClick,
|
|
164
|
-
myItemsOnCancelExchange,
|
|
165
163
|
myItemsOnRaiseDisputeClick,
|
|
166
164
|
myItemsOnAvatarClick,
|
|
167
165
|
onExchangePolicyClick,
|
|
@@ -403,11 +401,6 @@ function RedeemNonModal({
|
|
|
403
401
|
setExchange(exchange);
|
|
404
402
|
myItemsOnRedeemClick?.(exchange);
|
|
405
403
|
}}
|
|
406
|
-
onCancelExchange={(exchange) => {
|
|
407
|
-
setActiveStep(ActiveStep.CANCELLATION_VIEW);
|
|
408
|
-
setExchange(exchange);
|
|
409
|
-
myItemsOnCancelExchange?.(exchange);
|
|
410
|
-
}}
|
|
411
404
|
isValid={isRedeemFormOK}
|
|
412
405
|
onRaiseDisputeClick={(exchange) => {
|
|
413
406
|
setExchange(exchange);
|
|
@@ -3,15 +3,22 @@ import { colors, getCssVar } from "../../theme";
|
|
|
3
3
|
import { cardWrapperStyles } from "./commonStyles";
|
|
4
4
|
import { Typography } from "../ui/Typography";
|
|
5
5
|
import { zIndex } from "../ui/zIndex";
|
|
6
|
+
import { buttonBorderRadius } from "../../borders";
|
|
7
|
+
import { ExchangeCardStatus } from "../exchangeCard/types";
|
|
6
8
|
|
|
7
9
|
export const ProductCardLabelWrapper = styled.div`
|
|
8
|
-
position: absolute;
|
|
9
|
-
top: 0.5rem;
|
|
10
|
-
left: 0.5rem;
|
|
11
|
-
background: white;
|
|
12
|
-
font-weight: 600;
|
|
13
|
-
color: ${colors.greyDark};
|
|
14
10
|
z-index: 1;
|
|
11
|
+
position: relative;
|
|
12
|
+
background-color: ${getCssVar("--main-text-color")};
|
|
13
|
+
color: ${getCssVar("--background-accent-color")};
|
|
14
|
+
border-radius: ${buttonBorderRadius["mid"]};
|
|
15
|
+
padding: 0.125rem 0.5rem 0.125rem 0.25rem;
|
|
16
|
+
display: flex;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
align-items: center;
|
|
19
|
+
gap: 4px;
|
|
20
|
+
position: relative;
|
|
21
|
+
left: 0;
|
|
15
22
|
`;
|
|
16
23
|
|
|
17
24
|
export const ProductCardCreator = styled.div`
|
|
@@ -53,15 +60,7 @@ export const ProductCardCreatorName = styled.div`
|
|
|
53
60
|
export const ProductCardTitle = styled(Typography).attrs({
|
|
54
61
|
className: "title"
|
|
55
62
|
})`
|
|
56
|
-
word-break: break-word;
|
|
57
|
-
overflow: hidden;
|
|
58
|
-
display: -webkit-box;
|
|
59
|
-
-webkit-box-orient: vertical;
|
|
60
|
-
-webkit-line-clamp: 2;
|
|
61
|
-
line-height: 1.5em;
|
|
62
63
|
max-height: calc(1.5em * 2);
|
|
63
|
-
white-space: nowrap;
|
|
64
|
-
text-overflow: ellipsis;
|
|
65
64
|
`;
|
|
66
65
|
|
|
67
66
|
export const ProductCardPriceWrapper = styled.div`
|
|
@@ -105,6 +104,7 @@ export const ProductCardBottomContent = styled.div`
|
|
|
105
104
|
export const ProductCardTitleWrapper = styled.div`
|
|
106
105
|
width: 100%;
|
|
107
106
|
box-sizing: border-box;
|
|
107
|
+
align-items: flex-start;
|
|
108
108
|
`;
|
|
109
109
|
|
|
110
110
|
export const ProductCardWrapper = styled.div<{
|
|
@@ -121,15 +121,12 @@ export const ProductCardWrapper = styled.div<{
|
|
|
121
121
|
flex-direction: column;
|
|
122
122
|
min-height: 286px;
|
|
123
123
|
height: 286px;
|
|
124
|
-
padding: 0 1rem 1rem 1rem;
|
|
125
124
|
${({ $isHoverDisabled }) =>
|
|
126
125
|
$isHoverDisabled
|
|
127
126
|
? ""
|
|
128
127
|
: css`
|
|
129
128
|
transition: all 300ms ease-in-out;
|
|
130
129
|
&:hover {
|
|
131
|
-
border: 2px solid ${colors.border};
|
|
132
|
-
|
|
133
130
|
[data-image-wrapper] {
|
|
134
131
|
width: 110%;
|
|
135
132
|
img {
|
|
@@ -235,10 +232,52 @@ export const CTAOnHoverContainer = styled.div<{ $isHovered: boolean }>`
|
|
|
235
232
|
export const ProductTypeWrapper = styled.div`
|
|
236
233
|
background-color: ${colors.black};
|
|
237
234
|
color: ${colors.white};
|
|
238
|
-
display: flex;
|
|
239
235
|
align-items: center;
|
|
240
236
|
gap: 0.25rem;
|
|
241
|
-
padding: 0.1563rem 0.25rem;
|
|
242
237
|
border-radius: ${getCssVar("--button-border-radius")};
|
|
243
238
|
margin-top: 0.5rem;
|
|
239
|
+
padding: 0.125rem 0.5rem 0.125rem 0.25rem;
|
|
240
|
+
display: flex;
|
|
241
|
+
justify-content: center;
|
|
242
|
+
align-items: center;
|
|
243
|
+
gap: 4px;
|
|
244
|
+
position: relative;
|
|
245
|
+
left: 0;
|
|
246
|
+
`;
|
|
247
|
+
|
|
248
|
+
export const ProductExchangeStatus = styled.div<{
|
|
249
|
+
$status: ExchangeCardStatus;
|
|
250
|
+
}>`
|
|
251
|
+
position: absolute;
|
|
252
|
+
z-index: 10;
|
|
253
|
+
letter-spacing: 0.5px;
|
|
254
|
+
line-height: 16px;
|
|
255
|
+
font-weight: 600;
|
|
256
|
+
font-size: 0.75rem;
|
|
257
|
+
padding: 0.5rem 1rem;
|
|
258
|
+
border-radius: 20px;
|
|
259
|
+
&:first-letter {
|
|
260
|
+
text-transform: uppercase;
|
|
261
|
+
}
|
|
262
|
+
background: ${({ $status }) => {
|
|
263
|
+
switch ($status) {
|
|
264
|
+
case "REDEEMED":
|
|
265
|
+
case "CANCELLED":
|
|
266
|
+
return colors.green;
|
|
267
|
+
case "COMMITTED":
|
|
268
|
+
return colors.violet;
|
|
269
|
+
default:
|
|
270
|
+
return colors.white;
|
|
271
|
+
}
|
|
272
|
+
}};
|
|
273
|
+
color: ${({ $status }) => {
|
|
274
|
+
switch ($status) {
|
|
275
|
+
case "COMMITTED":
|
|
276
|
+
return colors.white;
|
|
277
|
+
default:
|
|
278
|
+
return colors.black;
|
|
279
|
+
}
|
|
280
|
+
}};
|
|
281
|
+
left: 0.5rem;
|
|
282
|
+
top: 24px;
|
|
244
283
|
`;
|
|
@@ -22,12 +22,17 @@ import { ProductType } from "./const";
|
|
|
22
22
|
import { Grid } from "../ui/Grid";
|
|
23
23
|
import { CircleHalf } from "phosphor-react";
|
|
24
24
|
import { isMobile } from "../../lib/userAgent/userAgent";
|
|
25
|
+
import { Typography } from "../ui/Typography";
|
|
26
|
+
import { getCssVar } from "../../theme";
|
|
27
|
+
import { ExchangeCardStatus } from "../exchangeCard/types";
|
|
25
28
|
|
|
26
29
|
export const PhygitalLabel = () => {
|
|
27
30
|
return (
|
|
28
31
|
<ProductTypeWrapper>
|
|
29
32
|
<CircleHalf />
|
|
30
|
-
|
|
33
|
+
<Typography fontSize={"0.75rem"} fontWeight={600}>
|
|
34
|
+
Phygital
|
|
35
|
+
</Typography>
|
|
31
36
|
</ProductTypeWrapper>
|
|
32
37
|
);
|
|
33
38
|
};
|
|
@@ -54,6 +59,7 @@ export interface IProductCard {
|
|
|
54
59
|
isImageFitCover?: boolean;
|
|
55
60
|
className?: string;
|
|
56
61
|
currencyColor?: CurrencyDisplayProps["color"];
|
|
62
|
+
status?: ExchangeCardStatus;
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
const Wrapper = ({
|
|
@@ -89,7 +95,7 @@ export const ProductCard = (props: IProductCard) => {
|
|
|
89
95
|
tooltip = "",
|
|
90
96
|
tooltipProps = {},
|
|
91
97
|
CTAOnHover,
|
|
92
|
-
hideCreatorName =
|
|
98
|
+
hideCreatorName = true,
|
|
93
99
|
isImageFitCover = false,
|
|
94
100
|
className,
|
|
95
101
|
productType,
|
|
@@ -121,12 +127,15 @@ export const ProductCard = (props: IProductCard) => {
|
|
|
121
127
|
</CTAOnHoverContainer>
|
|
122
128
|
)}
|
|
123
129
|
</ProductCardImageWrapper>
|
|
124
|
-
|
|
125
130
|
<ProductCardBottom>
|
|
126
131
|
<ProductCardBottomContent>
|
|
127
|
-
<Grid flexDirection="
|
|
132
|
+
<Grid flexDirection="row" alignItems="flex-start">
|
|
128
133
|
<ProductCardTitleWrapper>
|
|
129
|
-
<ProductCardTitle
|
|
134
|
+
<ProductCardTitle
|
|
135
|
+
fontSize={"0.75rem"}
|
|
136
|
+
color={getCssVar("--main-text-color")}
|
|
137
|
+
fontWeight={"600"}
|
|
138
|
+
>
|
|
130
139
|
{title}
|
|
131
140
|
</ProductCardTitle>
|
|
132
141
|
</ProductCardTitleWrapper>
|
|
@@ -135,29 +144,23 @@ export const ProductCard = (props: IProductCard) => {
|
|
|
135
144
|
{avatarName}
|
|
136
145
|
</ProductCardCreatorName>
|
|
137
146
|
)}
|
|
147
|
+
<Wrapper tooltip={tooltip} tooltipProps={tooltipProps}>
|
|
148
|
+
<CurrencyDisplay
|
|
149
|
+
value={price}
|
|
150
|
+
currency={currency}
|
|
151
|
+
fontSize={"0.875rem"}
|
|
152
|
+
color={currencyColor}
|
|
153
|
+
iconSize={16}
|
|
154
|
+
gap={"0.3125rem"}
|
|
155
|
+
style={{
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
justifyContent: "center"
|
|
158
|
+
}}
|
|
159
|
+
/>
|
|
160
|
+
</Wrapper>
|
|
138
161
|
</Grid>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
value={price}
|
|
142
|
-
currency={currency}
|
|
143
|
-
fontSize={"0.875rem"}
|
|
144
|
-
color={currencyColor}
|
|
145
|
-
iconSize={16}
|
|
146
|
-
gap={"0.3125rem"}
|
|
147
|
-
style={{
|
|
148
|
-
wordBreak: "break-all",
|
|
149
|
-
alignItems: "center",
|
|
150
|
-
justifyContent: "center",
|
|
151
|
-
paddingTop: "0.25rem"
|
|
152
|
-
}}
|
|
153
|
-
/>
|
|
154
|
-
</Wrapper>
|
|
155
|
-
{productType === ProductType.phygital && (
|
|
156
|
-
<ProductTypeWrapper>
|
|
157
|
-
<CircleHalf />
|
|
158
|
-
Phygital
|
|
159
|
-
</ProductTypeWrapper>
|
|
160
|
-
)}
|
|
162
|
+
|
|
163
|
+
{productType === ProductType.phygital && <PhygitalLabel />}
|
|
161
164
|
</ProductCardBottomContent>
|
|
162
165
|
</ProductCardBottom>
|
|
163
166
|
</ProductCardWrapper>
|
|
@@ -115,7 +115,6 @@ export const ProductsRoblox = ({
|
|
|
115
115
|
|
|
116
116
|
const {
|
|
117
117
|
data: purchasedProductsInPage,
|
|
118
|
-
isLoading: purchasedProductsLoading,
|
|
119
118
|
fetchNextPage: fetchNextPagePurchasedProducts,
|
|
120
119
|
hasNextPage: hasNextPagePurchasedProducts,
|
|
121
120
|
refetch: refetchPurchasedProducts
|
|
@@ -257,7 +256,20 @@ export const ProductsRoblox = ({
|
|
|
257
256
|
});
|
|
258
257
|
}
|
|
259
258
|
}}
|
|
260
|
-
|
|
259
|
+
handleOnCardClick={(robloxExchange) => {
|
|
260
|
+
const { offer } = robloxExchange;
|
|
261
|
+
if (isProductV1(offer)) {
|
|
262
|
+
handleSetProductUuid({
|
|
263
|
+
selectedProductUuid: offer.metadata.product.uuid,
|
|
264
|
+
exchange: robloxExchange
|
|
265
|
+
});
|
|
266
|
+
} else if (isBundle(offer)) {
|
|
267
|
+
handleSetBundleUuid({
|
|
268
|
+
selectedBundleUuid: offer.metadata.bundleUuid,
|
|
269
|
+
exchange: robloxExchange
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}}
|
|
261
273
|
/>
|
|
262
274
|
</Grid>
|
|
263
275
|
<Grid flexDirection="column" alignItems="flex-start">
|
|
@@ -54,12 +54,12 @@ const TransparentSkeletonProductCard = styled(ProductCardSkeleton)`
|
|
|
54
54
|
`;
|
|
55
55
|
|
|
56
56
|
export type RobloxExchangesGridProps = {
|
|
57
|
-
isLoading: boolean;
|
|
58
57
|
numProducts?: number;
|
|
59
58
|
itemsPerRow: GridContainerProps["itemsPerRow"];
|
|
60
59
|
raiseDisputeForExchangeUrl: string;
|
|
61
60
|
handleRequestShipment: (robloxExchange: BosonRobloxExchange) => void;
|
|
62
61
|
handleCancellation: (robloxExchange: BosonRobloxExchange) => void;
|
|
62
|
+
handleOnCardClick: (robloxExchange: BosonRobloxExchange) => void;
|
|
63
63
|
exchanges: BosonRobloxExchange[] | undefined;
|
|
64
64
|
fetchNextPage: (
|
|
65
65
|
options?: FetchNextPageOptions
|
|
@@ -73,12 +73,12 @@ export type RobloxExchangesGridProps = {
|
|
|
73
73
|
};
|
|
74
74
|
const gap = "2rem";
|
|
75
75
|
export const RobloxExchangesGrid = ({
|
|
76
|
-
isLoading,
|
|
77
76
|
numProducts,
|
|
78
77
|
itemsPerRow,
|
|
79
78
|
raiseDisputeForExchangeUrl,
|
|
80
79
|
exchanges,
|
|
81
80
|
handleRequestShipment,
|
|
81
|
+
handleOnCardClick,
|
|
82
82
|
handleCancellation,
|
|
83
83
|
fetchNextPage,
|
|
84
84
|
refetch,
|
|
@@ -189,14 +189,9 @@ export const RobloxExchangesGrid = ({
|
|
|
189
189
|
type: "button"
|
|
190
190
|
} as const
|
|
191
191
|
}
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
handleCancellation(robloxExchange);
|
|
196
|
-
},
|
|
197
|
-
type: "button"
|
|
198
|
-
} as const
|
|
199
|
-
}
|
|
192
|
+
onCardClick={() => {
|
|
193
|
+
handleOnCardClick(robloxExchange);
|
|
194
|
+
}}
|
|
200
195
|
disputeButtonConfig={
|
|
201
196
|
{
|
|
202
197
|
onClick: () => {
|