Skip to content

Commit

Permalink
start sybil check, add beacon effect
Browse files Browse the repository at this point in the history
  • Loading branch information
lachlanglen committed Feb 9, 2024
1 parent cd51a5c commit 4102963
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 6 deletions.
2 changes: 1 addition & 1 deletion apps/potlock/widget/Cart/AddToCart.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { ownerId } = props;
const existsInCart = props.cart && !!props.cart[props.projectId];

// console.log("props in AddToCart: ", props);
console.log("props in AddToCart: ", props);
// console.log("existsInCart: ", props);
return (
<Widget
Expand Down
2 changes: 2 additions & 0 deletions apps/potlock/widget/Cart/CheckoutItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ const referrerFeePercent = basisPointsToPercent(referralFeeBasisPoints);
const referrerFeeAmount =
(parseFloat(cartItem?.amount) * referralFeeBasisPoints) / TOTAL_BASIS_POINTS;

console.log("cartItem: ", cartItem);

return (
<ItemContainer>
<ItemLeft>
Expand Down
20 changes: 16 additions & 4 deletions apps/potlock/widget/Components/Indicator.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,27 @@ const Outer = styled.div`
display: flex;
align-items: center;
justify-content: center;
width: 18px;
height: 18px;
width: 16px;
height: 16px;
border-radius: 50%;
background-color: ${props.colorOuter};
@keyframes beacon {
0%,
100% {
transform: scale(1);
}
50% {
transform: scale(1.3);
}
}
animation: beacon 1.5s infinite;
`;

const Inner = styled.div`
width: 10px;
height: 10px;
width: 9px;
height: 9px;
border-radius: 50%;
background-color: ${props.colorInner};
`;
Expand Down
10 changes: 9 additions & 1 deletion apps/potlock/widget/Pots/Detail.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ State.init({
applicationMessage: "",
applicationMessageError: "",
applicationSuccess: false,
sybilWrapperProviderResult: null,
});

if (state.potDetail === null) {
Expand All @@ -104,14 +105,21 @@ if (state.potDetail === null) {
} else {
State.update({ potDetail, canApply: true });
}
if (potDetail.sybil_wrapper_provider) {
const [contractId, methodName] = potDetail.sybil_wrapper_provider.split(":");
Near.asyncView(contractId, methodName, { account_id: context.accountId }).then((result) => {
console.log("sybil result: ", result);
State.update({ sybilWrapperProviderResult: result });
});
}
})
.catch((e) => {
console.log("error getting pot detail: ", e);
State.update({ potDetail: undefined });
});
}

// console.log("state in pot detail: ", state);
console.log("state in pot detail: ", state);

const noPot = state.potDetail === undefined;
const loading = state.potDetail === null;
Expand Down

0 comments on commit 4102963

Please sign in to comment.