Skip to content

Commit

Permalink
Merge branch 'develop' into copy-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
manangouhari authored Mar 18, 2021
2 parents 61ba6d5 + a37abb3 commit cb8de1f
Show file tree
Hide file tree
Showing 15 changed files with 239 additions and 17,541 deletions.
1 change: 1 addition & 0 deletions gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ module.exports = {
options: {
dsn: "https://[email protected]/5675666",
sampleRate: 0.7,
denyUrls: ["localhost:8000"]
},
},
],
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,17 @@
"react-helmet": "^5.2.1",
"react-icons": "^3.9.0",
"react-live": "^2.2.2",
"react-loadable":"^5.5.0",
"react-loader-spinner": "^3.1.14",
"react-responsive": "^8.0.3",
"react-spring": "^8.0.27",
"react-three-fiber": "^5.3.18",
"react-tooltip": "^4.2.5",
"react-transition-group": "^4.4.1",
"react-typography": "^0.16.19",
"reactour":"^1.18.3",
"react-use": "^15.3.8",
"styled-components":"^4.0.0",
"scheduler": "^0.20.1",
"sharp": "^0.23.4",
"tailwindcss": "^2.0.2",
Expand Down
4 changes: 4 additions & 0 deletions src/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export default function HTML(props) {
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta
name="ahrefs-site-verification"
content="8cd0305e74b2fd42de579434ad307197d6dd94c55c34246110be242c4df562ea"
/>
<script
type="module"
src="https://unpkg.com/@google/model-viewer/dist/model-viewer.min.js"
Expand Down
2 changes: 1 addition & 1 deletion src/pages/tezos/academy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const CourseCard = ({ m, i, progress }) => {
)}
<button
onClick={() => {
trackEventWithProperties('Module-Click-From-Academy', {
trackEventWithProperties('click academy view module button', {
slug: m.frontmatter.slug,
});
navigate(`/tezos/academy/${m.frontmatter.slug}`);
Expand Down
68 changes: 54 additions & 14 deletions src/pages/tezos/claim-transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ import { MichelsonMap } from '@taquito/taquito';

import { trackEvent } from 'src/utils/analytics';

const Steppers = ({ number, name, clickEvent, tick = false }) => {
const Steppers = ({ number, name, clickEvent, step, tick = false }) => {
return (
<div onClick={clickEvent}>
<div className="flex items-center text-primary-600 relative">
<div className={`flex items-center text-primary-600 relative`}>
{tick ? (
<div
style={{
Expand All @@ -44,7 +44,11 @@ const Steppers = ({ number, name, clickEvent, tick = false }) => {
<MdDone size={24} />
</div>
) : (
<div className="rounded-full h-12 w-12 py-3 inline-flex items-center justify-center bg-primary-600 text-white">
<div
className={`rounded-full h-12 w-12 py-3 inline-flex items-center justify-center ${
number == step ? 'bg-primary-600' : 'bg-base-600'
} text-white`}
>
{number}
</div>
)}
Expand Down Expand Up @@ -148,9 +152,11 @@ function Transaction({ location }) {
const [opHash, setOpHash] = useState(null);
const [networkFeeEstimate, setNetworkFeeEstimate] = useState(0);
// const xtzPrice = location.state ? location.state.xtzPrice : null;
const modelURI = location.state ? location.state.modelURI : null;
const jsonURI = location.state ? location.state.jsonURI : null;
console.log(location.state);
// const modelURI = location.state ? location.state.modelURI : null;
// const jsonURI = location.state ? location.state.jsonURI : null;
const [modelURI, setModelURI] = useState();
const [jsonURI, setJsonURI] = useState();

const { width, height } = useWindowSize();
const [xtzPrice, updateXtzPrice] = useState(null);

Expand All @@ -161,6 +167,29 @@ function Transaction({ location }) {
const [copyLink, setCopyLink] = useState(false);
const [claimButtonDisabled, setClaimButtonDisabledStatus] = useState(true);

useEffect(() => {
if (typeof window === `undefined`) return;
if (location.state == null) {
const stateJSON = localStorage.getItem('claim-transaction-state');

if (stateJSON != null) {
const state = JSON.parse(stateJSON);
setModelURI(state.modelURI);
setJsonURI(state.jsonURI);
}
} else {
localStorage.setItem(
'claim-transaction-state',
JSON.stringify({
modelURI: location.state.modelURI,
jsonURI: location.state.jsonURI,
}),
);
setModelURI(location.state.modelURI);
setJsonURI(location.state.jsonURI);
}
}, []);

const ErrorModal = () => {
return (
<div
Expand Down Expand Up @@ -196,7 +225,7 @@ function Transaction({ location }) {
useAsync(async () => {
try {
const result = await getXTZPrice();
console.log(result);

updateXtzPrice(result);
} catch (error) {
console.log(error);
Expand Down Expand Up @@ -236,7 +265,7 @@ function Transaction({ location }) {
const result = await op.confirmation(1);
// Go to 3rd Step
setStep(3);
trackEvent('Bot-Minted-Successfully');
trackEvent('successful bot mint');
console.log('result 🔥', result);
} catch (err) {
console.log(err);
Expand Down Expand Up @@ -280,26 +309,37 @@ function Transaction({ location }) {
number="1"
name="Confirm Claim"
tick={step >= 2}
step={step}
clickEvent={e => {
e.preventDefault();
// setStep(1);
}}
/>
<div className="flex-auto border-t-2 border-primary-600"></div>
<div
className={`flex-auto border-t-2 ${
step >= 2 ? 'border-primary-600' : 'border-base-600'
}`}
></div>
<Steppers
number="2"
name="Transaction"
tick={step === 3}
step={step}
clickEvent={e => {
e.preventDefault();
// setStep(2);
}}
/>
<div className="flex-auto border-t-2 border-primary-600"></div>
<div
className={`flex-auto border-t-2 ${
step == 3 ? 'border-primary-600' : 'border-base-600'
}`}
></div>
<Steppers
number="3"
name="Finished"
tick={step === 3}
step={step}
clickEvent={e => {
e.preventDefault();
// setStep(3);
Expand Down Expand Up @@ -426,11 +466,11 @@ function Transaction({ location }) {
Share your unique cryptobot with your friends and start
trading with other on marketplace!
</h4>
<div className="text-white text-center text-lg font-mulish mt-8">
Here’s the link to your unique cryptobot:
<div className="text-white text-center text-lg font-mulish mt-8 break-all">
<p>Here’s the link to your unique cryptobot:</p>
<a
href={`https://cryptocodeschool.in/tezos/cryptobot/${botTokenId}`}
className="text-primary-400 underline"
className="text-primary-400 underline break-all"
target="_blank"
rel="noopener noreferrer"
>
Expand Down Expand Up @@ -509,7 +549,7 @@ function Transaction({ location }) {
Earn more super cool cryptobots by completing Modules or
exploring Marketplace
</h4>
<div className="grid md:grid-cols-2 grid-cols-1 space-x-4 mx-auto justify-center text-white mt-8">
<div className="grid md:grid-cols-2 grid-cols-1 space-x-4 mx-auto justify-center text-white mt-8">
<Link to="/tezos/marketplace">
<Button size="lg" type="secondary">
Explore Marketplace
Expand Down
Loading

0 comments on commit cb8de1f

Please sign in to comment.