The repo for Purrform's main BigCommerce store.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

checkpoint

+102 -79
+4
assets/scss/custom/components/_accountsReward.scss
··· 167 167 color: red; 168 168 } 169 169 170 + .add-cat-btn { 171 + margin-top: 0.5rem; 172 + } 173 + 170 174 #change-slot-dialog { 171 175 border-radius: 0.5rem; 172 176 border-color: #687d6a;
+42 -26
templates/pages/account/inbox.html
··· 450 450 const mainContainer = document.querySelector('.cat-birthdays'); 451 451 452 452 let catsInHousehold, 453 - catsRegistered, 453 + catsRegistered = 0, 454 454 changeSlotAvailable, 455 455 changeSlotUsed, 456 456 registeredCatsData; ··· 476 476 return response.json(); 477 477 }) 478 478 .then((data) => { 479 + if (!data) { 480 + const catListTitle = document.createElement('h5'); 481 + catListTitle.classList.add('cat-list-title'); 482 + catListTitle.textContent = `You have not registered any cats yet.`; 483 + catListDiv.appendChild(catListTitle); 484 + catListDiv.appendChild(document.createElement('br')); 485 + return; 486 + } 479 487 mainContainer.style.display = 'block'; 480 488 householdQuestionDiv.style.display = 'none'; 481 489 birthdayErrorDiv.style.display = 'none'; ··· 494 502 return; 495 503 } 496 504 497 - const catListTitle = document.createElement('h4'); 505 + const catListTitle = document.createElement('h5'); 498 506 catListTitle.classList.add('cat-list-title'); 499 - catListTitle.textContent = `Your Registered Cats (${catsRegistered}/${catsInHousehold})`; 507 + catListTitle.textContent = `You have previously registered ${catsRegistered} cat${ 508 + catsRegistered > 1 ? 's' : '' 509 + }`; 500 510 catListDiv.appendChild(catListTitle); 501 511 catListDiv.appendChild(document.createElement('br')); 502 512 ··· 606 616 <button class="delete-cat-btn" onclick="deleteCat('${catName}')">Remove</button> 607 617 `; 608 618 619 + catListDiv.appendChild(catDiv); 620 + 609 621 if (catsRegistered === 4 && !changeSlotUsed) { 610 - catDiv.innerHTML += ` 611 - <button class="change-cat-btn" onclick="changeCat('${catName}')">Change</button> 612 - `; 622 + const allCatDivs = document.querySelectorAll('.cat'); 623 + 624 + allCatDivs.forEach((catDiv) => { 625 + catDiv.innerHTML += ` 626 + <button class="change-cat-btn" onclick="changeCat('${catName}')">Change</button> 627 + `; 628 + }); 613 629 } 614 630 615 - catListDiv.appendChild(catDiv); 616 631 document.querySelector('#reward-cat-name').value = ''; 617 632 document.querySelector('#reward-cat-breed').value = ''; 618 633 document.querySelector('#reward-cat-birthday').value = ''; 619 - document.querySelector('#reward-cat-sex').value = ''; 620 634 621 635 if (catsRegistered >= catsInHousehold) { 622 636 birthdayFormDiv.style.display = 'none'; ··· 624 638 625 639 document.querySelector( 626 640 '.cat-list-title' 627 - ).textContent = `Your Registered Cats (${catsRegistered}/${catsInHousehold})`; 641 + ).textContent = `You have previously registered ${catsRegistered} cat${ 642 + catsRegistered > 1 ? 's' : '' 643 + }`; 628 644 629 645 return; 630 646 }) ··· 659 675 } 660 676 }); 661 677 662 - catsRegistered--; 663 - if (catsRegistered < catsInHousehold) { 664 - birthdayFormDiv.style.display = 'block'; 665 - } 666 - 667 678 // remove the change buttons 668 679 const changeButtons = 669 680 document.querySelectorAll('.change-cat-btn'); ··· 680 691 681 692 document.querySelector( 682 693 '.cat-list-title' 683 - ).textContent = `Your Registered Cats (${catsRegistered}/${catsInHousehold})`; 694 + ).textContent = `You previously registered ${catsRegistered} cat${ 695 + catsRegistered > 1 ? 's' : '' 696 + }`; 684 697 685 698 return; 686 699 }) ··· 777 790 catDiv.querySelector('.cat-header').textContent === 778 791 oldName 779 792 ) { 780 - catDiv.querySelector('.cat-header').textContent = 781 - catName; 782 - catDiv.querySelector( 783 - '.cat-detail:nth-of-type(1)' 784 - ).textContent = `Breed: ${catBreed}`; 785 - catDiv.querySelector( 786 - '.cat-detail:nth-of-type(2)' 787 - ).textContent = `Sex: ${catGender}`; 788 - catDiv.querySelector( 789 - '.cat-detail:nth-of-type(3)' 790 - ).textContent = `Birthday: ${catBirthday}`; 793 + catDiv.innerHTML = ` 794 + <div class="cat-header">${catName}</div> 795 + <div class="cat-detail">Breed: ${catBreed}</div> 796 + <div class="cat-detail">Sex: ${catGender}</div> 797 + <div class="cat-detail">Birthday: ${catBirthday}</div> 798 + <button class="delete-cat-btn" onclick="deleteCat('${catName}')">Remove</button> 799 + `; 800 + 801 + // remove the change buttons 802 + const changeButtons = 803 + document.querySelectorAll('.change-cat-btn'); 804 + changeButtons.forEach((button) => { 805 + button.remove(); 806 + }); 791 807 } 792 808 }); 793 809
+56 -53
widget/.eslintrc.js
··· 1 1 module.exports = { 2 - env: { 3 - browser: true, 4 - jest: true, 5 - }, 6 - root: true, 7 - parser: '@typescript-eslint/parser', 8 - extends: [ 9 - 'eslint:recommended', 10 - 'airbnb-base', 11 - 'plugin:@typescript-eslint/recommended', 12 - 'plugin:import/errors', 13 - 'plugin:import/warnings', 14 - 'plugin:import/typescript', 15 - 'plugin:react/recommended', 16 - ], 17 - parserOptions: { 18 - project: './tsconfig.json', 19 - ecmaVersion: 6, 20 - sourceType: "module", 21 - ecmaFeatures: { 22 - jsx: true 23 - } 24 - }, 25 - rules: { 26 - "import/order": ["error", { 27 - "newlines-between": "always", 28 - }], 29 - "@typescript-eslint/explicit-member-accessibility": "off", 30 - "no-underscore-dangle": "off", 31 - "@typescript-eslint/no-var-requires": "off", 32 - "import/no-extraneous-dependencies": "off", 33 - "@typescript-eslint/camelcase": "off", 34 - "indent": ["error", 4], 35 - "max-len": [1, 120, 4], 36 - "no-plusplus": "off", 37 - "global-require": "off", 38 - "@typescript-eslint/explicit-function-return-type": "off", 39 - "import/extensions": "off" 40 - }, 41 - overrides: [ 42 - { 43 - files: ['*.test.tsx', '*.test.ts'], 44 - rules: { 45 - "no-undef": "off", 46 - "@typescript-eslint/no-explicit-any": "off" 47 - } 48 - } 49 - ], 50 - settings: { 51 - react: { 52 - version: "detect" 53 - } 54 - } 2 + env: { 3 + browser: true, 4 + jest: true, 5 + }, 6 + root: true, 7 + parser: '@typescript-eslint/parser', 8 + extends: [ 9 + 'eslint:recommended', 10 + 'airbnb-base', 11 + 'plugin:@typescript-eslint/recommended', 12 + 'plugin:import/errors', 13 + 'plugin:import/warnings', 14 + 'plugin:import/typescript', 15 + 'plugin:react/recommended', 16 + ], 17 + parserOptions: { 18 + project: './tsconfig.json', 19 + ecmaVersion: 6, 20 + sourceType: 'module', 21 + ecmaFeatures: { 22 + jsx: true, 23 + }, 24 + }, 25 + rules: { 26 + 'import/order': [ 27 + 'error', 28 + { 29 + 'newlines-between': 'always', 30 + }, 31 + ], 32 + '@typescript-eslint/explicit-member-accessibility': 'off', 33 + 'no-underscore-dangle': 'off', 34 + '@typescript-eslint/no-var-requires': 'off', 35 + 'import/no-extraneous-dependencies': 'off', 36 + '@typescript-eslint/camelcase': 'off', 37 + indent: ['error', 4], 38 + 'max-len': [1, 120, 4], 39 + 'no-plusplus': 'off', 40 + 'global-require': 'off', 41 + '@typescript-eslint/explicit-function-return-type': 'off', 42 + 'import/extensions': 'off', 43 + }, 44 + overrides: [ 45 + { 46 + files: ['*.test.tsx', '*.test.ts'], 47 + rules: { 48 + 'no-undef': 'off', 49 + '@typescript-eslint/no-explicit-any': 'off', 50 + }, 51 + }, 52 + ], 53 + settings: { 54 + react: { 55 + version: 'detect', 56 + }, 57 + }, 55 58 };