Skip to content

Commit

Permalink
wip: pending to update CTAs in commit widget
Browse files Browse the repository at this point in the history
  • Loading branch information
albertfolch-redeemeum committed Jan 13, 2025
1 parent 67e3a03 commit 8bb5602
Show file tree
Hide file tree
Showing 158 changed files with 390 additions and 379 deletions.
41 changes: 39 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@
"react": "^18.2.0",
"react-avatar-editor": "^13.0.0",
"react-chartjs-2": "^4.2.0",
"react-cookie": "^7.2.2",
"react-csv": "^2.2.2",
"react-dom": "^18.2.0",
"react-draggable": "^4.4.5",
Expand Down
8 changes: 4 additions & 4 deletions src/components/addressInputPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const InputPanel = styled.div`
${flexColumnNoWrap};
position: relative;
border-radius: 1.25rem;
background-color: ${colors.darkGrey};
background-color: ${colors.greyDark};
z-index: 1;
width: 100%;
`;
Expand All @@ -30,7 +30,7 @@ const ContainerRow = styled.div<{ error: boolean }>`
transition:
border-color 300ms ${({ error }) => (error ? "step-end" : "step-start")},
color 500ms ${({ error }) => (error ? "step-end" : "step-start")};
background-color: ${colors.darkGrey};
background-color: ${colors.greyDark};
`;

const InputContainer = styled.div`
Expand All @@ -44,7 +44,7 @@ const Input = styled.input<{ error?: boolean }>`
border: none;
flex: 1 1 auto;
width: 0;
background-color: ${colors.darkGrey};
background-color: ${colors.greyDark};
transition: color 300ms ${({ error }) => (error ? "step-end" : "step-start")};
color: ${({ error, theme }) =>
error ? theme.accentFailure : theme.textPrimary};
Expand Down Expand Up @@ -111,7 +111,7 @@ export default function AddressInputPanel({
<AutoColumn $gap="md">
<Grid>
<Typography
color={colors.lightGrey}
color={colors.greyLight}
fontWeight={500}
fontSize={14}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/avatar/fallback-avatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import styled from "styled-components";
import { colors } from "../../lib/styles/colors";

const AddressImageContainer = styled.div<{ avatarSize: number }>`
border: ${({ avatarSize }) => avatarSize / 40}px solid ${colors.lightGrey};
border: ${({ avatarSize }) => avatarSize / 40}px solid ${colors.greyLight};
border-radius: 50%;
background-color: ${colors.lightGrey};
background-color: ${colors.greyLight};
margin-bottom: 5px;
display: flex;
`;
Expand Down
4 changes: 2 additions & 2 deletions src/components/breadcrumbs/Breadcrumbs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ function Breadcrumbs({ steps, margin }: Props) {
<Typography
fontSize="0.875rem"
fontWeight="600"
color={step.hightlighted ? "var(--accent)" : colors.darkGrey}
color={step.hightlighted ? "var(--accent)" : colors.greyDark}
margin="0 0.3125rem 0 0"
>
{step.label}
</Typography>{" "}
{isNotFinalStep(step.id) && (
<StyledCaret
size={18}
color={step.hightlighted ? "var(--accent)" : colors.darkGrey}
color={step.hightlighted ? "var(--accent)" : colors.greyDark}
/>
)}
</Button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/collapse/Collapse.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const ArrowContainer = styled.div`
font-size: 1.5rem;
`;
const CollapseWrapper = styled.div`
background: ${colors.lightGrey};
background: ${colors.greyLight};
padding: 1rem;
`;

Expand Down
12 changes: 6 additions & 6 deletions src/components/currencyInputPanel/SwapCurrencyInputPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const CurrencySelect = styled(Button)<{
&:hover,
&:active {
background-color: ${({ selected }) =>
selected ? colors.darkGrey : colors.secondary};
selected ? colors.greyDark : colors.secondary};
color: ${colors.white};
}
Expand All @@ -115,11 +115,11 @@ const CurrencySelect = styled(Button)<{
}
&:hover:before {
background-color: ${opacify(8, colors.darkGrey)};
background-color: ${opacify(8, colors.greyDark)};
}
&:active:before {
background-color: ${opacify(24, colors.lightGrey)};
background-color: ${opacify(24, colors.greyLight)};
}
}
Expand All @@ -135,13 +135,13 @@ const InputRow = styled.div`
const LabelRow = styled.div`
${flexRowNoWrap};
align-items: center;
color: ${colors.lightGrey};
color: ${colors.greyLight};
font-size: 0.75rem;
line-height: 1rem;
span:hover {
cursor: pointer;
color: ${darken(0.2, colors.lightGrey)};
color: ${darken(0.2, colors.greyLight)};
}
`;

Expand Down Expand Up @@ -285,7 +285,7 @@ export default function SwapCurrencyInputPanel({
</FixedContainer>
)}
<Container hideInput={hideInput}>
<Typography color={colors.darkGrey}>{label}</Typography>
<Typography color={colors.greyDark}>{label}</Typography>
<InputRow
style={hideInput ? { padding: "0", borderRadius: "8px" } : {}}
>
Expand Down
4 changes: 2 additions & 2 deletions src/components/datepicker/DatePicker.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const CalendarRow = styled.div`
export const CalendarHeader = styled(CalendarFlex)`
margin-bottom: 0.5rem;
> div {
color: ${colors.darkGrey};
color: ${colors.greyDark};
font-size: 0.875rem;
font-weight: 600;
}
Expand Down Expand Up @@ -136,7 +136,7 @@ export const CalendarDay = styled(CalendarCell)<{
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: ${colors.lightGrey};
background: ${colors.greyLight};
border-radius: 50%;
width: 0;
height: 0;
Expand Down
12 changes: 6 additions & 6 deletions src/components/detail/Detail.style.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const CommitStepWrapper = styled.div`
export const CommitStep = styled.div`
position: relative;
padding: 1rem;
background: ${colors.lightGrey};
background: ${colors.greyLight};
&:not(:last-child) {
&:before {
position: absolute;
Expand All @@ -50,7 +50,7 @@ export const CommitStep = styled.div`
transform: translate(-50%, 0);
border-left: 30rem solid transparent;
border-right: 30rem solid transparent;
border-top: 1rem solid ${colors.lightGrey};
border-top: 1rem solid ${colors.greyLight};
}
&:after {
Expand Down Expand Up @@ -85,7 +85,7 @@ export const CommitStep = styled.div`
left: initial;
transform: translate(0%, -50%);
border-top: 10rem solid transparent;
border-left: 1rem solid ${colors.lightGrey};
border-left: 1rem solid ${colors.greyLight};
border-bottom: 10rem solid transparent;
border-right: none;
}
Expand Down Expand Up @@ -269,7 +269,7 @@ export const Table = styled.table<{
color: inherit;
`
: css`
color: ${colors.darkGrey};
color: ${colors.greyDark};
`}
}
tr {
Expand Down Expand Up @@ -472,7 +472,7 @@ export const RedeemLeftButton = styled.button`
cursor: pointer;
transition: all 150ms ease-in-out;
&:hover {
background: ${colors.lightGrey};
background: ${colors.greyLight};
}
${miniButton}
Expand All @@ -494,7 +494,7 @@ export const RaiseProblemButton = styled(Button)`
transition: all 150ms ease-in-out;
&:hover:not(:disabled) {
color: ${colors.red};
background: ${colors.lightGrey};
background: ${colors.greyLight};
}
svg {
margin-left: 1rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export const BasicCommitDetailWidget: React.FC<
<ExternalCommitDetailView
providerProps={{
...CONFIG,
sendDeliveryInfoThroughXMTP: true,

Check failure on line 31 in src/components/detail/DetailWidget/BasicCommitDetailWidget.tsx

View workflow job for this annotation

GitHub Actions / call-reusable-workflow-PR / Build, Test and Deploy the Marketplace Interface

Type '{ sendDeliveryInfoThroughXMTP: true; envName: EnvironmentType; configId: ConfigId; walletConnectProjectId: string; defaultCurrencySymbol: string; defaultCurrencyTicker: string; ... 43 more ...; widgetsUrl: string; }' is not assignable to type 'Omit<CommitWidgetProvidersProps, "children">'.
envName: config.envName,
configId: config.envConfig.configId,
walletConnectProjectId: CONFIG.walletConnect.projectId,
Expand All @@ -40,7 +41,8 @@ export const BasicCommitDetailWidget: React.FC<
curationLists?.sellerCurationList?.join(",") || "",
withReduxProvider: false,
withCustomReduxContext: false,
withWeb3React: false
withWeb3React: false,
roundness: "min"
}}
selectedVariant={selectedVariant}
showPriceAsterisk={isPreview}
Expand All @@ -53,11 +55,6 @@ export const BasicCommitDetailWidget: React.FC<
exchangePolicyCheckResult: exchangePolicyCheckResult
});
}}
onPurchaseOverview={() => {
showModal(MODAL_TYPES.WHAT_IS_REDEEM, {
title: "Commit to Buy and Redeem"
});
}}
onClickBuyOrSwap={({ swapParams }) => {
navigate({ pathname: BosonRoutes.Swap, search: swapParams });
}}
Expand Down
19 changes: 6 additions & 13 deletions src/components/detail/DetailWidget/CommitDetailWidget.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
CommitButton,
ExternalCommitDetailView,
extractUserFriendlyError,
getHasUserRejectedTx,
getIsOfferExpired,
Provider,
RedeemButton,
subgraph
subgraph,
ThemedCommitButton

Check failure on line 9 in src/components/detail/DetailWidget/CommitDetailWidget.tsx

View workflow job for this annotation

GitHub Actions / call-reusable-workflow-PR / Build, Test and Deploy the Marketplace Interface

'"@bosonprotocol/react-kit"' has no exported member named 'ThemedCommitButton'. Did you mean 'ThemedButton'?
} from "@bosonprotocol/react-kit";
import * as Sentry from "@sentry/browser";
import { useConfigContext } from "components/config/ConfigContext";
Expand Down Expand Up @@ -231,7 +231,6 @@ export const CommitDetailWidget: React.FC<CommitDetailWidgetProps> = ({
disabled={disabled}
data-commit-proxy-address
style={{ height: "3.5rem" }}
withBosonStyle
>
Commit <small>Step 1/2</small>
</BosonButton>
Expand Down Expand Up @@ -464,7 +463,9 @@ export const CommitDetailWidget: React.FC<CommitDetailWidgetProps> = ({
externalConnectedSigner: signer,
withReduxProvider: false,
withWeb3React: false,
withCustomReduxContext: false
withCustomReduxContext: false,
sendDeliveryInfoThroughXMTP: true,

Check failure on line 467 in src/components/detail/DetailWidget/CommitDetailWidget.tsx

View workflow job for this annotation

GitHub Actions / call-reusable-workflow-PR / Build, Test and Deploy the Marketplace Interface

Type '{ envName: EnvironmentType; configId: ConfigId; walletConnectProjectId: string; defaultCurrencySymbol: string; defaultCurrencyTicker: string; licenseTemplate: string; ... 47 more ...; widgetsUrl: string; }' is not assignable to type 'Omit<CommitWidgetProvidersProps, "children">'.
roundness: "min"
}}
selectedVariant={selectedVariant}
showPriceAsterisk={isPreview}
Expand All @@ -477,11 +478,6 @@ export const CommitDetailWidget: React.FC<CommitDetailWidgetProps> = ({
exchangePolicyCheckResult: exchangePolicyCheckResult
});
}}
onPurchaseOverview={() => {
showModal(MODAL_TYPES.WHAT_IS_REDEEM, {
title: "Commit to Buy and Redeem"
});
}}
onClickBuyOrSwap={({ swapParams }) => {
navigate({ pathname: BosonRoutes.Swap, search: swapParams });
}}
Expand Down Expand Up @@ -513,14 +509,13 @@ export const CommitDetailWidget: React.FC<CommitDetailWidgetProps> = ({
{showCommitProxyButton ? (
<CommitProxyButton />
) : (
<CommitButton
<ThemedCommitButton
coreSdkConfig={{
envName: config.envName,
configId: config.envConfig.configId,
web3Provider: signer?.provider as Provider,
metaTx: config.metaTx
}}
variant="primaryFill"
isPauseCommitting={!address}
buttonRef={commitButtonRef}
onGetSignerAddress={handleOnGetSignerAddress}
Expand All @@ -533,7 +528,6 @@ export const CommitDetailWidget: React.FC<CommitDetailWidgetProps> = ({
onPendingTransaction={onCommitPendingTransaction}
onSuccess={onCommitSuccess}
extraInfo="Step 1/2"
withBosonStyle
/>
)}
</>
Expand Down Expand Up @@ -566,7 +560,6 @@ export const CommitDetailWidget: React.FC<CommitDetailWidgetProps> = ({
metaTx: config.envConfig.metaTx
}}
disabled
withBosonStyle
exchangeId="0"
extraInfo="Step 2/2"
variant="primaryFill"
Expand Down
Loading

0 comments on commit 8bb5602

Please sign in to comment.