index
int64
0
0
repo_id
stringclasses
87 values
file_path
stringlengths
41
143
content
stringlengths
6
1.82M
0
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts/icon/Read Me.txt
Open *demo.html* to see a list of all the glyphs in your font along with their codes/ligatures. To use the generated font in desktop programs, you can install the TTF font. In order to copy the character associated with each icon, refer to the text box at the bottom right corner of each glyph in demo.html. The character inside this text box may be invisible; but it can still be copied. See this guide for more info: https://icomoon.io/#docs/local-fonts You won't need any of the files located under the *demo-files* directory when including the generated font in your own projects. You can import *selection.json* back to the IcoMoon app using the *Import Icons* button (or via Main Menu → Manage Projects) to retrieve your icon selection.
0
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts/icon/style.css
@font-face { font-family: 'gmx'; src: url('fonts/gmx.eot?w50xaq'); src: url('fonts/gmx.eot?w50xaq#iefix') format('embedded-opentype'), url('fonts/gmx.ttf?w50xaq') format('truetype'), url('fonts/gmx.woff?w50xaq') format('woff'), url('fonts/gmx.svg?w50xaq#gmx') format('svg'); font-weight: normal; font-style: normal; font-display: block; } [class^="icon-"], [class*=" icon-"] { /* use !important to prevent issues with browser extensions that change fonts */ font-family: 'gmx' !important; speak: never; font-style: normal; font-weight: normal; font-variant: normal; text-transform: none; line-height: 1; /* Better Font Rendering =========== */ -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .icon-dashboard:before { content: "\e90a"; } .icon-order:before { content: "\e90b"; } .icon-product:before { content: "\e90c"; } .icon-transaction:before { content: "\e90d"; } .icon-user-view:before { content: "\e909"; } .icon-file-upload:before { content: "\e908"; } .icon-envelop:before { content: "\e906"; } .icon-phone:before { content: "\e907"; } .icon-globe:before { content: "\e904"; } .icon-pdf-download:before { content: "\e905"; } .icon-call:before { content: "\e902"; } .icon-email:before { content: "\e903"; } .icon-cap:before { content: "\e900"; } .icon-listing:before { content: "\e901"; }
0
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts/icon
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts/icon/demo-files/demo.css
body { padding: 0; margin: 0; font-family: sans-serif; font-size: 1em; line-height: 1.5; color: #555; background: #fff; } h1 { font-size: 1.5em; font-weight: normal; } small { font-size: .66666667em; } a { color: #e74c3c; text-decoration: none; } a:hover, a:focus { box-shadow: 0 1px #e74c3c; } .bshadow0, input { box-shadow: inset 0 -2px #e7e7e7; } input:hover { box-shadow: inset 0 -2px #ccc; } input, fieldset { font-family: sans-serif; font-size: 1em; margin: 0; padding: 0; border: 0; } input { color: inherit; line-height: 1.5; height: 1.5em; padding: .25em 0; } input:focus { outline: none; box-shadow: inset 0 -2px #449fdb; } .glyph { font-size: 16px; width: 15em; padding-bottom: 1em; margin-right: 4em; margin-bottom: 1em; float: left; overflow: hidden; } .liga { width: 80%; width: calc(100% - 2.5em); } .talign-right { text-align: right; } .talign-center { text-align: center; } .bgc1 { background: #f1f1f1; } .fgc1 { color: #999; } .fgc0 { color: #000; } p { margin-top: 1em; margin-bottom: 1em; } .mvm { margin-top: .75em; margin-bottom: .75em; } .mtn { margin-top: 0; } .mtl, .mal { margin-top: 1.5em; } .mbl, .mal { margin-bottom: 1.5em; } .mal, .mhl { margin-left: 1.5em; margin-right: 1.5em; } .mhmm { margin-left: 1em; margin-right: 1em; } .mls { margin-left: .25em; } .ptl { padding-top: 1.5em; } .pbs, .pvs { padding-bottom: .25em; } .pvs, .pts { padding-top: .25em; } .unit { float: left; } .unitRight { float: right; } .size1of2 { width: 50%; } .size1of1 { width: 100%; } .clearfix:before, .clearfix:after { content: " "; display: table; } .clearfix:after { clear: both; } .hidden-true { display: none; } .textbox0 { width: 3em; background: #f1f1f1; padding: .25em .5em; line-height: 1.5; height: 1.5em; } #testDrive { display: block; padding-top: 24px; line-height: 1.5; } .fs0 { font-size: 16px; } .fs1 { font-size: 32px; }
0
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts/icon
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts/icon/demo-files/demo.js
if (!('boxShadow' in document.body.style)) { document.body.setAttribute('class', 'noBoxShadow'); } document.body.addEventListener("click", function(e) { var target = e.target; if (target.tagName === "INPUT" && target.getAttribute('class').indexOf('liga') === -1) { target.select(); } }); (function() { var fontSize = document.getElementById('fontSize'), testDrive = document.getElementById('testDrive'), testText = document.getElementById('testText'); function updateTest() { testDrive.innerHTML = testText.value || String.fromCharCode(160); if (window.icomoonLiga) { window.icomoonLiga(testDrive); } } function updateSize() { testDrive.style.fontSize = fontSize.value + 'px'; } fontSize.addEventListener('change', updateSize, false); testText.addEventListener('input', updateTest, false); testText.addEventListener('change', updateTest, false); updateSize(); }());
0
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts/icon
/content/gmx-projects/gmx-admin/frontend/public/assets/fonts/icon/fonts/gmx.svg
<?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" > <svg xmlns="http://www.w3.org/2000/svg"> <metadata>Generated by IcoMoon</metadata> <defs> <font id="gmx" horiz-adv-x="1024"> <font-face units-per-em="1024" ascent="960" descent="-64" /> <missing-glyph horiz-adv-x="1024" /> <glyph unicode="&#x20;" horiz-adv-x="512" d="" /> <glyph unicode="&#xe900;" glyph-name="cap" d="M485.831 807.538c-23.211-11.15-44.373-20.48-46.421-20.48-1.138 0-5.006-1.593-8.647-3.413-3.413-1.82-12.516-5.916-20.025-9.33-7.509-3.186-17.749-7.737-22.756-9.785-9.33-4.324-30.72-13.653-59.164-25.941-8.647-3.641-22.3-9.785-30.037-13.198-7.964-3.641-15.701-6.599-17.522-6.599-1.593 0-4.324-1.593-5.916-3.413s-4.551-3.413-6.599-3.413c-2.048 0-9.785-2.958-16.839-6.827-7.282-3.641-15.019-6.827-17.294-6.827-2.048 0-4.779-0.91-5.916-2.048-1.365-1.138-8.875-4.779-17.067-8.192-13.653-5.689-34.361-14.791-70.087-31.175-7.737-3.413-14.791-6.372-15.701-6.372-1.82 0-18.432-7.509-32.996-15.019-6.144-2.958-12.743-5.461-15.019-5.461s-5.916-1.365-8.42-3.186c-2.503-1.593-16.384-7.964-30.72-13.881-32.996-13.881-38.684-19.342-38.684-38.229 0-9.785 1.138-15.246 4.551-19.797 4.324-6.144 30.492-20.48 37.319-20.48 1.593 0 4.324-1.593 5.916-3.413s4.551-3.413 6.827-3.413c2.276 0 10.24-3.186 17.749-6.827 7.737-3.868 14.791-6.827 15.929-6.827 1.365 0 8.42-2.958 15.929-6.827 7.737-3.641 15.246-6.827 17.067-6.827s4.551-1.593 6.144-3.413c1.593-1.82 4.096-3.413 5.689-3.413s9.102-2.958 16.612-6.827c7.737-3.641 14.791-6.827 15.929-6.827s6.599-2.276 12.060-5.234l10.012-5.461 1.138-111.275c0.91-83.058 1.82-112.64 4.096-116.281 1.365-2.731 2.731-6.599 2.731-8.647 0-5.916 15.474-35.271 24.576-46.649 14.564-18.204 31.175-32.996 50.517-45.511 17.067-11.15 19.342-12.288 38.684-21.845 24.121-11.833 28.9-13.881 44.373-18.204 7.509-2.048 17.294-5.006 21.618-6.599 8.42-3.186 48.924-10.923 76.231-14.791 20.48-2.731 95.573-2.731 116.053 0 27.307 3.868 67.812 11.605 76.231 14.791 4.324 1.593 14.108 4.551 21.618 6.599 15.474 4.324 20.252 6.372 44.373 18.204 53.020 25.941 85.788 54.841 104.676 91.932 13.881 27.762 14.108 29.81 15.246 148.366 0.683 70.77 1.82 108.999 3.413 110.82 1.365 1.593 4.096 2.958 6.372 2.958s5.234 1.593 6.827 3.641c1.82 1.82 5.689 3.186 8.875 2.731l5.916-0.683 0.228-171.804c0-184.32-0.455-176.356 11.833-189.326 5.006-5.461 7.509-6.372 19.342-6.372 16.156 0 20.48 2.048 27.762 13.653l5.689 9.102v188.871c0 177.948 0.228 189.099 4.096 190.464 2.048 0.683 10.24 4.096 18.204 7.737 7.737 3.641 15.474 6.599 17.294 6.599 1.593 0 4.324 1.593 5.916 3.413s4.324 3.413 5.916 3.413c6.372 0 32.996 14.336 36.636 19.57 1.82 2.958 5.006 5.461 6.599 5.461 2.503 0 3.186 3.641 3.186 14.791 0 10.012-0.91 14.791-2.731 14.791-1.593 0-5.461 2.958-8.647 6.372-3.413 4.096-15.701 10.695-31.858 17.522-14.336 6.144-28.217 12.516-30.72 14.108s-6.144 2.958-8.42 2.958c-2.276 0-8.875 2.503-15.019 5.461-14.564 7.509-31.175 15.019-32.996 15.019-1.593 0-10.012 3.868-46.649 20.708-7.737 3.641-15.474 6.599-17.294 6.599-1.593 0-4.324 1.593-5.916 3.413s-4.324 3.413-5.916 3.413c-1.82 0-9.785 3.186-17.522 6.827-7.964 3.868-15.474 6.827-16.612 6.827s-8.647 3.186-16.839 7.054c-25.031 12.288-27.534 13.426-29.81 13.426-1.138 0-8.42 2.958-16.384 6.599-13.198 6.144-28.217 12.516-63.033 27.534-8.192 3.641-24.804 11.15-37.092 16.839s-23.666 10.468-25.259 10.468c-1.593 0-4.779 1.593-7.282 3.413-2.276 1.82-5.689 3.413-7.282 3.413-2.503 0-9.557 2.958-47.787 20.708-18.204 8.42-29.127 8.42-47.104-0.228zM529.522 739.044c16.156-7.509 22.983-10.468 38.229-16.839 19.797-8.42 50.29-21.39 70.542-30.265 8.875-3.868 25.941-11.605 38.229-17.294s23.438-10.468 24.804-10.468c1.138 0 5.006-1.365 8.192-2.958 5.689-2.958 12.516-5.916 30.72-13.653 14.564-6.372 41.643-18.204 55.524-24.576 7.964-3.641 15.701-6.599 17.294-6.599s3.868-0.91 5.006-2.048c1.365-1.138 15.019-7.509 30.72-14.108s30.492-13.198 32.996-15.019c2.503-1.593 5.916-2.958 7.964-2.958 3.413-0.228 13.653-7.509 13.653-10.012 0-0.683-4.779-3.186-10.468-5.916-12.743-5.461-31.403-5.916-60.985-1.365-41.643 6.599-57.572 8.875-77.596 10.468-11.15 0.91-27.534 2.958-36.409 4.324-8.647 1.365-28.672 4.096-44.373 6.144s-38.002 5.006-49.38 6.827c-11.605 1.82-26.396 3.186-32.996 3.186s-18.66 1.593-26.852 3.641c-8.192 1.82-27.307 3.641-42.325 3.868-26.852 0.455-27.762 0.228-33.223-5.234-15.929-16.612-13.881-38.684 4.551-51.2 4.551-3.186 11.378-5.689 15.246-5.689 9.102 0 59.164-6.144 82.148-10.24 10.24-1.82 23.211-3.413 28.9-3.413 9.785 0 27.534-2.276 78.962-10.24 12.060-1.82 27.989-3.413 35.726-3.413s15.701-0.683 17.749-1.365c3.186-1.365 3.186-1.82-0.228-5.689-2.048-2.503-5.006-4.324-6.144-4.324-2.276 0-17.977-6.599-26.852-11.378-1.82-0.91-17.294-7.737-34.133-14.791s-31.403-13.881-32.54-15.019c-1.365-1.138-3.641-2.048-5.234-2.048s-9.33-2.958-17.294-6.599c-14.108-6.372-41.87-18.66-55.751-24.348-4.096-1.593-10.923-4.551-15.246-6.599-4.324-1.82-11.378-4.779-15.246-6.599-4.096-1.593-12.288-5.234-18.432-7.964-13.426-5.916-17.067-5.916-30.492 0.228-6.144 2.503-14.336 6.144-18.204 7.964-10.695 4.551-22.3 9.33-30.72 13.198-4.096 1.82-15.246 6.372-24.576 10.468-9.33 3.868-23.438 10.012-31.175 13.653-7.964 3.641-15.701 6.599-17.522 6.599-1.593 0-4.324 1.593-5.916 3.413s-4.096 3.413-5.461 3.413c-3.186 0-47.332 18.66-69.632 29.582-1.82 0.91-12.516 5.461-23.893 10.012-11.15 4.779-26.624 11.605-34.361 15.246-7.509 3.641-15.246 6.599-17.294 6.599-1.82 0-4.779 1.593-6.372 3.413s-4.096 3.413-5.461 3.413c-2.503 0-30.037 11.378-54.841 22.756-5.006 2.276-13.653 5.916-19.342 8.192s-11.15 4.779-12.288 5.689c-2.276 2.048 7.282 10.923 11.833 11.15 1.365 0 7.509 2.503 13.653 5.689 5.916 2.958 24.576 11.378 41.415 18.432s35.954 15.019 42.098 17.977c15.701 7.054 44.146 19.342 53.020 22.983 17.294 7.282 38.457 16.612 96.028 41.87 11.833 5.234 28.9 12.516 37.547 16.384 8.875 3.868 18.887 8.192 22.3 10.012 3.641 1.82 7.509 3.186 8.647 3.186 2.048 0 17.294 6.599 46.421 20.48 7.509 3.641 15.929 6.599 18.66 6.599 2.958 0.228 12.060-2.958 20.48-6.827zM282.396 429.568c11.833-5.006 25.259-11.15 30.037-13.653 4.779-2.276 9.557-4.324 10.923-4.324 1.138 0 8.42-2.958 16.384-6.599 7.737-3.641 20.252-9.33 27.762-12.743s17.522-7.964 22.3-10.468c4.779-2.276 10.012-4.324 11.833-4.324 1.593 0 9.102-2.958 16.384-6.827 7.054-3.641 14.791-6.827 16.839-6.827s5.006-1.593 6.599-3.413c1.593-1.82 4.324-3.413 5.916-3.413 1.82 0 9.557-2.958 17.294-6.599 26.852-12.060 38.002-16.156 45.056-16.156s18.204 4.096 45.056 16.156c7.737 3.641 15.019 6.599 16.156 6.599s5.006 1.365 8.647 3.186c3.413 1.593 12.971 6.144 21.163 10.24 8.192 3.868 16.156 7.054 17.522 7.054s8.647 3.186 16.156 6.827c7.737 3.868 15.246 6.827 17.067 6.827s4.551 1.593 6.144 3.413c1.593 1.82 4.096 3.413 5.689 3.413s9.102 3.186 16.612 6.827c7.737 3.868 15.246 6.827 16.839 6.827 1.82 0 4.096 0.91 5.461 2.048 1.138 1.138 7.737 4.324 14.564 7.054 14.791 6.144 30.72 12.971 38.457 16.612 10.695 5.234 11.15 2.048 10.468-92.388-0.455-49.38-1.593-89.884-2.958-93.98-5.461-17.522-34.361-50.29-52.338-59.62-4.551-2.276-13.426-7.054-19.57-10.468-12.288-6.827-46.876-20.708-55.979-22.528-3.186-0.683-16.384-3.868-29.582-7.509-23.666-6.372-24.348-6.372-95.573-6.372s-71.908 0-95.573 6.372c-13.198 3.641-27.534 7.282-31.858 8.192-12.971 3.186-27.079 8.875-49.835 20.025-30.72 15.474-30.037 15.019-46.421 30.948-15.701 15.246-25.714 29.127-29.355 40.96-3.186 9.785-4.324 181.362-1.365 185.23 3.186 3.868 2.958 3.868 27.079-6.599z" /> <glyph unicode="&#xe901;" glyph-name="listing" d="M209.351 956.587c0-2.048-3.186-3.641-8.42-4.551-4.779-0.91-13.198-2.958-18.66-4.779-5.689-1.82-11.833-3.186-14.108-3.186-2.048 0-5.006-1.593-6.599-3.413s-4.096-3.413-5.689-3.413c-3.413 0-19.57-7.509-31.175-14.336-36.181-21.618-70.315-55.751-92.16-92.16-6.827-11.378-14.336-27.762-14.336-30.948 0-1.593-1.138-3.868-2.731-5.461s-4.096-7.509-5.689-13.653c-1.593-5.916-4.096-15.246-5.689-20.935-2.048-7.737-2.958-84.651-3.413-309.476l-0.683-299.236 6.144-25.031c3.186-13.653 7.509-26.624 9.102-28.672 1.593-1.82 2.958-4.551 2.958-5.916 0-5.234 11.833-27.307 25.941-48.697 9.33-14.108 45.739-50.745 60.075-60.757 21.618-15.019 45.511-27.762 51.428-27.762 1.593 0 3.868-1.138 5.461-2.731s7.509-4.096 13.653-5.689c5.916-1.593 15.246-4.096 20.935-5.689 7.737-2.048 84.651-2.958 309.476-3.413l299.236-0.683 25.031 6.144c13.881 3.186 26.624 7.509 28.672 9.102 1.82 1.593 4.551 2.958 5.916 2.958 5.689 0 30.037 13.198 51.2 27.762 14.336 10.012 50.745 46.649 60.075 60.757 14.108 21.39 25.941 43.463 25.941 48.697 0 1.365 1.365 4.096 2.958 5.916 1.82 2.048 5.461 13.653 8.42 25.941 3.413 14.564 6.372 22.073 8.192 22.073 2.731 0 3.186 49.152 3.186 300.373 0 261.234-0.455 300.373-3.413 300.373-2.048 0-3.641 3.186-4.551 8.647-0.91 4.551-2.958 12.971-4.779 18.432-1.82 5.689-3.186 11.833-3.186 14.108 0 2.048-1.593 5.006-3.413 6.599s-3.413 4.096-3.413 5.689c0 6.144-12.971 30.265-27.534 51.2-20.025 28.672-64.853 67.356-92.615 79.644-2.958 1.138-10.468 4.551-17.067 7.509-12.743 5.916-31.858 11.605-45.284 14.108-5.461 0.683-8.647 2.503-8.647 4.551 0 2.958-39.14 3.413-300.373 3.413s-300.373-0.455-300.373-3.413zM815.787 865.109c11.833-4.324 31.403-13.653 47.787-22.756 2.503-1.593 11.605-9.33 19.797-17.522 22.073-21.618 35.499-43.236 45.739-74.183l5.006-14.791v-290.133c0-276.708-0.228-290.816-4.324-302.649-20.252-60.302-56.661-97.166-115.143-116.736l-14.791-5.006h-580.267l-14.791 5.006c-57.799 19.342-95.118 56.661-114.46 114.46l-5.006 14.791v580.267l5.006 14.791c4.324 12.743 12.743 30.72 22.983 48.924 3.641 6.599 35.954 38.912 42.553 42.553 28.444 16.156 52.11 25.486 69.404 27.534 4.324 0.455 136.078 0.683 292.409 0.683l284.444-0.455 13.653-4.779zM494.933 698.766c-8.42-2.958-16.839-10.012-22.073-18.204l-5.234-8.42v-452.836l5.006-7.964c2.958-4.551 8.42-10.695 12.516-13.653 6.372-4.779 10.012-5.689 24.576-5.689s18.204 0.91 24.576 5.689c4.096 2.958 9.557 9.102 12.516 13.653l5.006 7.964v452.836l-5.006 7.964c-8.42 13.426-17.522 18.66-33.451 19.57-7.509 0.455-15.929 0-18.432-0.91zM276.935 525.596c-4.779-2.503-10.923-7.282-13.653-10.695-10.012-12.743-10.695-21.39-10.012-160.199l0.455-131.072 5.689-11.15c7.964-15.474 20.935-22.3 39.822-21.163 10.923 0.683 15.701 2.276 22.528 7.509 17.749 13.426 17.294 7.964 17.294 161.109 0 148.366 0.228 145.18-12.971 159.289-10.695 11.15-34.133 14.108-49.152 6.372zM706.788 527.644c-8.875-2.731-17.067-10.695-22.073-21.618-3.868-8.42-4.324-17.749-4.324-146.318 0-131.072 0.228-137.444 4.324-145.863 7.282-13.881 19.115-21.618 35.499-22.528 18.887-1.138 31.858 5.689 39.822 21.163l5.689 11.15 0.455 131.072c0.683 138.809 0 147.456-10.012 160.199-10.468 12.971-30.72 18.204-49.38 12.743z" /> <glyph unicode="&#xe902;" glyph-name="call" d="M450.56 947.257c-33.223-5.006-75.776-14.336-88.747-19.57-3.186-1.365-8.647-3.186-12.516-4.324-22.528-5.916-69.404-27.534-100.807-46.421-65.308-39.14-130.844-104.676-169.984-169.984-18.66-31.175-39.822-77.141-46.649-100.807-0.91-3.641-2.958-9.785-4.096-13.653-20.48-61.212-28.672-147.456-19.797-210.034 5.461-37.774 13.881-77.141 19.797-91.477 1.365-3.186 3.186-8.647 4.324-12.516 9.557-36.181 42.553-99.669 72.135-138.809 50.517-66.674 109.682-116.281 182.5-152.69 50.062-25.031 98.076-39.595 158.834-48.469 21.39-3.186 113.778-3.186 135.168 0 79.644 11.605 145.18 35.726 211.172 78.052 34.588 22.073 75.776 58.482 106.041 93.525 35.271 40.96 57.116 75.321 81.237 128.796 16.839 36.636 31.63 89.202 37.319 132.892 1.138 8.875 2.731 13.426 4.779 13.198 2.048-0.455 2.731 12.288 2.731 57.344s-0.683 57.799-2.731 57.572c-2.048-0.455-3.641 4.096-4.779 12.971-5.689 43.691-20.48 96.256-37.319 132.892-38.912 85.788-89.884 149.732-163.385 205.483-39.14 29.582-102.628 62.578-138.809 72.135-3.641 1.138-9.33 2.958-12.516 4.324-13.653 5.461-55.979 14.791-91.477 19.797-30.037 4.324-92.615 4.096-122.425-0.228zM571.847 920.178c60.53-8.192 106.724-22.528 159.744-49.38 48.014-24.576 83.74-50.517 121.742-88.292 48.924-49.152 80.782-98.076 109.909-169.529 5.234-12.743 16.156-49.38 20.48-68.267 17.067-76.004 13.426-165.433-10.012-242.347-6.372-20.935-9.33-28.444-18.432-50.062-48.924-113.095-139.719-204.117-252.132-252.132-22.3-9.557-29.355-12.060-50.062-18.432-78.052-23.666-158.834-27.307-241.209-10.24-17.749 3.641-56.889 15.246-70.542 21.163-4.324 1.82-12.516 5.234-18.204 7.509-111.047 47.104-204.345 140.174-252.132 252.132-9.557 22.3-12.060 29.355-18.432 50.062-27.762 91.477-27.762 188.416 0 279.893 6.372 20.708 8.875 27.762 18.432 50.062 47.787 111.957 141.084 205.028 252.132 252.132 5.689 2.276 13.881 5.689 18.204 7.509 13.426 5.689 52.565 17.522 70.542 21.39 50.062 10.24 113.323 12.971 159.972 6.827zM337.92 697.628c-27.534-21.845-53.476-48.924-53.476-55.751 0-1.138-1.593-3.413-3.413-5.006s-3.413-4.324-3.413-6.372c0-1.82-1.365-5.234-2.958-7.054-3.186-3.641-7.737-17.749-14.108-42.553-4.324-17.522-4.324-49.152 0-63.716 1.82-6.144 3.413-13.653 3.413-16.612 0-6.144 5.916-25.714 10.468-34.816 1.82-3.186 3.186-7.054 3.186-8.647 0-2.958 20.935-45.739 27.307-55.751 2.503-3.641 5.461-8.875 6.827-11.378 5.006-10.012 34.816-48.697 60.53-78.507 18.432-21.618 48.469-51.883 65.764-66.219 5.006-4.324 11.15-9.557 13.653-11.833 4.096-3.868 30.265-21.845 40.96-28.217 12.060-7.054 51.428-25.714 54.613-25.714 2.048 0 5.689-1.138 8.192-2.503 7.282-3.868 40.505-8.875 59.164-8.875 19.797 0 40.277 3.186 53.248 8.192 12.743 5.006 24.348 10.24 28.444 12.516 1.82 1.138 5.006 2.731 6.827 3.641 7.737 3.413 34.133 25.941 52.793 45.056 5.461 5.689 10.923 18.204 10.923 25.031 0 9.102-8.647 25.486-20.025 38.002-9.33 10.012-52.11 46.421-59.62 50.745-25.486 14.108-46.421 16.612-63.488 7.737-10.012-5.234-26.852-19.115-38.912-32.54-30.265-33.223-68.494-18.66-133.348 51.2-9.785 10.923-35.499 44.373-38.002 49.835-0.91 1.82-3.641 6.599-5.916 10.24-20.935 32.54-22.756 61.212-4.551 76.914 4.324 4.096 15.474 13.198 24.348 20.48 20.025 16.612 26.169 24.348 31.175 40.277 3.868 12.288 3.868 13.198-0.683 27.307-4.779 15.246-9.785 27.307-14.791 35.271-19.57 31.63-33.906 50.972-45.511 61.44-13.426 12.288-14.108 12.516-27.534 12.516-13.653 0-14.336-0.228-32.085-14.336z" /> <glyph unicode="&#xe903;" glyph-name="email" d="M451.98 957.251c0.229-2.062-4.353-3.665-13.287-4.811-24.512-3.207-69.183-13.287-81.324-18.098-3.207-1.374-8.705-3.207-12.6-4.353-22.679-5.956-69.87-27.719-101.484-46.733-65.747-39.402-131.723-105.378-171.125-171.125-18.785-31.384-40.089-77.659-46.962-101.484-0.916-3.665-2.978-9.851-4.123-13.745-8.018-23.596-13.516-48.336-18.556-83.157-3.207-21.305-3.207-114.541 0-136.075 11.454-79.492 36.195-146.384 78.575-212.589 37.34-58.187 101.942-120.727 162.191-156.922 31.613-19.014 78.804-40.777 101.484-46.733 3.894-1.145 9.392-2.978 12.6-4.353 13.058-5.269 51.544-13.745 84.302-18.556 21.534-3.207 114.541-3.207 136.075 0 32.759 4.811 71.245 13.287 84.302 18.556 3.207 1.374 8.934 3.207 12.6 4.353 36.424 9.621 100.338 42.838 139.74 72.619 73.994 56.125 125.308 120.498 164.481 206.862 16.952 36.882 31.843 89.8 37.57 133.784 1.145 8.934 2.749 13.516 4.811 13.287 2.062-0.458 2.749 12.37 2.749 57.729s-0.687 58.187-2.749 57.958c-2.062-0.458-3.665 4.123-4.811 13.058-5.727 43.984-20.617 96.902-37.57 133.784-39.173 86.364-90.488 150.736-164.481 206.862-39.402 29.781-103.316 62.998-139.74 72.619-3.665 1.145-9.392 2.978-12.6 4.353-12.141 4.811-56.813 14.89-81.324 18.098-8.934 1.145-13.516 2.749-13.058 4.811 0.229 2.062-12.6 2.749-57.958 2.749s-58.187-0.687-57.729-2.749zM568.813 926.783c60.936-8.247 107.44-22.679 160.816-49.711 70.328-35.966 123.705-81.553 173.416-148.446 11.225-15.119 37.34-59.332 44.671-75.597 13.516-30.010 18.327-42.838 25.657-66.434 23.825-78.117 27.49-163.336 10.309-242.828-4.123-19.243-15.119-55.896-20.847-69.87-29.552-72.619-60.936-120.727-110.647-170.667-49.482-49.253-98.735-81.324-170.667-110.647-13.974-5.727-50.627-16.723-69.87-20.847-66.434-14.203-135.388-14.203-203.884 0-17.868 3.665-57.271 15.349-71.016 21.305-4.353 1.833-12.6 5.269-18.327 7.56-103.774 43.984-195.408 130.806-243.286 230.915-13.745 28.864-21.076 47.42-29.094 73.306-14.203 46.504-20.847 91.862-20.847 140.886 0 78.346 17.181 149.362 53.147 219.919 51.773 101.255 137.45 181.663 240.079 225.188 5.727 2.291 13.974 5.727 18.327 7.56 13.516 5.727 52.918 17.639 71.016 21.534 50.398 10.309 114.083 13.058 161.045 6.872zM271.921 633.099c-0.916-0.687-1.604-2.52-1.604-3.665 0-2.749 204.571-206.862 215.338-214.88 15.119-11.454 39.86-12.6 54.751-2.749 3.207 2.062 52.231 49.711 108.814 105.836s104.92 104.004 107.211 106.294c2.52 2.291 3.894 5.498 3.436 6.872-0.687 2.062-58.645 2.978-243.744 3.436-133.555 0.229-243.515-0.229-244.202-1.145zM241.911 599.882c-3.207-4.582-3.665-23.366-3.665-158.983 0-145.926 0.229-153.944 4.123-157.38 2.291-2.291 4.582-3.894 5.269-3.894 1.374 0 162.42 161.045 162.42 162.649 0 1.833-161.274 162.649-163.107 162.649-0.916 0-3.207-2.291-5.040-5.040zM701.451 524.743c-44.213-44.213-80.637-81.553-80.637-83.157 0-3.894 160.587-162.191 163.565-161.274 3.436 1.145 3.436 322.778 0.229 323.923-1.374 0.458-38.715-35.508-83.157-79.492zM351.642 336.895c-43.984-43.984-80.179-81.324-80.179-82.928 0-2.52 45.358-2.978 242.599-3.665 138.137-0.229 243.744 0.458 244.889 1.604 2.062 2.062-155.547 161.274-162.191 163.794-2.062 0.687-7.56-2.978-14.203-9.621-26.115-26.115-40.319-32.988-67.579-32.988-25.886 0-40.089 6.414-62.54 28.177-8.934 8.705-17.41 15.807-18.556 15.807s-38.028-35.966-82.241-80.179z" /> <glyph unicode="&#xe904;" glyph-name="globe" d="M506.766 953.856c-0.91-0.91-17.294-2.276-36.409-3.186-32.085-1.593-71.225-6.599-76.686-10.012-1.365-0.683-7.054-2.276-13.198-3.413-27.534-5.006-83.285-27.762-116.508-47.559-4.324-2.503-9.557-5.461-11.378-6.372-1.82-0.683-7.054-4.324-11.605-7.964-4.551-3.413-9.102-6.372-9.785-6.372-0.91 0-11.378-7.282-23.666-16.384-24.576-18.204-100.58-92.615-100.58-98.532 0-0.91-4.551-7.509-10.24-14.791s-10.24-13.881-10.24-14.564c0-0.455-4.551-7.737-10.24-15.929-5.689-8.42-10.24-16.384-10.24-18.204 0-1.593-1.593-4.324-3.413-5.916s-3.413-4.551-3.413-6.827c0-2.276-1.593-5.234-3.413-6.827s-3.413-4.096-3.413-5.689c0-1.82-1.365-5.916-3.186-9.557-11.378-22.528-27.989-71.452-31.63-92.843-0.683-3.641-2.276-10.923-3.641-15.929-6.372-25.486-9.33-58.709-9.33-103.538 0.228-25.714 1.138-51.2 2.503-56.889 1.138-5.689 2.731-14.791 3.413-20.48 0.455-5.689 2.276-15.929 4.096-22.756s4.324-17.067 5.916-22.756c1.365-5.689 3.413-13.881 4.551-18.204 2.503-10.468 6.599-22.3 10.468-30.037 1.82-3.186 3.186-7.054 3.186-8.42 0-4.324 19.115-45.056 31.63-67.356 25.486-45.511 64.171-93.070 108.772-133.348 7.964-7.282 50.745-39.367 55.296-41.643 3.641-1.593 7.509-3.868 21.618-12.971 10.923-6.827 48.242-25.031 62.578-30.492 5.689-2.048 12.288-5.006 14.791-6.372 2.503-1.138 7.509-3.186 11.378-4.096 3.641-0.91 10.012-2.731 13.653-3.868 23.893-7.964 61.895-16.384 73.956-16.384 5.689 0 16.384-1.593 23.438-3.413 15.701-4.096 96.484-4.551 113.095-0.91 5.689 1.365 16.839 3.186 25.031 4.324 18.204 2.276 50.062 9.557 69.404 16.384 3.868 1.138 10.24 3.186 14.564 4.096 4.096 1.138 8.647 2.958 10.012 4.324s4.551 2.503 6.827 2.503c2.276 0 7.054 1.365 10.24 3.186 3.413 1.593 10.24 5.006 15.246 7.054 5.006 2.276 10.695 5.006 12.516 6.144 1.82 0.91 4.551 2.276 5.689 2.731 1.365 0.455 3.868 1.593 5.689 2.276s6.599 3.413 10.24 5.916c3.868 2.503 9.102 5.461 11.833 6.599 6.599 2.958 29.355 18.432 51.883 35.271 19.797 14.791 76.686 70.77 90.567 88.974 17.294 22.756 30.492 40.96 31.858 44.373 0.91 1.82 3.641 6.599 6.144 10.24 5.916 9.33 34.133 65.991 34.133 68.949 0 1.365 1.365 5.234 3.186 8.875 4.779 9.785 9.785 24.804 15.019 46.194 1.593 5.689 3.868 13.881 5.234 18.204s3.186 13.653 4.324 20.48c0.91 6.827 2.731 20.252 4.096 29.582 6.599 45.056 7.282 55.068 5.916 78.507-2.503 43.918-6.599 73.5-14.108 100.352-1.82 6.372-3.186 13.198-3.186 15.246 0 4.551-12.743 45.511-17.294 56.206-2.048 4.324-5.006 10.923-6.827 14.336-1.82 3.641-3.186 7.737-3.186 9.33s-2.503 7.509-5.461 12.971c-3.186 5.461-7.964 14.564-10.695 20.252s-7.737 14.336-10.923 19.342c-3.186 5.006-6.827 10.923-8.192 12.971-6.144 10.012-23.893 35.726-26.852 38.684-1.82 1.82-8.875 9.785-15.474 17.977-15.701 18.887-44.601 47.104-64.398 63.26-17.749 14.336-43.918 33.451-49.152 35.954-1.82 0.683-6.372 3.868-10.24 6.599-6.372 4.551-43.918 23.893-62.578 32.085-4.324 1.82-10.695 5.006-14.108 6.599-3.186 1.82-7.509 3.186-9.557 3.186-1.82 0-6.827 1.365-10.923 3.186-13.653 5.916-51.2 15.474-75.776 19.57-8.647 1.593-30.72 3.413-48.924 4.324s-35.044 2.503-37.547 3.413c-2.503 0.91-5.461 0.91-6.372-0.228zM481.28 788.878c0-54.613-0.683-100.124-1.593-101.035-1.82-1.593-11.378-1.593-29.127 0.228-4.324 0.455-17.067 1.365-28.444 2.048-94.208 5.916-87.609 5.234-92.16 8.192-2.731 1.593-2.731 2.958-0.228 8.42 1.593 3.413 4.324 9.785 6.144 13.881 6.372 14.791 10.012 22.528 17.977 39.14 8.875 18.432 10.24 20.935 20.025 35.954 3.413 5.461 6.144 10.468 6.144 11.378 0 3.186 35.499 42.553 44.601 49.38 4.779 3.641 10.012 7.737 11.15 9.33 2.958 3.186 25.714 16.839 28.217 16.839 1.138 0 3.186 1.593 4.779 3.413 1.593 2.048 5.234 3.413 7.737 2.958 4.779-0.683 4.779-1.138 4.779-100.124zM555.008 884.452c11.378-3.868 35.499-20.252 50.517-34.361 11.605-10.695 37.547-43.236 41.415-51.655 0.91-1.82 3.641-6.372 5.916-10.24 4.779-7.509 17.294-32.54 27.989-55.751 3.641-8.192 8.192-17.977 10.24-21.845 1.82-4.096 2.958-9.102 2.503-11.378-0.91-5.234-13.426-6.827-70.087-8.647-41.415-1.593-48.924-2.048-65.991-4.551-5.689-0.91-11.605-0.683-13.198 0.455-2.048 1.365-2.731 23.438-2.731 99.669 0 53.703 0 98.304 0 99.442 0 2.276 4.096 2.048 13.426-1.138zM339.74 855.324c-0.683-2.276-2.503-5.689-4.324-7.054s-3.186-3.641-3.186-4.779c0-1.365-2.958-6.144-6.827-10.923-3.641-4.779-6.827-10.24-6.827-12.060 0-2.048-0.91-4.096-2.048-4.779-1.82-1.138-4.324-5.461-14.564-25.259-3.641-6.827-15.246-32.313-20.708-45.511-5.006-11.833-8.647-22.528-9.785-29.127-1.82-9.33-7.509-11.378-20.48-7.509-11.15 3.186-27.762 6.827-46.194 10.24-8.647 1.593-20.935 4.551-35.726 8.42-4.551 1.138-3.413 4.324 4.551 13.426 29.81 34.361 70.77 68.949 105.131 88.974 8.647 5.234 47.787 24.576 54.613 27.307 3.868 1.365 7.054 2.731 7.282 2.958 0 0-0.228-1.82-0.91-4.324zM699.733 851.684c2.503-1.82 6.144-3.186 8.192-3.186s5.006-1.593 6.599-3.413c1.593-1.82 4.096-3.413 5.916-3.413 1.593 0 7.509-2.958 12.971-6.827 5.689-3.641 10.923-6.827 11.833-6.827s5.461-2.958 10.24-6.827c4.779-3.641 9.33-6.827 10.24-6.827 6.599 0 92.16-79.417 92.16-85.788 0-3.186-18.887-9.785-28.672-9.785-3.868 0-10.923-1.593-15.246-3.413-4.551-1.82-11.833-3.413-15.929-3.413-4.324 0-12.288-1.593-17.522-3.413s-12.971-3.413-17.067-3.413c-7.737 0-8.647 1.593-18.66 28.444-5.006 13.426-10.695 26.852-21.163 48.924-4.779 10.012-6.827 14.336-11.378 22.3-1.365 2.048-3.186 5.916-4.324 8.42s-4.779 8.42-7.964 13.198c-3.186 4.779-5.916 9.33-5.916 10.24s-3.186 5.006-6.827 9.33c-3.868 4.096-6.827 8.647-6.827 9.785 0 2.731 13.426 0 19.342-4.096zM151.324 671.004c12.516-2.731 27.534-6.599 39.822-10.468 5.689-1.82 12.516-3.186 15.019-3.186 2.731 0 8.647-1.593 12.971-3.413 4.551-1.82 11.15-3.413 14.791-3.413 11.378 0 12.516-3.641 9.785-32.313-2.276-25.031-3.641-35.726-10.468-86.016-1.82-13.198-3.641-29.355-4.096-35.954-1.593-21.163 2.731-20.025-85.106-20.025l-76.914 0.228 0.228 18.204c0.455 23.211 8.42 64.853 15.929 82.603 1.82 4.096 3.186 8.875 3.186 10.695s1.365 6.599 3.186 10.695c1.82 4.096 5.461 13.198 8.192 20.025 2.958 6.827 8.192 18.66 11.833 26.169 14.564 29.355 16.384 31.63 25.486 29.582 3.868-0.91 11.15-2.503 16.156-3.413zM903.168 661.447c5.234-10.468 7.964-15.474 11.605-21.618 1.365-2.276 2.958-5.689 3.641-7.509s2.731-6.372 4.551-9.785c1.593-3.641 3.186-8.192 3.186-10.468 0-2.048 1.593-5.916 3.413-8.42 1.82-2.276 3.413-6.372 3.413-9.102 0-2.503 1.593-6.599 3.413-9.102 1.82-2.276 3.413-6.827 3.413-9.785s1.365-10.695 3.186-17.067c7.964-27.989 10.468-40.050 11.605-58.709 0.91-14.791 0.683-20.025-1.593-21.618-1.593-0.91-37.092-1.82-78.734-2.048-87.609-0.228-77.824-3.413-81.92 27.534-6.144 45.511-7.737 58.254-9.557 77.369-1.138 11.378-2.958 25.031-4.324 30.72-3.413 15.019-3.186 30.72 0.683 34.133 1.82 1.365 8.875 3.413 15.474 4.324 6.599 1.138 17.294 3.186 23.438 4.779 6.372 1.365 17.067 4.096 23.893 5.689s18.66 4.551 26.169 6.372c7.509 1.82 17.294 3.413 21.845 3.641 7.282 0.228 8.647-0.683 13.198-9.33zM375.467 633.23c12.516-1.365 40.277-3.186 63.716-4.324 26.624-1.138 39.367-3.186 41.415-6.599 2.503-3.868 2.048-138.354-0.455-142.45-1.82-2.958-15.019-3.413-94.663-3.641-86.471-0.228-92.388 0-93.753 3.868-1.593 4.324 0.683 62.35 2.958 73.728 0.683 3.868 2.276 14.791 3.413 24.348 1.138 9.785 2.731 18.887 3.413 20.252 0.91 1.365 2.503 9.102 3.413 17.067 2.731 22.073 2.731 22.073 35.271 20.252 15.019-0.91 30.948-1.82 35.271-2.503zM714.98 624.811c0.683-6.144 2.503-14.108 3.868-17.977s2.503-10.695 2.503-15.246c0-4.551 1.138-11.833 2.503-16.156 2.503-8.42 6.827-52.11 6.599-66.446 0-4.551 0.91-12.516 2.048-17.294 0.91-5.006 1.138-10.468 0-12.060-2.731-4.551-185.23-5.006-188.871-0.683-3.186 3.868-2.958 141.995 0.228 145.18 2.503 2.503 9.102 3.186 42.098 4.779 12.516 0.683 32.085 1.593 43.236 2.276 11.378 0.455 25.031 0.91 30.72 1.138 5.689 0 11.833 0.91 13.653 2.048 1.82 1.365 11.605 2.048 21.618 1.82l18.204-0.455 1.593-10.923zM225.052 414.094c3.186-3.186 4.324-7.964 4.551-21.845 0.228-9.785 0.91-18.66 1.593-19.57 1.365-2.276 3.186-14.108 4.551-29.355 0.683-6.827 2.503-20.708 4.324-30.72 1.593-10.012 3.641-27.534 4.551-38.912 1.593-22.983 0.91-24.576-12.516-26.624-11.605-1.593-33.678-6.144-46.649-9.557-35.044-9.33-53.476-12.971-59.164-11.605-3.186 0.91-8.192 8.192-15.701 23.438-5.916 12.288-12.060 24.348-13.198 26.852-1.365 2.503-3.413 7.509-4.324 11.378-0.91 3.641-3.868 12.516-6.599 19.342s-5.916 17.294-6.827 23.211c-1.138 6.144-2.731 12.060-3.413 13.198-3.868 6.372-11.605 65.991-9.33 71.68 1.138 2.958 12.971 3.413 77.596 3.413 71.225 0 76.459-0.228 80.555-4.324zM479.46 415.46c2.503-2.503 2.503-141.767 0-144.27-1.138-0.91-21.163-2.503-44.373-3.641-23.438-0.91-46.194-2.276-50.517-2.731-4.324-0.683-22.3-1.82-39.822-2.503-37.547-1.593-36.864-2.048-40.050 20.708-1.138 8.42-2.958 16.839-4.096 18.887-0.91 2.048-2.503 12.971-3.413 23.893-0.683 11.15-2.503 22.073-3.641 24.348-2.503 4.779-3.186 64.398-0.683 66.901 2.276 2.276 184.32 0.683 186.596-1.593zM727.495 417.052c4.779-1.365 5.006-2.276 3.868-18.887-3.413-54.841-7.964-90.795-13.653-110.82-1.82-6.372-3.186-14.108-3.186-17.522 0-3.186-1.138-6.599-2.731-7.509-3.868-2.503-49.607-1.138-83.74 2.503-10.24 1.138-51.883 3.641-69.404 4.096l-13.653 0.455-0.683 71.68c-0.228 39.367 0 72.818 0.683 74.411 0.683 2.276 20.48 2.958 89.202 2.958 48.469 0 90.567-0.683 93.298-1.365zM952.092 417.052c3.186-1.138 3.413-4.324 2.503-20.025-1.365-18.887-6.372-46.421-10.695-60.53-1.365-4.324-3.413-11.605-4.324-15.929s-3.868-13.653-6.599-20.48c-2.731-6.827-5.916-15.474-7.054-19.342-1.138-3.641-7.964-18.66-15.474-32.996-10.012-20.025-14.108-26.169-17.522-25.941-4.324 0.228-17.749 3.413-38.457 8.875-19.115 5.006-33.678 8.42-44.373 10.468-5.689 1.138-15.246 3.413-21.618 5.234l-11.378 2.958v15.701c0.228 15.019 1.82 29.355 9.33 79.417 1.82 12.516 3.186 26.852 3.186 31.858 0 7.737 4.324 28.9 7.964 39.367 0.683 2.048 17.977 2.731 76.004 2.731 41.188 0 76.686-0.683 78.507-1.365zM480.597 206.108c0.91-1.365 1.82-45.966 1.82-98.987 0-79.189-0.455-96.484-3.186-97.394-5.234-2.048-35.954 14.108-51.655 27.079-13.653 11.378-43.691 45.966-47.104 53.931-0.683 1.82-5.689 9.785-11.15 17.749s-9.785 15.701-9.785 17.522c0 1.82-0.91 3.641-2.048 4.324-2.048 1.365-7.054 11.605-15.246 30.492-1.82 3.868-4.779 10.695-6.599 14.791-1.82 3.868-3.868 10.923-4.779 15.701-1.82 11.605-2.731 11.378 74.183 14.336 21.845 0.91 43.463 2.276 47.787 3.186 10.923 2.276 25.486 0.683 27.762-2.731zM566.613 208.384c4.324-0.91 23.893-2.048 43.236-2.731s39.367-1.82 44.373-2.276c5.006-0.683 15.701-1.593 23.666-2.048 7.964-0.683 15.019-1.82 15.929-2.503 0.683-0.91-0.455-4.551-2.731-8.192-2.048-3.868-3.868-8.42-3.868-10.012s-1.365-5.916-3.186-9.557c-1.82-3.413-4.779-10.012-6.827-14.336-4.551-10.923-12.743-27.534-15.701-32.996-28.444-49.607-58.254-83.968-89.202-102.855-11.605-7.054-25.259-12.288-27.989-10.468-4.551 2.958-4.324 194.105 0.455 197.518 3.413 2.503 8.875 2.731 21.845 0.455zM264.875 189.724c1.82-1.82 4.096-5.689 4.779-8.647 0.91-2.731 2.731-7.964 4.551-11.833 1.593-3.641 4.551-10.468 6.372-14.791 17.067-39.14 26.624-58.254 38.229-76.231 2.276-3.641 5.234-8.875 6.372-11.378s5.916-10.24 10.24-17.067c9.102-13.653 10.468-19.57 4.324-16.156-5.006 2.503-18.887 8.647-23.438 10.24-1.82 0.683-5.461 2.503-7.964 4.096-7.509 4.324-11.15 6.144-15.929 8.647-2.503 1.365-7.509 4.324-11.378 6.827-3.641 2.503-8.42 5.234-10.24 6.144-1.82 0.683-7.054 4.324-11.605 7.964-4.551 3.413-9.557 6.372-10.695 6.372-1.365 0-3.413 1.365-4.324 2.958s-6.827 6.827-12.743 11.378c-23.666 17.749-69.86 65.308-69.86 71.908 0 1.365 2.048 2.503 4.779 2.503 4.324 0 14.564 2.276 48.014 10.468 7.282 1.82 15.929 3.186 19.342 3.413 3.641 0 10.012 1.593 14.336 3.186 10.468 4.096 12.743 4.096 16.839 0zM780.288 186.311c3.641 0 9.557-1.138 13.198-2.503 3.413-1.365 11.605-3.413 17.749-4.551 32.085-5.461 46.649-9.557 46.649-13.198 0-3.413-22.983-28.217-48.014-51.655-10.695-9.785-53.248-42.325-58.937-44.828-1.82-0.91-6.372-3.641-10.24-5.916-3.641-2.503-11.378-6.599-17.067-9.33s-11.833-5.916-13.653-7.054c-1.82-1.138-5.006-2.731-6.827-3.413s-6.372-2.731-9.785-4.551c-8.875-4.324-12.971-4.096-12.971 1.138 0 2.503 0.683 4.779 1.82 5.234 2.731 1.138 22.073 29.355 24.576 35.954 0.683 1.82 2.048 5.006 3.186 6.827s5.916 11.15 10.468 20.48c4.551 9.33 9.102 18.66 10.24 20.48s2.731 5.006 3.413 6.827c0.683 1.82 2.503 6.599 4.324 10.24 1.593 3.868 3.641 8.875 4.096 11.378 2.503 9.33 8.647 24.348 12.060 29.582 3.413 5.006 3.868 5.234 11.15 2.048 4.324-1.82 10.923-3.186 14.564-3.186z" /> <glyph unicode="&#xe905;" glyph-name="pdf-download" horiz-adv-x="901" d="M176.356 948.167c-2.048-16.612-0.455-107.861 1.82-110.364 1.138-0.91 91.25-2.276 200.249-2.958l198.428-1.138v-205.255c0-112.868-0.91-205.938-1.82-207.076-1.138-0.91-89.202-2.048-195.698-2.276-106.724-0.228-195.698-0.91-197.746-1.593-3.868-0.91-4.096-12.060-4.096-193.195 0-183.637 0.228-192.284 4.096-195.925 3.868-3.413 13.426-3.641 101.717-3.186 65.764 0.455 97.621 1.365 98.304 3.186 0.91 2.731-18.432 28.444-46.421 61.668-4.324 5.234-10.695 12.971-13.881 17.294-12.743 16.612-51.655 64.171-54.158 66.446-5.461 5.006-14.564 18.887-14.564 22.528 0 3.413 5.916 3.868 73.956 3.641 40.505-0.228 74.866 0.228 76.231 1.138 1.593 0.91 2.276 26.169 2.276 77.824-0.228 41.87 0 76.686 0.683 77.141 1.365 1.593 263.509 1.138 266.012-0.455 1.138-0.683 1.82-33.678 1.82-77.596-0.228-41.87 0.228-76.686 0.683-77.369 0.683-0.455 34.133-0.91 74.183-0.683 83.513 0.228 82.148 0.683 67.129-17.294-5.006-5.916-13.198-16.156-18.66-23.211-5.234-7.054-10.468-13.426-11.378-14.108s-9.785-11.378-19.797-23.893c-10.012-12.288-19.797-24.121-21.618-26.169-3.413-3.868-18.432-22.756-35.954-45.284-5.234-6.827-10.695-13.198-12.060-14.108-1.365-0.683-2.048-3.413-1.593-5.689 0.683-4.096 4.779-4.324 91.705-5.006 50.062-0.455 96.484 0 103.083 0.683l11.833 1.365v666.51l-7.282 0.228c-4.096 0.228-62.578 0.455-129.707 0.683-85.561 0.228-122.88 0.91-124.7 2.731s-2.503 38.229-2.276 123.335c0 66.446-0.455 124.928-1.365 129.934l-1.593 9.33h-456.476l-1.365-11.833zM695.182 927.687c-2.048-5.234-0.228-169.529 1.82-171.804 2.731-2.503 170.212-3.641 172.715-1.138 1.138 1.138-32.768 36.864-80.782 84.878-97.621 97.621-92.16 92.388-93.753 88.064zM5.234 776.135l-5.234-0.683v-295.595l515.413 1.138 0.455 144.498c0.455 85.106-0.228 145.863-1.365 147.684-1.82 2.958-36.864 3.413-253.269 3.413-138.126 0.228-253.269 0-256-0.455zM129.707 715.15c13.198-3.186 17.294-5.461 26.396-14.791 13.881-14.108 20.252-31.63 16.612-45.739-1.365-5.461-2.958-12.288-3.641-15.246s-6.599-10.468-12.971-17.067c-9.33-9.33-14.791-12.516-26.169-15.701-7.737-2.276-16.612-3.641-19.115-2.958-10.012 2.503-11.378-0.683-11.605-31.858l-0.228-29.355-17.067-1.365c-9.33-0.683-18.432-0.683-19.797-0.228-2.276 0.683-2.958 20.252-2.958 87.836 0 48.014 0.683 87.836 1.593 88.519 2.958 3.186 53.476 1.593 68.949-2.048zM268.516 715.15c30.492-5.461 46.194-16.156 59.392-40.732 5.916-10.695 11.833-38.457 10.468-48.242-4.096-28.217-7.054-38.684-14.108-49.607-9.557-15.019-15.246-19.797-32.313-28.444l-14.336-6.827-36.864 0.455-37.092 0.683-0.683 85.333c-0.228 46.876 0 86.471 0.455 88.064 1.593 3.868 40.050 3.641 65.081-0.683zM455.339 700.587c0.683-9.33 0.683-18.204 0.228-19.797-0.683-1.82-8.42-2.958-23.893-3.413l-23.211-0.683-0.683-10.012c-0.455-5.689-0.228-12.516 0.683-15.474 1.365-5.461 1.82-5.461 22.756-5.006 11.833 0.455 22.073 0 22.983-0.683 1.82-1.82 1.82-33.451 0-35.271-0.683-0.683-11.378-1.365-23.438-1.593l-22.3-0.228-0.683-33.451c-0.455-23.666-1.365-33.451-3.413-34.133-1.365-0.455-10.468-0.455-19.797 0.228l-17.067 1.365-0.683 79.644c-0.228 43.918 0 82.83 0.683 86.926s2.958 7.737 5.234 8.192c2.048 0.683 21.39 0.91 42.553 0.683l38.684-0.228 1.365-17.067zM99.897 675.556c0-1.138-0.228-7.964-0.228-14.791s0.228-13.426 0.228-14.791c0.228-1.138 5.234-2.276 11.15-2.276 8.875 0 12.060 1.138 16.384 5.461 6.599 7.282 6.599 15.929 0 23.211-4.324 4.324-7.509 5.461-16.384 5.461-5.916 0-10.923-0.91-11.15-2.276zM245.077 676.238c-0.91-0.683-1.593-22.3-1.593-47.787 0-45.966 0-46.421 5.234-48.242 2.731-1.138 7.282-1.138 10.24 0s7.737 2.048 10.695 2.048c7.282 0 19.115 10.468 24.121 21.618 8.192 17.749 4.096 49.835-7.964 61.44-7.964 7.737-19.115 12.516-29.355 12.516-5.461 0-10.695-0.683-11.378-1.593zM469.675 298.041c-2.276-0.455-5.006-1.82-6.144-3.413-0.91-1.365-1.593-35.726-1.593-76.459 0.228-40.732 0.228-75.321 0-76.686 0-2.276-10.012-2.958-41.87-2.958-23.211 0-42.553-0.91-43.236-1.82-0.683-1.138 3.186-7.054 8.42-13.426 10.012-11.833 25.486-31.175 42.098-52.793 5.234-6.827 10.468-13.198 11.378-13.881s9.785-11.378 19.797-23.893c10.012-12.516 18.887-23.211 19.797-23.893 1.365-1.138 6.827-7.737 37.774-47.559 7.737-10.012 16.384-19.57 19.115-20.935 5.234-2.731 5.689-2.503 26.169 24.121 5.689 7.509 11.605 14.791 12.971 15.929 2.503 2.276 42.098 50.972 54.386 66.901 3.413 4.551 8.647 10.695 11.378 13.881 2.731 2.958 9.102 10.923 14.108 17.294 13.198 16.839 27.534 34.816 37.092 46.194 4.551 5.461 8.192 10.468 7.964 11.378-0.455 0.683-19.797 1.82-43.236 2.503l-42.78 1.138-0.683 77.369c-0.228 47.559-1.365 78.052-2.731 79.417-2.276 2.276-129.707 3.641-140.174 1.593z" /> <glyph unicode="&#xe906;" glyph-name="envelop" d="M56.661 803.214l-5.461-4.551 197.291-196.608c185.685-185.23 206.393-205.255 220.046-212.764 23.211-13.198 57.344-12.971 83.968 0.683 11.378 5.689 25.714 19.797 228.921 222.549 176.811 176.356 186.368 186.14 182.727 190.009-3.868 3.641-30.948 3.868-453.063 4.551-441.913 0.455-449.195 0.455-454.428-3.868zM3.641 749.511c-3.413-5.006-3.641-32.768-3.641-300.828 0-287.858 0.228-295.595 4.551-301.056l4.324-5.689 38.912 38.684c188.416 187.506 266.24 266.012 266.24 268.516 0 1.593-58.937 61.668-131.072 133.575-71.908 71.68-140.174 139.947-151.78 151.552-11.378 11.378-21.39 20.935-22.3 20.935s-3.186-2.503-5.234-5.689zM988.274 734.265c-11.605-11.605-76.004-76.004-143.132-142.905-67.356-66.901-126.748-126.521-132.21-132.21l-9.785-10.695 129.024-128.796c71.225-70.77 140.402-139.719 153.828-153.145 24.576-24.348 24.804-24.576 28.217-19.342 2.048 2.731 5.006 5.006 6.599 5.006 2.731 0 3.186 46.194 3.186 296.96 0 259.186-0.455 296.96-3.413 296.96-1.82 0-4.324 2.048-5.689 4.551s-3.186 4.551-4.096 4.551c-0.91 0-11.15-9.557-22.528-20.935zM204.572 252.075l-153.372-152.462 5.461-4.551c5.234-4.324 12.288-4.324 454.428-3.868 422.571 0.683 449.195 0.91 453.063 4.551 3.641 3.868-3.868 11.833-149.504 156.558-84.196 83.74-153.828 152.462-154.738 152.462-1.138 0-15.019-12.971-31.175-28.9-29.355-29.127-39.595-36.181-72.363-49.835-20.708-8.647-72.59-8.647-93.298 0-32.768 13.653-43.008 20.708-72.363 49.835-16.156 15.929-30.265 28.9-31.175 28.9s-70.542-68.722-154.965-152.69z" /> <glyph unicode="&#xe907;" glyph-name="phone" d="M236.658 956.814c0-1.82-2.048-3.868-4.324-4.779-5.234-1.593-29.582-17.067-34.361-21.845-1.82-1.82-15.701-14.336-30.72-27.534s-32.54-29.582-38.912-36.409c-10.24-10.695-35.044-43.236-35.044-45.966 0-0.683-2.958-5.689-6.827-11.15-3.641-5.689-6.827-11.15-6.827-12.516s-2.958-8.875-6.827-16.839c-3.641-7.737-6.827-16.156-6.827-18.204s-1.365-6.599-3.186-10.24c-3.413-6.599-7.737-25.714-13.881-60.985-9.102-53.020 0.455-119.922 28.444-201.387 7.282-20.935 37.319-83.968 45.739-96.028 2.503-3.186 4.324-6.827 4.324-7.964s4.551-9.102 10.24-17.522c5.689-8.647 10.24-15.929 10.24-16.156 0-2.048 36.864-55.068 48.697-69.86 7.509-10.012 16.156-21.163 18.887-25.031 2.958-3.868 9.785-12.288 15.246-18.66s14.336-16.612 19.57-22.983c34.816-41.87 98.532-105.358 144.953-144.498 28.217-23.893 88.974-65.991 112.185-77.824 4.324-2.276 10.468-5.689 13.653-7.282 18.887-10.24 68.494-30.948 74.411-30.948 1.82 0 6.144-1.365 9.33-3.186 3.413-1.593 12.288-4.324 19.797-5.916s18.204-3.868 23.893-5.006c17.749-4.096 108.772-4.779 126.748-1.138 27.534 5.916 38.002 8.875 44.601 12.060 3.641 1.82 7.964 3.186 9.557 3.186s5.916 1.365 9.557 3.186c3.413 1.82 10.468 5.006 15.474 7.282 22.3 10.24 53.931 31.175 70.542 46.649 5.006 4.779 11.833 10.923 15.019 13.881s9.785 8.875 14.564 13.198c4.779 4.324 10.468 9.102 12.743 10.24 5.689 3.413 24.576 26.169 29.582 35.726 3.186 6.372 4.324 13.198 4.324 26.624 0 16.156-0.91 19.57-7.964 33.451-13.198 25.259-37.092 50.517-88.747 93.070-5.916 5.006-14.564 12.288-18.887 15.929-15.019 12.971-31.175 23.666-49.38 32.54-32.768 16.384-36.181 17.294-59.847 17.067-19.797 0-23.666-0.683-37.092-7.282-8.42-3.868-16.384-8.647-17.977-10.468s-3.868-3.413-5.006-3.413c-2.958 0-34.588-28.672-55.068-49.607-8.875-9.33-18.204-17.749-20.708-18.887s-8.647-4.779-13.653-7.737c-7.964-4.779-11.833-5.689-29.81-5.689-29.81 0-56.206 10.695-93.070 38.002-35.271 26.169-120.377 115.598-144.498 152.007-1.82 2.731-7.964 11.605-13.653 19.57-28.217 40.050-43.918 73.728-48.014 102.172-2.731 18.204-0.455 46.649 3.868 50.29 1.82 1.365 3.186 3.641 3.186 4.779 0 4.551 12.971 18.887 27.762 30.492 8.42 6.827 15.929 12.288 16.612 12.288 2.958 0 44.146 37.092 52.793 47.332 13.198 15.929 17.977 24.804 22.3 42.553 8.192 32.996-3.413 72.135-37.092 127.431-5.461 8.875-10.923 17.977-12.516 20.48s-5.461 8.192-8.875 12.743c-3.641 4.551-6.372 8.875-6.372 9.557 0 1.365-17.977 27.534-25.031 36.864-11.605 15.019-33.223 35.044-44.146 40.96-7.054 3.868-12.743 8.192-12.743 9.785 0 2.048-5.689 2.731-20.48 2.731-16.156 0-20.48-0.683-20.48-3.186z" /> <glyph unicode="&#xe908;" glyph-name="file-upload" d="M491.52 956.587c0-2.048-2.731-4.551-6.144-5.916-10.012-3.641-215.95-210.261-222.777-223.232-15.019-29.355 0.91-62.805 34.588-73.5 12.288-3.868 13.426-3.868 26.852 0.228s15.246 5.689 71.225 61.44c39.822 39.595 58.027 56.434 59.847 54.613 1.593-1.593 2.276-93.070 2.276-291.044 0-210.034 0.683-291.271 2.503-297.643 5.689-18.887 29.355-36.181 49.835-36.181 20.252 0 43.008 16.612 49.607 36.181 2.048 5.689 2.731 84.196 2.731 296.96 0 198.428 0.683 290.133 2.276 291.726 1.82 1.82 20.025-14.791 59.847-54.613 55.751-55.524 57.799-57.344 71.225-61.44s14.564-4.096 26.852-0.228c32.768 10.24 48.697 42.553 35.726 71.908-3.413 7.509-31.175 36.636-110.364 115.826-58.254 58.254-108.999 107.179-112.868 108.772-3.641 1.365-6.827 4.324-6.827 6.144 0 2.731-3.641 3.413-18.204 3.413-14.791 0-18.204-0.683-18.204-3.413zM32.313 495.104c-11.15-4.096-22.756-14.336-27.762-24.804-4.551-9.33-4.551-13.881-4.551-240.981 0-152.007 0.683-232.107 2.276-233.017 1.138-0.683 2.276-3.413 2.276-5.916 0-14.336 35.499-49.835 49.835-49.835 2.503 0 5.234-0.91 5.916-2.276 2.048-3.186 896.796-3.186 898.844 0 0.683 1.365 3.413 2.276 5.916 2.276 14.336 0 49.835 35.499 49.835 50.062 0 2.503 2.048 5.689 4.551 7.282 4.551 2.958 4.551 5.461 4.551 234.382 0 203.435-0.455 231.652-3.413 231.652-1.82 0-4.779 3.413-6.599 7.509-8.42 20.48-37.774 31.63-63.033 23.893-11.15-3.186-28.217-20.025-32.085-30.948-2.276-6.372-3.186-57.344-4.096-215.495l-1.138-207.076h-807.822l-1.138 207.076c-0.91 157.696-1.82 209.124-4.096 215.495-3.868 10.923-20.935 27.762-32.085 30.948-10.923 3.413-26.396 3.186-36.181-0.228z" /> <glyph unicode="&#xe909;" glyph-name="user-view" d="M452.836 947.029c-75.548-12.743-131.072-47.559-173.17-108.772-38.002-55.524-50.745-133.348-32.313-199.111 12.516-45.284 33.906-81.237 67.584-114.005 44.146-43.463 110.364-70.315 172.26-70.315 29.582 0 80.1 11.378 102.855 23.211 22.073 11.378 29.582 15.701 42.098 25.031 17.977 13.198 34.816 29.582 48.924 47.104 13.653 17.294 15.474 20.025 23.211 35.726 2.958 6.372 6.372 12.288 7.282 12.971 4.779 4.779 15.701 43.008 20.252 69.632 9.785 60.302-7.054 126.521-45.511 178.859-7.282 10.012-17.067 22.073-21.618 27.079-10.012 10.468-38.912 32.996-53.931 41.643-20.025 11.833-63.033 27.989-73.728 27.989-3.186 0-12.971 1.593-21.618 3.413-19.342 4.096-37.092 3.868-62.578-0.455zM383.431 374.044c-10.012-1.82-23.211-3.186-29.582-3.186-12.971-0.228-40.505-4.779-78.507-13.198-14.336-3.186-30.265-6.599-35.271-7.509-12.516-2.731-27.989-6.827-37.547-10.24-4.324-1.593-13.653-4.551-20.48-6.599s-16.384-5.234-20.935-7.054c-8.42-3.186-17.977-6.827-37.092-14.108-27.762-10.468-89.429-41.415-98.304-49.152-9.102-7.964-19.797-23.438-22.3-32.54-3.186-11.15-4.096-209.806-0.91-220.501 6.144-20.935 21.845-41.415 38.457-49.835 20.708-10.468 18.887-10.468 256.228-10.468 123.335-0.228 224.825 0.228 225.508 0.683 1.138 1.138-7.282 6.372-27.762 17.522-7.509 4.096-15.246 8.875-17.294 10.468-1.82 1.82-4.324 3.186-5.234 3.186-3.868 0-48.924 36.636-65.991 53.703-15.929 15.929-53.703 61.895-53.703 65.536 0 0.683-2.731 5.006-5.916 9.785-13.198 19.342-15.701 27.534-15.474 51.883 0 23.893 0.91 26.852 18.887 55.751 3.641 6.144 29.81 41.415 31.858 43.236 0.683 0.683 7.737 7.964 15.474 16.384 19.797 21.618 63.26 58.709 68.494 58.709 1.365 0 2.731 0.683 3.186 1.82 0.683 1.82 39.822 25.486 42.098 25.486 0.683 0 4.779 2.276 9.102 4.779 5.916 3.641 7.054 5.461 4.779 6.827-4.779 3.186-121.060 1.82-141.767-1.365zM650.809 357.888c-26.169-3.413-49.835-8.647-56.434-12.060-2.503-1.365-6.827-2.503-9.33-2.503-5.689 0-14.336-3.641-47.559-20.025-42.78-20.708-72.59-42.553-104.448-76.459-17.522-18.204-39.367-45.056-39.367-47.787 0-0.683-3.413-6.144-7.282-12.060-6.599-9.557-7.509-12.743-7.509-25.714s0.91-16.156 7.509-25.714c3.868-5.916 7.282-11.378 7.282-12.060 0-2.731 21.845-29.355 38.912-47.332 16.839-17.977 55.524-50.972 63.488-54.613 1.82-0.683 6.599-3.413 10.24-5.689 20.025-12.971 54.841-29.355 72.818-34.361 3.868-0.91 10.012-2.958 13.653-4.324 33.223-11.378 76.231-17.067 116.053-15.474 37.774 1.593 79.189 8.647 98.532 16.612 4.096 1.82 8.875 3.186 10.695 3.186 5.916 0 43.463 17.522 66.901 31.403 33.223 19.342 74.411 54.841 98.076 84.423 14.108 17.749 31.63 44.601 31.858 48.469 0 2.276 2.048 5.234 4.551 6.827 3.186 2.048 4.551 5.461 4.551 10.695 0 4.324-0.683 7.054-1.593 6.372-2.048-2.048-7.509 2.731-7.509 6.827 0 8.875-40.050 61.212-63.943 83.74-12.971 12.288-48.697 40.277-54.386 42.78-1.82 0.91-6.372 3.641-10.24 6.144-17.977 11.605-58.254 29.582-76.914 34.361-4.779 1.138-10.24 2.958-12.516 4.096-5.234 2.731-26.396 6.827-55.068 10.468-28.9 3.868-61.895 3.868-91.022-0.228zM755.484 285.070c21.618-5.006 38.912-10.24 45.966-13.653 3.186-1.82 7.054-3.186 8.647-3.186 2.503 0 26.169-11.378 38.912-18.432 6.599-3.868 36.864-26.396 47.332-35.271 4.096-3.641 15.701-15.701 25.486-27.079 20.48-22.983 21.618-27.534 10.923-39.822-3.641-4.324-12.060-13.881-18.204-21.163-10.24-11.605-36.864-35.044-47.332-41.415-2.048-1.365-7.964-5.234-13.198-8.647-5.461-3.413-10.695-6.144-11.833-6.144s-3.186-1.593-4.779-3.413c-1.593-1.82-4.551-3.413-6.827-3.413s-5.234-1.365-6.599-3.186c-1.365-1.82-5.006-3.641-7.737-4.324s-11.15-3.413-18.66-6.144c-30.948-11.15-68.267-17.977-97.849-18.204-51.883 0-114.233 17.294-153.6 43.008-6.827 4.551-14.108 8.875-15.929 9.557-4.779 2.048-40.277 33.678-51.2 45.511-13.426 14.791-23.893 28.444-23.893 31.63 0 8.875 47.787 58.254 72.818 75.321 35.726 24.121 59.392 34.588 109.227 47.787 26.169 6.827 89.202 7.282 118.329 0.683zM675.84 241.152c-18.432-3.641-38.457-17.977-49.607-35.271-7.964-12.288-14.108-31.858-14.108-44.601 0-11.15 6.599-34.816 10.923-39.14 1.593-1.593 2.731-3.868 2.731-5.234 0-3.641 20.252-22.528 29.582-27.534 26.624-14.108 58.482-12.971 83.513 3.186 15.246 9.785 24.576 20.48 31.858 36.409 4.779 10.468 5.689 15.929 5.689 32.768 0 17.749-0.91 21.618-7.282 34.816-7.964 16.156-23.438 31.858-39.595 39.595-10.695 5.234-39.595 7.964-53.703 5.006z" /> <glyph unicode="&#xe90a;" glyph-name="dashboard" d="M458.524 956.587c-1.593-2.503-9.33-4.096-26.396-5.689-13.426-1.365-32.313-4.551-42.098-7.054-10.012-2.731-22.528-5.689-28.217-6.827s-15.246-4.551-21.163-7.737c-6.144-3.186-12.060-5.689-13.198-5.689-3.641 0-69.404-31.403-82.83-39.367-66.446-40.050-130.844-104.448-170.894-170.212-14.336-23.893-39.367-74.183-42.098-84.878-0.91-3.868-3.868-12.743-6.599-19.57s-5.689-16.156-6.599-20.48c-1.138-4.324-2.958-12.288-4.551-17.522-1.365-5.461-3.641-14.108-5.006-19.342-5.689-20.935-7.509-48.469-7.509-106.496 0-58.482 1.82-85.788 7.509-106.951 1.593-5.689 4.324-16.384 6.372-23.893 1.82-7.509 5.916-20.708 9.102-29.582 2.958-8.647 6.372-19.115 7.282-22.756 0.91-3.868 2.731-8.875 4.096-11.378s7.964-15.701 14.564-29.582c28.217-58.482 57.344-98.304 107.861-147.456 22.3-21.618 70.315-58.937 85.333-65.991 1.82-0.91 6.599-3.641 10.24-6.144 3.868-2.503 9.102-5.461 12.060-6.827 2.731-1.138 13.653-6.144 23.893-10.923 10.24-5.006 23.211-10.695 28.9-12.743 5.689-2.276 13.426-5.461 17.067-7.054 28.9-12.288 51.655-17.522 113.323-26.169 19.797-2.958 101.717-2.958 121.515 0 62.35 8.647 92.16 15.701 112.64 26.396 3.186 1.82 7.054 3.186 8.42 3.186 3.868 0 68.949 30.72 83.285 39.367 51.428 31.175 105.586 80.1 144.043 130.617 17.749 23.438 35.044 52.338 50.517 83.74 16.156 33.678 17.294 36.409 27.762 69.404 4.324 13.881 6.372 21.39 13.426 47.787 1.365 5.689 3.413 18.432 4.551 28.444 1.138 12.060 2.958 18.887 5.461 20.708 5.234 3.868 5.234 111.73 0 115.598-2.503 1.82-4.324 8.647-5.461 20.708-1.138 10.012-3.186 22.756-4.551 28.444-1.593 5.689-4.324 16.384-6.372 23.893-1.82 7.509-5.916 20.935-9.102 29.582-2.958 8.875-6.372 19.115-7.282 22.756-0.91 3.868-2.731 8.875-4.096 11.378s-7.964 15.929-14.564 29.582c-15.019 31.403-32.54 60.302-50.29 83.74-38.457 50.517-92.615 99.442-144.043 130.617-13.653 8.192-79.189 39.367-82.83 39.367-1.365 0-7.054 2.503-12.743 5.689-5.916 2.958-14.336 6.144-18.887 7.054-4.779 0.683-12.971 2.731-18.66 4.324-16.612 5.006-33.906 8.192-56.889 10.468-14.791 1.365-22.528 3.186-24.121 5.461-3.868 5.006-98.759 5.006-102.172 0zM530.204 824.604c1.593-1.82 4.096-3.413 5.461-3.413 3.641 0 11.15-8.192 16.384-18.204 4.096-7.509 4.324-18.66 5.461-219.364l1.138-211.172 11.378-5.916c17.977-9.33 44.601-37.319 53.476-56.206 17.522-37.319 17.749-76.004 1.138-111.502-11.15-23.666-26.396-40.505-50.062-55.068-15.019-9.33-47.332-18.887-64.626-18.887-15.019 0-40.732 6.372-57.116 14.336-14.108 6.827-18.432 10.012-31.858 22.528-7.054 6.372-20.48 23.438-20.48 25.941 0 0.91-1.365 3.413-2.958 5.234-1.82 2.048-4.779 8.192-6.827 13.881-10.923 31.403-11.15 67.129-0.455 92.16 1.593 3.868 3.641 8.42 4.324 10.24 2.503 6.599 17.749 27.534 26.396 36.636 5.461 5.689 19.797 15.929 30.265 21.39l9.557 5.234 1.138 212.309c1.138 195.698 1.365 212.992 5.006 219.591 4.096 7.282 10.468 13.426 20.025 19.797 7.737 5.006 39.14 5.461 43.236 0.455zM311.979 727.893c10.923-5.689 27.079-19.797 27.079-23.893 0-1.593 1.365-4.096 3.186-5.461 2.958-2.503 6.144-15.701 7.282-29.81 1.365-19.115-15.246-46.194-33.906-55.296-16.384-7.737-25.486-9.33-40.732-6.144-7.964 1.593-15.929 4.324-17.977 5.916-1.82 1.82-4.551 3.186-5.689 3.186-3.868 0-18.432 16.612-23.438 26.624-6.827 13.653-6.599 40.050 0.228 53.476 6.372 11.833 18.432 24.348 30.265 30.72 12.743 6.827 40.732 7.282 53.703 0.683zM759.808 727.438c12.516-6.144 25.031-18.204 31.63-30.948 6.827-13.426 7.054-39.822 0.228-53.476-5.006-10.012-19.57-26.624-23.438-26.624-1.138 0-3.868-1.365-5.689-3.186-2.048-1.593-10.012-4.324-17.977-5.916-11.378-2.276-16.156-2.276-23.893-0.228-27.534 8.192-41.415 22.073-49.607 49.607-2.048 7.737-2.048 12.516 0.228 23.893 1.593 7.964 4.324 15.929 5.916 17.977 1.82 1.82 3.186 4.551 3.186 5.689 0 3.641 16.384 18.204 26.169 23.211 12.971 6.827 39.14 6.827 53.248 0zM220.046 501.703c8.875-4.779 20.708-16.156 23.666-22.756 1.138-2.731 2.958-6.372 4.096-8.192 5.006-8.42 7.054-25.031 4.551-35.726-1.365-6.144-3.413-12.516-4.551-14.336s-2.958-5.461-4.096-8.192c-3.186-7.282-14.791-17.977-25.714-23.666-7.964-4.324-13.198-5.234-29.355-5.234-18.66 0-20.025 0.455-32.313 8.42-20.935 13.881-29.355 29.355-29.355 53.703 0 17.749 1.82 22.983 12.743 39.14 5.461 8.192 25.941 21.618 34.361 22.756 12.743 1.365 38.684-2.048 45.966-5.916zM863.573 499.2c20.48-13.653 28.9-29.127 28.9-53.476s-8.42-39.822-29.355-53.703c-12.288-7.964-13.653-8.42-32.313-8.42-16.156 0-21.39 0.91-29.355 5.234-10.923 5.689-22.528 16.384-25.714 23.666-1.138 2.731-2.958 6.372-4.096 8.192s-3.186 8.192-4.551 14.336c-5.689 24.121 9.102 54.158 33.223 67.129 6.827 3.641 12.971 4.779 29.81 4.779 20.708 0.228 21.618 0 33.451-7.737z" /> <glyph unicode="&#xe90b;" glyph-name="order" d="M186.596 906.069c-10.24-6.827-16.384-13.198-20.708-21.618-4.096-8.192-4.324-20.252-4.324-443.733l0.228-435.314 5.234-9.102c2.731-5.006 9.102-11.833 14.108-15.246l8.875-6.144 643.527-0.228 8.192 5.006c10.012 6.144 12.516 9.33 18.432 21.618 4.551 9.33 4.551 14.108 4.096 311.751l-0.683 302.194-128.569 1.138c-141.084 1.138-137.216 0.91-150.414 15.246-13.881 14.791-13.426 9.102-13.426 149.732v128.569l-189.326-0.228c-171.577 0-190.009-0.455-195.243-3.641zM680.619 493.739c5.916-6.144 6.599-7.964 6.599-22.3-0.228-17.294-3.186-22.756-14.791-27.534-5.234-2.276-43.008-2.731-163.157-2.276-184.775 0.683-168.619-1.82-169.756 28.444-0.683 17.977-0.455 18.432 6.372 24.348l7.282 5.916h320.853l6.599-6.599zM679.253 377.23c8.192-7.282 8.192-7.282 7.509-24.576-0.683-16.612-0.91-17.294-8.42-22.3l-7.737-5.234h-317.44l-7.054 5.916c-6.827 5.689-7.054 6.599-7.054 23.893v17.749l8.42 5.916 8.647 5.689h314.937l8.192-7.054zM678.343 260.722c7.509-5.006 7.737-5.689 8.42-21.845 0.455-13.426-0.228-17.522-3.413-21.163-10.012-11.15-6.144-10.923-171.804-10.923h-155.42l-8.647 5.689-8.42 5.916v17.749c0 17.294 0.228 18.204 7.054 23.893l7.054 5.916h317.44l7.737-5.234zM631.922 908.345c-0.91-0.683-1.593-52.793-1.593-115.826 0-101.945 0.455-114.46 3.641-115.598 2.048-0.683 53.476-1.365 114.46-1.365 83.058 0 111.502 0.683 113.55 2.731 4.096 4.096 3.413 14.336-1.593 25.259-5.234 11.15-190.236 196.836-202.069 202.752-7.282 3.641-23.666 5.006-26.396 2.048z" /> <glyph unicode="&#xe90c;" glyph-name="product" d="M413.013 950.443c-277.845-64.512-457.387-330.752-403.115-598.357 12.288-61.099 35.499-122.539 45.739-122.539 5.12 0 45.056 18.091 51.541 23.552 1.024 0.683-6.485 23.893-16.384 51.883-85.675 239.957 63.488 512 316.416 576.171 110.592 27.989 278.528-2.389 350.549-63.147l17.067-14.677h-15.36c-13.995-0.341-15.36-3.755-15.36-34.475v-34.133h70.997c90.112 0 89.088-1.024 82.603 88.747-5.461 77.824-4.779 76.459-47.445 70.656-29.355-4.096-31.744-5.803-27.989-20.48 5.12-20.48 6.144-20.821-47.104 11.605-103.083 62.464-254.976 89.771-362.155 65.195zM380.928 711.168c-69.973-33.792-129.365-63.829-131.755-66.219-2.048-2.389 19.797-17.408 49.152-33.109 29.355-16.043 70.315-38.229 90.795-49.493 20.821-11.264 56.32-31.061 79.531-43.691l41.984-23.211 132.096 72.363c72.363 39.595 133.12 73.387 134.485 75.093 2.731 2.389-22.869 14.677-200.363 98.304l-68.267 32.085-127.659-62.123zM938.667 655.189c-11.264-6.144-21.163-11.605-21.845-12.288-1.024-0.683 6.485-23.893 16.384-51.883 115.371-322.901-186.709-655.36-523.605-576.171-73.045 17.067-185.344 78.165-144.043 78.165 12.629 0 14.336 3.755 14.336 34.133v34.133h-70.997c-90.112 0-89.088 1.024-82.603-88.747 5.461-77.824 3.072-73.728 46.763-69.632 30.72 2.731 32.427 3.755 28.672 19.115-5.12 21.163-5.12 21.163 48.128-11.264 407.211-249.515 925.696 188.075 738.645 623.275-15.36 35.499-19.456 37.205-49.835 21.163zM191.147 421.717v-148.821l133.803-64.512c73.728-35.157 136.875-65.195 140.288-66.56s5.461 55.979 4.096 139.605l-1.707 141.653-30.72 18.091c-16.725 9.899-58.368 33.109-92.16 51.2-33.792 18.432-79.872 43.691-102.4 55.979s-43.349 22.187-46.080 22.528c-2.731 0-5.12-66.901-5.12-149.163zM684.373 496.811l-131.413-72.704v-141.995c0-78.165 2.389-140.629 5.12-139.264 2.731 1.707 22.187 10.923 42.667 20.139 20.821 9.557 79.872 37.547 131.413 62.123l93.867 44.715v150.528c0 82.944-2.389 150.187-5.12 149.845s-64.171-33.109-136.533-73.387z" /> <glyph unicode="&#xe90d;" glyph-name="transaction" d="M409.6 949.419c-60.757-13.312-110.251-31.744-114.688-43.008-7.168-19.115 31.744-84.651 48.469-80.896 8.192 1.707 39.253 9.899 68.949 17.749 332.8 88.405 621.568-270.677 465.579-578.56-22.528-44.373-25.6-45.397-49.152-20.821-53.931 57.003-64.171 44.715-64.171-74.752 0.341-120.149-9.557-110.933 116.053-108.885 121.856 2.389 123.904 3.755 78.165 52.907l-31.744 34.133 19.797 32.427c231.765 380.587-105.131 863.232-537.259 769.707zM42.667 839.509c-14.336-5.803-9.557-20.821 15.019-46.763 42.325-44.715 41.301-40.619 18.091-78.507-206.848-336.555 40.619-778.24 436.224-778.24 82.603 0 212.651 33.792 217.088 56.661 4.437 22.187-32.427 81.579-48.469 77.824-8.192-1.707-39.253-9.899-68.949-17.749-332.8-88.405-621.568 270.677-465.579 578.56 22.869 45.056 23.211 45.056 58.027 13.653 16.384-14.677 33.109-25.6 37.547-24.235 11.605 3.755 13.995 210.261 2.731 217.429-9.557 6.144-187.392 7.168-201.728 1.365zM433.493 709.12c-296.96-106.155-233.813-531.115 78.507-530.773 292.864 0.341 376.832 392.875 110.592 517.461-57.685 26.965-135.851 32.427-189.099 13.312zM525.653 625.493c0-20.48 2.731-27.307 10.923-27.307 21.845 0 57.344-44.373 57.344-71.339 0-32.085-29.013-34.133-32.768-2.731-6.827 59.392-99.328 52.565-99.328-7.509 0-29.013 18.432-45.739 55.296-51.541 88.405-13.312 107.52-123.221 28.331-164.181-16.043-8.192-19.797-14.677-19.797-34.133 0-18.432-2.731-23.552-12.971-23.552-13.995 0-21.163 12.629-21.163 37.547 0 9.557-5.12 17.749-12.629 20.139-27.648 8.875-58.709 60.075-50.517 83.968 5.461 16.043 27.307 9.216 32.085-10.24 15.701-61.781 99.328-57.685 99.328 5.12 0 31.744-15.019 45.739-57.344 53.931-55.296 10.24-85.675 54.955-71.68 106.155 6.144 21.845 40.277 58.368 54.613 58.368 3.413 0 6.144 7.509 6.144 16.384 0 25.6 7.168 38.229 21.163 38.229 10.581 0 12.971-5.12 12.971-27.307z" /> </font></defs></svg>
0
/content/gmx-projects/gmx-admin/frontend/public/assets
/content/gmx-projects/gmx-admin/frontend/public/assets/css/pages.css
.card_img { position: relative; } .card_img input { padding-right: 65px; } .card_img img { position: absolute; content: ""; top: 50%; transform: translateY(-50%); right: 15px; } .rdtPicker { background-color: #282828 !important; border: 1px solid #4b4b4b !important; } .rdtPicker td, .rdtPicker th { height: 32px; color: #dadada !important; } .rdtPicker th { font-weight: 500; color: #fff !important; } .rdtPicker td:hover, .rdtPicker td.rdtActive, .rdtPicker td.rdtActive:hover { background-color: #22a612 !important; color: #fff !important; } .rdtPicker thead tr:first-of-type th { background-color: transparent !important; border-bottom: 1px solid #4b4b4b !important; } .rdtPicker td.rdtToday:before { border-bottom: 7px solid #22a612 !important; } .tbl-datepicker .rdtPicker { right: 0; } .top-datepicker .rdtPicker { bottom: 0; } .message_sent_form input, .search_form input { font-weight: normal; color: #fff; min-height: 40px; border-radius: 6px; background-color: #282828; border: 1px solid #3e3e3e; font-size: 14px; } .message_sent_form input::placeholder, .search_form input::placeholder { color: #fefefe; } .message_sent_form button, .search_form button { min-width: 40px; padding: 0px 5px; } .message_sent_form button .svg-inline--fa, .search_form button .svg-inline--fa { width: 16px !important; height: 16px !important; } /**************** chat room ****************/ .user_profile { position: relative; display: inline-block; max-width: 50px; min-width: 50px; height: 50px; border-radius: 25px; filter: drop-shadow(0 0 13.5px rgba(0, 0, 0, 0.15)); background-color: #e2e2e2; border: 2px solid #474747; overflow: hidden; } .user_profile .online { position: absolute; content: ""; right: 5px; bottom: 5px; display: inline-block; width: 16px; height: 16px; background-color: #75e4a5; border: 3px solid #fff; border-radius: 50px; } .user_profile .offline { position: absolute; content: ""; right: 5px; bottom: 5px; display: inline-block; width: 16px; height: 16px; background-color: #f46853; border: 3px solid #fff; border-radius: 50px; } .user_chat_list .user_profile .figure-circle, .user_header .user_profile .figure-circle { border: 2px solid #005b93; padding: 2px; } .user_chat_list .user_profile .figure-circle img, .user_header .user_profile .figure-circle img { object-fit: cover; object-position: center; height: 100%; width: 100%; border-radius: 50%; } .user_info { display: block; padding-right: 70px; position: relative; width: 100%; } .user_info span { position: absolute; content: ""; top: 0; right: 0; } .user_chat_list li { width: 100%; } .user_chat_list li:last-child { border-bottom: none; } .user_chat_list li a { width: 100%; display: flex; align-items: center; padding: 10px; border-radius: 0px; position: relative; transition: 0.3s ease-in-out; color: #fff; border-top: 1px solid #5c5c5c; } .user_chat_list li.active a, .user_chat_list li a:hover { color: #f3772c; background-color: #000; box-sizing: 0px 5px 8px rgba(0, 0, 0, 0.3); border-color: #5d3c28; } .user_chat_list li p { word-break: break-word; } .user_chat_list li a .badge { width: 20px; height: 20px; border-radius: 10px; background-color: #22a612 !important; line-height: 20px; font-size: 12px; color: #ffffff; font-weight: 500; text-align: center; padding: 0; position: absolute; right: 15px; } .user_header { width: 100%; padding: 5px 20px; background-color: #fff; box-shadow: 0px 1px 1.5px rgba(0, 0, 0, 0.25); border-top: 1px solid #dae7ef; border-bottom: 1px solid #dae7ef; } .user_header h3 { margin-bottom: 0; font-weight: 600; font-size: 18px; color: #3f4450; } .user_header .user_profile .online, .user_header .user_profile .offline { width: 12px; height: 12px; border: 3px solid #fff; right: 0; } .received_msg { max-width: 70%; } .received_msg .msgbox { display: block; max-width: max-content; padding: 15px 20px; font-size: 14px; box-shadow: 0 0 8.5px rgba(0, 0, 0, 0.15); color: #fff; background-color: #191919; border: 1px solid #3e3e3e; margin-bottom: 0; border-radius: 20px; border-top-left-radius: 0; margin-right: auto; } .send_msg { max-width: 70%; margin-left: auto; text-align: left; } .send_msg .msgbox { display: block; max-width: max-content; padding: 15px 20px; font-size: 14px; color: #fff; background-color: #22a612; margin-bottom: 0; border-radius: 20px; border-top-right-radius: 0; margin-left: auto; } .received_msg p, .send_msg p { margin-bottom: 0 !important; } .received_msg span { font-size: 12px; line-height: 26px; color: #777777; display: block; text-align: left; } .send_msg span { font-size: 12px; line-height: 26px; color: #777777; display: block; text-align: right; } .received_msg span .svg-inline--fa, .send_msg span .svg-inline--fa { width: 12px !important; height: 12px !important; } .chatareabox { position: relative; } .chatareabox input { padding: 20px; } .chatareabox .attachment input[type="file"] { opacity: 0; visibility: hidden; position: absolute; width: 0; left: 0; } .chatareabox .attachment { background-color: #9db2be; border-color: #9db2be; font-size: 20px; cursor: pointer; border-top-left-radius: 0px; border-bottom-left-radius: 0px; min-width: 52px; justify-content: center; } .chatareabox button { font-size: 18px; padding: 5px 15px; height: 52px; } .card_chat_box { background-color: #282828; } .card_chat_box .card-header { padding: 12px; } .card_chat_box .card-body { height: 434px; } .card_chat_box .card-footer { padding: 22px 20px !important; border-top: 1px solid #5c5c5c; } .card_chat_box .inner-progress { margin-top: 25px; margin-bottom: 10px; overflow: visible; position: relative; } .card_chat_box .inner-progress span { position: absolute; content: ""; top: -25px; left: 0px; right: inherit !important; font-size: 14px; color: #202020 !important; } .card_chat_box .days { position: relative; margin-bottom: 20px; z-index: 0; } .card_chat_box .days::before { position: absolute; content: ""; left: 0; right: 0; top: 14px; width: 100%; height: 1px; background-color: #d2e1e9; z-index: -1; } .card_chat_box .days span { padding: 5px 15px; font-size: 14px; color: #697d87; background-color: #d2e1e9; } .received_msg .chat-bubble, .received_msg .upload_file { display: block; max-width: max-content; padding: 10px 20px; font-size: 16px; color: #575757; background-color: #e8e8e8; margin-bottom: 0; border-radius: 10px; border-bottom-left-radius: 0; margin-right: auto; text-align: left; } .send_msg .chat-bubble, .send_msg .upload_file { display: block; max-width: max-content; padding: 10px 20px; font-size: 16px; color: #575757; background-color: #cee4f1; margin-bottom: 0; border-radius: 10px; border-bottom-right-radius: 0; margin-left: auto; text-align: left; } .received_msg .upload_file a, .send_msg .upload_file a { font-size: 14px; color: #202020; } .send_msg .upload_file, .received_msg .upload_file { max-width: 280px; padding: 0; background-color: transparent !important; } .chat-bubble .dot { position: static !important; display: inline-block; width: 8px; height: 8px; border-radius: 50px; margin: 1px; background: #005b93; animation: jump 1s ease infinite; animation-delay: 1s; } .chat-bubble .dot:nth-child(2) { animation-delay: 1.1s; } .chat-bubble .dot:nth-child(3) { animation-delay: 1.2s; } /* #top_chats {overflow-x: auto;flex-wrap: nowrap !important;} #top_chats .col {min-width: 90px;} */ .file-attachment { position: relative; overflow: hidden; } .file-attachment input { opacity: 0; position: absolute; content: ""; left: 0; right: 0; top: 0; bottom: 0; } .border-F6F7F8 { border-color: #f6f7f8 !important; } @keyframes jump { 0%, 100% { transform: initial; } 30% { transform: translateY(-8px); } 60% { transform: translateY(3px); } } @-webkit-keyframes jump { 0%, 100% { transform: initial; } 30% { transform: translateY(-8px); } 60% { transform: translateY(3px); } } .custom-scroll > div { scroll-behavior: smooth !important; } @media screen and (max-width: 991px) { .mob_view { position: fixed; top: 90px; bottom: 0; left: 0; right: 0; width: 100%; height: calc(100vh - 80px); z-index: 998; background-color: #fff; } .mob_view.card-user-profile { height: 100%; } .mob_view.card_chat_box .card-body { height: calc(100vh - 130px); min-height: 100%; padding-bottom: 140px; } .mob_view.card_chat_box .card-footer { position: fixed; bottom: 0; left: 0; right: 0; } .mob_view.card_chat_box .card-body > div { height: 100% !important; } .card_chat_box.close { display: none; } } @media screen and (max-width: 480px) { .received_msg, .send_msg { max-width: 95%; } .chatareabox .attachment { padding: 5px 10px; min-width: 42px; } .chatareabox button { padding: 5px 10px; height: 42px; } .chatareabox input { padding: 12px; height: 44px; } .mob_view .card_chat_box .card-body { height: calc(100vh - 120px); } } /**************** dropzone ****************/ .dzu-previewMain { display: flex; flex-wrap: wrap; } .dzu-dropzone { background-color: #242424; border: 1px solid #4b4b4b; color: #dbdbdb; font-weight: 400; padding: 25px; overflow: hidden !important; border-radius: 12px; flex-direction: inherit; } .dzu-inputLabel { color: #dbdbdb; font-weight: 400; font-size: 16px; } .dzu-previewImage { max-height: 100px !important; width: 100%; object-fit: cover !important; margin: auto; } .dzu-previewContainer { padding: 20px !important; width: 140px; height: 154px; background-color: #2e2e2e; border: 1px solid #3f3f3f; margin-right: 15px; border-radius: 4px; position: relative; } .dzu-previewContainer::after { position: absolute; content: ""; top: -1px; right: -1px; width: 16px; height: 16px; border-top: 16px solid #282828; border-left: 16px solid transparent; } .dzu-previewContainer::before { position: absolute; content: ""; top: -1px; right: -1px; width: 16px; height: 16px; border-left: 16px solid #4b4b4b; border-top: 16px solid transparent; } .dzu-dropzone .dzu-previewContainer::after { border-top: 16px solid #242424; } .dzu-previewContainer:last-child { margin-right: 0; } .dzu-previewContainer progress { display: block; position: absolute; bottom: 5px; left: 0; right: 0; width: 80%; margin: auto; background-color: #22a612; height: 5px; border-radius: 5px; overflow: hidden; } .dzu-previewButton { position: absolute; font-family: "Font Awesome 5 Pro"; content: "\f2ed"; background-image: none !important; top: 50%; left: 50%; transform: translate(-50%, -50%); opacity: 1; z-index: 999; background: #d24646; display: inline-block; width: 36px; height: 36px; border-radius: 50px; margin: 0 !important; opacity: 0; transition: 0.5s ease-in-out; } .dzu-previewButton::before { position: absolute; font-family: "Font Awesome 5 Pro"; content: "\f2ed"; font-weight: 900; font-size: 16px; line-height: 38px; text-align: center; width: 100%; color: #fff; } .dzu-previewContainer:hover .dzu-previewButton { opacity: 1; } .dzu-inputLabelWithFiles { margin: auto; background-color: transparent; border: 1px solid #aaaaaa; font-size: 15px; line-height: 38px; color: #aaaaaa; font-weight: 500; border-radius: 25px; width: 180px; } /******Page Not Found******/ .pagenotfound { height: 540px; align-items: center; display: flex; flex-direction: column; justify-content: center; text-align: center; background: url("../images/retailer-shape1.png") repeat center / 250px #67a96b; } .pagenotfound h1 { color: #fff; font-size: 12.5rem; letter-spacing: 0.1em; margin: 0.025em 0; text-shadow: 0.05em 0.05em 0 rgba(0, 0, 0, 0.25); white-space: nowrap; } .pagenotfound h2 { color: #fff; margin-bottom: 0.4em; } @media (max-width: 30rem) { .pagenotfound h1 { font-size: 8.5rem; } } .pagenotfound h1 > span { -webkit-animation: spooky 2s alternate infinite linear; animation: spooky 2s alternate infinite linear; color: #f3772c; display: inline-block; } @-webkit-keyframes spooky { from { transform: translatey(0.15em) scaley(0.95); } to { transform: translatey(-0.15em); } } @keyframes spooky { from { transform: translatey(0.15em) scaley(0.95); } to { transform: translatey(-0.15em); } } /*******Custom Scroll******/ .CustomScrollbarY::-webkit-scrollbar { height: 5px; } .CustomScrollbar::-webkit-scrollbar { width: 5px; } /* Track */ .CustomScrollbar::-webkit-scrollbar-track { box-shadow: inset 0 0 5px grey; border-radius: 10px; } /* Handle */ .CustomScrollbar::-webkit-scrollbar-thumb { background: #f3772c; border-radius: 10px; } /* Handle on hover */ .CustomScrollbar::-webkit-scrollbar-thumb:hover { background: #f3772c; } /* Range Slider Start*/ .input-range__slider { -webkit-appearance: none; -moz-appearance: none; appearance: none; background: #ffffff; border: 3px solid #f3772c; border-radius: 100%; cursor: pointer; display: block; height: 1rem; margin-left: -0.5rem; margin-top: -0.65rem; outline: none; position: absolute; top: 50%; -webkit-transition: box-shadow 0.3s ease-out, -webkit-transform 0.3s ease-out; transition: box-shadow 0.3s ease-out, -webkit-transform 0.3s ease-out; transition: transform 0.3s ease-out, box-shadow 0.3s ease-out; transition: transform 0.3s ease-out, box-shadow 0.3s ease-out, -webkit-transform 0.3s ease-out; width: 1rem; } .input-range__slider:active { -webkit-transform: scale(1.3); transform: scale(1.3); } .input-range__slider:focus { box-shadow: 0 0 0 5px rgba(63, 81, 181, 0.2); } .input-range--disabled .input-range__slider { background: #cccccc; border: 1px solid #cccccc; box-shadow: none; -webkit-transform: none; transform: none; } .input-range__slider-container { -webkit-transition: left 0.3s ease-out; transition: left 0.3s ease-out; } .input-range__label { color: #aaaaaa; font-family: "Helvetica Neue", san-serif; font-size: 0.8rem; -webkit-transform: translateZ(0); transform: translateZ(0); white-space: nowrap; display: none; } .input-range__label--min, .input-range__label--max { bottom: -1.4rem; position: absolute; } .input-range__label--min { left: 0; } .input-range__label--max { right: 0; } .input-range__label--value { position: absolute; top: -1.8rem; } .input-range__label-container { left: -50%; position: relative; } .input-range__label--max .input-range__label-container { left: 50%; } .input-range { position: relative; width: 100%; height: 1rem; margin: 12px 0; } .input-range__track { background: #eeeeee; border-radius: 0.3rem; cursor: pointer; display: block; height: 0.3rem; position: relative; -webkit-transition: left 0.3s ease-out, width 0.3s ease-out; transition: left 0.3s ease-out, width 0.3s ease-out; } .input-range--disabled .input-range__track { background: #eeeeee; } .input-range__track--background { left: 0; margin-top: -0.15rem; position: absolute; right: 0; top: 50%; } .input-range__track--active { background: #f3772c; } /* Range Slider End*/ .dv-star-rating { margin: 15px auto 8px; } .dv-star-rating .dv-star-rating-star { font-size: 26px; margin: 0 8px; } /**************** Custom Tabs ****************/ .responsiveTable.table-hover > tbody > tr:hover > * { --bs-table-accent-bg: transparent !important; background-color: transparent !important; } .responsiveTable.form-dark .form-control { background-color: transparent !important; min-height: 40px; border-radius: 10px; padding: 0 12px; font-size: 14px; } .responsiveTable.form-dark .react-select__control { min-height: 40px; line-height: 34px; border-radius: 10px; padding: 0 2px; font-size: 14px; } .custom-tabs .nav-tabs { display: flex; justify-content: center; align-items: center; border: none; margin-bottom: -1px; position: relative; } .custom-tabs .nav-tabs .nav-item .nav-link { margin: 0 5px; font-size: 16px; line-height: 23px; color: rgb(255 255 255 / 50%); font-weight: 500; padding: 15px 30px; border-radius: 15px 15px 0 0; background-color: #000000; border: 1px solid #ffffff; cursor: pointer; min-width: 190px; text-align: center; } .custom-tabs .tab-content { border-radius: 15px; background-color: #000000; border: 1px solid #ffffff; padding: 20px 28px; } .custom-tabs .nav-tabs .nav-item .nav-link.active { background-color: #000000; border-bottom: transparent; color: #fff; margin-bottom: -1px; padding-bottom: 16px; } .custom-tabs .nav-tabs .nav-item .nav-link:hover, .custom-tabs .nav-tabs .nav-item .nav-link:focus { color: #fff; } .theme-dark.custom-tabs .tab-content { padding: 0; overflow: hidden; } .theme-dark.custom-tabs .nav-tabs .nav-item .nav-link { background-color: #000000; } .comment-icons li:not(:last-child) { margin-right: 15px; } .comment-icons li a { color: #a5a5a5; font-size: 18px; } .comment-icons li i.icon, .comment-icons li span i { font-size: 18px !important; vertical-align: top !important; } .likes-comments li { font-size: 14px; line-height: 16px; margin-bottom: 18px; } .likes-comments li:not(:last-child) { border-right: 1px solid #a5a5a5; padding-right: 15px; margin-right: 15px; } .gallery-view { display: flex; align-items: center; } .gallery-image { display: block; border-radius: 20px; overflow: hidden; max-height: 200px; min-height: 200px; margin-bottom: 15px; position: relative; } .gallery-image img, .gallery-image video { width: 100%; max-height: 200px; min-height: 200px; object-fit: cover; object-position: center; } .gallery-image .more-images { position: absolute; content: ""; left: 0; right: 0; top: 0; bottom: 0; background-color: rgba(0, 0, 0, 0.5); color: #fff; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 46px; } .timeline-comment .timeline-row { position: relative; } .timeline-comment .timeline-row:not(:last-child):before { position: absolute; content: ""; left: 42px; top: 0; bottom: 0; background-color: #474747; width: 2px; height: 100%; } .modal-fullscreen, .modal-fullscreen .modal-content { max-width: 100%; background-color: rgba(0, 0, 0, 20%); } .commentModal .modal-content { max-width: 100%; background-color: rgba(0, 0, 0, 0.966); } .brand-sign-up a { cursor: pointer; font-size: 16px; line-height: 28px; color: #fff; font-weight: 400; transition: 0.5s ease-in-out; } .brand-sign-up a:hover { color: #fff; } .brand-sign-up a:hover { color: #fff; } .change-hover-color a:hover { color: #000; } .seller-infor-main { padding: 20px 20px 20px 20px; } .listing-24p.list-33 li { width: 40%; } .listing-24p.list-33 li:first-child, .listing-24p.list-33 li:last-child { width: 30%; } .border-right { border-right: 1px solid #4b4b4b; padding: 0 11%; } .border-left { border-left: 1px solid #4b4b4b; }
0
/content/gmx-projects/gmx-admin/frontend/public/assets
/content/gmx-projects/gmx-admin/frontend/public/assets/css/component.css
a { text-decoration: none; cursor: pointer;} .f-style-italic { font-style: italic; } .icon {font-size: 14px !important;} /*======== color ==========*/ .color-black { color:black !important;} .color-white { color:white !important;} .color-0d0d0d { color: #0d0d0d;} .color-177b0b { color: #177b0b;} .color-22a612 { color: #22a612;} .color-20da97 { color: #20da97;} .color-f8bf52 { color: #f8bf52;} .color-f3772c { color: #f3772c;} .color-dcdcdc { color: #dcdcdc;} .color-f32c2c { color: #f32c2c} .color-0e1d3d { color: #0e1d3d;} .color-202020 { color: #202020;} .color-bfbfbf { color: #bfbfbf;} .color-7e7e7e { color: #7e7e7e;} .color-929292 { color: #929292;} .color-0598ff { color: #0598ff;} .color-777777 { color: #777777;} .color-8c8c8c { color: #8c8c8c;} .color-a5a5a5 { color: #a5a5a5;} .d-block {display: block;} .d-inline-b {display: inline-block;} .o-05 {opacity: 0.5;} .o-08 {opacity: 0.8;} .o-09 {opacity: 0.9;} /*========== border ===========*/ .border-gray {border: 1px solid #4b4b4b;} .border-top-4b4b4b {border-top: 1px solid #4b4b4b;} .border-top-light {border-top: 1px solid rgb(0 0 0 / 10%);} .border-bottom-light {border-bottom: 1px solid rgb(0 0 0 / 10%);} .border-btm-white-light { border-bottom: 1px solid rgb(255 255 255 / 10%) !important;} .border-btm-gray {border-bottom: 1px solid #4b4b4b;} .border-f3772c {border: 1px solid #f3772c;} .box-border-green { border: 2px solid #22a612;} .box-border-gray { border: 2px solid #4b4b4b;} .border-bottom-gray-light {border-bottom: 1px solid rgba(233,233,233,0.32);} .border-white-2 {border: 2px solid #ffffff;} .border-left-greenlight {border-left: 1px solid rgba(34,166,18,0.2);} .border-bottom-greenlight {border-bottom: 1px solid rgba(34,166,18,0.2);} .b-w-2 { border-width: 2px; border-style: solid;} .b-c-22a612 { border-color: #22a612; } .b-c-f3772c { border-color: #f3772c; } /*========== bg-color ============*/ .bg-transparent { background-color: transparent; } .bg-color-spindle { background-color:#bfe1ef;} .bg-color-white { background-color:white;} .bg-black { background-color:black;} .bg-color-282828 { background-color: #282828;} .bg-color-gray { background-color:#e5e5e5 !important;} .bg-color-1f1f1f { background-color: #1f1f1f;} .bg-color-333 { background-color: #333;} .bg-color-22a612 { background-color: #22a612;} .bg-color-0d0d0d { color: #0d0d0d;} .bg-color-22a612 { color: #22a612;} .bg-color-f2d4c2 { background-color: #f2d4c2; } .bg-color-3d3d3d { background-color: #3d3d3d; } .bg-color-191919 { background-color: #191919 } .box-bg-light-green { background-color: #f0fcee;} /*========== font-size ===========*/ .text-decoration-none{text-decoration:none;} .text-decoration-underline{text-decoration:underline;} .fs-10{font-size:10px;} .fs-12{font-size:12px;} .fs-13{font-size:13px;} .fs-14{font-size:14px;} .fs-15{font-size:15px;} .fs-16{font-size:16px;} .fs-17{font-size:17px;} .fs-18{font-size:18px;} .fs-19{font-size:19px;} .fs-20{font-size:20px;} .fs-22{font-size:22px;} .fs-24{font-size:24px;} .fs-25{font-size:25px;} .fs-26{font-size:26px;} .fs-28{font-size:28px;} .fs-30{font-size:30px;} .fs-32{font-size:32px;} .fs-35{font-size:35px;} .fs-38{font-size:38px;} .fs-40{font-size:40px;} .fs-42{font-size:42px;} .fs-45{font-size:45px;} .fs-48{font-size:48px;} .fs-50{font-size:50px;} .fs-52{font-size:52px;} .fs-55{font-size:55px;} .fs-58{font-size:58px;} .fs-60{font-size:60px;} .fs-62{font-size:62px;} .fs-63{font-size:63px;} .fs-65{font-size:65px;} .fs-80{font-size:80px;} @media (max-width: 767px) { .fs-35{font-size:25px;} .fs-50{font-size:30px;} .fs-52{font-size:32px;} .fs-55{font-size:35px;} .fs-58{font-size:38px;} .fs-60{font-size:40px;} .fs-62{font-size:42px;} .fs-63{font-size:43px;} .fs-65{font-size:45px;} .fs-80{font-size:60px;} } /*========== font-weight ==============*/ .fw-300{font-weight:300 !important;} .fw-400{font-weight:400 !important;} .fw-500{font-weight:500 !important;} .fw-600{font-weight:600 !important;} .fw-700{font-weight:700 !important;} .fw-800{font-weight:800 !important;} .fw-900{font-weight:900 !important;} /*========== text align ==============*/ .text-align-left{text-align:left;} .text-align-right{text-align:right;} .text-align-center{text-align:center;} .text-UpperCase{text-transform:uppercase;} .text-CapitaLize{text-transform:capitalize;} .v-align-middle {vertical-align: middle;} /*============== image ==================*/ .img_circle{position:relative;display:inline-block;min-width:100px;width:100px;height:100px;margin:0 auto;border-radius:50%;background-color:#ffffff;border:8px solid rgba(0,0,0,0.07);} .img_circle .verify_profile{position:absolute;bottom:-10px;left:-5px;width:25px;height:30px;} .img_circle.img_w140 {min-width:140px;width:140px;height:140px;} .img_circle.img_w125 {min-width:125px;width:125px;height:125px;} img.cover{display:block; width:100%;height:100%;object-fit:cover;} img.circle{border-radius:100%;overflow: hidden;} .figure .figure-img{margin:0;} /****** image ******/ img { max-width: 100%; } img.cover { width: 100%; height: 100%; object-fit: cover; } img.contain { width: 100%; height: 100%; object-fit:contain; } .figure-wrap{position: relative;} figure{position:relative; background-color: #FFF;} .figure-circle{border-radius:100%; overflow:hidden;} .figure-rounded{border-radius:12px;overflow:hidden;} .figure-thmbnail{display:inline-flex;border-radius:12px;border:2px solid rgba(195,195,195,1);box-shadow:5px 5px 19px rgba(0, 0, 0, 0.4);overflow:hidden;} .figure-40 {min-width:40px;width:40px;height:40px;} .figure-62 {min-width:62px;min-height: 62px; width:62px;height:62px;} .figure-100 {min-width:100px;width:100px;height:100px;} .figure-120 {min-width:120px;width:120px;height:120px;} .figure-150 {min-width:150px;width:150px;height:150px;} .figure-green-2 {border: 2px solid #22a612;} .figure-gray-2 {border: 2px solid #525252;} .figure-gray-4 {border: 4px solid #525252;} .listing-w-100 > li { width: 100%; } .border-gray-1 {border: 1px solid #525252;} /*======= title all ===========*/ .section_title{font-size:25px;font-weight:bold;line-height:30px;color:#000000;} .sub_title{font-size:18px;font-weight:500;line-height:30px;color:#3ea3cf;} .section_sub_title{font-size:16px;font-weight:500;letter-spacing:0px;color:#000000;} .border_left_w5{padding-left:15px;border-left:5px solid #3ea3cf;} .commone_title.font-20{line-height:30px;} .commone_title.font-17{line-height:25px;} /*=========== All Button ==============*/ .pointer-not-allowed {pointer-events: none !important; cursor: not-allowed !important;} .disabled {pointer-events: none !important; cursor: not-allowed !important; opacity: 0.6;} .btn-left{text-align:left;} .btn-center{text-align:center;} .btn-right{text-align:right;} .btn-span{display:inline-block;text-align:center;border-radius:8px;border:2px solid #c2c2c2;background-color:#ffffff;} .btn{min-width:80px;line-height:36px; font-size:16px;border-radius:2px;padding:0 15px; position: relative; box-shadow: none !important;} .btn.btn-lg{font-size:18px;border-width:2px;} .btn.btn-xs{font-size:13px;} .btn[disabled]{pointer-events:none;} .noarrow.dropdown-toggle::after {content:none;} .btn-primary{color:#ffffff; border-color:#22a612; background-color: #22a612; box-shadow:0px 5px 4px rgba(13,9,44,0.25);transition:all 0.5s linear;} .btn-primary:hover,.btn-primary:focus,.btn-primary:not(:disabled):not(.disabled).active,.btn-primary:not(:disabled):not(.disabled):active,.show > .btn-primary.dropdown-toggle, .btn-primary.disabled, .btn-primary:disabled{border-color:#22a612; background-color:#22a612; box-shadow:none;} .btn-secondary{color:#ffffff; border-color:#f3772c; background-color: #f3772c; box-shadow:0px 5px 4px rgba(13,9,44,0.25);transition:all 0.5s linear;} .btn-secondary:hover,.btn-secondary:focus,.btn-secondary:not(:disabled):not(.disabled).active,.btn-secondary:not(:disabled):not(.disabled):active,.show > .btn-secondary.dropdown-toggle{border-color:#f3772c; background-color:#f3772c; box-shadow:none;} .btn-outline-primary{color:#22a612; border-color:#22a612; background-color: transparent; box-shadow:none;transition:all 0.5s linear;} .btn-outline-primary:hover,.btn-outline-primary:focus,.btn-outline-primary:not(:disabled):not(.disabled).active,.btn-outline-primary:not(:disabled):not(.disabled):active,.show > .btn-outline-primary.dropdown-toggle{border-color:#22a612; background-color:#22a612; box-shadow:none;color:#fff;} .btn-outline-primary.disabled, .btn-outline-primary:disabled {color:#22a612;} .btn-success{background-image:linear-gradient(to right,rgba(107,161,81,1) 46%,rgba(91,136,68,1) 56%);background-size:400% auto;border-color:#6ba151;box-shadow:0px 13px 13.5px rgba(62,163,207,0.09);transition:all 0.5s linear;} .btn-success:hover,.btn-success:focus,.btn-success:not(:disabled):not(.disabled).active,.btn-success:not(:disabled):not(.disabled):active,.show > .btn-success.dropdown-toggle{color:#ffffff;border-color:#5b8844;background-position:right center;box-shadow:none;} .btn-danger{border-color:#dc3545;background-image:linear-gradient(to right,rgba(220,53,69,1) 46%,rgba(200,35,51,1) 56%);background-size:400% auto;box-shadow:0px 13px 13.5px rgba(62,163,207,0.09);transition:all 0.5s linear;} .btn-danger:hover,.btn-danger:focus,.btn-danger:not(:disabled):not(.disabled).active,.btn-danger:not(:disabled):not(.disabled):active,.show > .btn-danger.dropdown-toggle{color:#ffffff;border-color:#c82333;background-position:right center;box-shadow:none;} .btn-light{font-size:16px;color:#333;border-color:#e7e8e8;background-image:linear-gradient(to right,rgba(231,232,232,1) 46%,rgba(216,218,218,1) 56%);background-size:400% auto;transition:all 0.5s linear;} .btn-light:hover,.btn-light:focus,.btn-light:not(:disabled):not(.disabled).active,.btn-light:not(:disabled):not(.disabled):active,.show > .btn-light.dropdown-toggle{color:#333;border-color:#d8dada;background-position:right center;box-shadow:none;} .btn-outline-secondary{color:#575857;background-image:linear-gradient(to right,rgba(255,255,255,1) 46%,rgba(87,88,87,1) 56%);border-color:#c2c2c2;background-size:400% auto;transition:all 0.5s linear;} .btn-outline-secondary:hover,.btn-outline-secondary:focus,.btn-outline-secondary:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary:not(:disabled):not(.disabled):active:focus,.show > .btn-outline-secondary.dropdown-toggle:focus{color:#fff;box-shadow:none;background-position:right center;} .btn-outline-success{color:#6ba151;background-image:linear-gradient(to right,rgba(255,255,255,1) 46%,rgba(107,161,81,1) 56%);border-color:#6ba151;background-size:400% auto;transition:all 0.5s linear;} .btn-outline-success:hover,.btn-outline-success:focus,.btn-outline-success:not(:disabled):not(.disabled).active:focus,.btn-outline-success:not(:disabled):not(.disabled):active:focus,.show > .btn-outline-success.dropdown-toggle:focus{color:#fff;background-position:right center;box-shadow:none;} .btn-outline-danger{color:#dc3545;background-image:linear-gradient(to right,rgba(255,255,255,1) 46%,#dc3545 56%);border-color:#dc3545;background-size:400% auto;transition:all 0.5s linear;} .btn-outline-danger:hover,.btn-outline-danger:focus,.btn-outline-danger:not(:disabled):not(.disabled).active:focus,.btn-outline-danger:not(:disabled):not(.disabled):active:focus,.show > .btn-outline-danger.dropdown-toggle:focus{color:#fff;background-position:right center;box-shadow:none;} .btn-outline-dark{color:#343a40;background-image:linear-gradient(to right,rgba(255,255,255,1) 46%,#343a40 56%);border-color:#343a40;background-size:400% auto;transition:all 0.5s linear;} .btn-outline-dark:hover,.btn-outline-dark:focus,.btn-outline-dark:not(:disabled):not(.disabled).active:focus,.btn-outline-dark:not(:disabled):not(.disabled):active:focus,.show > .btn-outline-dark.dropdown-toggle:focus{color:#fff;background-position:right center;box-shadow:none;} .btn-outline-light{color:#f8f9fa;background-image:linear-gradient(to right,transparent 46%,#f8f9fa 56%);border-color:#f8f9fa;background-size:400% auto;transition:all 0.5s linear;} .btn-outline-light:hover,.btn-outline-light:focus,.btn-outline-light:not(:disabled):not(.disabled).active:focus,.btn-outline-light:not(:disabled):not(.disabled):active:focus,.show > .btn-outline-light.dropdown-toggle:focus{color:#212529;background-position:right center;box-shadow:none;} .btn-outline-secondary-transparent {border: 1px solid transparent !important; background-color: transparent !important; color: #f3772c;} .btn-outline-secondary-transparent:hover,.btn-outline-secondary-transparent:focus,.btn-outline-secondary-transparent:not(:disabled):not(.disabled).active:focus,.btn-outline-secondary-transparent:not(:disabled):not(.disabled):active:focus,.show > .btn-outline-secondary-transparent.dropdown-toggle:focus{color:#fff;background-color:#f3772c; border-color: #f3772c;} .btn-outline-green-transparent {border: 1px solid #58b943; background-color: transparent; color: #58b943;} .btn-outline-green-transparent:hover,.btn-outline-green-transparent:focus,.btn-outline-green-transparent:not(:disabled):not(.disabled).active:focus,.btn-outline-green-transparent:not(:disabled):not(.disabled):active:focus,.show > .btn-outline-green-transparent.dropdown-toggle:focus{color:#fff;background-color:#58b943;} .btn-outline-red-transparent {border: 1px solid #d93737; background-color: transparent; color: #d93737;} .btn-outline-red-transparent:hover,.btn-outline-red-transparent:focus,.btn-outline-red-transparent:not(:disabled):not(.disabled).active:focus,.btn-outline-red-transparent:not(:disabled):not(.disabled):active:focus,.show > .btn-outline-red-transparent.dropdown-toggle:focus{color:#fff;background-color:#d93737;} .btn-gray { background-color: #686868; border: 1px solid #686868; font-size: 15px; line-height: 13px; color: #fff; font-weight: 500;} .btn-gray:hover,.btn-outline-gray:focus { background-color: #686868; color: #fff !important;} .btn-outline-gray { background-color: transparent; border: 1px solid #aaaaaa; font-size: 15px; line-height: 13px; color: #aaaaaa; font-weight: 500;} .btn-outline-gray:hover,.btn-outline-gray:focus { background-color: #aaa; color: #fff !important;} .btn-bg-white{color: #22a612;; border-color:#fff; background-color: #fff; box-shadow:0px 5px 4px rgba(13,9,44,0.25);transition:all 0.5s linear;} .btn-bg-white:hover,.btn-bg-white:focus,.btn-bg-white:not(:disabled):not(.disabled).active,.btn-bg-white:not(:disabled):not(.disabled):active,.show > .btn-bg-white.dropdown-toggle{border-color:#22a612; background-color:#22a612; box-shadow:none;} .btn-group>.btn-group:not(:first-child)>.btn, .btn-group>.btn:nth-child(n+3), .btn-group>:not(.btn-check)+.btn {border-top-left-radius: 0 !important;border-bottom-left-radius: 0 !important;} .btn-rounded{border-radius:50px;} .btn-circle{border-radius:100%;} .br-0{border-radius: 0px !important;} .br-6{border-radius: 6px;} .br-8{border-radius: 8px;} .br-10{border-radius: 10px;} .br-15{border-radius: 15px;} .br-30{border-radius: 30px;} .br-50p{border-radius: 50%; overflow: hidden;} .br-t-l-0 { border-top-left-radius: 0 !important;} .br-t-r-0 { border-top-right-radius: 0 !important;} .bs-none {box-shadow: none !important;} .b-none { border: none; } .bs-box { box-shadow: 0px 11px 19px rgba(0,0,0,0.11); } .bs-box-dark { box-shadow: 0 0 9px rgba(25,100,16,0.41);} .btn-wh-180-54 { min-width:180px;line-height:54px; } .btn-wh-160-54 { min-width:160px;line-height:54px; } .btn-wh-150-54 { min-width:150px;line-height:54px; } .btn-wh-150-46 { min-width:150px;line-height:46px; } .btn-wh-180-46 { min-width:180px;line-height:46px; } .btn-wh-220-46 { min-width:220px;line-height:46px; } .btn-wh-150-48 { min-width:150px;line-height:48px; } .btn-wh-180-56 { min-width:180px;line-height:56px; } .btn-wh-188-51 { min-width:188px;line-height:51px; } .btn-wh-188-38 { min-width:188px;line-height:38px; } .btn-wh-130-38 { min-width:130px;line-height:38px; } .btn-wh-120-41 { min-width:120px;line-height:41px; } .btn-wh-110-28 { min-width:110px;line-height:28px; } .btn-wh-30 {min-width: 30px; line-height: 28px; padding: 0;} .btn-wh-35 {min-width: 35px; line-height: 35px; padding: 0;} .btn-wh-42 {min-width: 45px; line-height: 42px; padding: 0;} .btn-wh-295-47 {min-width: 295px; line-height: 45px; } button.btn-wh-111-33 {min-width: 111px; height: 33px;} .btn-wh-184-51 {min-width: 184px; height: 51px;} .btn-h-30 {font-size: 14px; line-height: 28px; padding: 0px 20px;} .btn-h-38 {font-size: 14px; line-height: 36px; padding: 0px 20px;} .btn-right-icons {position: relative; padding-right: 60px;} .btn-right-icons span {position: absolute; content: ""; right: 6px; top: 6px; transition: 0.5s ease-in-out; width: 44px; height: 44px; background-color: rgba(255, 255, 255, 0.3); border-radius: 50px; font-size: 20px; line-height: 44px;} .btn-right-icons:hover span {opacity: 1;} .btn-right-icons span svg {width: 20px; height: 20px;} .svg-inline--fa {width: 20px !important; height: 20px !important;} .btn-wh-150-46.btn-right-icons span{width: 35px; height: 35px; line-height: 35px;} .btn-left-icons {position: relative; padding-left: 60px;} .btn-left-icons span {font-size: 44px; opacity: 0.3; opacity: 0.3; position: absolute; content: ""; right: 6px; top: 1px; transition: 0.5s ease-in-out;} .btn-left-icons:hover span {opacity: 1;} .btn-bg-white.btn-right-icons span {background-color: rgba(34, 166, 18, 0.3);} .btn-outline-secondary-transparent.btn-right-icons span {background-color: rgba(243, 119, 44, 0.3);} /*============== form element ==================*/ .form-group{margin-bottom:20px;} .form-control-hide{position:absolute;left:0;width:0;height:0;overflow:hidden;} .form-control, .form-select {padding:0 20px;border:1px solid #e9e9e9;border-radius:15px; background-color:#f5f5f5; min-height: 56px;} .form-control::placeholder{color:#0d0d0d; opacity: 0.5;} .form-control:focus, .form-control.required_input:focus,.form-select:focus{box-shadow:none;border-color:#f3772c;} .form-control.required_input{border-bottom:1px solid #ff5c5c;} .form-control-xs {min-height: 30px; border-radius: 8px;} .form-control-sm {min-height: 38px; border-radius: 8px;} .form-label{margin-bottom:5px;font-size:16px;line-height:18px;font-weight:500;letter-spacing:0px;color:#FFF;} textarea.form-control{padding:15px 20px;resize:none;} .input-left-right-icon{position:relative;} .input-left-right-icon .form-control{padding-left:56px;padding-right:56px;} .input-left-right-icon i{position:absolute;top:9px;height:20px;font-size:19px;} .input-left-right-icon i.left{left:20px;} .input-left-right-icon i.right{right:20px;} .input-left-right-icon i:not([class*="color-"]){color:#a3a3a3;} .input-left-icon{position:relative;} .input-left-icon .form-control{padding-left:56px;} .input-left-icon i{position:absolute;left:20px;top:9px;height:20px;font-size:19px;} .input-left-icon i:not([class*="color-"]){color:#a3a3a3;} .input-right-icon{position:relative;} .input-right-icon .form-control{padding-right:56px;} .input-right-icon i{position:absolute;right:20px;top:9px;height:20px;font-size:19px;} .input-right-icon i:not([class*="color-"]){color:#a3a3a3;} .input-right-icon.verify_email i{color:#6ba151;} .input-right-icon.unverify_email i{font-size:24px;color:#f44336;} /*================= Custom Checkbox ===================*/ .form-check-label {cursor: pointer;} .form-check-input {box-shadow: none !important; width: 18px; height: 18px; border-radius: 4px; background-color: #ffffff; border: 1px solid #c8c8c8;} .form-check-input:checked {background-color: #ff5c5c; border-color: #ff5c5c;} .custom-checkbox .custom-control-input:focus ~ .custom-control-label::before{box-shadow:none !important;} .custom-checkbox .custom-control-label{margin-bottom:5px;color:#585858;cursor:pointer;} .custom-checkbox .custom-control-label::before{top:2px;left:-25px;width:18px;height:18px;} .custom-checkbox .custom-control-label::after{top:1px;left:-25px;width:18px;height:18px;} .custom-checkbox .custom-control-input:checked ~ .custom-control-label::before{color:#fff;border-color:#3ea3cf;background-color:#3ea3cf;} .custom-checkbox .custom-control-input:checked ~ .custom-control-label::after{background-size:13px;} .lbl-checkbox-favorite {position:relative;margin:0;padding:0;cursor:pointer;} .lbl-checkbox-favorite input{position:absolute;opacity:0;} .lbl-checkbox-favorite .spn-checkbox{display:inline-flex;justify-content:center;align-items:center;width:37px;height:37px;padding-top:2px;font-size:18px;border-radius:45px;color:#22a612;border:2px solid #22a612;background:transparent;} .lbl-checkbox-favorite .spn-checkbox::before{display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1;font-weight:400;font-family:"Font Awesome 5 Pro";content:"\f004";} .lbl-checkbox-favorite input:checked ~ .spn-checkbox::before {font-weight:900;} .lbl-checkbox-favorite input:checked ~ .spn-checkbox {color:#22a612;border:2px solid #22a612;} .lbl-checkbox-favorite.lbl-sm .spn-checkbox{display:inline-flex;justify-content:center;align-items:center;width:32px;height:32px;padding-top:2px;font-size:16px;border-radius:45px;color:#22a612;border:1px solid #4b4b4b;background:transparent;} .lbl-checkbox-favorite.lbl-sm input:checked ~ .spn-checkbox {color:#22a612;border:1px solid #4b4b4b;} /*============== Custom radio =================*/ .custom-radio .custom-control-input:focus ~ .custom-control-label::before{box-shadow:none !important;} .custom-radio .custom-control-label{color:#585858;cursor:pointer;} .custom-radio .custom-control-label::before{top:1px;left:-25px;width:20px;height:20px;} .custom-radio .custom-control-label::after{top:6px;left:-20px;width:10px;height:10px;border-radius:50%;} .custom-radio .custom-control-input:checked ~ .custom-control-label::before{border-color:#3ea3cf;background-color:#ffffff;} .custom-radio .custom-control-input:checked ~ .custom-control-label::after{width:10px;height:10px;background-image:none;background-color:#3ea3cf;} .custom-radio2{padding-left:15px;} .custom-radio2 .custom-control-label{line-height:40px;} .custom-radio2 .custom-control-label::before{top:0;left:0;right:0;width:100% !important;height:4px !important;border-radius:0 !important;border:none;background:transparent;} .custom-radio2 .custom-control-label::after{top:0px;left:0px;width:100% !important;height:4px !important;border-radius:0 !important;} .custom-radio2 .custom-control-input:checked ~ .custom-control-label::before{width:100% !important;border-bottom-left-radius:15px !important;border-bottom-right-radius:15px !important;background-color:#3ea3cf;} .custom-radio2 .custom-control-input:checked ~ .custom-control-label::after{width:0 !important;height:4px;background-image:none;background-color:#ffffff;} .custom-radio2 .custom-control-input:checked ~ .custom-control-label{color:#3ea3cf;} /*=============== custom-switch =================*/ .custom-switch .custom-control-label::before{top:0;left:-2.25rem;width:50px;height:26px;border-radius:50px;box-shadow:none;cursor:pointer;} .custom-switch .custom-control-label::after{top:4px;left:-30px;width:18px;height:18px;box-shadow:none;cursor:pointer;} .custom-switch .custom-control-input:checked ~ .custom-control-label::after{background-color:#fff;transform:translateX(22px);} .custom-control-input:checked ~ .custom-control-label::before{border-color:#3ea3cf;background-color:#3ea3cf;} /*======== spinner ==========*/ .spinner-border{vertical-align:middle;} .spinner{position:absolute;left:50%;top:50%;width:50px;height:50px;margin-left:-20.5px;background:transparent;} .spinner>div { display: inline-block; height: 100%; width: 4px; margin: 0 3px 0 0; background-color: #22a612; animation: sk-stretchdelay 1.2s infinite ease-in-out; } .spinner .rect2{animation-delay:-1.1s;} .spinner .rect3{animation-delay:-1s;} .spinner .rect4{animation-delay:-0.9s;} .spinner .rect5{animation-delay:-0.8s;} @keyframes sk-stretchdelay{ 0%,100%,40%{transform:scaleY(0.4);} 20%{transform:scaleY(1);} } /*====== card =========*/ .card{border-radius: 15px; box-shadow: 0 0 13.5px rgba(18,94,9,0.21);} .card.noradius{border-radius:0;} .card-height-full{height:100%;} .card.card-dark { background-color: #282828; } .card.card-black { background-color: #000000; } .card-post {overflow: hidden;} .card-post .card-header {padding: 10px 40px; border-bottom: 1px solid #4b4b4b; background-color: #4b4b4b;} .card-post .card-body {padding: 20px 40px; background-color: #191919;} .card-axis-point .card-header {background-color: #282828;} /*============== service_card =================*/ .service_card{display:flex;align-items:center;justify-content:space-between;padding:15px;margin-bottom:20px;border-radius:10px;background:#efefef;} .service_card .service_card_inner{text-align:center;border-right:1px solid #c2c2c2;} .service_card .service_card_inner p{margin-bottom:0;} .service_card .service_card_inner.col1{flex-grow:1;padding:0 15px;} .service_card .service_card_inner.col3{max-width:300px;width:100%;padding:0 15px;border-right:none;} @media screen and (max-width:1200px){ .service_card .service_card_inner.col3{max-width:260px;} } @media screen and (max-width:991px){ .service_card .service_card_inner.col3{max-width:300px;} } @media screen and (max-width:767px){ .service_card{flex-direction:column;} .service_card .service_card_inner{border-right:none;} .service_card .service_card_inner.col1{margin-bottom:15px;} } /*=========== card_3d ==============*/ .card_3d .card3d_header{position:relative;padding:6px 20px;text-align:center;background-color:#d7d7d7;} .card_3d .card3d_header:before{content:"";position:absolute;left:0;bottom:-30px;border-top:30px solid #ababab;border-left:30px solid transparent;} .card_3d .card3d_header:after{content:"";position:absolute;right:0;bottom:-30px;border-top:30px solid #ababab;border-right:30px solid transparent;} .card_3d .card3d_header strong{color:#000;font-size:16px;font-weight:bold;line-height:34px;letter-spacing:1px;} .card_3d .card3d_header h2{margin-top:5px;margin-bottom:4px;color:#fff;font-size:36px;font-weight:500;line-height:26px;letter-spacing:-0.25px;} .card_3d .card3d_header h3{margin-bottom:4px;color:#fff;font-size:24px;font-weight:500;line-height:24px;letter-spacing:-0.25px;} .card_3d .card3d_body{margin:0 30px 30px;border-radius:8px;background:#fff;box-shadow:0px 5px 20px rgba(0,0,0,0.15);} .card_3d .card3d_body .card3d_body_inner{display:block;padding:35px 30px;text-align:center;} .card_3d .card3d_body .card3d_body_inner p{margin-bottom:0;} .card_3d .card3d_body .card3d_footer{display:block;padding:15px;text-align:center;border-top:1px solid #d7d7d7;} .card_3d .card3d_body .card3d_footer p{margin-bottom:10px;} .card_3d .card3d_body .card3d_body_inner .rating_star{margin:15px 0 15px;} .card_3d .card3d_body .card3d_body_inner .rating_star .dv-star-rating span{margin:5px;font-size:22px;} .card_3d .card3d_body .card3d_body_inner .rating_star span{margin:0 5px;vertical-align:top;line-height:30px;} @media screen and (max-width:575px){ .card_3d .card3d_body .card3d_body_inner{padding:16px;} .card_3d .card3d_body .card3d_body_inner .font-22{font-size:20px;} .card_3d .card3d_body .card3d_body_inner .rating_star{margin:0;} .card_3d .card3d_body .card3d_body_inner .rating_star .dv-star-rating-star{margin:0;} .card_3d .card3d_body .card3d_body_inner .rating_star .dv-star-rating span{margin:0;} .card_3d .card3d_body .card3d_body_inner .rating_star span{margin:0;} .card_3d .card3d_body .card3d_body_inner .rating_star .font-18{font-size:16px;} .card_3d .card3d_body .card3d_footer .font-30{font-size:25px;} .card_3d .card3d_body .card3d_footer p{margin-bottom:0;} } /*========= Modal ===========*/ .modal-content{border-radius:10px;overflow:hidden;} .verified_modal{position:relative;padding:0 120px 30px;text-align:center;} .verified_modal:before{content:"";position:absolute;top:0;left:0;right:0;width:100%;height:8px;background-color:#3ea3cf;} .verified_badge{display:inline-block;width:160px;height:155px;margin-bottom:30px;padding:25px;text-align:center;border-bottom-left-radius:50%;border-bottom-right-radius:50%;background-color:#3ea3cf;box-shadow:0 0 16px rgba(0,0,0,0.13);} .verified_badge img{height:100%;} @media screen and (max-width:767px){ .verified_modal{padding:0 50px 30px;} } .modal-overflow-visible .modal-content{overflow: visible;} .modal-fullscreen .carousel .carousel-item .slider_img, .modal-fullscreen .carousel .carousel-item .slider_video { display: flex; align-items: center; justify-content: center; height: calc(100vh - 110px); } /*=========== progress ==============*/ .progress{margin-top: 17px;height: 8px;border-radius:10px;overflow:visible;} .progress-bar{position:relative;text-align:right;color:#ffffff;font-size:14px;font-weight:bold;border-radius:10px;background-color:#3ea3cf;z-index:1;overflow:visible;} .progress-bar::before{content:"";position:absolute;top:-11px;right:-8px;width:47px;height:28px;border-radius:5px;background-color:#3ea3cf;z-index:-1;} .profile_complete .progress-bar:before{right:-4px;} .profile_incomplete .progress-bar:before{right:-18px;} .circle .progress-bar::before {width:28px;height:28px;border-radius:50px;} /*============== react-select ===============*/ .react-select__value-container > div {display: inline-block; width: inherit !important; color:#FBFBFB !important;} .react-select__value-container--is-multi{line-height:24px !important;color:#FBFBFB !important; padding: 6px 10px !important;} .react-select__multi-value{background-color:#282828 !important; border-radius: 5px !important;padding: 2px 10px;} .react-select__multi-value__label{color:#FBFBFB !important;font-weight:normal !important;} .react-select__multi-value__remove svg{width: 18px; height: 18px;} .react-select__multi-value__remove:hover{color:#FBFBFB !important;background-color:#282828 !important;cursor:pointer !important;} .react-select-tag .react-select__control{padding:0;} .react-select-tag .react-select__dropdown-indicator{display:none;} .react-select-lg.required_input .react-select__control{border-bottom:1px solid #ff5c5c;} .react-select__indicator-separator {background-color: transparent !important;} .react-select-lg-light .react-select__value-container > div {color:#282828 !important;} .react-select-lg-light .react-select__indicator {color: #282828 !important;} .react-select__menu {color:#FFF !important;background-color:#393D43 !important;} .react-select__menu > div {padding: 0 !important;} .react-select__menu .react-select__option {color:#FBFBFB !important; background-color:#4b4b4b !important; font-size: 14px !important; cursor:pointer !important;} .react-select__menu .react-select__option:hover, .react-select__menu .react-select__option.react-select__option--is-selected {color:#FFF !important; background-color:#22a612 !important;} .react-select-lg-light .react-select__menu {color:#333 !important;background-color:#FFF !important;} .react-select-lg-light .react-select__menu > div {padding: 0 !important;} .react-select-lg-light .react-select__menu .react-select__option {color:#333 !important; background-color:#FFF !important; font-size: 14px !important; cursor:pointer !important;} .react-select-lg-light .react-select__menu .react-select__option:hover, .react-select-lg-light .react-select__menu .react-select__option.react-select__option--is-selected {color:#FFF !important; background-color:#22a612 !important;} /*============== rating star ===============*/ .rating_star.rs-flex{display:flex;} .rating_star.rs-space2 .dv-star-rating-star{margin-right:6px;} .react-reveal .rating_star{padding: 10px 0 0;text-align: center;} /*============== ribbont =================*/ .ribbon-right-top-outline{position:absolute;right:32px;top:0;padding: 11px 16px;border-radius:0 0 8px 8px;border:1px solid #c2c2c2;box-shadow:0 0 15px rgba(0,0,0,0.02);background-color:white;} /*======== ul-taglist ===========*/ .ul-taglist > li{position:relative; word-break: break-all; display:inline-block;margin-right:10px;margin-bottom:10px;padding:0 15px;text-align:center;color:#3ea3cf;border-radius:5px;line-height:36px;font-weight:normal;border:1px solid #cdcdcd;background-color:rgba(62,163,207,0);text-transform:capitalize;} .ul-taglist-arrow > li{position:relative;display:inline-block;width:50%;margin-bottom:5px;padding:0 20px;color:#455062;text-transform:uppercase;} .ul-taglist-arrow > li:before{content:"\f101";position:absolute;left:0;top:4px;color:#455062;font-family:"Font Awesome 5 Pro";font-weight:900;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;display:inline-block;font-style:normal;font-variant:normal;text-rendering:auto;line-height:1;} /*============== ul tablist =================*/ .list-group-horizontal .list-group-item{flex:1;padding:0;text-align:center;border-top:0;border-bottom:0;transition:all 0.5s;overflow:hidden;} .list-group-horizontal .list-group-item:not(.nohover):hover, .list-group-horizontal .list-group-item.active{border-color:#bfe1ef;background-color:#bfe1ef;} .list-group-horizontal .list-group-item:first-child{border-bottom-left-radius:10px;border-top-left-radius:10px;border-left:0;} .list-group-horizontal .list-group-item:last-child{border-top-right-radius:10px;border-bottom-right-radius:10px;border-right:0;} .list-group-horizontal .list-group-item a{display:block;padding:15px;color:#000;font-size:16px;font-weight:bold;} .ul-tablist-max{flex-wrap:wrap;} .ul-tablist-max .list-group-item{border-width:0;} .ul-tablist-max .list-group-item .linktext{padding:14px 0;white-space: nowrap;text-decoration:none;} .ul-tablist-max .list-group-item .linktext .text{display:block;padding:0 5px;} .ul-tablist-max .list-group-item:not(:last-of-type) .linktext .text{border-right: 1px solid rgba(0,0,0,.125);} .ul-tablist-max .list-group-item .linktext.active{background-color:#bfe1ef;} .ul-tablist-max .list-group-item:not(.nohover):hover .linktext .text, .ul-tablist-max .list-group-item .linktext.active .text{border-color:#bfe1ef;} /*=============== ul social color ==============*/ .ul-social-color{display:flex;flex-wrap:wrap;} .ul-social-color li{margin-right:15px;} .ul-social-color li i{font-size:24px;} /*=============== react-player ==============*/ .react-player { border-radius: 15px; overflow: hidden; background-color: black; } /*============== Custon tabs =================*/ .custom_tabs.nav-tabs .nav-item {margin-right: 5px;} .custom_tabs.nav-tabs .nav-link {width: 120px;height: 42px; font-size: 16px; font-weight: 500; border-top-left-radius: 5px; border-top-right-radius: 5px; text-align: center; color: #dcdcdc; background-color: #191919; border-color: #191919 #191919 #dcdcdc;} .custom_tabs.nav-tabs .nav-item.show .nav-link, .custom_tabs.nav-tabs .nav-link.active {font-weight: 600; color: #dcdcdc; background-color: #191919; border-color: #dcdcdc #dcdcdc #191919;} .upload_file { position: relative; } .upload_file input[type="file"] { position: absolute; content: ""; top: 0; bottom: 0; left: 0; right: 0; width: 100%; opacity: 0; } .upload_file label { margin: 0; position: absolute; right: 5px; top: 5px; line-height: 42px; border-radius: 10px; width: 150px; color: #FFF; } .react-reveal .sc-AxjAm{display:inherit !important;} .react-reveal .form-cardplugin-wrap{padding:10px 0 !important; flex-wrap: wrap;} .react-reveal .form-cardplugin-wrap.is-invalid{border:0 !important;border-width:0 !important;border-radius:0 !important;} .react-reveal .form-cardplugin-wrap img.eYXtTu{position:relative;bottom: 0;width: 45px;height: 34px;} .react-reveal .form-cardplugin-wrap > label{flex:1 1 auto !important;} .react-reveal .form-cardplugin-wrap .credit-card-input{font-size:16px !important;} .react-reveal .form-cardplugin-wrap .credit-card-input:focus{box-shadow:none!important;border-color:#3ea3cf!important;} .react-reveal p.error{display:block;font-size:14px;font-weight:400;text-align:left;color:#f44336;} /*======= Padding ========*/ .p-8-21-30 { padding: 8px 21px 30px; } .p-19-0-10 { padding: 19px 0 10px; } .p-20-20-20-39 { padding: 20px 20px 20px 39px; } .p-20-20-30-20 { padding: 20px 20px 30px 20px } .p-30-30-35-30 { padding: 30px 30px 35px; } .p-25-28 { padding: 25px 28px; } .p-25-20 { padding: 25px 20px; } .p-0 { padding: 0; } .p-20 { padding: 20px; } .p-30 { padding: 30px; } .p-l-0 { padding-left: 0; } .p-l-10 { padding-left: 10px; } .p-l-15 { padding-left: 15px; } .p-l-25 { padding-left: 25px; } .p-l-46 { padding-left: 46px; } .p-l-67 { padding-left: 67px; } .p-r-0 { padding-right: 0; } .p-t-0 { padding-top: 0; } .p-t-7 { padding-top: 7px; } .p-t-15 { padding-top: 15px; } .p-t-30 { padding-top: 30px; } .p-t-35 { padding-top: 35px; } .p-t-100 { padding-top: 100px; } .p-bottom-0 { padding-bottom: 0; } .p-b-6 { padding-bottom: 6px; } .p-b-10 { padding-bottom: 10px; } .p-b-15 { padding-bottom: 15px; } .p-b-19 { padding-bottom: 19px; } .p-b-20 { padding-bottom: 20px; } .p-b-25 { padding-bottom: 25px; } .p-b-30 { padding-bottom: 30px; } .p-25-0 { padding: 25px 0; } .p-20-0-50 { padding: 20px 0 50px 0; } .p-20-0-60 { padding: 20px 0 60px 0; } .p-30-0-60 { padding: 30px 0 60px 0; } .p-27-0-55 { padding: 27px 0 55px; } .p-10-20-10-20 { padding: 10px 20px; } .p-15-20-30 { padding: 15px 20px 30px; } .p-15-50-40 {padding: 15px 50px 40px;} .p-15-20-20 { padding: 15px 20px 20px; } .p-10-15 { padding: 10px 15px; } .p-7-20 { padding: 7px 20px; } .p-5-21 {padding: 5px 21px;} .p-7-15 { padding: 7px 15px; } .p-0-0-60 { padding: 0 0 60px; } .p-0-0-80-0 { padding: 0 0 80px 0; } .p-7-25 { padding: 7px 25px; } .p-13-20 { padding: 13px 20px; } .p-30-0 { padding: 30px 0; } .p-b-13 { padding-bottom: 13px; } .p-60-0 { padding: 60px 0; } .p-70-0-80 { padding: 70px 0 80px; } .p-88-0-78 { padding: 88px 0 78px; } .p-30-150-38-50 { padding: 30px 150px 38px 50px; } .p-20 { padding: 20px; } /*======= Margin ========*/ .mt-22 {margin-top: 22px;} .mt-20 {margin-top: 20px;} .mt-10 {margin-top: 10px;} .mt-13 {margin-top: 13px;} .mt-15 {margin-top: 15px;} .mt-10 {margin-top: 10px;} .mt-8 {margin-top: 8px;} .mt-6 {margin-top: 6px;} .mb-0 { margin-bottom: 0; } .mb-3 { margin-bottom: 3px; } .mbottom-5 { margin-bottom: 5px; } .mb-6 { margin-bottom: 6px; } .mb-7 { margin-bottom: 7px; } .mb-10 { margin-bottom: 10px; } .mb-12 { margin-bottom: 12px; } .mb-14 { margin-bottom: 14px; } .mb-15 { margin-bottom: 15px; } .mb-17 { margin-bottom: 17px; } .mb-18 { margin-bottom: 18px; } .mb-19 { margin-bottom: 19px; } .mb-20 { margin-bottom: 20px; } .mb-25 { margin-bottom: 25px; } .mb-30 { margin-bottom: 30px; } .mb-45 { margin-bottom: 45px; } .mb-60 { margin-bottom: 60px; } .mb-90 { margin-bottom: 90px; } .mr-10 { margin-right: 10px; } .mr-30 { margin-right: 30px; } .m-l-10 { margin-left: 10px; } .m-l-20 { margin-left: 20px; } .m-l-r-30 { margin: 0 30px; } .m-l-r-20 { margin: 0 20px; } .m-l-r-10 { margin: 0 10px; } .m-25-0-35 { margin: 25px 0 35px; } .m-0-0-45 { margin: 0 0 45px 0; } .m-4-0-25 { margin: 4px 0 25px; } .m-10 { margin: 10px; } .m-5-0 { margin: 5px 0; } .w-28 { width: 28px; } .h-28 { height: 28px; } .w-30 { width: 30px; } .h-30 { height: 30px; } .w-33 { width: 33px; } .h-33 { height: 33px; } .w-37 { width: 37px; } .h-37 { height: 37px; line-height: 37px; } .w-60 { width: 60px; } .h-60 { height: 60px; } .w-100p { width: 100% } .h-100p { height: 100% } .overflow-hidden { overflow: hidden; }
0
/content/gmx-projects/gmx-admin/frontend/public/assets
/content/gmx-projects/gmx-admin/frontend/public/assets/css/designer.css
@import url('general.css'); @import url('component.css'); @import url('custom-style'); @import url('header.css'); @import url('pages.css'); @import url('footer.css'); @import url('responsive.css');
0
/content/gmx-projects/gmx-admin/frontend/public/assets
/content/gmx-projects/gmx-admin/frontend/public/assets/css/footer.css
/*===================================================== Footer ====================================================*/ .footer_top { padding: 0 0 40px; background: url(../images/footer-bg-map.png) no-repeat center/ cover #0d0d0d; } .footer_top .nav_brand_logo { font-weight: 900; background-color: #292929; margin: 0 auto 25px; max-width: 270px; height: 140px; padding: 15px; display: block; text-align: center; border-bottom-left-radius: 20px; border-bottom-right-radius: 20px; } .footer_top p { font-size: 16px; font-weight: 500; line-height: 25px; color: #fff; opacity: 0.5; } .footer_top .footer_title { margin-bottom: 18px; font-size: 20px; line-height: 34px; color: #fff; position: relative; margin-top: 50px; padding-bottom: 15px; border-bottom: thin solid rgba(255, 255, 255, 0.3); } .footer_top .footer_title::before { position: absolute; content: ""; background-color: #f3772c; width: 70px; height: 5px; left: 0; bottom: -3px; } ul.quick_links li { position: relative; margin-bottom: 10px; float: left; width: 50%; } ul.quick_links li a { font-size: 16px; font-weight: 500; line-height: 25px; color: #fff; opacity: 1; transition: 0.5s ease-in-out; } ul.quick_links li a:hover, ul.quick_links li.active a { opacity: 1; color: #fff; } ul.quick_links li.active i, ul.quick_links li:hover i { animation: arrowAnimation 1.2s infinite ease-in-out; } ul.left_padding li { padding-left: 25px; } ul.quick_links li i { content: ""; position: absolute; top: 4px; left: 0; font-size: 18px; color: #a6a6a6; } ul.quick_links li a { color: rgb(255 255 255 / 50%); } @keyframes arrowAnimation { 0% { left: 0; } 50% { left: 8px; } 100% { left: 0; } } ul.get_in_touch li { margin-bottom: 15px; } ul.get_in_touch li i { font-size: 26px; display: inline-block; vertical-align: middle; padding-right: 10px; } ul.get_in_touch li a { font-size: 14px; color: #fff; opacity: 0.5; transition: 0.5s ease-in-out; } ul.get_in_touch li a:hover { color: #fff; opacity: 1; } .footer_bottom { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; background-color: #1a1a1a; } .footer_bottom ul li { display: inline-block; margin-right: 20px; padding-right: 20px; color: #fff; line-height: 16px; } .footer_bottom .copyright_terms { display: flex; } .footer_bottom .copyright_terms li { border-right: 1px solid #fff; } .footer_bottom .copyright_terms li:last-child { margin-right: 0px; padding-right: 0px; border-right: none; } .footer_bottom .social_media_icon { display: flex; align-items: center; } .footer_bottom .social_media_icon li { display: inline-block; width: 28px; margin-right: 10px; padding: 0; font-size: 18px; text-align: center; } .footer_bottom .social_media_icon .dropdown { margin-left: 20px; margin-right: 50px; } @media screen and (max-width: 767px) { .footer_top { padding: 0 0 25px; } .footer_bottom { display: block; padding: 20px 0; } .footer_bottom .copyright_terms { margin-bottom: 20px; } .footer_bottom .social_media_icon { display: block; } .footer_bottom .social_media_icon li { text-align: left; } .footer_bottom .social_media_icon .dropdown { margin: 20px 0 0 0; } .footer_top .nav_brand_logo { max-width: 220px; height: 100px; } .footer_top .footer_title { margin-top: 10px; } } /*=========== user Footer ==============*/ .admin_footer { position: fixed; bottom: 0; right: 0; left: 0; padding: 15px; border: 1px solid #efefef; background-color: #ffffff; } body.sidebar-open .admin_footer { left: 199px; } .admin_footer p { margin-bottom: 0; font-size: 14px; line-height: 20px; color: #676767; font-weight: 500; text-align: center; } .admin_footer a { color: #676767; } ul.quick_links li a { color: rgb(255 255 255 / 50%); } ul.social_media_links { display: inline-flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; margin-top: 28px; } ul.social_media_links li a { width: 29px; height: 29px; font-size: 20px; border-radius: 5px; background-color: #22a612; margin-right: 20px; padding: 0; min-width: auto; line-height: 29px; text-align: center; color: #fff; transition: 0.3s ease-in-out; } ul.social_media_links li a:hover { transform: scale(1.1); } .footer_top ul.social_media_links li a { font-size: 16px; } .footer_bottom { background-color: #1a1a1a; } .footer_bottom p { margin: 0; font-size: 12px; line-height: 28px; color: #6b6b6b; font-weight: 400; } .footer_bottom ul li a { cursor: pointer; font-size: 12px; line-height: 28px; color: #6b6b6b; font-weight: 400; transition: 0.5s ease-in-out; } .footer_bottom ul li a:hover { color: #fff; } .footer_bottom ul li { padding: 0; margin: 0 0 0 20px; } .footer-logo-content { max-width: 370px; margin: 0 auto; } .footer-logo-content p { font-size: 14px; line-height: 23px; color: #ffffff; font-weight: 400; }
0
/content/gmx-projects/gmx-admin/frontend/public/assets
/content/gmx-projects/gmx-admin/frontend/public/assets/css/responsive.css
@media (max-width: 1199px) { ul.listing-33p.product-detail-listing li { width: 50%; } .rating-listing li { padding-left: 0; text-align: center; } .table.table-dark td, .table.table-dark th { padding-left: 2px; padding-right: 2px; } .table.table-dark td:first-child, .table.table-dark th:first-child { padding-left: 5px; } .about-img-col figure { width: 90%; } .card-contact-form { margin-left: 70px; padding: 20px 135px 20px 20px; } .card-contact-detail { margin-right: 0px; margin-left: -135px; padding: 20px 18px; } .banner-slide { height: 580px; } .img-listing-5 li { width: calc(25% - 20px); } } @media (max-width: 991px) { .form-label { font-size: 14px; } .vision-img-col .figure { margin-right: 0; width: 100%; } .vision-box { margin-top: 0; margin-left: 0; margin-bottom: 30px; padding: 20px; } .vision-section .row { flex-direction: column-reverse; } .brand-content { margin-bottom: 30px; } .retailer-box { padding-left: 0; margin-bottom: 30px; } .retailer-section .row { flex-direction: column-reverse; } .retailer-img-box { margin-right: 0; width: 100%; } section.vision-section { padding: 50px 0; } section.retailer-section { padding: 50px 0; } .m-l-r-30 { margin: 0; } .table.table-dark td, .table.table-dark th { padding-left: 2px; padding-right: 2px; } .table.table-dark td:first-child, .table.table-dark th:first-child { padding-left: 5px; } .action-btn { margin-right: 5px; } .action-btn:last-child { margin-right: 0px; } ul.listing-33p.product-detail-listing li { width: 100%; } .product-detail-wrap { padding-bottom: 10px; } .product-name { width: 100%; } div.product-price { width: 100%; } .change-psw-form button { margin-top: 15px; } ul.sidebar-menu li a { padding: 0 10px; } ul.sidebar-menu li a span.msg-count { right: 10px; } .logo-box { width: 150px; } .seller-detail-wrap { width: calc(100% - 150px); } ul.inline-listing li { margin-right: 15px; } .sidebar-menu-wrap { margin-bottom: 30px; } .about-img-col figure { width: 90%; max-width: 100%; } .about-content-box { margin-left: 0; padding-right: 0; } .about-img-col { margin-right: 0; padding: 30px 0 30px; } .about-tagline-box { margin-top: 0; max-width: 100%; width: 100%; } .about-tagline-section { margin-top: 0; padding: 0 0 30px 0; } .about-tagline-section .content-box.p-t-100 { padding-top: 30px; } .contact-section .col-lg-9 { flex: 0 0 auto; width: 100%; } .contact-section .col-lg-3 { flex: 0 0 auto; width: 100%; } .card-contact-form { margin-left: 0; padding: 20px; margin-bottom: 30px; } .card-contact-detail { margin-left: 0; } .card-contact-detail .social_media_links { padding: 15px; } .card-contact-detail.p-30 { padding: 15px; } .footer_top .col-lg-6 { order: 1; } .footer_box.col-lg-3 { order: 2; } .sidebar-nav-wrapper button.navbar-toggler { display: block; } .sidebar-nav-wrapper .navbar-collapse.collapse:not(.show) { display: none; } .sidebar-nav-wrapper button.navbar-toggler { display: flex; } /* .nav_profile {margin: 0 15px;} */ .dzu-previewContainer .dzu-previewButton { opacity: 1; } .card-post .card-header { padding: 10px 20px; } .card-post .card-body { padding: 20px; } } @media (max-width: 767px) { .listing-24p.list-33 li:first-child, .listing-24p.list-33 li:last-child { width: 100%; } ul.listing-24p li { width: 50%; } .follo-main { justify-content: center; } .follo-main li { width: 50%; } .border-left { border-left: #4b4b4b; } .seller-infor-main { justify-content: center; } .listing-24p.list-33 li { width: 100%; } .border-right:last-child { border-right: 0; } .p-25-28 { padding: 10px; } div.product-price ul { border-left: 0; margin-left: 0; } div.product-price ul li:first-child a { margin-left: 0; } ul.product-detail-listing-wrap > li { width: 100%; } ul.product-detail-listing-wrap li.product-quality-wrap { width: 100%; margin-top: 20px; } ul.product-detail-listing-wrap li.product-quality-wrap .d-flex { justify-content: flex-start !important; } p.product-rating { font-size: 14px; } .comment-detail h5, .comment-detail p:not(.product-rating) { padding-right: 100px; } .seller-infor ul.inline-listing { flex-direction: column; justify-content: flex-start; align-items: flex-start; } .star-count { font-size: 14px; width: 50px; height: 50px; line-height: 48px; } .seller-infor .btn { position: unset; transform: none; margin-top: 10px; } .seller-infor { padding: 10px; } ul.listing-33p li { width: 100%; border-right: none; border-bottom: 1px solid #4b4b4b; } ul.listing-33p li:last-child { border-bottom: none; } .logo-box { align-items: flex-start !important; padding-top: 15px; width: 150px; } .seller-detail-wrap { width: calc(100% - 150px); } ul.listing-25p li { width: 50%; padding: 10px 0; } .rating-listing li:after { display: none; } ul.react-tabs__tab-list .react-tabs__tab { min-width: initial; padding: 10px 15px; font-size: 14px; } .sidebar-menu-wrap { margin-bottom: 30px; } .d-flex.card-header { flex-wrap: wrap; } .d-flex.card-header .card-title { width: 100%; margin-bottom: 10px !important; } .d-flex.card-header .btn-primary { margin-left: auto; } .page-title-wrap.mb-60 { margin-bottom: 30px; } .contact-section .col-lg-9 { flex: 0 0 auto; width: 100%; } .contact-section .col-lg-3 { flex: 0 0 auto; width: 100%; } .card-contact-form { padding: 20px; margin-bottom: 30px; } .card-contact-detail { margin-left: 0; } .fs-17 { font-size: 16px; } .fs-60 { font-size: 32px; } .banner-content { padding: 50px 0 100px; } .banner-slide { height: 420px; } .custom-tabs .nav-tabs .nav-item .nav-link { min-width: 140px; padding: 15px 10px; } .filter-form .form-label { min-width: 100px; } .filter-form .maxw-200, .filter-form .maxw-150, .search-form { max-width: 100%; width: 100%; } .search-form-main { width: 100%; } } @media (max-width: 640px) { .responsiveTable { min-width: 100% !important; } .responsiveTable td.pivoted { padding: 8px 10px !important; padding-left: calc(100px + 10px) !important; } .responsiveTable td .tdBefore { width: calc(100px - 20px); top: 50%; transform: translateY(-50%); line-height: 18px; } .responsiveTable.form-dark .form-control { min-height: 40px; border-radius: 10px; } .responsiveTable.form-dark .react-select__control { min-height: 40px; line-height: 34px; border-radius: 10px; } .rdtPicker thead tr { position: inherit; display: revert; border: none; } .rdtPicker tbody tr { padding: 0; border: 0; } .rdtPicker td, .rdtPicker th { display: table-cell; padding: 5px; width: 35px; border: none; border-bottom: none !important; padding: 0; } .rdtPicker th.rdtNext, .rdtPicker th.rdtPrev { vertical-align: middle !important; } .table-chat-btn { display: inline-block !important; } } @media (max-width: 575px) { .img-listing-5 li { width: calc(33.333% - 10px); margin: 5px; } .img-listing-5 { justify-content: center; } .dzu-previewContainer { width: calc(50% - 20px); height: 200px; } .fs-60 { font-size: 28px; line-height: 30px; } /* .order-filter .form-inline { margin: 5px 0;} .card { padding: 10px !important;} */ } @media (max-width: 480px) { .footer_bottom .d-flex { flex-direction: column-reverse; justify-content: center; } .footer_bottom ul.d-flex { flex-direction: initial; } .footer_bottom ul li { margin: 0 10px; } .footer_bottom p { text-align: center; } .footer_bottom { padding: 10px 0 0; } .form-btmbox { flex-direction: column; } .form-btmbox .mb-3 { margin-bottom: 0 !important; } form p a { display: inline-block; } .table-top-filter { padding: 10px; } .table-top-filter button { margin: 5px 0; } .img-listing-5 li { width: calc(50% - 10px); margin: 5px; } .img-listing-5 { justify-content: center; } p.product-rating { position: unset; } .comment-detail h5, .comment-detail p:not(.product-rating) { padding-right: 0; padding-bottom: 7px; } .comment-wrap figure { width: 40px; height: 40px; } .comment-detail { width: calc(100% - 40px); margin-left: 0; padding-bottom: 10px; } .comment-detail p { margin: 0; } .logo-box { width: 100%; border-right: 0; padding: 15px 10px; } .seller-detail-wrap { width: 100%; text-align: center; } .seller-infor ul.inline-listing { flex-direction: initial; justify-content: center; align-items: center; flex-wrap: wrap; } .seller-infor ul.inline-listing li { width: 100%; margin: 5px 0; } ul.listing-25p li { width: 100%; } ul.react-tabs__tab-list .react-tabs__tab { font-size: 11px; padding: 5px 7px; margin: 0 2px -1px; } .react-tabs__tab-panel { padding: 15px 10px; } .p-30-30-35-30 { padding: 15px; } .custom_tabs.nav-tabs .nav-link { width: 100px; font-size: 14px; height: 35px; } .p-20-20-20-39 { padding: 15px; } .dv-star-rating .dv-star-rating-star { margin: 0 5px; } .custom-tabs .nav-tabs .nav-item { flex: 1; } .custom-tabs .nav-tabs .nav-item .nav-link { width: 100%; margin: 0; } .card-contact-detail .icon-round { width: 30px; height: 30px; margin-right: 10px; } .card-contact-detail .get_in_touch li .icon-round i { line-height: 26px; } .card-contact-detail ul.get_in_touch li a { font-size: 12px; } } @media (max-width: 360px) { .captch { transform: scale(0.8); margin-left: -30px; } .card-contact-detail ul.get_in_touch li a { font-size: 10px; } }
0
/content/gmx-projects/gmx-admin/frontend/public/assets
/content/gmx-projects/gmx-admin/frontend/public/assets/css/custom-style.css
/****/ .w--153 { width: calc(100% - 153px); } /****/ .form-inline { display: flex; align-items: center; justify-content: flex-start; flex-wrap: wrap; } .form-inline .form-label { width: auto; padding-right: 6px; } .form-inline .form-select { width: auto; min-width: 160px; } .form-dark .form-label { color: #dcdcdc; } .form-dark .form-select { background-color: #242424; border: 1px solid #4b4b4b; color: #dbdbdb; font-weight: 400; } .form-dark .form-control { background-color: #242424; border: 1px solid #4b4b4b; color: #dbdbdb; font-weight: 400; } .form-dark .form-control::placeholder { color: #d5d5d5; } .form-dark .rmsc .dropdown-heading { height: 56px; padding: 0 15px; } .form-dark .rmsc .dropdown-container { background-color: transparent; border-radius: 15px; border: 1px solid #4b4b4b; } .form-dark .rmsc .dropdown-container:focus-within { box-shadow: var(--rmsc-main) 0 0 0 0px; border-color: #fff; } .form-dark .rmsc .dropdown-heading .dropdown-heading-value { color: #dbdbdb; font-weight: 400; } .mention-textarea::placeholder { color: #d5d5d5; } .form-dark .form-control:focus, .form-dark .form-control:visited, .form-dark .form-control:read-only { border-color: #fff !important; background-color: #242424 !important; } .search-form { position: relative; width: 100%; min-width: 250px; } .search-form button { position: absolute; top: 0; right: 0; border: none; box-shadow: none; display: flex; align-items: center; justify-content: center; height: 35px; } .form-group-h-33 .form-select { font-size: 14px; line-height: 19px; min-height: 33px; padding: 0 10px; } .form-group-h-33 .form-label { font-size: 14px; margin: 0; } .search-form .form-control::placeholder { color: #d5d5d5; } .search-form .form-control { font-size: 14px; line-height: 34px; color: #dcdcdc; font-weight: 400; height: auto; min-height: auto; border-radius: 8px; padding: 0 50px 0 16px; } /****/ .bg-f3772c { background-color: #f3772c; } .color-0e9bfd { color: #0e9bfd; } .color-f3772c { color: #f3772c; } /*****/ .table> :not(:first-child) { border-top: 0; } .table-dark { background-color: #000000; border: 1px solid #4b4b4b; border-right: none !important; } .table.table-dark td, .table.table-dark th { border: 1px solid #4b4b4b; vertical-align: middle; border-right: none; border-left: none; padding-left: 5px; padding-right: 5px; } .table.table-dark td:first-child, .table.table-dark th:first-child { padding-left: 10px; } .table.table-dark th { font-size: 14px; line-height: 16px; color: #dcdcdc; font-weight: 600; background-color: #282828; } .table.table-dark td { font-size: 14px; line-height: 23px; color: #dcdcdc; font-weight: 400; background-color: #000; } .table.table-dark td:last-child a.btn-outline-green-transparent, .table.table-dark td:last-child .icon { display: flex; align-items: center; justify-content: center; } .table-dark.table-bordered> :not(caption)>* { border-color: #4b4b4b; } .table-wrap { /* border-radius: 15px; */ /* overflow-y: hidden; overflow-x: auto; */ border: 1px solid #4b4b4b; } .white-space { white-space: nowrap; } .table-wrap table { margin: -1px; } .table-hover>tbody>tr:hover>* { background-color: #181818; } .table-head-bg-101010.table.table-dark th { background-color: #101010; } .table-head-bg-000.table.table-dark th { background-color: #000; } .table-td-bg-191919.table.table-dark td { background-color: #191919; } .page-item.active .page-link, .page-item .page-link:hover, .page-item .page-link:focus { box-shadow: 0px 2px 3px rgba(24, 125, 12, 0.39); background-color: #22a612; border-color: transparent; } .page-item .page-link { width: 30px; height: 30px; border-radius: 15px; font-size: 15px; line-height: 28px; color: rgb(255 255 255 / 80%); font-weight: 400; margin: 0 2.5px; text-align: center; background-color: transparent; border: none; padding: 0; border: 1px solid transparent; } .prev-item.page-item .page-link, .next-item.page-item .page-link { border: 1px solid #777777; border-radius: 50%; } .page-item:not(:first-child) .page-link, .page-item:not(:first-child) .page-link { margin: 0 2.5px; } .prev-item.page-item .page-link span:before { content: "\f30a"; font-family: "Font Awesome 5 Pro"; font-weight: 900; font-size: 15px; color: #f3782d; } .prev-item.page-item .page-link span { font-size: 0; } .next-item.page-item .page-link span:before { content: "\f30b"; font-family: "Font Awesome 5 Pro"; font-weight: 900; font-size: 15px; color: #f3782d; } .next-item.page-item .page-link span { font-size: 0; } .action-btn { width: 32px; height: 32px; border-radius: 16px; background-color: #000000; /* border: 1px solid #4b4b4b; */ display: inline-block; text-align: center; line-height: 34px; margin-right: 9px; cursor: pointer; } .action-btn:last-child { margin-right: 0; } .action-btn i { font-size: 18px; } .btn-favorite .action-btn { width: 37px; height: 37px; border-radius: 50px; background-color: transparent; border: 2px solid #22a612; display: inline-block; text-align: center; line-height: 35px; font-size: 18px; } .userdetail-listing span { font-size: 18px; line-height: 30px; color: #dcdcdc; font-weight: 400; display: inline-block; padding: 10px 0; width: 180px; min-width: 180px; padding-left: 30px; } .userdetail-listing span.listing-title { font-weight: 500; padding-left: 0; position: relative; } .userdetail-listing li { width: 100%; } .userdetail-listing span.listing-title:after { content: ":"; position: absolute; right: 0; } ul.userdetail-listing { min-width: 360px; } ul.sidebar-menu li a { font-size: 14px; line-height: 49px; color: #dcdcdc; font-weight: 400; display: block; padding: 0 20px; border-bottom: 1px solid #4b4b4b; cursor: pointer; position: relative; } ul.sidebar-menu li a.active, ul.sidebar-menu li a:hover, ul.sidebar-menu li a:focus { background-color: #22a612; } ul.sidebar-menu li a span { color: #22a612; font-size: 16px; display: inline-block; vertical-align: revert; padding-right: 15px; } ul.sidebar-menu li a.active span, ul.sidebar-menu li a:hover span, ul.sidebar-menu li a:focus span { color: #fff; } ul.sidebar-menu li:last-child a { border-bottom: 0; } .sidebar-menu-wrap { /*max-width: 238px;*/ width: 100%; overflow: hidden; } ul.sidebar-menu li a span.msg-count { width: 20px; height: 20px; border-radius: 10px; background-color: #22a612; line-height: 20px; font-size: 12px; color: #ffffff; font-weight: 500; text-align: center; padding: 0; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); } .form-dark .form-select.br-8 { border-radius: 8px; } .userimg-wrap .form-control.upload_file { padding: 0; line-height: 26px; min-height: auto; background-color: #22a612; box-shadow: 0px 10px 10px rgba(0, 0, 0, 0.3); background-color: #22a612; border: 2px solid #ffffff; text-align: center; position: absolute; bottom: 0; right: 0; } .userimg-wrap .form-control.upload_file label.profile-edit-btn { width: 100%; padding: 0; line-height: 26px; position: unset; } .userimg-wrap { width: 100px; height: 100px; border-radius: 50px; background-color: #ffffff; border: 2px solid rgba(119, 119, 119, 0.2); margin: 0 auto; position: relative; } .profile-box { padding: 55px 0 27px; position: relative; overflow: hidden; } .profile-box>label.form-label { color: #fff; position: absolute; top: 18px; width: 100%; text-align: center; margin: 0; } .profile-box:before { content: ""; width: 100%; height: 50%; background-color: #464646; position: absolute; top: 0; left: 0; } .banner-content { padding: 126px 0 128px; } .banner-content h2 { text-shadow: 0px 5px 4px rgba(0, 0, 0, 0.39); } .banner-content p { max-width: 585px; margin: 20px auto 35px; } button.slick-arrow { position: absolute; bottom: 19px; left: auto; transform: none; top: auto; z-index: 9; } .banner-slide { background-size: cover; background-position: center center; background-repeat: no-repeat; } /* .slick-slider:before { width: 132px; height: 60px; content: ''; position: absolute; bottom: 0; right: 0; background-color: #000; z-index: 9; } */ .slick-arrow.slick-next { right: 50px; } .slick-prev:before, .slick-next:before { color: #fff; font-family: "Font Awesome 5 Pro"; font-weight: 900; font-size: 17px; } .slick-arrow.slick-prev { left: auto; right: 75px; } .slick-prev:before { content: "\f104"; } .slick-next:before { content: "\f105"; } .slick-dots { bottom: 0; right: 132px; width: auto; background-color: #000; border-radius: 15px 0 0 0px; padding: 15px 0 15px 30px; } .slick-dots::before { width: 132px; height: 60px; content: ""; position: absolute; bottom: 0; right: -132px; background-color: #000; z-index: 2; } .slick-dots li button:before { width: 26px; height: 26px; border-radius: 13px; color: #fff; background-color: transparent; text-align: center; line-height: 26px; padding: 0; opacity: 1; } .slick-dots li button { width: 26px; height: 26px; padding: 0; margin: 0; display: block; } .slick-dots li { width: auto; height: auto; margin: 0 2px; } .slick-dots li button:hover::before, .slick-dots li.slick-active button:before { background-color: #22a612; opacity: 1; color: #fff !important; font-size: 10px; line-height: 28px; } figure.w-100p img { width: 100%; } .vision-box { padding: 50px 50px 60px 50px; margin-top: 108px; margin-left: -17px; } .content-box .title { padding-bottom: 10px; position: relative; margin-bottom: 15px; } .content-box .title:before { width: 37px; height: 5px; background-color: rgb(255, 255, 255, 10%); content: ""; position: absolute; bottom: 0; } .vision-img-col .figure { margin-right: -40px; width: calc(100% + 40px); } .about-tagline-section .content-box p { color: #dcdcdc; } .content-box p { font-size: 16px; color: #dcdcdc; font-weight: 400; } .vision-img-col img { max-height: 450px; } .brand-section { background-image: url("../images/brand-bg.png"); } ul.listing-icon { margin-bottom: 20px; } ul.listing-icon li { display: flex; align-items: flex-start; margin-bottom: 10px; } ul.listing-icon li i, ul.listing-icon li .icon { padding-right: 18px; line-height: 31px; } ul.listing-icon li p span { max-width: 465px; } .brand-content.content-box .title:before { background-color: rgb(255 255 255 / 20%); } .content-box.brand-content .card-body>span { opacity: 0.5; } .retailer-img-box { position: relative; margin-right: -30px; width: calc(100% + 30px); } .large-img.figure { width: 78.005%; } .large-img.figure img { width: 100%; } .small-img.figure { position: absolute; bottom: 40px; right: 0; width: 45.856%; box-shadow: 0px 21px 28.5px rgba(0, 0, 0, 0.15); } .small-img.figure img { width: 100%; } .retailer-section { position: relative; overflow: hidden; background-color: #000; } .retailer-section:before { content: ""; position: absolute; bottom: -125px; left: -65px; width: 405px; height: 367px; background-image: url(../images/retailer-shape1.png); background-repeat: no-repeat; background-size: cover; z-index: 0; } .retailer-section:after { content: ""; position: absolute; bottom: -45px; right: 0; width: 202px; height: 100%; background-image: url(../images/retailer-shape3.png); background-repeat: no-repeat; background-size: cover; z-index: 0; } .retailer-section .content-box p { color: #fff; } .vision-section { position: relative; overflow: hidden; background-color: #000; } .vision-section:before { content: ""; position: absolute; bottom: -4px; left: 0px; width: 170px; height: 100%; background-image: url(../images/vision-shape1.png); background-repeat: no-repeat; background-size: cover; z-index: 0; } .vision-section:after { content: ""; position: absolute; bottom: 40px; right: 0; width: 283px; height: 100%; background-image: url(../images/vision-shape2.png); background-repeat: no-repeat; background-size: cover; z-index: 0; } .vision-box { position: relative; background-color: #191919; } .vision-box:before { content: ""; position: absolute; top: -96px; left: 53px; width: 150px; height: 78px; background-image: url(../images/dots-shape.png); background-repeat: no-repeat; background-size: cover; z-index: -1; opacity: 0.2; } .vision-ing-box { position: relative; } .vision-ing-box:before { content: ""; position: absolute; bottom: -78px; left: 50%; transform: translateX(-50%); width: 220px; height: 78px; border-radius: 0 0 8px 8px; background-color: #f5f5f5; display: none; } .vision-box p { font-weight: 500; color: #dcdcdc; } ul.listing-true-false li { position: relative; padding-left: 28px; margin-bottom: 10px; } ul.listing-true-false li:before { content: ""; width: 20px; height: 20px; border-radius: 10px; position: absolute; left: 0; top: 0; } ul.listing-true-false li.true:before { background-color: #c7ebc2; } ul.listing-true-false li.false:before { background-color: #f0cec3; } ul.listing-true-false li.true:after { content: "\f00c"; font-family: "Font Awesome 5 Pro"; font-weight: 700; position: absolute; left: 6px; font-size: 10px; top: 3px; color: #36ae28; } ul.listing-true-false li.false:after { content: "\f00d"; font-family: "Font Awesome 5 Pro"; font-weight: 700; position: absolute; left: 6px; font-size: 12px; top: 1px; color: #f01818; } .form-icon { position: relative; } .form-icon .icon { position: absolute; top: 50%; transform: translateY(-50%); } .form-icon.form-icon-right .icon { right: 22px; } .form-icon.form-icon-right .form-control, .form-icon.form-icon-right .form-select { padding-right: 42px; } .form-label span { font-size: 14px; color: #737373; padding-left: 3px; } .profile-edit-btn.form-label span { color: #fff; } .table td p { margin: 0; } .cancel { font-size: 14px; color: #cc3432; font-weight: 600; } .received { font-size: 14px; color: #47a03a; font-weight: 600; } .placed { font-size: 14px; color: #d86825; font-weight: 600; } .table-chat-btn { border-width: 2px; line-height: 26px; /* margin: 0 auto; */ text-align: center; } .close-btn { display: flex; align-items: center; justify-content: center; border-width: 2px; text-align: center; line-height: 25px; font-size: 18px; } .tooltip-btn { margin-left: 10px; background: transparent; border: 0; color: #ccc; } .form-label-top { position: relative; } .form-label-top .form-label { position: absolute; top: -8px; left: 20px; background-color: #242424; padding: 0 5px; } /***Modal***/ .swal2-dark { border-radius: 8px !important; background-color: #242424 !important; border: 1px solid #4b4b4b !important; } .swal2-dark .swal2-title { color: #dcdcdc; } .modal-dark .modal-content { border-radius: 8px; background-color: #242424; border: 1px solid #4b4b4b; } .modal-content { max-width: 612px; padding: 15px 20px 30px 30px; } .modal-dialog { max-width: 612px; } .modal-dialog.modal-lg { max-width: 1024px; top: 100px; } .modal-header { padding: 0 0 15px 0; border-bottom: 1px solid #4b4b4b; } .modal-title { font-size: 18px; line-height: 22px; color: #ffffff; font-weight: 600; } .modal-header .btn-close { color: #fff; } .modal-body { padding: 10px 0; } .react-stars>span { stroke: #22a612; stroke-width: 0.1px; fill: transparent; margin: 5px 3px; width: 35px; text-align: center; } .form-rating .form-control { padding: 0 15px; } .modal-header .btn-close:before { font-family: "Font Awesome 5 Pro"; content: "\f00d"; font-weight: 300; color: #fff; font-size: 28px; position: absolute; top: 4px; right: 0; line-height: 15px; } .modal-header .btn-close { background-image: none; position: relative; padding: 0; width: 20px; height: 20px; margin: 0; } .custom-modal .modal-content { border-radius: 15px; padding: 0; } .custom-modal .modal-header { padding: 15px 20px; background-color: #373737; } .custom-modal .modal-body { padding: 0; } .list-dark .list-group-item { background-color: #2a2a2a; color: #dbdbdb; border-color: #3f3f3f; } .list-gray .list-group-item { background-color: #191919; color: #dbdbdb; border-color: #3f3f3f; } .list-black .list-group-item { background-color: #000; color: #dbdbdb; border-color: #3f3f3f; padding: 15px 50px; } .box-dark { border-radius: 10px; background-color: #282828; border: 1px solid rgba(233, 233, 233, 0.32); } .logo-box { width: 200px; border-right: 1px solid #4b4b4b; border-bottom: 1px solid #4b4b4b; } .seller-detail-wrap { width: calc(100% - 200px); border-bottom: 1px solid #4b4b4b; } ul.inline-listing { display: flex; justify-content: flex-start; align-items: center; } ul.inline-listing li { margin-right: 80px; } ul.inline-listing li:last-child { margin: 0; } ul.listing-33p li { width: 33.3333%; padding: 4px 0; border-right: 1px solid #4b4b4b; } ul.listing-33p { display: flex; justify-content: flex-start; flex-wrap: wrap; padding: 10px; } ul.listing-24p li { width: 24.3333%; padding: 4px 0; } ul.listing-24p { display: flex; justify-content: flex-start; flex-wrap: wrap; padding: 10px; } .seller-infor { border-bottom: 1px solid #4b4b4b; position: relative; padding: 20px 190px 20px 20px; } .seller-infor .btn { position: absolute; top: 50%; right: 37px; transform: translateY(-50%); } ul.listing-25p li { width: 25%; } ul.listing-50p li { width: 50%; } ul.listing-50p { display: flex; justify-content: flex-start; align-items: center; } ul.listing-25p { display: flex; justify-content: flex-start; align-items: center; padding: 10px; flex-wrap: wrap; } ul.listing-33p li:last-child { border-right: none; } ul.listing-33p.rating-listing li::after { display: none; } .star-count { width: 58px; height: 58px; border-radius: 28px; background-color: #191919; border: 1px solid #22a612; display: inline-block; text-align: center; line-height: 56px; margin: 0 8px; font-size: 16px; color: #22a612; font-weight: 500; } .rating-listing li { padding-left: 55px; position: relative; } .rating-listing li:after { content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 57px; background-color: #4b4b4b; } .rating-listing li:last-child::after { display: none; } ul.rating-listing { background-color: #191919; } ul.rating-listing { background-color: #191919; } ul.react-tabs__tab-list { display: flex; justify-content: center; align-items: center; } ul.react-tabs__tab-list .react-tabs__tab { margin: 0 5px -1px; font-size: 16px; line-height: 23px; color: rgb(255 255 255 / 50%); font-weight: 500; padding: 15px 30px; border-radius: 15px 15px 0 0; background-color: #000000; border: 1px solid #4b4b4b; cursor: pointer; min-width: 190px; text-align: center; } .react-tabs__tab-panel { border-radius: 15px; background-color: #191919; border: 1px solid #4b4b4b; padding: 20px 28px; } ul.react-tabs__tab-list .react-tabs__tab.react-tabs__tab--selected { background-color: #191919; border-bottom: transparent; color: #fff; } ul.react-tabs__tab-list .react-tabs__tab:hover, ul.react-tabs__tab-list .react-tabs__tab:focus { color: #fff; } li.comment-wrap { display: flex; justify-content: flex-start; align-items: flex-start; } .product-rating { margin: 0; position: absolute; right: 0; top: 0; } .comment-detail { position: relative; margin-left: 10px; border-bottom: 1px solid #4b4b4b; width: calc(100% - 70px); padding-left: 5px; } .comment-detail .svg-inline--fa { width: 14px !important; height: 14px !important; } .react-tabs__tab-panel { opacity: 0; visibility: hidden; transition: all ease 0.5s; display: none; } .react-tabs__tab-panel.react-tabs__tab-panel--selected { opacity: 1; visibility: visible; transition: all ease 0.7s; display: block; } .product-rating { font-size: 16px; line-height: 24px; color: #777777; font-weight: 600; margin: 0; } .product-rating svg { font-size: 14px; margin: 0 2px; } li.comment-wrap { margin-bottom: 20px; } li.comment-wrap:last-child { margin-bottom: 0; } li.comment-wrap:last-child .comment-detail { border-bottom: none; } .seller-detail-wrap .inline-listing a i { font-family: "gmx" !important; font-size: 20px; display: inline-block; vertical-align: middle; padding-right: 14px; } .btn-block { position: relative; } .btn-block:before { width: 64px; height: 5px; background-color: #f3772c; content: ""; position: absolute; left: 0; bottom: -2.5px; } .card-contact-form { margin-left: 0px; border-radius: 15px; background-color: #f9f9f9; border: 1px solid #e1e1e1; box-shadow: none; } .icon-round { width: 35px; height: 35px; border-radius: 18px; background-color: rgba(237, 231, 229, 0); border: 2px solid #f3772c; display: inline-block; text-align: center; margin-right: 15px; } .card-contact-detail .get_in_touch li .icon-round i { color: #dcdcdc; font-size: 14px; padding: 0; text-align: center; line-height: 33px; } .card-contact-detail { border-radius: 15px; box-shadow: 0 0 13.5px rgba(0, 0, 0, 0.19); background-color: #282828; border: 2px solid rgba(243, 119, 44, 0.46); margin-left: -110px; margin-right: px; } .card-contact-detail ul.get_in_touch li a { color: #dcdcdc; font-size: 16px; font-weight: 400; opacity: 1; } .card-contact-detail ul.get_in_touch li a:hover, .card-contact-detail ul.get_in_touch li a:focus { color: #f3772c; } .card-contact-detail .social_media_links { border-radius: 15px; background-color: #242424; padding: 32px; } .card-contact-detail .social_media_links li:first-child a { margin-left: 0; } .card-contact-detail .social_media_links li a { width: 40px; height: 40px; line-height: 40px; margin: 0 0 0 19px; } .card-contact-detail .social_media_links li a:hover { color: #fff; } .page-title-wrap { background-color: #fefefe; border-bottom: 1px solid rgb(0 0 0 / 10%); } .about-img-col { margin-left: 15px; } .about-img-col figure { max-width: 461px; } .about-img-col { position: relative; padding: 37px 0 56px; margin-right: 64px; } .about-img-col:before { width: 227px; height: 100%; background-color: #282828; content: ""; position: absolute; top: 0; right: 0; border-radius: 0 0 30px 0; } .about-content-box { padding-right: 20px; margin-left: -40px; } ul.listing-icon figure { min-width: 42px; margin-right: 15px; text-align: center; } .about-tagline-section { margin-top: 100px; } .bg-color-lightblue { background-color: #e9edee; } .about-tagline-box { margin-top: -100px; border-radius: 10px; max-width: 570px; float: right; } .about-tagline-box .figure img { border-top-left-radius: 10px; border-top-right-radius: 10px; } .tagline-wrap { border-radius: 0 0 10px 10px; background-color: #f3772c; padding: 0 30px 29px 30px; } .quote-icon { width: 74px; height: 74px; border-radius: 37px; background-color: #ffffff; display: block; text-align: center; line-height: 74px; color: #f3772c; font-size: 39px; margin: -37px auto 16px; z-index: 9; position: relative; } .tagline-wrap h3 { line-height: 24px; } ul.listing-icon li figure~p span { max-width: 550px; } .cms-pages .content-box h6 { color: #dcdcdc; } .cms-pages .content-box p { font-size: 14px; line-height: 22px; color: #dcdcdc; font-weight: 300; } .cms-pages .content-box a { color: #22a612 !important; } .cms-pages .content-box { margin-bottom: 30px; } .cms-pages .content-box ul { padding-left: 30px; } .cms-pages .content-box ul li { list-style: disc; } .upload_file.upload_file_btn { width: 187px; } .upload_file.upload_file_btn .btn { position: unset; padding: 0; width: 100%; border-radius: 30px; font-size: 15px; color: #aaaaaa; font-weight: 500; } .upload_file.upload_file_btn .btn i { padding-right: 10px; } .upload_file.upload_file_btn input[type="file"] { min-height: 44px; } .dark-canvas { background-color: #2e2e2e; } .offcanvas { padding-left: 20px; } .offcanvas-body { padding: 20px 30px 20px 0px; } .offcanvas-header { padding: 15px 30px 15px 0px; border-bottom: 1px solid rgb(255 255 255 / 10%); } .dark-canvas .offcanvas-title { color: #ffffff; } .offcanvas-title { font-size: 18px; line-height: 20px; font-weight: 500; } .offcanvas-header .btn-close { padding: 0; color: #fff; opacity: 0.5; background-image: none; position: relative; margin: 0; } .offcanvas-header .btn-close:before { content: "\f00d"; font-size: 16px; font-family: "Font Awesome 5 Pro"; } .offcanvas .search-form .form-control { line-height: 43px; background-color: #606060; } .offcanvas .search-form button { line-height: 45px; width: 45px; background-color: #22a612; } .offcanvas .search-form { margin-bottom: 20px; } .offcanvas-end { max-width: 466px; width: 100%; } .offcanvas-lg { max-width: 680px; } .offcanvas .form-control, .offcanvas .form-select { min-height: 43px; border-radius: 8px; font-size: 14px; } .offcanvas .form-label { font-size: 14px; margin-bottom: 7px; } li.product-detail-wrap { width: 100%; } ul.product-detail-listing { padding: 0; } ul.listing-33p.border-none li { border: none; } ul.product-detail-listing li { display: flex; align-items: flex-start; justify-content: flex-start; /* flex-wrap: wrap; */ } ul.product-detail-listing li span, ul.product-detail-listing li p { display: flex; justify-content: space-between; margin: 0; } ul.product-detail-listing-wrap li.product-quality-wrap { width: 300px; } ul.product-detail-listing-wrap>li { width: calc(100% - 300px); } ul.product-detail-listing-wrap { display: flex; align-items: flex-start; justify-content: flex-start; } li.product-detail-wrap { width: 100%; } ul.product-detail-listing { padding: 0; } ul.listing-33p.border-none li { border: none; } ul.product-detail-listing li { display: flex; align-items: flex-start; justify-content: flex-start; } ul.product-detail-listing li p { margin: 0; } ul.product-detail-listing-wrap li.product-quality-wrap { width: 300px; } ul.product-detail-listing-wrap>li { width: calc(100% - 300px); } ul.product-detail-listing-wrap { display: flex; align-items: flex-start; justify-content: flex-start; flex-wrap: wrap; } ul.product-detail-listing li span::after:not(.react-loading-skeleton) { content: ":"; padding: 0 10px; position: absolute; right: 0; } ul.product-detail-listing li span { min-width: 160px; position: relative; } .img-listing-5 li { width: calc(20% - 20px); margin: 10px; border: 1px solid #4b4b4b; max-height: 170px; } .img-listing-5 { display: flex; flex-wrap: wrap; justify-content: flex-start; align-items: stretch; margin: 0 -10px; } .img-listing-5 li figure { width: 100%; margin: 0; height: 100%; } .img-listing-5 li figure img { width: 100%; height: 100%; object-fit: cover; object-position: center; } .form-dark .form-select { background-image: url("../images/arrow-btn-white.png"); background-size: 10px 7px; } .product-price { display: flex; align-items: center; } .brown-box { border-radius: 10px; background-color: #261e18; border: 1px solid rgba(150, 98, 66, 0.41); } .brown-box { border-radius: 10px; background-color: #261e18; border: 1px solid rgba(150, 98, 66, 0.41); } ul.listing-with-title .title { position: relative; width: 105px; display: inline-block; } ul.listing-with-title .title:after { content: ":"; position: absolute; right: 0; padding-right: 10px; } .box-dark ul.listing-true-false li.true:before { background-color: rgb(34 166 18 / 20%); } .box-dark ul.listing-true-false li.false:before { background-color: rgb(240 24 24 / 20%); } .subscribed-plan { max-width: 243px; } .subscribed-plan.plan-active { border-color: #22a612; } .modal-medium .modal-dialog, .modal-medium .modal-dialog .modal-content { max-width: 711px; } /* table#list_table { min-width: 1024px; } */ /* table#list_table th, table#list_table td { padding: 5px 10px; } */ /* table#seller_detail { min-width: 1030px; } */ table#seller-favourite { /* min-width: 800px; */ /* min-width: 1024px; */ } table#seller-order { /* min-width: 820px; */ /* min-width: 1024px; */ } table#retailers { min-width: 550px; } table#seller-product { /* min-width: 750px; */ /* min-width: 1180px; */ } /* table#seller-my-order { min-width: 775px; min-width: 1180px; } table#seller-subscription { min-width: 675px; } */ .tabel-with-filetr .table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; } .table-top-filter { border: 1px solid #4b4b4b; border-bottom: none; border-radius: 15px 15px 0 0; } .table-top-filter .svg-inline--fa { width: 16px !important; height: 16px !important; } .comment-detail h5, .comment-detail p:not(.product-rating) { padding-right: 240px; } .comment-detail .react-stars>span { width: auto !important; } input[type="date"].form-control { background-image: url("../images/calender.png"); background-repeat: no-repeat; background-position: 97% 50%; } .form-dark input[type="date"].form-control { background-image: url("../images/calender-light.png"); } input[type="date"]::-webkit-inner-spin-button, input[type="date"]::-webkit-calendar-picker-indicator { display: none; -webkit-appearance: none; } .sidebar-nav-wrapper button.navbar-toggler { display: none; } .sidebar-nav-wrapper .navbar-collapse { display: block; } .sidebar-nav-wrapper button { width: 100%; background-color: #3e962f; border-radius: 7px; margin-bottom: 20px; position: relative; } .sidebar-nav-wrapper button:before { content: "Sidebar Menu"; text-align: left; color: #fff; font-size: 16px; position: absolute; left: 15px; top: 50%; transform: translateY(-50%); } .sidebar-nav-wrapper .navbar-toggler-icon { background-image: none; position: relative; width: 35px; height: 3px; background-color: #fff; opacity: 1; position: absolute; right: 15px; } .sidebar-nav-wrapper .navbar-toggler-icon:before { content: ""; width: 35px; height: 3px; position: absolute; top: -10px; background-color: #fff; left: 0; } .sidebar-nav-wrapper .navbar-toggler-icon:after { content: ""; width: 35px; height: 3px; position: absolute; bottom: -10px; background-color: #fff; left: 0; } .sidebar-nav-wrapper button.navbar-toggler { padding: 0; border: none; margin-right: 15px; height: 40px; align-items: center; } .sidebar-nav-wrapper .navbar-toggler:focus { box-shadow: none; } .grid-wrapper { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); grid-auto-rows: 200px; gap: 1rem; padding: 11px; border: 1px solid #3f3f3f; border-radius: 25px; } .grid-wrapper .gallery-image:nth-child(1), .grid-wrapper .gallery-image.gallery-video { grid-row: span 2; max-height: inherit; min-height: inherit; display: flex; align-items: center; justify-content: center; } .grid-wrapper .gallery-image:nth-child(1) img, .grid-wrapper .gallery-image.gallery-video video { max-height: 414px; min-height: 414px; } .grid-wrapper .gallery-image:nth-child(2), .grid-wrapper .gallery-image:nth-child(3) { grid-row: span 1; } .grid-wrapper .gallery-image:nth-child(4) { grid-row: span 1; } .grid-wrapper .gallery-image img { max-height: inherit; min-height: inherit; } /* .grid-wrapper .gallery-image:nth-child(4n+1), .grid-wrapper .gallery-image.gallery-video { grid-column-end: span 2; grid-row-end: span 3; } */ .grid-wrapper .gallery-image { position: relative; background-color: #202020; margin-bottom: 0; border: 0.5px solid #3f3f3f; } .gallery-image .btn-remove { position: absolute; content: ""; top: 6px; right: 6px; min-width: 36px; padding: 0 5px; border-radius: 50px; color: #fff; background-color: rgba(0, 0, 0, 0.6); border: none !important; font-size: 23px; z-index: 10; } /* ================== 02/09/2023 */ .table-container.hidden { display: none; } .toggle-button { border: 0; margin: 0; background: transparent; color: #fff; line-height: 1; display: flex; padding: 0; font-size: 30px; align-items: center; position: relative; width: 25px; height: 25px; padding-bottom: 18px; margin-left: 10px; } .toggle-button i { position: absolute; top: 0; } .brand-name-icon { width: 100%; display: flex; justify-content: center; max-width: 188px; } .brand-name-icon span { background: #686868; width: 80px; height: 80px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 25px; } .product-detail-listing .w-100 span { min-width: auto; } .product-detail-listing .w-100 .ml-2 { margin-left: 10px; } .category-list li { font-size: 14px; margin-bottom: 10px; margin-right: 10px; background: #22a612; color: #fff; padding: 2px 17px; border-radius: 20px; } /* ================== 02/09/2023 */
0
/content/gmx-projects/gmx-admin/frontend/public/assets
/content/gmx-projects/gmx-admin/frontend/public/assets/css/general.css
body{font-size:16px;font-family: 'Poppins', sans-serif; font-style: normal; color:#7e7e7e;background-color:#ffffff;} section{padding:50px 0;} .container{max-width:1260px;width:100%;margin:0 auto;} div.error{display:block;font-size:14px;font-weight:400;text-align:left;color:#f44336;} h1,h2,h3,h4,h5,h6{font-weight:bold;} img{max-width:100%;} ul,li{margin:0;padding:0;list-style:none;} a:focus, select:focus{outline:none;} a{color:#000;} a:hover{color:#22a612;} .cursor-pointer{cursor:pointer;} hr.dote-hr{border-top:2px dotted rgba(0,0,0,.4);} .react-reveal-height-wrap .react-reveal {height: 100%;} .table td, .table th {padding: .75rem;vertical-align: top;border-bottom: 1px solid #dee2e6;border-top: none} .data-not-found {padding: 15px 20px; text-align: center;} .dzu-dropzone {overflow-y: scroll !important;overflow-x: hidden !important;} .dzu-inputLabel {font-family: 'Poppins', sans-serif !important;} .mh-275 {min-height: 275px;} .mw-50 {min-width: 54px;} .mw-90 {min-width: 90px;} .mw-100 {min-width: 100px;} .mw-110 {min-width: 110px;} .mw-120 {min-width: 120px;} .mw-140 {min-width: 140px;} .mw-150 {min-width: 150px;} .mw-200 {min-width: 200px;} .mw-150 .css-zk88xw-singleValue {font-size: 15px;} .maxw-100 {max-width: 100px;} .maxw-150 {max-width: 150px;} .maxw-180 {max-width: 180px;} .maxw-200 {max-width: 200px;} .mw-375 {width: 375px;} .mw-480 {max-width: 480px;} .mw-600 {max-width: 600px;} .mw-720 {max-width: 720px;} .navbar-dark .navbar-toggler-icon {background-image: none; position: relative; width: 35px; height: 3px; background-color: #fff; opacity: 1;} .navbar-dark .navbar-toggler-icon:before { content: ''; width: 35px; height: 3px; position: absolute; top: -10px; background-color: #fff; left: 0;} .navbar-dark .navbar-toggler-icon:after { content: ''; width: 35px; height: 3px; position: absolute; bottom: -10px; background-color: #fff; left: 0;} button.navbar-toggler { padding: 0; border: none; margin-right: 15px;} .navbar-toggler:focus { box-shadow: none;} button.navbar-toggler:not(.collapsed) .navbar-toggler-icon { background-color: transparent;} button.navbar-toggler:not(.collapsed) .navbar-toggler-icon:before { transform: rotate(45deg); top: -6px;} button.navbar-toggler:not(.collapsed) .navbar-toggler-icon:after { transform: rotate(-45deg); bottom: 6px;} .btn-group.navbar-nav {flex-direction: initial;} .dropdown-item.active, .dropdown-item:active {background-color: #22a612 !important;} header .navbar .navbar-nav .btn { display: inline-block; width: auto; flex: initial; } .date_picker input {background: url(../images/calendar-light.svg) no-repeat top 18px right 18px / 18px;} input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; } /* Firefox */ input[type=number] { -moz-appearance: textfield; } .tooltip-580 > .tooltip-inner { max-width: 580px; } input[type="search"]:focus { color: #fff !important; } .fslightbox-fade-in-strong {animation: fslightbox-fade-in-strong .25s cubic-bezier(0,0,0.99,1) !important;} #nprogress .bar{ background-color: #22a612 !important; } .multimediaFiles { position: relative; display: inline-block; overflow: hidden; } .multimediaFiles .mediaFiles { position: absolute; opacity: 0; left: 0; top: 0; bottom: 0; cursor: pointer; z-index: -1; } .scroll-component { overflow-x: hidden !important; } .scroll-component::-webkit-scrollbar { width: 5px; } .scroll-component::-webkit-scrollbar-track { box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); } .scroll-component::-webkit-scrollbar-thumb { background-color: #f3772c; outline: 1px solid #f3772c; border-radius: 6px; } .mention-textarea__suggestions__list { overflow-x: hidden !important; } .mention-textarea__suggestions__list::-webkit-scrollbar { width: 5px; } .mention-textarea__suggestions__list::-webkit-scrollbar-track { box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3); } .mention-textarea__suggestions__list::-webkit-scrollbar-thumb { background-color: #f3772c; outline: 1px solid #f3772c; border-radius: 6px; } /* For google autocomplete address */ .pac-container { z-index: 100000; } ::ng-deep .pac-container { z-index: 100000; }
0
/content/gmx-projects/gmx-admin/frontend/public/assets
/content/gmx-projects/gmx-admin/frontend/public/assets/css/header.css
/*======================================================================= header ========================================================================*/ .nav_brand_logo { display: inline-block; color: #000 !important; font-size: 35px; line-height: 26px; text-decoration: none !important; } .navbar-brand { font-weight: 900; } .guest-header .navbar-brand .logo-img { width: 275px; } header { background-color: #0d0d0d; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); position: sticky; top: 0; z-index: 999; } .guest-header .navbar-toggler { position: absolute; left: 0; top: 10px; padding: 0; border: none; } @media screen and (min-width: 992px) { .guest-header .mob-user { display: none; } } @media screen and (max-width: 460px) { .guest-header .mob-user { display: flex; align-items: center; justify-content: space-between; width: 100%; } } header .navbar { padding: 4px 0; box-shadow: 10px 0 15px rgba(0, 0, 0, 15); } header .navbar .navbar-nav .nav-link { position: relative; margin: 0 15px; padding: 15px 0; font-size: 16px; font-weight: 500; color: #fff !important; transition: all 0.5s; } header .navbar .navbar-nav .nav-link:hover, header .navbar .navbar-nav .nav-link.active { color: #22a612 !important; } header .navbar .navbar-nav .nav-link:hover::before, header .navbar .navbar-nav .nav-link.active::before { width: 100%; } header .navbar .navbar-nav .btn { padding: 4px 20px; border-radius: 24px; background-color: #f3772c; border-left: 0.5px solid rgba(0, 0, 0, 0.2) !important; } header .navbar .navbar-nav .btn:first-child { border-left: none !important; } header .navbar .navbar-nav .btn:hover:first-child { border-left: none !important; border-right: 0.5px solid rgba(0, 0, 0, 0.2) !important; } header .navbar .navbar-nav .btn:hover { border-left: 0.5px solid rgba(0, 0, 0, 0.2) !important; } header .navbar .navbar-nav .nav-link:hover span, header .navbar .navbar-nav .nav-link.active span { content: ""; position: absolute; left: 0px; right: 0px; bottom: 0px; width: 5px; height: 5px; background-color: #22a612; transition: all 0.4s; text-align: center; border-radius: 50px; margin: auto; } header .navbar .navbar-nav .nav-link:hover span::before, header .navbar .navbar-nav .nav-link.active span::before { content: ""; position: absolute; left: -15px; bottom: 0px; width: 5px; height: 5px; background-color: #22a612; transition: all 0.4s; text-align: center; border-radius: 50px; } header .navbar .navbar-nav .nav-link:hover span::after, header .navbar .navbar-nav .nav-link.active span::after { content: ""; position: absolute; right: -15px; bottom: 0px; width: 5px; height: 5px; background-color: #22a612; transition: all 0.4s; text-align: center; border-radius: 50px; } header .navbar-brand { width: 150px; } .nav_profile { display: flex; align-items: center; } .nav_profile .figure { width: 52px; height: 52px; background-color: #ffffff; border: 2px solid #f3772c; transition: 0.5s ease-in-out; } .nav_profile .figure img { border: 2px solid #fff; border-radius: 100%; } .nav_profile:hover .figure { border-color: #22a612; } .cart-items { position: relative; margin-left: 20px; margin-right: 15px; } .cart-items span { display: inline-block; width: 22px; height: 22px; line-height: 22px; color: #fff; background-color: #f3772c; border-radius: 50px; text-align: center; font-size: 10px; position: absolute; top: -5px; right: -15px; } .nav_profile .dropdown-toggle { padding-left: 10px; padding-right: 30px; font-size: 16px; font-weight: 500; color: #fff !important; background: url(../images/select-arrow-white.svg) no-repeat center right / 16px; } .dropdown-toggle::after { display: none; } header .dropdown .dropdown-menu { margin-top: 0; min-width: 206px; max-height: inherit; border-radius: 8px; border-width: 2px; border-color: rgba(30, 38, 61, 0.1); overflow: visible; right: -20px; background: #242424; } header .dropdown .dropdown-menu::before { content: ""; display: block; position: absolute; left: 45%; top: -9px; width: 15px; height: 15px; border: thin solid rgba(30, 38, 61, 0.1); border-width: 0 0 2px 2px; background: #242424; transform: rotate(134deg); pointer-events: none; } header .dropdown .dropdown-menu.dropdown-menu-end::before { left: 80%; } header .dropdown .dropdown-item { color: #fff; } header .dropdown .dropdown-item:hover, header .dropdown .dropdown-item:focus { background-color: #22a612; } header .dropdown .switch-item .dropdown-toggle { padding: 0.25rem 1rem; background-position: right 10px center; } header .dropdown .switch-item .dropdown-menu .dropdown-item.add-com, header .dropdown .switch-item .dropdown-menu .dropdown-toggle { padding: 0.25rem 1rem 0.25rem 28x; } header .dropdown .switch-item .dropdown-menu .dropdown-item { padding: 0.25rem 1rem 0.25rem 63px; } .status-icon { width: 18px; height: 18px; display: inline-flex; background: #f8bf52; border-radius: 50%; vertical-align: middle; } header .dropdown .switch-item .dropdown-menu { position: relative; left: 0; margin: 0; padding: 0; border-radius: 0; border: 0; } header .dropdown .switch-item .dropdown-toggle span { width: 18px; text-align: center; display: inline-block; vertical-align: middle; } header .dropdown .dropdown-item .svg-inline--fa { width: 14px !important; height: 14px !important; } header .dropdown .dropdown-item span { display: inline-block; width: 18px; text-align: center; } .status-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; } header .dropdown .dropdown-item .msg-count, header .navbar .navbar-nav .msg-count { display: inline-block; width: 20px; height: 20px; margin-left: 10px; text-align: center; line-height: 20px; color: #22a612; background-color: #ffffff; border-radius: 50px; font-size: 12px; } @media screen and (max-width: 1180px) { header .navbar .navbar-nav .nav-link { margin: 0 10px; padding: 10px 0; font-size: 14px; } } @media screen and (max-width: 991px) { .guest-header .navbar-brand { margin-left: auto; margin-right: auto; padding-left: 30px; } .guest-header .navbar .navbar-nav .user-info, .guest-header .navbar .navbar-nav .login-link { display: none; } .guest-header .navbar .navbar-nav .nav-link { margin-left: 0; } .guest-header .navbar-collapse { position: absolute; top: 60px; left: 0; right: 0px; padding: 0 30px; background: #fff; z-index: 99; } .guest-header .navbar .navbar-nav .nav-link::before { content: none; display: none; } header .navbar .navbar-nav .nav-link span { display: none !important; } .navbar-collapse { position: fixed; top: 88px; bottom: 0; right: 0; left: -100%; width: 100%; height: 100%; background: #000; transition: 0.4s ease-in-out; z-index: 999; } .navbar-collapse.show { left: 0; transform: translateX(0px); } header .navbar.main-nav .navbar-nav .nav-link { padding: 0; } .btn-group.navbar-nav { margin: 15px 15px 0; } .nav_profile { margin-left: auto !important; } .nav_profile > .dropdown > .dropdown-toggle { padding-right: 15px; font-size: 0; height: 16px; } header .dropdown .dropdown-menu { right: 0; } } @media screen and (max-width: 575px) { .guest-header .navbar-brand .logo-img { width: 140px; } } /*============ user header ===============*/ .admin_header { position: fixed; top: 0; left: 0; right: 0; box-shadow: 0 0 5px rgba(0, 0, 0, 0.1); background-color: #ffffff; z-index: 999; } .admin_header .navbar { padding: 8px 14px; } .admin_header .navbar-brand .logo-img { width: 185px; } .admin_header .navbar-brand .logo-img-min { display: none; } @media screen and (max-width: 575px) { .admin_header .navbar-brand .logo-img { width: 102px; } } .hamburger { cursor: pointer; } .hamburger .ico_menuclose { bottom: 3px; font-size: 34px; color: #3ea3cf; } #SidebarMenu { transition: 0.5s ease-in-out; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/VideoJs.js
import React from 'react'; import videojs from 'video.js'; import 'video.js/dist/video-js.css'; export const VideoJS = (props) => { const videoRef = React.useRef(null); const playerRef = React.useRef(null); const {options, onReady} = props; React.useEffect(() => { // Make sure Video.js player is only initialized once if (!playerRef.current) { const videoElement = videoRef.current; if (!videoElement) return; const player = playerRef.current = videojs(videoElement, options, () => { // console.log(options['sources'][0]['type']); // videojs.log.level('error'); // videojs.log.error() onReady && onReady(player); }); // You could update an existing player in the `else` block here // on prop change, for example: } else { // const player = playerRef.current; // player.autoplay(options.autoplay); // player.src(options.sources); } }, [options, videoRef]); // Dispose the Video.js player when the functional component unmounts React.useEffect(() => { const player = playerRef.current; return () => { if (player) { player.dispose(); playerRef.current = null; } }; }, [playerRef]); return ( <div data-vjs-player> <video ref={videoRef} className='video-js vjs-big-play-centered' /> </div> ); } export default VideoJS;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/Activity.js
import React, { useRef, useState } from 'react'; import { Col, Figure, Row, Overlay, OverlayTrigger, Tooltip, Popover, } from 'react-bootstrap'; import ReactPlayer from 'react-player'; import { APP_URL, ASSETS_URL } from '../config/server.config'; import { getSingle, isLoggedIn } from '../services/Auth'; import { dateTimeFormat } from '../services/Helper'; import Notifier from './Notifier'; import { handleDeletePost, handleOnLike, handleOnRepost, } from '../app/slices/activitiesSlice'; import { useDispatch } from 'react-redux'; import Link from 'next/link'; import { FacebookShareButton, LinkedinShareButton, TwitterShareButton, } from 'react-share'; import { roles } from '../services/Role'; import { CustomLadda } from './CustomLadda'; const Activity = (props) => { const [show, setShow] = useState(false); const [target, setTarget] = useState(null); const ref = useRef(null); const handleClick = (event) => { setShow(!show); setTarget(event.target); }; const dispatch = useDispatch(); const noti = new Notifier(); const { activity, handleShow, handleShowCommentModal, likesClickHandler, repostsClickhandler, } = props; const mainPost = activity.type == '2' ? activity.parentPost : activity; // Profile data const userRoleWiseId = getSingle('role') === '2' ? getSingle('currentBrandId') : getSingle('retailerCompanyId'); const role = mainPost?.role; const userName = role === '2' ? mainPost?.brand?.brandName : mainPost?.retailer?.companyName; const profilePath = role === '2' ? `${ASSETS_URL}${mainPost?.brand?.profilePath}` : `${ASSETS_URL}${mainPost?.retailer?.profilePath}`; const slug = role === '2' ? `/brand/${mainPost?.brand?.slug}` : `/customer/${mainPost?.retailer?.slug}`; // Repost Activity const repostUserName = activity.role === '2' ? activity?.brand?.brandName : activity?.retailer?.companyName; const isReposted = mainPost.isReposted; const isLiked = mainPost.isLiked; const handleRepostClick = async ({ postId, post }) => { let formData = { type: 2, repostId: postId, post: post, }; await dispatch(handleOnRepost(formData)); }; const handleLikeClick = async (pId) => { await dispatch(handleOnLike({ pId })); }; return ( <Row className='mx-0'> <Col sm='auto'> <Figure className='figure figure-circle figure-gray-2 figure-62'> <img className='cover' src={profilePath ?? '/profile/no-profile-image.jpg'} alt='profile' /> </Figure> </Col> <Col> {activity.type == '2' && ( <div> <h3 className='text-white fs-16 fw-normal'> {' '} <i className='icon icon-reposts'></i>{' '} {userRoleWiseId == activity?.userId ? 'You' : `${repostUserName} Reposted`} </h3> </div> )} <div className='d-flex flex-wrap justify-content-between'> <Link href={slug}> <a> <h3 className='text-white fs-18'> {userName}{' '} <span className='color-a5a5a5 fs-14 fw-normal ms-2'> {dateTimeFormat(mainPost.createdAt, 'DD MMM YYYY')} </span> </h3> </a> </Link> {parseInt(userRoleWiseId) === activity?.userId && activity?.type == 1 && ( <> <CustomLadda className='action-btn color-f32c2c' onClick={() => dispatch(handleDeletePost(mainPost.id))} > <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={<Tooltip>Delete Post</Tooltip>} > <i className='fas fa-trash-alt'></i> </OverlayTrigger> </CustomLadda> </> )} </div> <Link href={'/post/' + activity.postUniqueId}> <a> <p className='color-bfbfbf'>{mainPost.post}</p> </a> </Link> <Row> {mainPost.attachments?.length > 0 && mainPost.attachments.map((attachmentFile, aIndex) => ( <Col lg={3} md={4} sm={6} key={'attachment' + aIndex}> {aIndex <= 3 ? ( attachmentFile.attachmentType == 2 ? ( <div className='gallery-image cursor-pointer' onClick={() => handleShow(true, aIndex, activity.id)} > <ReactPlayer className='react-player' width='100%' height='100%' url={ASSETS_URL + attachmentFile.attachment} playing={false} controls={true} //volume={5} muted={true} /> {mainPost.attachments.length > 4 && aIndex == 3 ? ( <span className='more-images'> {mainPost.attachments.length - 4 == 0 ? null : `+${mainPost.attachments.length - 4}`} </span> ) : null} </div> ) : ( <div className='gallery-image cursor-pointer' onClick={() => handleShow(true, aIndex, activity.id)} > <img className='cover' src={ASSETS_URL + attachmentFile.attachment} alt='postedImage' /> {mainPost.attachments.length > 4 && aIndex == 3 ? ( <span className='more-images'> {mainPost.attachments.length - 4 == 0 ? null : `+${mainPost.attachments.length - 4}`} </span> ) : null} </div> ) ) : null} </Col> ))} </Row> <div className='d-sm-flex justify-content-between align-items-center'> <ul className='comment-icons nav mb-3'> <li> <OverlayTrigger placement='top' overlay={<Tooltip> {!isLiked ? 'Like' : 'UnLike'}</Tooltip>} > {isLoggedIn() ? ( <a onClick={(e) => handleLikeClick(mainPost.id)}> {!isLiked ? ( <span> <i className='far fa-triangle'></i> </span> ) : ( <span className='color-22a612'> <i className='fas fa-triangle'></i> </span> )} </a> ) : ( <Link href={`/sign-in`}> <a> <span> <i className='far fa-triangle'></i> </span> </a> </Link> )} </OverlayTrigger> </li> <li> <OverlayTrigger placement='top' overlay={<Tooltip>Comment</Tooltip>} > {isLoggedIn() ? ( <a onClick={() => handleShowCommentModal(mainPost.id, 'comment') } > <i className='icon icon-chat-bubble'></i> </a> ) : ( <Link href={`/sign-in`}> <a> <i className='icon icon-chat-bubble'></i> </a> </Link> )} </OverlayTrigger> </li> <li> <OverlayTrigger placement='top' overlay={ <Tooltip>{!isReposted ? 'Repost' : 'Undo Repost'}</Tooltip> } > {isLoggedIn() ? ( <a onClick={() => handleRepostClick({ postId: mainPost.id, post: mainPost.post, }) } > {!isReposted ? ( <span> <i className='icon icon-reposts'></i> </span> ) : ( <span className='color-22a612'> <i className='icon icon-reposts'></i> </span> )} </a> ) : ( <Link href={`/sign-in`}> <a> <span> <i className='icon icon-reposts'></i> </span> </a> </Link> )} </OverlayTrigger> </li> <li> {/* <OverlayTrigger trigger="click" placement="top" overlay={ <Popover id="popover-basic"> <Popover.Body> <ul className="comment-icons nav"> <li><a><FacebookShareButton url={APP_URL + "post/" + activity.postUniqueId}><i className="fab fa-facebook-f"></i></FacebookShareButton></a></li> <li><a><TwitterShareButton url={APP_URL + "post/" + activity.postUniqueId}><i className="fab fa-twitter"></i></TwitterShareButton></a></li> <li><a><LinkedinShareButton url={APP_URL + "post/" + activity.postUniqueId}><i className="fab fa-linkedin-in"></i></LinkedinShareButton></a></li> </ul> </Popover.Body> </Popover> }> */} <div ref={ref}> <Overlay show={show} target={target} placement='bottom' container={ref} > <Popover id='popover-contained'> <Popover.Body className='py-2'> <ul className='comment-icons nav'> <li> <a> <FacebookShareButton url={APP_URL + 'post/' + activity.postUniqueId} > <i className='fab fa-facebook-f'></i> </FacebookShareButton> </a> </li> <li> <a> <TwitterShareButton url={APP_URL + 'post/' + activity.postUniqueId} > <i className='fab fa-twitter'></i> </TwitterShareButton> </a> </li> <li> <a> <LinkedinShareButton url={APP_URL + 'post/' + activity.postUniqueId} > <i className='fab fa-linkedin-in'></i> </LinkedinShareButton> </a> </li> </ul> </Popover.Body> </Popover> </Overlay> <OverlayTrigger overlay={<Tooltip>Share</Tooltip>}> <a onClick={handleClick}> <i className='icon icon-share-file'></i> </a> </OverlayTrigger> </div> </li> </ul> <ul className='likes-comments nav'> <li> <span className='text-white'>{mainPost.likeCount}</span>{' '} {mainPost.likeCount > 0 ? ( isLoggedIn() ? ( <a className='color-a5a5a5' onClick={(e) => { likesClickHandler(e, mainPost.postUniqueId); }} > Likes </a> ) : ( <Link href={`/sign-in`}> <a className='color-a5a5a5'>Likes</a> </Link> ) ) : ( 'Likes' )} </li> <li> {mainPost.commentCount > 0 ? ( <div> <span className='text-white'>{mainPost.commentCount}</span> <Link href={`/post/${activity.postUniqueId}`}> <a className='color-a5a5a5'> Comments</a> </Link> </div> ) : ( <div> <span className='color-a5a5a5'>{mainPost.commentCount}</span>{' '} Comments </div> )} </li> <li> <span className='text-white'>{mainPost.repostCount}</span>{' '} {mainPost.repostCount > 0 ? ( isLoggedIn() ? ( <a className='color-a5a5a5' onClick={(e) => { repostsClickhandler(e, mainPost.postUniqueId); }} > Reposts </a> ) : ( <Link href={`/sign-in`}> <a className='color-a5a5a5'>Reposts</a> </Link> ) ) : ( 'Reposts' )} </li> </ul> </div> </Col> </Row> ); }; export default Activity;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/LightboxModal.js
import React, { useEffect, useRef, useState } from 'react' import ReactPlayer from 'react-player' import { ASSETS_URL } from "../config/server.config"; import { Carousel, Modal } from "react-bootstrap"; export default function LightboxModal(props) { const [playing, setPlaying] = useState(true) // console.log('props--->', props.images); // const [imgHeight, setImgHeight] = useState(0) // const [imgWidth, setImgWidth] = useState(0) // const imageRef = useRef() // const handleZoomOut = () => { // setImgHeight(10) // setImgWidth(10) // const height = imageRef.current.clientHeight // const width = imageRef.current.clientWidth // } // const handleZoomIn = () => { // console.log('handleZoomIn'); // } const handleSelect = () => { setPlaying(false) } return ( <div> <Modal show={props.show} fullscreen={true} onHide={props.handleClose}> <Modal.Header closeButton> <Modal.Title></Modal.Title> </Modal.Header> <Modal.Body> <Carousel onSelect={() => handleSelect()} slide={false} defaultActiveIndex={props.sliderIndex} indicators={false}> {props.images.map((videoObj, index) => ( videoObj.attachmentType == 2 ? ( <Carousel.Item key={index}> <div className='slider_video'> <ReactPlayer url={ASSETS_URL + videoObj.attachment} pip={true} controls={true} playing={playing} /> </div> </Carousel.Item> ) : ( <Carousel.Item key={index}> <div className='slider_img'> <img src={ASSETS_URL + videoObj.attachment} className="mx-auto mw-375"/> </div> {/* <span onClick={handleZoomIn}><i className="far fa-search-plus"></i></span> <span onClick={handleZoomOut}><i className="far fa-search-minus"></i></span> */} </Carousel.Item> ) ))} </Carousel> </Modal.Body> </Modal> </div > ) }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/ActivitySkeleton.js
import React from 'react' import { Col, Row } from 'react-bootstrap'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; const baseColor = "#202020"; const highlightColor = "#444" const ActivitySkeleton = () => { return ( <Row> <Col sm="auto" > <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor}> <div className="d-flex align-items-center"> <Skeleton circle={true} height={62} width={62} className="mb-0 me-3" /> </div> </SkeletonTheme> </Col> <Col> <div> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor}> <h3 className="text-white fs-18"><Skeleton width={200} /></h3> <p className="color-bfbfbf"><Skeleton count={3} /></p> </SkeletonTheme> </div> </Col> </Row > ) } export default ActivitySkeleton
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/ProductRow.js
import { faEdit } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Link from 'next/link'; import { useState, useContext, useEffect } from 'react'; import { Helper } from '../services/Helper'; import Select from 'react-select'; import { DropdownIndicator, react_select_lg_Styles } from './DropDown'; import { CategoriesContext } from '../pages/product/list'; import FormValidator from './FormValidator'; import { Button, Form, OverlayTrigger, Spinner, Tooltip, } from 'react-bootstrap'; import Rest from '../config/rest.config'; import Notifier from './Notifier'; import API from '../config/endpoints.config'; import { Tr, Td } from 'react-super-responsive-table'; import 'react-super-responsive-table/dist/SuperResponsiveTableStyle.css'; const noti = new Notifier(); function ProductRow({ product: initialProduct, handleStatusChange, handleCategoryFilter, isLastRow, }) { //Edit Row const menuPlacement = isLastRow ? 'top' : 'auto'; const { categories } = useContext(CategoriesContext); const [subCategories, setSubCategories] = useState([]); const [showLoading, setShowLoading] = useState(false); const [isEditable, setIsEditable] = useState(false); const [product, setProduct] = useState(initialProduct); const [editableProduct, setEditableProduct] = useState({ title: product?.title ?? '', categoryId: product?.categoryId ?? '', subCategoryId: product?.subCategoryId ?? '', unitWeight: product?.unitWeight ?? '', unitPerPackage: product?.unitPerPackage ?? '', price: product?.price ?? '', packagesInStock: product?.packagesInStock ?? '', isShowStock: product?.isShowStock ?? '', }); const editProduct = (pId) => { setIsEditable(true); }; const tooltip = <Tooltip>Show 'Unit Stock' on Marketplace</Tooltip>; useEffect(() => { if (product?.categoryId) { handleSelectChangeSubCategory( { value: product?.categoryId }, { name: 'categoryId' } ); } }, []); const cancleEdit = () => { setIsEditable(false); setEditableProduct({ title: product?.title ?? '', categoryId: product?.categoryId ?? '', subCategoryId: product?.subCategoryId ?? '', unitWeight: product?.unitWeight ?? '', unitPerPackage: product?.unitPerPackage ?? '', price: product?.price ?? '', packagesInStock: product?.packagesInStock ?? '', isShowStock: product?.isShowStock ?? '', }); setShowLoading(false); }; const validator = new FormValidator([ { field: 'title', method: 'isEmpty', validWhen: false, message: 'Please enter title.', }, { field: 'categoryId', method: 'isEmpty', validWhen: false, message: 'Please select category.', }, { field: 'unitWeight', method: 'isEmpty', validWhen: false, message: 'Please enter unit weight.', }, { field: 'unitPerPackage', method: 'isEmpty', validWhen: false, message: 'Please enter unit per package.', }, { field: 'price', method: 'isEmpty', validWhen: false, message: 'Please enter price per package.', }, ]); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const handleChange = (event) => { const { name, value } = event.target; setEditableProduct((prevState) => ({ ...prevState, [name]: value })); }; const handleShowStock = (isShowStock) => { setEditableProduct((prevState) => ({ ...prevState, isShowStock: isShowStock, })); }; const handleShowStockChange = async (slug, isShowStock) => { setProduct((prevState) => ({ ...prevState, isShowStock: isShowStock, })); await Rest.axiosRequest(API.changeProductStock + '/' + slug, {}); }; const handleSelectChange = (val, e) => { if (isEditable) { if (val) { setEditableProduct((prevState) => ({ ...prevState, [e.name]: val.value, })); } else { setEditableProduct((prevState) => ({ ...prevState, [e.name]: '' })); } } }; const handleSelectChangeSubCategory = async (val, e) => { if (val) { setEditableProduct((prevState) => ({ ...prevState, [e.name]: val.value, })); setEditableProduct((prevState) => ({ ...prevState, subCategoryId: '', })); const subCategoriesData = await Rest.axiosRequest( `${API.getSubCategories}/${val.value}`, {}, 'GET' ); if (subCategoriesData.status === 200) { const subCategories = []; subCategoriesData.data.data.map((subCategory) => { subCategories.push({ id: subCategory.id, value: subCategory.id, name: subCategory.title, label: subCategory.title, }); }); setSubCategories(subCategories); } } }; const saveProduct = async (e) => { e.preventDefault(); const validation = validator.validate(editableProduct); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); let response = await Rest.axiosRequest( API.quickEditProduct + '/' + product.slug, editableProduct, 'PUT' ); if (response.status === 200) { noti.notify(response.data.message, 'success'); setProduct(response.data.data); setIsEditable(false); } else { noti.notify(response.data.message, 'danger'); } setSubmitted(false); setShowLoading(false); } }; let checkValidation = submitted ? validator.validate(editableProduct) : validation; return isEditable === false ? ( <Tr> <Td> <Link href={`/product/edit/${product.slug}`}> <a className='text-white'> <b>{Helper.niceString(product.title, 20, true)}</b> <br /> {product?.subcategory?.title} </a> </Link> </Td> <Td>{product?.brand?.brandName}</Td> <Td> <a className='color-0e9bfd text-decoration-underline' onClick={() => handleCategoryFilter(product.category.id)} > {product.category?.title} </a> </Td> <Td> <Link href={`/product/edit/${product.slug}`}> <a className='text-white'>{product.unitWeight}</a> </Link> </Td> <Td> <Link href={`/product/edit/${product.slug}`}> <a className='text-white'>{product.unitPerPackage}</a> </Link> </Td> <Td> <Link href={`/product/edit/${product.slug}`}> <a className='text-white'>{product.productPrice}</a> </Link> </Td> <Td> <Link href={`/product/edit/${product.slug}`}> <a className='text-white'> {product.packagesInStock ? product.packagesInStock : '-'} </a> </Link> </Td> <Td> <div className='text-center d-flex justify-content-center'> <Form.Check // prettier-ignore type='switch' name='isShowStock' id='custom-switch' checked={product.isShowStock} onClick={() => handleShowStockChange(product.slug, !product.isShowStock) } /> <OverlayTrigger overlay={tooltip} placement='top'> <button className='tooltip-btn'> <i class='fa fa-info-circle'></i> </button> </OverlayTrigger> </div> </Td> <Td> <span className='action-btn color-22a612' onClick={() => editProduct(product.id)} > <i className='fa fa-pencil' aria-hidden='true'></i> </span> <Link href={`/product/edit/${product.slug}`}> <a className='action-btn color-22a612'> <FontAwesomeIcon icon={faEdit} /> </a> </Link> <a className='action-btn color-f32c2c' onClick={() => handleStatusChange(product.slug)} > {+product.isActive === 1 ? ( <i className='fa fa-ban' id={'action-' + product.slug}></i> ) : ( <i className='fa fa-check' id={'action-' + product.slug}></i> )} </a> </Td> </Tr> ) : ( <Tr> <Td> <input type='text' name='title' className='form-control mw-110' value={editableProduct.title} onChange={handleChange} /> <div className={checkValidation.title.isInvalid ? 'animated fadeIn' : ''} > <div className='error'>{checkValidation.title.message}</div> </div> <br /> <Select classNamePrefix='react-select' className='react-select-lg mw-150' styles={react_select_lg_Styles} value={subCategories.filter( (item) => item.id == editableProduct.subCategoryId )} options={subCategories.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChange(val, e)} placeholder='Sub Category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='subCategoryId' isClearable={false} menuPlacement={menuPlacement} /> </Td> <Td> <Select classNamePrefix='react-select' className='react-select-lg mw-150' styles={react_select_lg_Styles} value={categories.filter( (item) => item.id == editableProduct.categoryId )} options={categories.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChangeSubCategory(val, e)} placeholder='Category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='categoryId' isClearable={false} menuPlacement={menuPlacement} /> <div className={ checkValidation.categoryId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'>{checkValidation.categoryId.message}</div> </div> </Td> <Td> <input type='text' name='unitWeight' className='form-control mw-100' value={editableProduct.unitWeight} onChange={handleChange} /> <div className={ checkValidation.unitWeight.isInvalid ? 'animated fadeIn' : '' } > <div className='error'>{checkValidation.unitWeight.message}</div> </div> </Td> <Td> <input type='text' name='unitPerPackage' className='form-control mw-100' value={editableProduct.unitPerPackage} onChange={handleChange} /> <div className={ checkValidation.unitPerPackage.isInvalid ? 'animated fadeIn' : '' } > <div className='error'>{checkValidation.unitPerPackage.message}</div> </div> </Td> <Td> <input type='text' name='price' className='form-control mw-100' value={editableProduct.price} onChange={handleChange} /> <div className={checkValidation.price.isInvalid ? 'animated fadeIn' : ''} > <div className='error'>{checkValidation.price.message}</div> </div> </Td> <Td> <input type='text' name='packagesInStock' className='form-control mw-100' value={editableProduct.packagesInStock} onChange={handleChange} /> </Td> <Td> <div className='text-center'> <Form.Check // prettier-ignore type='switch' name='isShowStock' id='custom-switch' checked={editableProduct.isShowStock} onChange={() => handleShowStock(!editableProduct.isShowStock)} /> </div> </Td> <Td className='mw-150'> {showLoading ? ( <Spinner animation='border' /> ) : ( <> <span className='action-btn color-22a612' onClick={saveProduct}> <i className='fa fa-save' aria-hidden='true'></i> </span> <span className='action-btn color-22a612' onClick={cancleEdit}> <i className='fa fa-times' aria-hidden='true'></i> </span> </> )} </Td> </Tr> ); } export default ProductRow;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/AppHeader.js
import { faAddressCard, faBuilding, faCommentDots, faFileLines, faGear, faHeart, faHouse, faMapLocation, faPlus, faSignOutAlt, faUser, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; import { Container, Figure, Image, Nav, NavDropdown, Navbar, OverlayTrigger, Tooltip, } from 'react-bootstrap'; import cookie from 'react-cookies'; import { useDispatch, useSelector } from 'react-redux'; import { fetchCompanies, switchAccount } from '../app/slices/companySlice'; import { ASSETS_URL } from '../config/server.config'; import { getSingle, isLoggedIn, logout, updateSingle } from '../services/Auth'; import MyCart from './MyCart'; import Notifier from './Notifier'; import AddBrand from './modal/company/AddBrand'; import AddCompany from './modal/company/AddCompany'; function AppHeader(props) { const totalCartItems = useSelector((state) => state.cart ? state.cart.totalItems : 0 ); const router = useRouter(); const [isNavOpen, setIsNaveOpen] = useState(false); const [loggedInUser, setLoggedInUser] = useState(false); const [unreadCount, setUnreadCount] = useState(0); // useEffect(async () => { // if (isLoggedIn()) { // const { data } = await Rest.axiosRequest(API.getUnreadCount, {}, 'GET'); // if (data?.status) { // setUnreadCount(data.data); // } else { // noti.notify(data.message, 'danger'); // } // } // }, [isLoggedIn()]); const openNav = () => { setIsNaveOpen(true); }; const closeNav = () => { setIsNaveOpen(false); }; const handleLogOut = () => { logout(); // signOut(); router.replace('/sign-in'); }; const [hideShowCart, setHideShowCart] = useState(false); const hideShowCartModal = async () => { setHideShowCart((prevState) => !prevState); }; useEffect(() => { setLoggedInUser(isLoggedIn()); }, [cookie.load('gmx')]); return ( <> <header> <Navbar collapseOnSelect expand='lg' variant='dark' expanded={isNavOpen} > <Container> <Navbar.Toggle aria-controls='responsive-navbar-nav' id='toggleBtn' onClick={isNavOpen ? closeNav : openNav} /> <Link href='/' passHref> <Navbar.Brand> <img alt='logo' src='/assets/images/main-logo.png' /> </Navbar.Brand> </Link> {loggedInUser ? ( <div className='nav_profile d-lg-none d-flex'> <Figure className='figure-circle mb-0'> <Image alt='profile' src={ASSETS_URL + getSingle('userImage')} className='cover' /> </Figure> <NavDropdown title={getSingle('userName')} align='end' id='basic-nav-dropdown' > {getSingle('role') === '2' ? ( <BrandProfileMenu /> ) : ( <> <Link href='/account' passHref> <NavDropdown.Item active={router.pathname === '/account'} eventKey='/account' onClick={closeNav} > <span className='me-2'> <FontAwesomeIcon icon={faUser} /> </span> Account </NavDropdown.Item> </Link> <Link href='/stores' passHref> <NavDropdown.Item active={router.pathname === '/stores'} eventKey='/stores' onClick={closeNav} > <span className='me-2'> <FontAwesomeIcon icon={faMapLocation} /> </span> Stores </NavDropdown.Item> </Link> <Link href='/favourites' passHref> <NavDropdown.Item active={router.pathname === '/favourites'} eventKey='/favourites' onClick={closeNav} > <span className='me-2'> <FontAwesomeIcon icon={faHeart} /> </span> Favourite </NavDropdown.Item> </Link> {/* <Link href='/' passHref> <NavDropdown.Item active={router.pathname === '/'} eventKey='/' onClick={closeNav} > <span className='me-2'> <i className='icon icon-order'></i> </span> Home </NavDropdown.Item> </Link> <Link href='/about-us' passHref> <NavDropdown.Item active={router.pathname === '/about-us'} eventKey='/about-us' onClick={closeNav} > <span className='me-2'> <FontAwesomeIcon icon={faFileLines} /> </span> About Us </NavDropdown.Item> </Link> <Link href='/contact-us' passHref> <NavDropdown.Item active={router.pathname === '/contact-us'} eventKey='/contact-us' onClick={closeNav} > <span className='me-2'> <FontAwesomeIcon icon={faCommentDots} /> </span> Contact Us </NavDropdown.Item> </Link> */} <Link href={`/customer/${getSingle('slug')}`} passHref> <NavDropdown.Item active={router.pathname === '/customer'} eventKey='/profile' > <span className='me-2'> <FontAwesomeIcon icon={faUser} /> </span> View Profile </NavDropdown.Item> </Link> {/* <Link href="/#email-notification" passHref> <NavDropdown.Item active={router.pathname === '/#email-notification'} eventKey="/#email-notification" onClick={closeNav}> <span className='me-2'><FontAwesomeIcon icon={faBell} /></span>Email Notifications </NavDropdown.Item> </Link> */} </> )} {/* <Link href="/social" passHref> <NavDropdown.Item active={router.pathname === '/social'} eventKey="/social" onClick={closeNav}><span className='me-2'><FontAwesomeIcon icon={faUser} /></span>Social</NavDropdown.Item> </Link> */} <NavDropdown.Item onClick={handleLogOut}> <span className='me-2'> <FontAwesomeIcon icon={faSignOutAlt} /> </span> Logout </NavDropdown.Item> </NavDropdown> {loggedInUser && getSingle('role') === '3' ? ( <a className='cart-items btn btn-outline-primary btn-circle btn-wh-42' onClick={hideShowCartModal} > <i className='far fa-shopping-cart'></i> <span>{totalCartItems > 99 ? '99+' : totalCartItems}</span> </a> ) : null} </div> ) : null} <Navbar.Collapse id='responsive-navbar-nav'> {!loggedInUser ? ( <> <Nav className='mx-auto'> <Link href='/' passHref> <Nav.Link eventKey='/' onClick={closeNav} active={router.pathname === '/'} > Home <span></span>{' '} </Nav.Link> </Link> <Link href='/about-us' passHref> <Nav.Link active={router.pathname === '/about-us'} onClick={closeNav} > About Us <span></span> </Nav.Link> </Link> <Link href={'/marketplace'} passHref> <Nav.Link active={ router.pathname === '/marketplace' || router.pathname === '/product/[slug]' } onClick={closeNav} > Marketplace <span></span> </Nav.Link> </Link> <Link href='/brands' passHref> <Nav.Link onClick={closeNav} active={ router.pathname === '/brands' || router.pathname === '/brand/[slug]' } > Brands<span></span> </Nav.Link> </Link> <Link href='/retailers' passHref> <Nav.Link onClick={closeNav} active={ router.pathname === '/retailers' || router.pathname === '/customer/[slug]' } > Retailers<span></span> </Nav.Link> </Link> <Link href='/contact-us' passHref> <Nav.Link onClick={closeNav} active={router.pathname === '/contact-us'} > Contact Us <span></span> </Nav.Link> </Link> </Nav> <Nav className='btn-group'> <Link href='/sign-in'> <a className='btn btn-secondary' onClick={closeNav}> Sign In </a> </Link> <Link href='/sign-up'> <a className='btn btn-secondary' onClick={closeNav}> Sign Up </a> </Link> </Nav> </> ) : ( <> <Nav className='mx-auto'> <Link href='/messages' passHref> <Nav.Link eventKey='/messages' onClick={closeNav} active={router.pathname === '/messages/[[...slug]]'} > Messages {unreadCount ? ( <b className='msg-count'>{unreadCount}</b> ) : null} <span></span> </Nav.Link> </Link> {getSingle('role') === '2' ? ( <> {/* <NavDropdown title='Orders' align='end' id='order-nav-dropdown' active={ router.pathname === '/orders' || router.pathname === '/set-minimum-order-amount' || router.pathname === '/drivers' } > <Link href='/orders' passHref> <NavDropdown.Item active={router.pathname === '/orders'} eventKey='/orders' onClick={closeNav} > <span className='me-2'> <i className='icon icon-order'></i> </span> Orders </NavDropdown.Item> </Link> <Link href='/drivers' passHref> <NavDropdown.Item active={router.pathname === '/drivers'} eventKey='/drivers' onClick={closeNav} > <span className='me-2'> <i className='icon icon-order'></i> </span> Drivers </NavDropdown.Item> </Link> <Link href='/set-minimum-order-amount' passHref> <NavDropdown.Item active={ router.pathname === '/set-minimum-order-amount' } eventKey='/set-minimum-order-amount' onClick={closeNav} > <span className='me-2'> <FontAwesomeIcon icon={faGear} /> </span> Set Order Minimum Amount </NavDropdown.Item> </Link> </NavDropdown> */} <Link href='/orders' passHref> <Nav.Link active={router.pathname === '/orders'} onClick={closeNav} > Orders <span></span> </Nav.Link> </Link> </> ) : ( <> <Link href='/my-orders' passHref> <Nav.Link active={router.pathname === '/my-orders'} onClick={closeNav} > Orders <span></span> </Nav.Link> </Link> </> )} <Link href={'/marketplace'} passHref> <Nav.Link active={ router.pathname === '/marketplace' || router.pathname === '/product/[slug]' } onClick={closeNav} > Marketplace <span></span> </Nav.Link> </Link> <Link href='/brands' passHref> <Nav.Link onClick={closeNav} active={ router.pathname === '/brands' || router.pathname === '/brand/[slug]' } > Brands<span></span> </Nav.Link> </Link> <Link href='/retailers' passHref> <Nav.Link onClick={closeNav} active={ router.pathname === '/retailers' || router.pathname === '/customer/[slug]' } > Retailers<span></span> </Nav.Link> </Link> <Link href={'/social'} passHref> <Nav.Link active={ router.pathname === '/social' || router.pathname === '/post/[slug]' } onClick={closeNav} > Social <span></span> </Nav.Link> </Link> </Nav> <div className='nav_profile d-lg-flex d-none'> <Figure className='figure-circle mb-0'> <Image alt='profile' src={ASSETS_URL + getSingle('userImage')} className='cover' /> </Figure> <NavDropdown title={getSingle('userName')} align='end' id='basic-nav-dropdown' > {getSingle('role') === '2' ? ( <BrandProfileMenu /> ) : ( <> <Link href='/account' passHref> <NavDropdown.Item active={router.pathname === '/account'} eventKey='/account' > <span className='me-2'> <FontAwesomeIcon icon={faUser} /> </span> Account </NavDropdown.Item> </Link> <Link href='/stores' passHref> <NavDropdown.Item active={router.pathname === '/stores'} eventKey='/stores' > <span className='me-2'> <FontAwesomeIcon icon={faMapLocation} /> </span> Stores </NavDropdown.Item> </Link> <Link href='/favourites' passHref> <NavDropdown.Item active={router.pathname === '/favourites'} eventKey='/favourites' > <span className='me-2'> <FontAwesomeIcon icon={faHeart} /> </span> Favourite </NavDropdown.Item> </Link> {/* <Link href='/' passHref> <NavDropdown.Item active={router.pathname === '/'} eventKey='/' > <span className='me-2'> <i className='icon icon-order'></i> </span> Home </NavDropdown.Item> </Link> <Link href='/about-us' passHref> <NavDropdown.Item active={router.pathname === '/about-us'} eventKey='/about-us' > <span className='me-2'> <FontAwesomeIcon icon={faFileLines} /> </span> About Us </NavDropdown.Item> </Link> <Link href='/contact-us' passHref> <NavDropdown.Item active={router.pathname === '/contact-us'} eventKey='/contact-us' > <span className='me-2'> <FontAwesomeIcon icon={faCommentDots} /> </span> Contact Us {unreadCount ? ( <span className='msg-count'>{unreadCount}</span> ) : null} </NavDropdown.Item> </Link> */} <Link href={`/customer/${getSingle('slug')}`} passHref > <NavDropdown.Item active={router.pathname === '/customer'} eventKey='/profile' > <span className='me-2'> <FontAwesomeIcon icon={faUser} /> </span> View Profile </NavDropdown.Item> </Link> {/* <Link href="/#email-notification" passHref> <NavDropdown.Item active={router.pathname === '/#email-notification'} eventKey="/#email-notification"> <span className='me-2'><FontAwesomeIcon icon={faBell} /></span>Email Notifications </NavDropdown.Item> </Link> */} </> )} {/* <Link href="/social" passHref> <NavDropdown.Item active={router.pathname === '/social'} eventKey="/social" onClick={closeNav}><span className='me-2'><FontAwesomeIcon icon={faUser} /></span>Social</NavDropdown.Item> </Link> */} <NavDropdown.Item onClick={handleLogOut}> <span className='me-2'> <FontAwesomeIcon icon={faSignOutAlt} /> </span> Logout </NavDropdown.Item> </NavDropdown> {loggedInUser && getSingle('role') === '3' ? ( <a className='cart-items btn btn-outline-primary btn-circle btn-wh-42' onClick={hideShowCartModal} > <i className='far fa-shopping-cart'></i> <span> {totalCartItems > 99 ? '99+' : totalCartItems} </span> </a> ) : null} </div> </> )} </Navbar.Collapse> </Container> </Navbar> </header> {getSingle('role') === '3' ? ( <MyCart hideShowCart={hideShowCart} hideShowCartModal={hideShowCartModal} /> ) : null} </> ); } export default AppHeader; const BrandProfileMenu = () => { const router = useRouter(); const noti = new Notifier(); const dispatch = useDispatch(); const companies = useSelector((state) => state.company.companiesData); const [isNavOpen, setIsNaveOpen] = useState(false); const [modalCompany, setModalCompany] = useState(false); const [modalBrand, setModalBrand] = useState({ open: false, company: '' }); const handleAddCompany = () => { setModalCompany(true); setIsNaveOpen(false); }; const handleAddBrand = (slug) => { setModalBrand({ open: true, company: slug }); setIsNaveOpen(false); }; const handleSwitchAccount = (slug) => { dispatch(switchAccount({ slug: slug })) .unwrap() .then((result) => { if (result.status) { const response = result?.data; updateSingle('currentBrandCompanyId', response?.brandCompany?.id); updateSingle('currentBrandId', response?.brand?.id); updateSingle('userName', response?.brand?.brandName); updateSingle('brandSlug', response?.brand?.slug); updateSingle('fullName', response?.brand?.brandName); updateSingle( 'userImage', response?.brand?.profilePath !== null ? response?.brand?.profilePath : '/profile/seller-default.png' ); //router.push('/account/brand'); router.push('/account/brand').then(() => router.reload()); // router.refresh(); //router.reload(); } }) .catch((rejectedValueOrSerializedError) => { noti.notify(rejectedValueOrSerializedError.message, 'danger'); }); setIsNaveOpen(false); }; useEffect(async () => { if (isLoggedIn()) { await dispatch(fetchCompanies()); } }, [isLoggedIn()]); return ( <> <Link href='/dashboard' passHref> <NavDropdown.Item active={router.pathname === '/dashboard'} eventKey='/dashboard' > <span className='me-2'> <i className='icon icon-dashboard'></i> </span> Dashboard </NavDropdown.Item> </Link> <Link href='/product/list' passHref> <NavDropdown.Item active={ router.pathname === '/product/list' || router.pathname === '/product/add' || router.pathname === '/product/edit/[slug]' } eventKey='/product' > <span className='me-2'> <i className='icon icon-product'></i> </span> Products </NavDropdown.Item> </Link> {companies?.length > 0 && ( <> <NavDropdown className='switch-item' title={ <> <div> <span className='me-2'> <i className='fas fa-exchange'></i> </span> Switch </div> </> } align='end' > {companies.map((company, index) => ( <NavDropdown title={ <> <div key={`${index}-company`}> {company?.isApproved === '1' ? ( <> <span className='me-2'> <i className='fas fa-building'></i> </span> {company?.companyName} </> ) : ( <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={ <Tooltip>Account verification is pending</Tooltip> } > <div> <span className='me-2 status-icon'></span> {company?.companyName} </div> </OverlayTrigger> )} </div> </> } align='end' key={index} > {company?.brands.length > 0 && ( <> {company?.brands?.map((brand, index) => { return company?.isApproved === '1' ? ( <NavDropdown.Item onClick={() => handleSwitchAccount(brand?.slug)} key={index} > <span className='me-2 status-icon'> <Image alt='profile' src={`${ASSETS_URL}/${brand?.profilePath}`} className='cover' /> </span> {brand?.brandName} </NavDropdown.Item> ) : ( <NavDropdown.Item disabled key={index}> <span className='me-2 status-icon'> <Image alt='profile' src={`${ASSETS_URL}/${brand?.profilePath}`} className='cover' /> </span> {brand?.brandName} </NavDropdown.Item> ); })} {company?.isApproved === '1' && ( <NavDropdown.Item onClick={() => handleAddBrand(company?.slug)} > <span className='me-2'> <FontAwesomeIcon icon={faPlus} /> </span> Add Brand </NavDropdown.Item> )} </> )} </NavDropdown> ))} </NavDropdown> </> )} {/* <Link href='/deals' passHref> <NavDropdown.Item active={ router.pathname === '/deals' || router.pathname === '/deals/discount/add' || router.pathname === '/deals/discount/edit/[slug]' || router.pathname === '/deals/bulk-order/add' || router.pathname === '/deals/bulk-order/edit/[slug]' } eventKey='/deals' onClick={closeNav} > <span className='me-2'> <FontAwesomeIcon icon={faTag} /> </span> Promotion </NavDropdown.Item> </Link> */} {/* <Link href='/' passHref> <NavDropdown.Item active={router.pathname === '/'} eventKey='/'> <span className='me-2'> <FontAwesomeIcon icon={faHouse} /> </span> Home </NavDropdown.Item> </Link> <Link href='/about-us' passHref> <NavDropdown.Item active={router.pathname === '/about-us'} eventKey='/about-us' > <span className='me-2'> <i className='icon icon-order'></i> </span> About Us </NavDropdown.Item> </Link> <Link href='/contact-us' passHref> <NavDropdown.Item active={router.pathname === '/contact-us'} eventKey='/contact-us' > <span className='me-2'> <FontAwesomeIcon icon={faCommentDots} /> </span> Contact Us </NavDropdown.Item> </Link> */} {/* <Link href="/#reviews" passHref> <NavDropdown.Item active={router.pathname === '/#reviews'} eventKey='/#reviews'> <span className='me-2'><FontAwesomeIcon icon={faStar} /></span>Reviews </NavDropdown.Item> </Link> */} <Link href='/manage-subscription' passHref> <NavDropdown.Item active={router.pathname === '/manage-subscription'} eventKey='/manage-subscription' > <span className='me-2'> <FontAwesomeIcon icon={faAddressCard} /> </span> Subscription </NavDropdown.Item> </Link> {/* <Link href="/#transaction-history" passHref> <NavDropdown.Item active={router.pathname === '/#transaction-history'} eventKey='/#transaction-history'> <span className='me-2'><i className='icon icon-transaction'></i></span>Transaction History </NavDropdown.Item> </Link> */} <Link href='/account/company' passHref> <NavDropdown.Item active={router.pathname === '/account/company'} eventKey='/account/company' > <span className='me-2'> <FontAwesomeIcon icon={faBuilding} /> </span> Company </NavDropdown.Item> </Link> <NavDropdown.Item onClick={handleAddCompany} className='add-com'> <span className='me-2'> <FontAwesomeIcon icon={faPlus} /> </span> Add Company </NavDropdown.Item> <Link href='/account/brand' passHref> <NavDropdown.Item active={router.pathname === '/account/brand'} eventKey='/account/brand' > <span className='me-2'> <FontAwesomeIcon icon={faUser} /> </span> Account </NavDropdown.Item> </Link> <Link href={`/brand/${getSingle('brandSlug')}`} passHref> <NavDropdown.Item active={router.pathname === '/brand/' + getSingle('brandSlug')} eventKey={`/brand/${getSingle('brandSlug')}`} > <span className='me-2'> <FontAwesomeIcon icon={faUser} /> </span> View Profile </NavDropdown.Item> </Link> <Link href='/account/credentials' passHref> <NavDropdown.Item active={router.pathname === '/account/credentials'} eventKey='/account/credentials' > <span className='me-2'> <FontAwesomeIcon icon={faGear} /> </span> Credentials </NavDropdown.Item> </Link> {getSingle('role') === '2' ? ( <> {modalCompany && ( <> <AddCompany modal={modalCompany} closeModal={() => setModalCompany(false)} /> </> )} {modalBrand?.open && ( <> <AddBrand modal={modalBrand} closeModal={() => setModalBrand({ open: false, company: '' })} /> </> )} </> ) : null} </> ); };
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/FollowingListItem.js
import { useEffect, useState } from 'react'; import { Button, Figure } from 'react-bootstrap'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import { ASSETS_URL } from '../config/server.config'; import { getSingle } from '../services/Auth'; import Notifier from './Notifier'; const noti = new Notifier(); function FollowingListItem({ following, deleteFollowing }) { const [followStatus, setFollowStatus] = useState(); const role = following?.followerRole === '2'; const profilePath = role ? following?.fromBrand?.profilePath : following?.fromRetailer?.profilePath; const name = role ? following?.fromBrand?.brandName : following?.fromRetailer?.retailer_company; const follow = role ? following?.fromBrand?.followers?.length : following?.fromRetailer?.followers?.length; const currentUserId = role ? following?.fromBrand?.id : following?.fromRetailer?.id; const currentUserSlug = role ? following?.fromBrand?.slug : following?.fromRetailer?.slug; const userRoleWiseId = getSingle('role') === '2' ? getSingle('currentBrandId') : getSingle('retailerCompanyId'); const handleFollow = async () => { let formData = { slug: currentUserSlug, }; let response = await Rest.axiosRequest(API.follow, formData); response = response.data; if (response.status) { const follow = response.data.follow; setFollowStatus(follow ? 'Following' : 'Follow'); } else { noti.notify(response.message, 'danger'); } }; useEffect(() => { setFollowStatus(follow ? 'Following' : 'Follow'); }, [following]); return ( <div className='d-flex justify-content-between align-items-center'> <div className='d-flex align-items-center'> <Figure className='figure figure-circle figure-40 mb-0 me-3'> <img className='cover' src={ASSETS_URL + profilePath} alt='profile' /> </Figure> <h4 className='fs-16 fw-500 my-2'>{name || ''}</h4> </div> {userRoleWiseId != currentUserId && (followStatus == 'Following' ? ( <Button variant='primary' className='btn-rounded btn-wh-130-38 btn-h-30 fs-sm' onClick={handleFollow} > <span className='me-2'> <i className='icon icon-add-friend'></i> </span> Following </Button> ) : ( <Button variant='secondary' className='btn-rounded btn-wh-130-38 btn-h-30 fs-sm' onClick={handleFollow} > <span className='me-2'> <i className='icon icon-add-friend'></i> </span> Follow </Button> ))} </div> ); } export default FollowingListItem;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/CommentModal.js
import React, { useEffect, useRef, useState } from 'react'; import { Button, Col, Figure, Form, Modal, Row, Spinner, } from 'react-bootstrap'; import { useDispatch, useSelector } from 'react-redux'; import { createComment, createCommentReply, showModal, } from '../app/slices/commentSlice'; import { ASSETS_URL } from '../config/server.config'; import Notifier from './Notifier'; import { Mention, MentionsInput } from 'react-mentions'; import mentionsInputStyle from '../services/mentionsInputStyle'; export default function CommentModal({ postId, userImage, showCommentModal, handleCloseCommentModal, users, }) { const notifier = new Notifier(); const dispatch = useDispatch(); const { commentStatus, isCommentModal, message, modalType } = useSelector( (state) => state.comment ); const [replyText, setReplyText] = useState(''); const [mentions, setMentions] = useState([]); const [searchValue, setSearchValue] = useState(''); const [attachments, setAttachments] = useState([]); const [isMediaEnable, setIsMediaEnable] = useState(false); const [isLoading, setIsLoading] = useState(false); const [selectedMediaFile, setSelectedMediaFile] = useState([]); const refModalAttachment = useRef(''); const [isEnable, setIsEnable] = useState(true); const filteredUserDatabase = users?.filter((user) => { return user?.display?.toLowerCase()?.includes(searchValue?.toLowerCase()); }); const replyTextChangeHandler = ( event, newValue, newPlainTextValue, mentions ) => { const { value } = event.target; setReplyText(newValue); setMentions(mentions); setSearchValue( newPlainTextValue?.substring(newPlainTextValue.lastIndexOf('@') + 1) ); if (value !== '' || Object.keys(selectedMediaFile).length > 0) { setIsEnable(false); } else { setIsEnable(true); } }; const replyContentHandlerSelect = (id, display) => { const mentionText = `@${display}`; setReplyText(mentionText); setMentions([...mentions, { id, display }]); }; const formatBytes = (bytes, decimals = 2) => { if (!+bytes) return '0 Bytes'; const k = 1024; const dm = decimals < 0 ? 0 : decimals; const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return { valueWithSize: `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${ sizes[i] }`, value: parseFloat((bytes / Math.pow(k, i)).toFixed(dm)), size: sizes[i], }; }; const attachmentsHandler = (event) => { let filesCount = selectedMediaFile.length + event.target.files.length; if (filesCount > 10) { notifier.notify('Please choose up to 10 media.', 'danger'); return false; } else { if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } if (event.target.files.length > 0) { setIsEnable(false); } else { setIsEnable(true); } const selectedFiles = event.target.files; const selectedFilesArray = Array.from(selectedFiles); const imagesArray = selectedFilesArray.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); // videos and images validation let previousAndSelectedMediaFile = selectedMediaFile.concat(imagesArray); let fileTypeCount = {}; let videoSize = {}; let imageSize = {}; previousAndSelectedMediaFile.map(function (item) { fileTypeCount[item.type] = (fileTypeCount[item.type] || 0) + 1; if (item.type === 'video') { videoSize[item.type] = item.size; } if (item.type === 'image') { imageSize[item.type] = item.size; } }); if (fileTypeCount.video > 1) { notifier.notify('You can upload only one video.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'GB' || videoSize?.video?.size === 'TB' || videoSize?.video?.size === 'PB' || videoSize?.video?.size === 'EB' || videoSize?.video?.size === 'ZB' || videoSize?.video?.size === 'YB' ) { notifier.notify('Max video file limit is 256 MB.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'MB' && videoSize?.video?.value > 256.05 ) { notifier.notify('Max video file limit is 256 MB.', 'danger'); return false; } } } if ( imageSize?.image?.size === 'GB' || imageSize?.image?.size === 'TB' || imageSize?.image?.size === 'PB' || imageSize?.image?.size === 'EB' || imageSize?.image?.size === 'ZB' || imageSize?.image?.size === 'YB' ) { notifier.notify('Max image file limit is 5 MB.', 'danger'); return false; } else { if (imageSize?.image?.size === 'MB' && imageSize?.image?.value > 5.05) { notifier.notify('Max image file limit is 5 MB.', 'danger'); return false; } } setSelectedMediaFile((previousMediaFile) => previousMediaFile.concat(imagesArray) ); //setAttachments((previousattachments) => previousattachments.concat(event.target.files)); let f = event.target.files; let sf = attachments; // setAttachments((prevState)=>{ // return {...prevState, ...f}; // }) //setAttachments((prevState)=> ({prevState, ...f})) // setAttachments({ attachments, ...f }); for (let i = 0; i < event.target.files.length; i++) { setAttachments((prevfiles) => [...prevfiles, event.target.files[i]]); // let f = event.target.files[i]; // setAttachments((prevfiles)=>({...prevfiles, ...f})) } } }; const deleteHandler = (selectedIndex, selectedFile, selectedId) => { setSelectedMediaFile( selectedMediaFile.filter((e, index) => index !== selectedIndex) ); const copiedAttachment = [...attachments]; delete copiedAttachment[selectedId]; const newFiles = []; for (let i = 0; i < copiedAttachment.length; i++) { if (copiedAttachment[i]) { newFiles.push(copiedAttachment[i]); } } setAttachments(newFiles); const imagesArray = newFiles.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); setSelectedMediaFile(imagesArray); if (Object.keys(copiedAttachment).length === 0 && replyText === '') { setIsEnable(true); } else { setIsEnable(false); } URL.revokeObjectURL(selectedFile); let filesCount = selectedMediaFile.length - 1; if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } }; function handleSubmit() { if (replyText != '' || Object.keys(attachments).length > 0) { setIsEnable(false); setIsMediaEnable(false); setIsLoading(true); let formData = new FormData(); if (modalType === 'comment') { // Remove round brackets formData.append('comment', replyText.replace(/\(([^)]+)\)/g, '$1')); formData.append('mentions', JSON.stringify(mentions)); formData.append('postId', parseInt(postId)); } else { // Remove round brackets formData.append('reply', replyText.replace(/\(([^)]+)\)/g, '$1')); formData.append('mentions', JSON.stringify(mentions)); formData.append('commentId', parseInt(postId)); } for (let key in attachments) { formData.append('attachment', attachments[key]); } if (modalType === 'comment') { dispatch(createComment(formData)) .unwrap() .then((result) => { setIsLoading(false); setIsMediaEnable(false); if (result.status) { notifier.notify(result.message, 'success'); dispatch(showModal({ modalStatus: false, modalType: 'comment' })); resetForm(); } }) .catch((rejectedValueOrSerializedError) => { setIsLoading(false); setIsMediaEnable(false); notifier.notify(rejectedValueOrSerializedError.message, 'danger'); }); } else { dispatch(createCommentReply(formData)) .unwrap() .then((result) => { setIsLoading(false); if (result.status) notifier.notify(result.message, 'success'); dispatch(showModal({ modalStatus: false, modalType: 'reply' })); resetForm(); }) .catch((rejectedValueOrSerializedError) => { setIsLoading(false); notifier.notify(rejectedValueOrSerializedError.message, 'danger'); }); } } else { setIsEnable(true); } } // function handleSubmitCommentReply(commentId) { // dispatch(createCommentReply({ commentId: parseInt(commentId), reply: replyText })) // } useEffect(() => { if (commentStatus === 'loading') { setIsLoading(true); } else if (commentStatus === 'succeeded') { setIsLoading(false); setIsMediaEnable(false); // notifier.notify(message, "success"); } else if (commentStatus === 'failed') { setIsLoading(false); setIsMediaEnable(false); } }, [commentStatus]); function resetForm() { setReplyText(''); setAttachments([]); // refModalAttachment.current.value = ''; setSelectedMediaFile([]); setIsEnable(true); setIsMediaEnable(false); } return ( <Modal className="commentModal" size="lg" show={isCommentModal} onHide={handleCloseCommentModal} > <Modal.Header closeButton> <Modal.Title>Comment</Modal.Title> </Modal.Header> <Modal.Body className="py-4"> <Row> <Col sm="auto"> <Figure className="figure figure-circle figure-gray-2 figure-62"> <img className="cover" src={ASSETS_URL + userImage} alt="profile" /> </Figure> </Col> <Col> <Form.Group className="form-dark"> <MentionsInput className="mention-textarea" placeholder="Enter Your Reply" value={replyText} onChange={replyTextChangeHandler} style={mentionsInputStyle} > <Mention trigger="@" data={filteredUserDatabase} renderSuggestion={( suggestion, search, highlightedDisplay ) => ( <div className="d-flex justify-content-between align-items-center"> <div className="d-flex align-items-center"> <Figure className="figure figure-circle figure-40 mb-0 me-3"> <img className="cover mention-image" src={ASSETS_URL + suggestion?.profilePath} alt={suggestion?.businessName} /> </Figure> <div> <h4 className="fs-16 fw-500 my-2"> {suggestion?.businessName} </h4> <span>@{highlightedDisplay}</span> </div> </div> </div> )} markup="@(__display__)" displayTransform={(id, display) => `@${display}`} onSelect={replyContentHandlerSelect} /> </MentionsInput> </Form.Group> {/* <Form.Group className="form-dark"> <Form.Control as="textarea" name='replyText' value={replyText} onChange={replyTextChangeHandler} placeholder="Enter Your Reply" /> </Form.Group> */} <Form.Group className="form-dark"> <div className="d-flex align-items-start flex-wrap"> <div className="multimediaFiles"> <label htmlFor="multimediaAttachmentFiles" className={`btn btn-outline-gray btn-rounded btn-h-30 me-3 mt-3${ isLoading || isMediaEnable ? ' disabled' : '' }`} > <span className="color-20da97 me-2"> <i className="icon icon-image v-align-middle"></i> </span> Media </label> <input type="file" ref={refModalAttachment} multiple accept="audio/*,video/*,image/*" onChange={attachmentsHandler} id="multimediaAttachmentFiles" className="mediaFiles" /> </div> <span className="me-3 mt-3"> {/* {(refModalAttachment.current !== null && refModalAttachment.current?.files.length !== 0) ? refModalAttachment.current.files.length + `${refModalAttachment.current.files.length > 1 ? ' files' : ' file'}` : null} */} </span> {/* <a href="#" className="btn btn-outline-gray btn-rounded btn-h-30 mt-3"> <span className="color-f8bf52 me-2"><i className="icon icon-video v-align-middle"></i></span> Videos </a> */} </div> </Form.Group> </Col> <Col sm="auto"> <button type="submit" onClick={!isLoading ? handleSubmit : null} disabled={isLoading || isEnable} className="btn btn-outline-gray btn-wh-150-48 btn-rounded mt-3" > {isLoading ? <Spinner animation="border" /> : 'Reply'} </button> </Col> <Row> <Col sm="auto"> <div style={{ width: '58px' }}></div> </Col> <Col className=" mt-3"> <div className={selectedMediaFile.length > 0 ? `grid-wrapper` : ``} > {selectedMediaFile && selectedMediaFile.map((selectedFile, index) => { return ( <div key={selectedFile + index} className={ `gallery-image position-relative` + (selectedFile.type === 'video' ? ` gallery-video` : ``) } > <Button variant="" className="btn-remove" onClick={() => deleteHandler( index, selectedFile.previewFile, selectedFile.id ) } > <i className="fal fa-times"></i> </Button> {selectedFile.type === 'video' ? ( <video controls> <source src={selectedFile.previewFile} type="video/mp4" /> Sorry, your browser doesn't support embedded videos. </video> ) : ( <img className="cover" src={selectedFile.previewFile} alt="upload" /> )} </div> ); })} </div> </Col> </Row> {/* <Row className="images"> {selectedMediaFile && selectedMediaFile.map((selectedFile, index) => { return ( <Col key={selectedFile + index} className="image"> <div className='gallery-image position-relative'> <Button variant="" className="btn-remove" onClick={() => deleteHandler(index, selectedFile.previewFile, selectedFile.id)}> <i className="fal fa-times"></i> </Button> { selectedFile.type === 'video' ? <video className="gallery-image" controls> <source src={selectedFile.previewFile} type="video/mp4" /> Sorry, your browser doesn't support embedded videos. </video> : <img className="gallery-image" src={selectedFile.previewFile} alt="upload" /> } </div> </Col> ); })} </Row> */} </Row> </Modal.Body> </Modal> ); }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/SingleReply.js
import Link from 'next/link'; import React, { useState } from 'react'; import { Col, Figure, Row } from 'react-bootstrap'; import ReactPlayer from 'react-player'; import { ASSETS_URL } from '../config/server.config'; import { dateTimeFormat } from '../services/Helper'; import { roles } from '../services/Role'; import LightboxModal from './LightboxModal'; export default function SingleReply({ replyData, handleShowReplies, reply, rIndex, count, handleHideReplies, }) { const [show, setShow] = useState(false); const [activeIndex, setActiveIndex] = useState(0); const handleClose = () => setShow(false); const [individualReplyAttachments, setIndividualReplyAttachments] = useState( [] ); const handleShow = (index) => { setActiveIndex(index); setShow(true); setIndividualReplyAttachments(replyData['attachments']); }; // Profile data const role = replyData?.role; const userName = role === '2' ? replyData?.brand?.brandName : replyData?.retailer?.companyName; const profilePath = role === '2' ? `${ASSETS_URL}${replyData?.brand?.profilePath}` : `${ASSETS_URL}${replyData?.retailer?.profilePath}`; const slug = role === '2' ? `/brand/${replyData?.brand?.slug}` : `/customer/${replyData?.retailer?.slug}`; return ( <Row key={'rIndex' + rIndex} className='timeline-row'> <Col sm='auto'> <Figure className='figure figure-circle figure-gray-2 figure-62'> <img className='cover' src={profilePath ?? '/profile/no-profile-image.jpg'} alt='profile' /> </Figure> </Col> <Col> <Link href={slug}> <a> <div> <h3 className='text-white fs-18'> {userName} <span className='color-a5a5a5 fs-14 fw-normal ms-2'> {dateTimeFormat(replyData.createdAt, 'DD MMM YYYY')} </span> </h3> <p className='color-bfbfbf'>{replyData.reply}</p> </div> </a> </Link> <Row className='gallery-view'> {replyData.attachments?.length > 0 && replyData.attachments.map((attachmentFile, aIndex) => ( <Col lg={3} md={4} sm={6} key={'attachment' + aIndex}> {aIndex <= 3 ? ( attachmentFile.attachmentType == 2 ? ( <div className='gallery-image cursor-pointer' onClick={() => handleShow(aIndex)} > <ReactPlayer className='react-player' width='100%' height='100%' url={ASSETS_URL + attachmentFile.attachment} playing={false} controls={true} //volume={5} muted={true} /> {aIndex == 3 ? ( <span className='more-images'> {replyData.attachments.length - 4 == 0 ? null : `+${replyData.attachments.length - 4}`} </span> ) : null} </div> ) : ( <div className='gallery-image cursor-pointer' onClick={() => handleShow(aIndex)} > <img className='cover' src={ASSETS_URL + attachmentFile.attachment} alt='postedImage' /> {aIndex == 3 ? ( <span className='more-images'> {replyData.attachments.length - 4 == 0 ? null : `+${replyData.attachments.length - 4}`} </span> ) : null} </div> ) ) : null} </Col> ))} </Row> {reply.length - 1 === rIndex && reply.length >= 3 ? ( count - 1 === rIndex ? ( <p onClick={() => handleHideReplies(replyData.commentId)} className='color-f3772c' > Hide Replies </p> ) : ( <p onClick={() => handleShowReplies(replyData.commentId)} className='color-f3772c' > Show Replies </p> ) ) : null} </Col> <LightboxModal sliderIndex={activeIndex} images={individualReplyAttachments} show={show} handleClose={handleClose} /> </Row> ); }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/MyCart.js
import { useEffect, useState } from 'react'; import { Button, Card, Col, Form, Offcanvas, Row } from 'react-bootstrap'; import { useDispatch, useSelector } from 'react-redux'; import { editStore, fetchCartProducts, fetchStores, resetCart, } from '../app/slices/cartSlice'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import CartItem from './CartItem'; import Notifier from './Notifier'; import Add from './modal/stores/Add'; import Edit from './modal/stores/Edit'; function OffCanvasMyCart({ name, ...props }) { const noti = new Notifier(); const cart = useSelector((state) => state.cart.data); const cartMinorderAmount = useSelector( (state) => state?.cart?.data?.brand?.orderAmount ); const productsStatus = useSelector((state) => state.cart.status); const orderTotal = useSelector((state) => state?.cart?.data?.orderTotal); const discountTotal = useSelector( (state) => state?.cart?.data?.discountTotal ); const finalOrderTotal = useSelector( (state) => state?.cart?.data?.finalOrderTotal ); const stores = useSelector((state) => state?.cart?.stores); const dispatch = useDispatch(); const [modal, setModal] = useState(false); const [editModal, setEditModal] = useState(false); const [order, setOrder] = useState({ storeId: '', }); const handleOrderChange = (event) => { event.persist(); const { name, value } = event.target; setOrder((prevState) => ({ ...prevState, [name]: value })); }; const handleOrderRequest = async () => { const response = await Rest.axiosRequest(API.orderRequest, { order: { ...cart, ...order }, }); if (response.data.status) { dispatch(resetCart()); noti.notify('Order has been requested successfully', 'success'); } else { noti.notify(response.data.message, 'danger'); } }; const handleAddStore = () => { setModal(true); }; const handleEditStore = async (id) => { dispatch(editStore(id)); setEditModal(true); }; useEffect(() => { if (productsStatus === 'idle') { dispatch(fetchCartProducts()); } }, [productsStatus, dispatch]); useEffect(() => { dispatch(fetchStores()); }, [props.show]); return ( <> <Offcanvas show={props.show} onHide={props.hideShowCartModal} {...props} className='dark-canvas' > <Offcanvas.Header closeButton> <Offcanvas.Title>My Cart</Offcanvas.Title> </Offcanvas.Header> <Offcanvas.Body> {cart?.cartItems && cart?.cartItems?.length ? ( <> {cart?.cartItems.map((product) => ( <CartItem key={`cart-item-${product.id}`} product={product} /> ))} <> {stores?.data?.length ? ( <Card className='card-dark bs-none mb-4'> <Card.Body> <Card.Title>Select a delivery address</Card.Title> <Card className='card-dark bs-none mb-4'> <Card.Body> <Card.Title>Your addresses</Card.Title> {stores?.data?.map((store, index) => ( <Row key={index}> <Col> <Form.Check type='radio' id={`store-${index}`} name='storeId' > <Form.Check.Input type='radio' name='storeId' isValid defaultChecked={ store.id == stores?.retailerCompany?.defaultStoreId } //defaultChecked={store?.isDefault} //checked={store?.isDefault} value={store?.id} onChange={handleOrderChange} /> <Form.Check.Label> {store?.managerName} </Form.Check.Label> <Form.Control.Feedback type='valid'> {`${store?.address}, ${store?.state?.name}, ${store?.zipCode}.`} </Form.Control.Feedback> </Form.Check> </Col> <Col sm='auto'> <a onClick={() => handleEditStore(store.id)}> <i className='fas fa-edit' title='Edit Address' ></i> </a> </Col> </Row> ))} <Row> <Col> <div className='d-flex align-items-center' onClick={handleAddStore} > <label className='form-label my-1 me-1'> <i className='fas fa-plus'></i> </label> <div className='color-dcdcdc my-1'> Add a new address </div> </div> </Col> </Row> </Card.Body> </Card> </Card.Body> </Card> ) : null} <Card className='card-dark bs-none mb-4' key='order-details'> <Card.Body> <Row> <Col> {discountTotal > 0 && ( <> <div className='d-flex align-items-center'> <label className='form-label my-1 me-3'> Total: </label> <div className='color-dcdcdc my-1'>{`$ ${orderTotal}`}</div> </div> <div className='d-flex align-items-center'> <label className='form-label my-1 me-3'> Promotion Applied: </label> <div className='color-dcdcdc my-1'> - {`$ ${discountTotal}`} </div> </div> </> )} <div className='d-flex align-items-center'> <label className='form-label my-1 me-3'> {discountTotal > 0 ? 'Order Total' : 'Order Total'} </label> <div className='color-dcdcdc my-1'>{`$ ${finalOrderTotal}`}</div> </div> {cartMinorderAmount > finalOrderTotal && ( <div className='d-flex align-items-center'> <label className='form-label my-1 me-3'> {`The minimum order amount to place an order is $ ${cartMinorderAmount}.`} </label> </div> )} </Col> </Row> </Card.Body> </Card> </> <div className='text-end'> <Button disabled={cartMinorderAmount > finalOrderTotal} variant='primary' className='btn-wh-220-46 btn-rounded' onClick={handleOrderRequest} > Confirm Order Request </Button> </div> </> ) : ( <Card className='card-dark bs-none mb-4'> <Card.Body> <div className='text-center'> <h4 className='fs-18 fw-600 color-dcdcdc'> Your cart is empty! </h4> <p>Looks like you haven't added anything in your cart yet.</p> </div> </Card.Body> </Card> )} </Offcanvas.Body> </Offcanvas> <Add modal={modal} closeModal={() => setModal(false)} /> <Edit modal={editModal} closeModal={() => setEditModal(false)} /> </> ); } function MyCart(props) { return ( <> <OffCanvasMyCart placement={'end'} name={'end'} show={props.hideShowCart} {...props} /> </> ); } export default MyCart;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/ReadMore.js
import React, { useState } from "react"; const ReadMore = ({ children }) => { const text = children; const [isReadMore, setIsReadMore] = useState(true); const toggleReadMore = () => { setIsReadMore(!isReadMore); }; return ( <p className="color-7e7e7e"> {isReadMore ? text.slice(0, 150) : text} <span onClick={toggleReadMore} className="read-or-hide"> {isReadMore ? "...read more" : " show less"} </span> </p> ); }; export default ReadMore;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/LikeModal.js
import React, { useEffect, useRef, useState } from 'react'; import { Button, Figure, ListGroup, Modal } from 'react-bootstrap'; import InfiniteScroll from 'react-infinite-scroll-component'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { ASSETS_URL } from '../config/server.config'; import FollowingListItem from './FollowingListItem'; import FollowerListItem from './FollowerListItem'; const baseColor = '#202020'; const highlightColor = '#444'; const LikeModal = ({ show, hide, likes, likesCount, fetchMoreLikes, handleFollowerFollowingCount, ...props }) => { return ( <Modal show={show} onHide={hide} className='modal-dark custom-modal' centered scrollable={true} > <Modal.Header closeButton> <Modal.Title>{likesCount} Likes</Modal.Title> </Modal.Header> <Modal.Body id='scrollableDiv'> <ListGroup variant='flush' className='list-dark'> <InfiniteScroll dataLength={likes.length} next={() => fetchMoreLikes()} hasMore={likesCount > likes.length ? true : false} loader={[...Array(10)].map((arrayData, index) => { return ( <div key={index + 'skeleton'} className='d-flex justify-content-between align-items-center px-3 list-group-item' > <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <div className='d-flex align-items-center'> <Skeleton circle={true} height={40} width={40} className='mb-0 me-3' /> <Skeleton width={200} height={20} /> </div> <Skeleton width={120} height={30} className='me-2' /> </SkeletonTheme> </div> ); })} scrollableTarget='scrollableDiv' > {likes.length > 0 ? ( likes.map((like, index) => { return ( <ListGroup.Item> <FollowerListItem follower={{ followerUser: like }} /> </ListGroup.Item> ); }) ) : ( <div className='d-flex justify-content-center align-items-center fs-16 fw-500 p-2'> No records found! </div> )} </InfiniteScroll> </ListGroup> </Modal.Body> </Modal> ); }; export default LikeModal;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/FormValidator.js
import validator from "validator"; class FormValidator { constructor(validations) { // validations is an array of validation rules specific to a form this.validations = validations; } add(obj) { this.validations.map((element, index) => { if (element.field === obj.field && element.idAdd === true) { this.validations.splice(index, 1); } return ""; }); this.validations[this.validations.length] = obj; } validate(state) { // start out assuming valid let validation = this.valid(); // for each validation rule this.validations.forEach((rule) => { // if the field hasn't already been marked invalid by an earlier rule if (!validation[rule.field].isInvalid) { // determine the field value, the method to invoke and optional args from // the rule definition const field_value = state[rule.field] ? state[rule.field].toString() : ""; const args = rule.args || []; const validation_method = typeof rule.method === "string" ? validator[rule.method] : rule.method; // call the validation_method with the current field value as the first // argument, any additional arguments, and the whole state as a final // argument. If the result doesn't match the rule.validWhen property, // then modify the validation object for the field and set the isValid // field to false if (rule.method === "isURL") { if (field_value !== "") { if ( validation_method(field_value, ...args, state) !== rule.validWhen ) { validation[rule.field] = { isInvalid: true, message: rule.message, }; validation.isValid = false; } } } else { if ( validation_method(field_value, ...args, state) !== rule.validWhen ) { validation[rule.field] = { isInvalid: true, message: rule.message }; validation.isValid = false; } } } }); return validation; } valid() { const validation = {}; this.validations.map( (rule) => (validation[rule.field] = { isInvalid: false, message: "" }) ); return { isValid: true, ...validation }; } } export default FormValidator;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/Meta.js
import Head from "next/head"; function Meta({title, description, keywords }) { return ( <Head> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width"/> <meta name="keywords" content={keywords} /> <meta name="description" content={description} /> <title>{title}</title> </Head> ); } Meta.defaultProps = { title: 'GMX', keywords: 'GMX', description: 'GMX' } export default Meta;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/PageLoader.js
import React, { Component } from 'react'; class PageLoader extends Component { render() { return ( <div className="spinner"> <div className="rect1"></div> <div className="rect2"></div> <div className="rect3"></div> <div className="rect4"></div> <div className="rect5"></div> </div> ); } }; export default PageLoader;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/ActivityList.js
import React from 'react'; import InfiniteScroll from 'react-infinite-scroll-component'; import Activity from './Activity'; import ActivitySkeleton from './ActivitySkeleton'; const ActivityList = (props) => { const { activities, fetchMoreActivity, totalActivities, handleShow, handleShowCommentModal, likesClickHandler, repostsClickhandler, } = props; return totalActivities > 0 ? ( <InfiniteScroll dataLength={activities.length} next={fetchMoreActivity} hasMore={totalActivities > activities.length ? true : false} loader={[...Array(10)].map((arrayData, index) => ( <ActivitySkeleton key={index} /> ))} > {activities.map((activity) => { return ( <div key={activity.id}> <Activity key={activity.id} activity={activity} handleShow={handleShow} handleShowCommentModal={handleShowCommentModal} likesClickHandler={likesClickHandler} repostsClickhandler={repostsClickhandler} /> <hr></hr> </div> ); })} </InfiniteScroll> ) : ( <div className='d-flex justify-content-center align-items-center fs-16 fw-500 p-2'> No records found! </div> ); }; export default ActivityList;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/NProgressBar.js
import NProgress from "nprogress" import "nprogress/nprogress.css" import { useRouter } from "next/router"; import { useEffect } from "react"; const NProgressBar = (config) => { const router = useRouter() NProgress.configure({ showSpinner: false, ...config }); useEffect(() => { const handleStart = (url) => { NProgress.start() } const handleStop = () => { NProgress.done() } router.events.on('routeChangeStart', handleStart) router.events.on('routeChangeComplete', handleStop) router.events.on('routeChangeError', handleStop) return () => { router.events.off('routeChangeStart', handleStart) router.events.off('routeChangeComplete', handleStop) router.events.off('routeChangeError', handleStop) } }, [router]) return null; }; export { NProgressBar };
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/FollowerListItem.js
import { useEffect, useState, memo } from 'react'; import Rest from '../config/rest.config'; import { ASSETS_URL } from '../config/server.config'; import { getSingle } from '../services/Auth'; import Notifier from './Notifier'; import { Button, Figure } from 'react-bootstrap'; import API from '../config/endpoints.config'; const noti = new Notifier(); function FollowerListItem({ follower, ...props }) { const [followStatus, setFollowStatus] = useState(); // Profile data const userRoleWiseId = getSingle('role') === '2' ? getSingle('currentBrandId') : getSingle('retailerCompanyId'); const role = follower?.followingRole; const user = role === '2' ? follower?.toBrand?.followers?.length : follower?.toRetailer?.followers?.length; const currentUserId = role === '2' ? follower?.toBrand?.id : follower?.toRetailer?.id; const userName = role === '2' ? follower?.toBrand?.brandName : follower?.toRetailer?.companyName; const profilePath = role === '2' ? `${ASSETS_URL}${follower?.toBrand?.profilePath}` : `${ASSETS_URL}${follower?.toRetailer?.profilePath}`; const slug = role === '2' ? follower?.toBrand?.slug : follower?.toRetailer?.slug; useEffect(() => { setFollowStatus(user == '1' ? 'Following' : 'Follow'); }, [follower]); const handleFollow = async () => { let formData = { slug: slug, }; let response = await Rest.axiosRequest(API.follow, formData); response = response.data; if (response.status) { const follow = response.data.follow; setFollowStatus(follow ? 'Following' : 'Follow'); } else { noti.notify(response.message, 'danger'); } }; return ( <div className='d-flex justify-content-between align-items-center'> <div className='d-flex align-items-center'> <Figure className='figure figure-circle figure-40 mb-0 me-3'> <img className='cover' src={profilePath} alt='profile' /> </Figure> <h4 className='fs-16 fw-500 my-2'>{userName}</h4> </div> {+userRoleWiseId !== +currentUserId && (followStatus == 'Following' ? ( <Button variant='primary' className='btn-rounded btn-wh-130-38 btn-h-30 fs-sm' onClick={handleFollow} > <span className='me-2'> <i className='icon icon-add-friend'></i> </span> Following </Button> ) : ( <Button variant='secondary' className='btn-rounded btn-wh-130-38 btn-h-30 fs-sm' onClick={handleFollow} > <span className='me-2'> <i className='icon icon-add-friend'></i> </span> Follow </Button> ))} </div> ); } export default memo(FollowerListItem);
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/CommentList.js
import Link from 'next/link'; import React from 'react'; import { Col, Figure, OverlayTrigger, Row, Tooltip } from 'react-bootstrap'; import ReactPlayer from 'react-player'; import { ASSETS_URL } from '../config/server.config'; import { dateTimeFormat } from '../services/Helper'; import { roles } from '../services/Role'; import ReplyList from './ReplyList'; import { getSingle } from '../services/Auth'; export default function CommentList({ commentData, handleShow, handleShowCommentModal, activity, }) { // Profile data const role = commentData?.role; const userName = role === '2' ? commentData?.brand?.brandName : commentData?.retailer?.companyName; const profilePath = role === '2' ? `${ASSETS_URL}${commentData?.brand?.profilePath}` : `${ASSETS_URL}${commentData?.retailer?.profilePath}`; const slug = role === '2' ? `/brand/${commentData?.brand?.slug}` : `/customer/${commentData?.retailer?.slug}`; return ( <div> <hr></hr> <Row> <Col sm='auto'> <Figure className='figure figure-circle figure-gray-2 figure-62'> <img className='cover' src={profilePath ?? '/profile/no-profile-image.jpg'} alt='profile' /> </Figure> </Col> <Col> <Link href={slug}> <a> <h3 className='text-white fs-18'> {userName} <span className='color-a5a5a5 fs-14 fw-normal ms-2'> {dateTimeFormat(commentData.createdAt, 'DD MMM YYYY')} </span> </h3> </a> </Link> <Link href={'/post/comment/' + commentData.commentUniqueId}> <a> <p className='color-bfbfbf'>{commentData.comment}</p> </a> </Link> <Row> {commentData.attachments?.length > 0 && commentData.attachments.map((attachmentFile, aIndex) => ( <Col lg={3} md={4} sm={6} key={'attachment' + aIndex}> {aIndex <= 3 ? ( attachmentFile.attachmentType == 2 ? ( <div className='gallery-image cursor-pointer' onClick={() => handleShow(true, aIndex, activity.id, 'comment') } > <ReactPlayer className='react-player' width='100%' height='100%' url={ASSETS_URL + attachmentFile.attachment} playing={false} controls={true} muted={true} /> {aIndex == 3 ? ( <span className='more-images'> {commentData.attachments.length - 4 == 0 ? null : `+${commentData.attachments.length - 4}`} </span> ) : null} </div> ) : ( <div className='gallery-image cursor-pointer' onClick={() => handleShow(true, aIndex, activity.id, 'comment') } > <img className='cover' src={ASSETS_URL + attachmentFile.attachment} alt='postedImage' /> {aIndex == 3 ? ( <span className='more-images'> {commentData.attachments.length - 4 == 0 ? null : `+${commentData.attachments.length - 4}`} </span> ) : null} </div> ) ) : null} </Col> ))} </Row> <div className='d-sm-flex justify-content-between align-items-center'> <ul className='comment-icons nav mb-3'> <li> <OverlayTrigger placement='top' overlay={<Tooltip>Comment</Tooltip>} > <a onClick={() => handleShowCommentModal(commentData.id, 'reply') } aria-controls={'commentReply'} > <i className='icon icon-chat-bubble'></i> </a> </OverlayTrigger> </li> </ul> {commentData.replyCount > 0 ? ( <Link href={'/post/comment/' + commentData.commentUniqueId}> <a className='color-a5a5a5'> <ul className='likes-comments nav'> <li> <span className='text-white'> {commentData.replyCount} </span>{' '} Comments </li> </ul> </a> </Link> ) : ( <ul className='likes-comments nav'> <li> <span className='text-white'>{commentData.replyCount}</span>{' '} Comments </li> </ul> )} </div> <ReplyList commentData={commentData.replies} commentId={commentData.id} /> </Col> </Row> </div> ); }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/DropDown.js
import { components } from "react-select"; const DropdownIndicator = (props) => { return ( components.DropdownIndicator && ( <components.DropdownIndicator {...props}> <div className={ props.selectProps.menuIsOpen ? "far fa-angle-up" : "far fa-angle-down" } ></div> </components.DropdownIndicator> ) ); }; const react_select_xs_Styles = { option: (provided, state) => ({ ...provided, color: state.isSelected ? "#FFF" : "#333", backgroundColor: state.isSelected ? "#f3772c" : "#FFF", padding: "8px 15px", "&:hover": { backgroundColor: state.isFocused ? "#f3772c" : "#FFF", color: state.isFocused ? "#FFF" : "#333", }, }), control: () => ({ position: "relative", display: "flex", flexWrap: "wrap", justifyContent: "space-between", alignItems: "center", width: "100%", minHeight: 28, lineHeight: "28px", padding: "0px 5px", fontSize: 14, outline: 0, border: "1px solid #4b4b4b", borderRadius: 6, backgroundColor: "#242424", color: "#FFF", }), input: (styles) => ({ ...styles, margin: 0, lineHeight: "0px", }), menu: (styles) => ({ ...styles, marginTop: 2, }), singleValue: (provided, state) => { const opacity = state.isDisabled ? 0.5 : 1; const transition = "opacity 300ms"; return { ...provided, opacity, transition }; }, }; const react_select_sm_Styles = { option: (provided, state) => ({ ...provided, color: state.isSelected ? "#606060" : "#333", backgroundColor: state.isSelected ? "#f3772c" : "#606060", padding: "8px 15px", "&:hover": { backgroundColor: state.isFocused ? "#f3772c" : "#606060", color: state.isFocused ? "#FFF" : "#333", }, }), control: () => ({ position: "relative", display: "flex", flexWrap: "wrap", justifyContent: "space-between", alignItems: "center", width: "100%", minHeight: 38, lineHeight: "38px", padding: "0px 10px", fontSize: 14, outline: 0, border: "1px solid #4b4b4b", borderRadius: 6, backgroundColor: "transparent", color: "#FFF", }), input: (styles) => ({ ...styles, margin: 0, lineHeight: "0px", }), menu: (styles) => ({ ...styles, marginTop: 2, }), singleValue: (provided, state) => { const opacity = state.isDisabled ? 0.5 : 1; const transition = "opacity 300ms"; return { ...provided, opacity, transition }; }, }; const react_select_lg_Styles = { option: (provided, state) => ({ ...provided, color: state.isSelected ? "#FFF" : "#dbdbdb", backgroundColor: state.isSelected ? "#f3772c" : "#FFF", padding: "8px 15px", "&:hover": { backgroundColor: state.isFocused ? "#f3772c" : "#FFF", color: state.isFocused ? "#FFF" : "#dbdbdb", }, }), control: () => ({ position: "relative", display: "flex", flexWrap: "wrap", justifyContent: "space-between", alignItems: "center", width: "100%", minHeight: 56, lineHeight: "45px", padding: "0px 10px", fontSize: 16, outline: 0, border: "1px solid #4b4b4b", borderRadius: 15, backgroundColor: "transparent", }), input: (styles) => ({ ...styles, margin: 0, lineHeight: "0px", }), menu: (styles) => ({ ...styles, marginTop: 2, }), singleValue: (provided, state) => { const opacity = state.isDisabled ? 0.5 : 1; const transition = "opacity 300ms"; return { ...provided, opacity, transition }; }, }; const react_select_lg_Styles_light = { option: (provided, state) => ({ ...provided, color: state.isSelected ? "#FFF" : "#dbdbdb", backgroundColor: state.isSelected ? "#f3772c" : "#FFF", padding: "8px 15px", "&:hover": { backgroundColor: state.isFocused ? "#f3772c" : "#FFF", color: state.isFocused ? "#FFF" : "#dbdbdb", }, }), control: () => ({ position: "relative", display: "flex", flexWrap: "wrap", justifyContent: "space-between", alignItems: "center", width: "100%", minHeight: 56, lineHeight: "45px", padding: "0px 10px", fontSize: 16, outline: 0, border: "1px solid #4b4b4b", borderRadius: 15, backgroundColor: "#242424", }), input: (styles) => ({ ...styles, margin: 0, lineHeight: "0px", }), menu: (styles) => ({ ...styles, marginTop: 2, color: "#dbdbdb" }), singleValue: (provided, state) => { const opacity = state.isDisabled ? 0.5 : 1; const transition = "opacity 300ms"; return { ...provided, opacity, transition }; }, }; export { DropdownIndicator,react_select_xs_Styles, react_select_sm_Styles, react_select_lg_Styles, react_select_lg_Styles_light };
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/Layout.js
import AppFooter from './AppFooter'; import AppHeader from './AppHeader'; import Meta from './Meta'; export default function Layout({ children }) { return ( <> <Meta /> <AppHeader /> {children} <AppFooter /> </> ); }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/AppFooter.js
import React, { useEffect, useState } from "react"; import Link from "next/link"; import { Container, Navbar, Nav, Row, Col } from "react-bootstrap"; import Rest from "../config/rest.config"; import API from "../config/endpoints.config"; import { APP_NAME } from "../config/server.config"; function AppFooter() { const [socialDetails, setSocialDetails] = useState([]); useEffect(() => { const getSettingsDetails = async () => { const response = await Rest.axiosRequest(API.getContactUs, {}); if (response.data.status) { const socialData = response.data; setSocialDetails({ infoEmail: socialData.data[0].description ?? "", contactNumber: socialData.data[1].description ?? "", facebookLink: socialData.data[3].description ?? "", instagramLink: socialData.data[4].description ?? "", twitterLink: socialData.data[5].description ?? "", linkedinLink: socialData.data[6].description ?? "", }); } }; getSettingsDetails(); }, []); return ( <> <footer> <div className="footer_top"> <Container> <Row> <Col lg={3} className="footer_box"> <h3 className="footer_title">Quick Links</h3> <ul className="quick_links left_padding"> <li> <i className="far fa-angle-right"></i> <Link href="/about-us">About Us</Link> </li> <li> <i className="far fa-angle-right"></i> <Link href="/contact-us">Contact Us</Link> </li> <li> <i className="far fa-angle-right"></i> <Link href="/marketplace">Marketplace</Link> </li> <li> <i className="far fa-angle-right"></i> <Link href="/brands">Brand</Link> </li> <li> <i className="far fa-angle-right"></i> <Link href="/retailers">Retailers</Link> </li> <li> <i className="far fa-angle-right"></i> <Link href="/social">Social</Link> </li> </ul> </Col> <Col lg> <Link href="/" passHref> <Navbar.Brand className="nav_brand_logo"> <img alt="logo" src="/assets/images/main-logo.png" className="h-100" /> </Navbar.Brand> </Link> <div className="text-center footer-logo-content"> {/* <p>Duis auctor justo et ex iaculis ullamcorper donec rutrum malesuada scelerisque quisque ac facilisis quam, eget erat elem</p> */} </div> </Col> <Col lg="auto" className="footer_box"> <h3 className="footer_title">Get In Touch</h3> <ul className="get_in_touch"> <li> <a href={` tel:${socialDetails.contactNumber}`}> <i className="icon-call"></i> {socialDetails.contactNumber} </a> </li> <li> <a href={`mailto:${socialDetails.infoEmail}`}> <i className="icon-email"></i> {socialDetails.infoEmail} </a> </li> </ul> <ul className="social_media_links"> <li> <a href={socialDetails.facebookLink} target="_blank" className="btn btn-primary btn-wh-30 br-6 me-3" > <i className="fab fa-facebook-f"></i> </a> </li> <li> <a href={socialDetails.twitterLink} target="_blank" className="btn btn-primary btn-wh-30 br-6 me-3" > <i className="fab fa-twitter"></i> </a> </li> <li> <a href={socialDetails.linkedinLink} target="_blank" className="btn btn-primary btn-wh-30 br-6 me-3" > <i className="fab fa-linkedin-in"></i> </a> </li> <li> <a href={socialDetails.instagramLink} target="_blank" className="btn btn-primary btn-wh-30 br-6 " > <i className="fab fa-instagram"></i> </a> </li> </ul> </Col> </Row> </Container> </div> <div className="footer_bottom"> <Container> <div className="d-flex justify-content-between"> <p> Copyright © {new Date().getFullYear()} {APP_NAME} </p> <ul className="d-flex align-items-center"> <li> <Link href="/terms-of-use">Terms of Use</Link> </li> <li> <Link href="/privacy-policy">Privacy Policy</Link> </li> <li> <Link href="/subscription-policy">Subscription Policy</Link> </li> </ul> </div> </Container> </div> </footer> </> ); } export default AppFooter;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/CustomDatePicker.js
import { LocalizationProvider } from '@mui/x-date-pickers/LocalizationProvider'; import { AdapterMoment } from '@mui/x-date-pickers/AdapterMoment'; import { ThemeProvider, createTheme } from '@mui/material/styles'; import { DatePicker } from '@mui/x-date-pickers/DatePicker'; import { MobileDatePicker } from '@mui/x-date-pickers/MobileDatePicker'; import { useState } from 'react'; const darkTheme = createTheme({ palette: { mode: 'dark', }, }); function CustomDatePicker(props) { const [open, setOpen] = useState(false); return ( <ThemeProvider theme={darkTheme}> <LocalizationProvider dateAdapter={AdapterMoment}> {props.responsive ? ( <DatePicker inputFormat="DD MMM 'YY" disableFuture={props.disableFutureDates} disablePast={props.disablePastDates} label="" openTo="day" views={['year', 'month', 'day']} open={open} onOpen={() => setOpen(true)} onClose={() => setOpen(false)} closeOnSelect={true} value={props.selectedDate} onChange={props.handleOnChange} renderInput={({ inputRef, inputProps, InputProps }) => ( <> <input ref={inputRef} {...inputProps} className="form-control mw-100" onClick={(e) => setOpen(true)} onKeyDown={(e) => e.preventDefault()} /> </> )} /> ) : ( <MobileDatePicker inputFormat="DD MMM 'YY" disableFuture={props.disableFutureDates} disablePast={props.disablePastDates} label="" openTo="day" views={['year', 'month', 'day']} open={open} onOpen={() => setOpen(true)} onClose={() => setOpen(false)} closeOnSelect={true} value={props.selectedDate} onChange={props.handleOnChange} renderInput={({ inputRef, inputProps, InputProps }) => ( <> <input ref={inputRef} {...inputProps} className="form-control mw-100" onClick={(e) => setOpen(true)} onKeyDown={(e) => e.preventDefault()} /> </> )} /> )} </LocalizationProvider> </ThemeProvider> ); } export default CustomDatePicker;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/Notifier.js
import { Store } from 'react-notifications-component'; import 'react-notifications-component/dist/theme.css'; class Notifier { // type = success,danger,info,default,warning notify(msg = "", nType = "success", position = "bottom-right", timeout = 5000) { return Store.addNotification({ title: "", message: msg, type: nType, insert: "top", container: position, animationIn: ["animated", "fadeInRight"], animationOut: ["animated", "fadeOutRight"], dismiss: { duration: timeout, pauseOnHover: true, showIcon: true } }); } }; export default Notifier;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/ReplyList.js
import React, { useEffect, useState } from 'react' import API from '../config/endpoints.config' import Rest from '../config/rest.config' import Notifier from './Notifier' import SingleReply from './SingleReply' export default function ReplyList({ commentData, commentId }) { const notifier = new Notifier() const [reply, setReply] = useState(commentData) const [replies, setReplies] = useState() const [page, setPage] = useState(0) const [commId, setCommId] = useState(0) const [count, setCount] = useState('') const handleHideReplies = async (id) => { const formData = { 'commentId': id, "limit": 3, "page": 0, } setPage(0) const response = await Rest.axiosRequest(API.singleCommentReplies, formData, 'POST') if (response.status === 201) { setReply(response.data.data.rows) } else { notifier.notify(response.data.message, "danger"); } } const handleShowReplies = async (id) => { setCommId(id) const formData = { 'commentId': id, "limit": 10, "page": page, } const response = await Rest.axiosRequest(API.singleCommentReplies, formData, 'POST') if (response.status === 201) { setCount(response.data.data.count) var ids = new Set(reply.map(d => d.id)); // var finalReply = [...reply, ...response.data.data.rows.filter(d => !ids.has(d.id))]; setReply([...reply, ...response.data.data.rows.filter(d => !ids.has(d.id))]) setPage(page + 1) } else { notifier.notify(response.data.message, "danger"); } } useEffect(() => { setReply(commentData) }, [commentData]) return ( <div className="timeline-comment"> { reply?.length > 0 && reply.map((replyData, rIndex) => ( <SingleReply key={rIndex} rIndex={rIndex} count={count} reply={reply} handleShowReplies={handleShowReplies} handleHideReplies={handleHideReplies} replyData={replyData} /> )) } </div> ) }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/CompanyList.js
import React, { useEffect, useState } from 'react' import { Button, Figure } from 'react-bootstrap'; import { useDispatch } from 'react-redux'; import { fetchUserById } from '../app/slices/userSlice'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import { ASSETS_URL } from '../config/server.config'; import { getSingle } from '../services/Auth'; import Notifier from './Notifier'; export default function CompanyList({ company, ...props }) { const dispatch = useDispatch(); const noti = new Notifier(); const [followStatus, setFollowStatus] = useState(); useEffect(() => { setFollowStatus(company.length == '1' ? 'Following' : 'Follow') }, [company]); const handleFollow = async () => { let formData = { slug: company.slug, }; let response = await Rest.axiosRequest(API.follow, formData) response = response.data; if (response.status) { const follow = response.data.follow; setFollowStatus(follow ? "Following" : "Follow"); } else { noti.notify(response.message, "danger"); } } useEffect(() => { dispatch(fetchUserById({ userId: getSingle('userId') })) }, [followStatus]) return ( <div className="d-flex justify-content-between align-items-center"> <div className="d-flex align-items-center"> <Figure className="figure figure-circle figure-40 mb-0 me-3"> <img className="cover" src={ASSETS_URL + company.profilePath} alt="profile" /> </Figure> <h4 className="fs-16 fw-500 my-2">{company.businessName}</h4> </div> {getSingle('userId') != company.id && (followStatus == "Following" ? <Button variant="primary" className="btn-rounded btn-wh-130-38 btn-h-30 fs-sm" onClick={handleFollow}><span className="me-2"><i className="icon icon-add-friend"></i></span>Following</Button> : <Button variant="secondary" className="btn-rounded btn-wh-130-38 btn-h-30 fs-sm" onClick={handleFollow}><span className="me-2"><i className="icon icon-add-friend"></i></span>Follow</Button>) } </div> ) }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/ChatSection.js
import { faArrowLeft, faCalendarAlt, faDownload, faPaperclip, faPaperPlane, } from '@fortawesome/free-solid-svg-icons'; import { faClock } from '@fortawesome/free-regular-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Link from 'next/link'; import { useCallback, useEffect, useRef, useState } from 'react'; import { Button, Card, Col, Figure, Form, FormControl, Image, InputGroup, Spinner, } from 'react-bootstrap'; import Scrollbars from 'react-custom-scrollbars'; import { saveAs } from 'file-saver'; import md5 from 'md5'; import { ASSETS_URL, REACT_APP_API_BASE_URL, SOCKET_URL, } from '../config/server.config'; import { getSingle } from '../services/Auth'; import { dateTimeFormat } from '../services/Helper'; import Rest from '../config/rest.config'; import API from '../config/endpoints.config'; import Notifier from './Notifier'; import { useRouter } from 'next/router'; import { io } from 'socket.io-client'; const socket = io(SOCKET_URL); export default function ChatSection(props) { const [selectedUser, setSelectedUser] = useState([]); const [message, setMessage] = useState(''); const [messages, setMessages] = useState([]); const [updateScroll, setUpdateScroll] = useState(false); const [offset, setOffset] = useState(0); const [hasMoreMsgs, setHasMoreMsgs] = useState(true); const [isDisabled, setIsDisabled] = useState(false); const noti = new Notifier(); const msgInputRef = useRef(null); const router = useRouter(); const downloadFile = (filePath) => { saveAs(REACT_APP_API_BASE_URL + '/get/file' + filePath); }; const userRole = getSingle('role'); const userRoleWiseId = getSingle('role') === '2' ? getSingle('currentBrandId') : getSingle('retailerCompanyId'); const sendMessage = async (e) => { e.preventDefault(); const { files } = e.target; let messageData; let isMultipart = false; if (files) { messageData = new FormData(); messageData.append('slug', selectedUser.slug); messageData.append('file', files[0]); isMultipart = true; e.target.value = null; } else { messageData = { slug: selectedUser.slug, message: message, }; isMultipart = false; } if (files || (!files && message)) { setIsDisabled(true); const response = await Rest.axiosRequest( API.messages, messageData, 'POST', isMultipart ); if (response.data.status) { setIsDisabled(false); setMessage(''); setUpdateScroll(!updateScroll); socket.emit('new_message', { sender: md5(response.data.data.fromId), receiver: md5(response.data.data.toId), msgData: response.data.data, }); setMessages([...messages, response.data.data]); setScrollToBottom(); setInputFocus(); } else { noti.notify(response.data.message, 'danger'); router.push(`/brand/${selectedUser?.slug}`); } } }; const getMessages = async (anotherUserSlug) => { const response = await Rest.axiosRequest(API.getMessages, { anotherUserSlug: anotherUserSlug, offset: 0, }); if (response.data.status) { setMessages(response.data.data.messages); setSelectedUser(response?.data?.data?.user); setScrollToBottom(); setInputFocus(); } else { noti.notify(response.data.message, 'danger'); router.push(`/messages`); } }; const getPreviousMessages = async (anotherUserSlug) => { if (hasMoreMsgs) { const response = await Rest.axiosRequest(API.getMessages, { anotherUserSlug: anotherUserSlug, offset: offset, }); if (response.data.status) { if (response.data.data.messages.length > 0) { setMessages([...response.data.data.messages, ...messages]); // if (props.scrollbarRefrence.current) { // props.scrollbarRefrence.current.scrollTop(50) // } } else { setHasMoreMsgs(false); } } else { noti.notify(response.data.message, 'danger'); } } }; useEffect(() => { socket.emit('joinRoom', { username: md5(parseInt(userRoleWiseId)), }); return () => { setMessages([]); setSelectedUser([]); setMessage(''); }; }, []); useEffect(() => { socket.on('new_message', function (data) { if (selectedUser) { if (md5(parseInt(selectedUser.id)) === data.sender) { setMessages((messages) => [...messages, data.msgData]); if (props.scrollbarRefrence.current) { props.scrollbarRefrence.current.scrollToBottom(); } } } }); return () => { socket.off('new_message'); }; }, [socket, selectedUser]); useEffect(() => { if (props.activeChat !== '') { getMessages(props.activeChat); setHasMoreMsgs(true); setOffset(0); } return () => { setMessages([]); setSelectedUser([]); setMessage(''); }; }, [props.activeChat]); // useEffect(() => { // // setMessages([...messages, ...props.messages]) // // setMessages([...messages, props.messages]) // // console.log("[...props.messages]", [...props.messages]); // setMessages([...props.messages]); // setHasMoreMsgs(true); // setOffset(0); // // }, [messages]) // }, [props.messages]) useEffect(() => { if (selectedUser !== undefined && offset !== 0) { getPreviousMessages(selectedUser.slug); } }, [offset]); const setScrollToBottom = () => { if (props.scrollbarRefrence.current) { props.scrollbarRefrence.current.scrollToBottom(); } }; const setInputFocus = () => { if (msgInputRef.current) { msgInputRef.current.focus(); } }; const handleOffset = async (scrollValue) => { if (scrollValue.top === 0) { setOffset((offset) => offset + 1); } }; return ( <Col lg={8} className={ props.isOpen ? 'card_chat_box mob_view' : 'card_chat_box close' } > <Card className='br-0 bg-color-282828 bs-none border-0'> {Object.keys(selectedUser)?.length ? ( <> <Card.Header className='px-3'> <div className='d-flex align-items-center'> <Link href=''> <a className='d-lg-none d-block fs-20 color-white me-3' onClick={props.toggleChat} > <FontAwesomeIcon icon={faArrowLeft} /> </a> </Link> <Figure className='user_profile me-3 mb-0'> <Image src={ASSETS_URL + selectedUser?.profilePath} className='cover' /> </Figure> <div> <Link href={`/customer/${selectedUser?.slug}`}> <a> <h3 className='fs-16 my-2 color-f3772c'> {userRole === '2' ? selectedUser?.companyName : selectedUser?.brandName} </h3> </a> </Link> </div> </div> </Card.Header> <Card.Body> {messages?.length > 0 && Object.keys(selectedUser).length > 0 ? ( <Scrollbars style={{ height: 400 }} ref={props.scrollbarRefrence} onScrollFrame={(value) => handleOffset(value)} className='custom-scroll' > <div className='pe-3'> {messages.map((message, index) => { return message.fromId === parseInt(userRoleWiseId) ? ( <div className='send_msg mb-3' key={message.id}> <div> <div className='msgbox'> {message.attachment == 1 ? ( <a onClick={() => downloadFile(message.message)} className='d-flex align-items-center text-white text-start' > <text className='fs-35 me-2 text-white'> <i className='fas fa-file-download'></i> </text> <div> <p>{message.fileType.toUpperCase()}</p> <span className='fs-16 text-white'> {message.fileSize} </span> </div> </a> ) : ( <p>{message.message}</p> )} </div> <span> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {dateTimeFormat( message.createdAt, 'MMMM DD, YYYY' )}{' '} &nbsp;&nbsp; <FontAwesomeIcon icon={faClock} />{' '} {dateTimeFormat(message.createdAt, 'h:mm a')} </span> </div> </div> ) : ( <div className='received_msg mb-3' key={message.id}> <div className='d-flex'> <Figure className='user_profile me-3 mb-0'> <Image src={ASSETS_URL + selectedUser?.profilePath} className='cover' /> </Figure> <div> <div className='msgbox'> {message.attachment == 1 ? ( <a onClick={() => downloadFile(message.message) } className='d-flex align-items-center text-white' > <text className='fs-35 me-2 text-white'> <i className='fas fa-file-download'></i> </text> <div> <p>{message.fileType.toUpperCase()}</p> <span className='fs-16 text-white'> {message.fileSize} </span> </div> </a> ) : ( <p>{message.message}</p> )} </div> <span> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {dateTimeFormat( message.createdAt, 'MMMM DD, YYYY' )}{' '} &nbsp;&nbsp; <FontAwesomeIcon icon={faClock} />{' '} {dateTimeFormat(message.createdAt, 'hh:mm A')} </span> </div> </div> </div> ); })} </div> </Scrollbars> ) : null} </Card.Body> <Card.Footer className='p-3'> <Form className='message_sent_form d-flex' onSubmit={sendMessage}> <InputGroup> <FormControl placeholder='Type here...' aria-label='Type here...' aria-describedby='basic-addon2' onChange={(e) => setMessage(e.target.value)} value={message} disabled={isDisabled} ref={msgInputRef} /> <Button type='submit' variant='primary' id='button-addon2' className='br-6' disabled={isDisabled} > <FontAwesomeIcon icon={faPaperPlane} /> </Button> </InputGroup> <Button variant='outline-primary' id='file-attachment' className='br-10 btn-wh-40 ms-3 file-attachment' disabled={isDisabled} > <FormControl onChange={(e) => sendMessage(e)} type='file' placeholder='Select File' /> <FontAwesomeIcon icon={faPaperclip} /> </Button> </Form> </Card.Footer> </> ) : null} </Card> </Col> ); }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/RepostModal.js
import React, { useEffect, useRef, useState } from 'react'; import { Button, Figure, ListGroup, Modal } from 'react-bootstrap'; import InfiniteScroll from 'react-infinite-scroll-component'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { ASSETS_URL } from '../config/server.config'; import FollowingListItem from './FollowingListItem'; import FollowerListItem from './FollowerListItem'; const baseColor = '#202020'; const highlightColor = '#444'; const RepostModal = ({ show, hide, reposts, repostsCount, fetchMoreReposts, ...props }) => { return ( <Modal show={false} onHide={hide} className='modal-dark custom-modal' centered scrollable={true} > <Modal.Header closeButton> <Modal.Title>{repostsCount} Reposts</Modal.Title> </Modal.Header> <Modal.Body id='scrollableDiv'> <ListGroup variant='flush' className='list-dark'> <InfiniteScroll dataLength={reposts?.length} next={() => fetchMoreReposts()} hasMore={repostsCount > reposts?.length ? true : false} loader={[...Array(10)].map((arrayData, index) => { return ( <div key={index + 'skeleton'} className='d-flex justify-content-between align-items-center px-3 list-group-item' > <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <div className='d-flex align-items-center'> <Skeleton circle={true} height={40} width={40} className='mb-0 me-3' /> <Skeleton width={200} height={20} /> </div> <Skeleton width={120} height={30} className='me-2' /> </SkeletonTheme> </div> ); })} scrollableTarget='scrollableDiv' > {reposts?.length > 0 ? ( reposts.map((repost, index) => { return ( <ListGroup.Item key={index}> <FollowerListItem key={index} follower={{ followerUser: repost.user }} /> </ListGroup.Item> ); }) ) : ( <div className='d-flex justify-content-center align-items-center fs-16 fw-500 p-2'> No records found! </div> )} </InfiniteScroll> </ListGroup> </Modal.Body> </Modal> ); }; export default RepostModal;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/FavouriteBtn.js
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSquare, faSquareCheck } from '@fortawesome/free-regular-svg-icons'; import { OverlayTrigger, Tooltip } from 'react-bootstrap'; import { useState } from 'react'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import Notifier from './Notifier'; function FavouriteBtn(props) { const noti = new Notifier(); const [checked, setChecked] = useState(props.isFavourite); const handleFavourite = async (slug) => { const response = await Rest.axiosRequest( API.addToFavourite + '/' + slug, {} ); if (response.data.status) { setChecked(!checked); noti.notify(response.data.message, 'success'); } else { noti.notify(response.data.message, 'danger'); } }; const Favourites = (props) => ( <Tooltip {...props}>Add/Remove Favourite</Tooltip> ); return ( <> <OverlayTrigger placement="top" delay={{ show: 250, hide: 400 }} overlay={Favourites} > <a className="action-btn color-22a612 fs-16" onClick={() => handleFavourite(props.productSlug)} > <FontAwesomeIcon icon={checked ? faSquareCheck : faSquare} /> </a> </OverlayTrigger> </> ); } export default FavouriteBtn;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/CartItem.js
import { useRef, useState } from 'react'; import { Card, Col, Form, Row } from 'react-bootstrap'; import { useDispatch } from 'react-redux'; import { fetchCartProducts, removeFromCart, updateItemQuantity, } from '../app/slices/cartSlice'; function CartItem({ product }) { const [isLoading, setIsLoading] = useState(false); const dispatch = useDispatch(); const quantityRef = useRef(null); // ref => { current: null } const isInt = (n) => { if (n.length == 0) { return false; } return !isNaN(n % 1) && n % 1 == 0; }; const handleUpdateQuantity = async ({ cartId, action, quantity, currentProductQuantity, }) => { // if ( // (action === 'manual' && // quantity >= 1 && // quantity <= 99999 && // isInt(quantity)) || // (action === 'decrement' && currentProductQuantity >= 1) || // (action === 'increment' && currentProductQuantity < 99999) // ) { if ( (action === 'manual' && quantity <= 99999) || (action === 'decrement' && currentProductQuantity >= 1) || (action === 'increment' && currentProductQuantity < 99999) ) { setIsLoading(true); await dispatch(updateItemQuantity({ cartId, action, quantity })).then( () => { dispatch(fetchCartProducts()); } ); setIsLoading(false); quantityRef.current?.focus(); } }; return ( <Card className='card-dark bs-none mb-4' key={product.id}> <Card.Body> <Row> <Col> <h3 className='fs-22 fw-600 color-22a612'> {product?.product?.title} </h3> <h4 className='fs-16 fw-600 color-dcdcdc'> {product?.product?.category?.title} </h4> <div className='d-flex align-items-center'> <label className='form-label my-1 me-3'>Brand:</label> <div className='color-dcdcdc my-1'> {product?.product?.brand?.brandName} </div> </div> <div className='d-flex align-items-center'> <label className='form-label my-1 me-3'>Units per Package:</label> <div className='color-dcdcdc my-1'> {product?.product?.unitPerPackage} </div> </div> <div className='d-flex align-items-center'> <label className='form-label my-1 me-3'>Price Per Package:</label> <div className='color-dcdcdc my-1'> {product?.product?.productPrice} </div> </div> <div className='d-flex align-items-center'> <label className='form-label my-1 me-3'>Qty :</label> <a className={`action-btn color-dcdcdc me-2 ${ product.quantity <= 1 || isLoading ? 'disabled' : '' }`} onClick={() => handleUpdateQuantity({ cartId: product.id, action: 'decrement', quantity: -1, currentProductQuantity: product.quantity, }) } > <i className='fas fa-minus'></i> </a> <div className='color-dcdcdc my-1 fw-600 form-dark'> <input className='form-control form-control-sm maxw-100' type='number' min={1} max={99999} value={product.quantity} ref={quantityRef} onChange={(e) => handleUpdateQuantity({ cartId: product.id, action: 'manual', quantity: e.target.value, currentProductQuantity: product.quantity, }) } disabled={isLoading ? true : false} /> </div> <a className={`action-btn color-dcdcdc ms-2 ${ product.quantity >= 99999 || isLoading ? 'disabled' : '' }`} onClick={() => handleUpdateQuantity({ cartId: product.id, action: 'increment', quantity: 1, currentProductQuantity: product.quantity, }) } > <i className='fas fa-plus'></i> </a> </div> {/* {product?.discountAmount > 0 && ( <> <div className="d-flex align-items-center"> <label className="form-label my-1 me-3">Total:</label> <div className="color-dcdcdc my-1">{`$ ${product?.total}`}</div> </div> <div className="d-flex align-items-center"> <label className="form-label my-1 me-3"> Discount Amount: </label> <div className="color-dcdcdc my-1"> {`$ ${product?.discountAmount}`} </div> </div> </> )} <div className="d-flex align-items-center"> <label className="form-label my-1 me-3">Line Total:</label> <div className="color-dcdcdc my-1"> {`$ ${product?.lineTotal}`} </div> </div> */} </Col> <Col sm='auto'> <a className={`action-btn color-dcdcdc ${ isLoading ? 'disabled' : '' }`} onClick={() => dispatch(removeFromCart(product.id))} > <i className='fas fa-trash-alt'></i> </a> </Col> </Row> </Card.Body> </Card> ); } export default CartItem;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/UsersList.js
import { faPaperclip } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Link from 'next/link'; import { Badge, Card, Figure, Image } from 'react-bootstrap'; import Scrollbars from 'react-custom-scrollbars'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { ASSETS_URL } from '../config/server.config'; import { getSingle } from '../services/Auth'; import { _userNameFields, dateTimeFormat, Helper } from '../services/Helper'; import { SkeletonOptions } from '../services/SkeletonOptions'; export default function UserList(props) { const userRole = getSingle('role'); const userRoleWiseId = getSingle('role') === '2' ? getSingle('currentBrandId') : getSingle('retailerCompanyId'); return ( <Card.Body className='p-0'> <Scrollbars style={{ height: 520 }} universal={true}> <ul className='nav user_chat_list pe-1'> {props.showSkeleton ? [...Array(5)].map((val, index) => { return ( <li key={index}> <a> <div className='d-flex align-items-center w-100'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton circle={true} height={50} width={50} className='me-2' /> </SkeletonTheme> <div className='w-100'> <h3 className='fs-16 mb-1'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={300} /> </SkeletonTheme> </h3> <p className='fs-14 mb-0 color-dcdcdc'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={200} /> </SkeletonTheme> </p> </div> </div> </a> </li> ); }) : props.chatList.length ? props.chatList.map((chat, index) => { const messageRole = _userNameFields(chat?.role); let user; if (chat?.fromId === parseInt(userRoleWiseId)) { user = messageRole[1]; } else { user = messageRole[0]; } return ( <li key={'chat-' + index} className={ props.activeChat === chat[user]['slug'] ? 'active pointer-not-allowed' : '' } > {/* <a onClick={() => props.getMessages(chat[user]['slug'])}> */} <a onClick={() => props.updateOpenChat(chat[user]['slug'])}> <div className='d-flex align-items-center w-100'> <Figure className='user_profile me-2'> <Image src={ASSETS_URL + chat[user]['profilePath']} className='cover' /> </Figure> <div className='w-100'> {chat.unreadCount ? ( <Badge>{chat.unreadCount}</Badge> ) : null} <h3 className='fs-16 mb-1'> {userRole === '2' ? chat[user]['companyName'] : chat[user]['brandName']} </h3> <p className='fs-14 mb-0 color-dcdcdc'> {chat.isAttachment === '1' ? ( <> <FontAwesomeIcon icon={faPaperclip} />{' '} Attachment </> ) : ( Helper.niceString(chat.message, 45) )} </p> <span className='fs-14 float-end color-dcdcdc'> {dateTimeFormat(chat.lastMsgTime, 'h:mm a')} </span> </div> </div> </a> </li> ); }) : null} </ul> </Scrollbars> </Card.Body> ); }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/components/CustomLadda.js
import { Component } from 'react'; import { Spinner } from 'react-bootstrap'; import Swal from 'sweetalert2'; export class CustomLadda extends Component { constructor(props) { super(props); this.state = { loading: false }; this.toggle = this.toggle.bind(this); } toggle() { Swal.fire({ // customClass: { // confirmButton: 'btn btn-primary br-30', // cancelButton: 'btn btn-danger br-30' // }, title: 'Are you sure?', text: '', icon: 'warning', showCancelButton: true, confirmButtonColor: '#22a612', cancelButtonColor: '#d93737', confirmButtonText: 'Yes, confirm!', customClass: { popup: 'swal2-dark', }, }).then(async (result) => { if (result.isConfirmed) { this.setState({ loading: !this.state.loading, }); this.props.onClick(); } }); } render() { return ( <a className={ this.props.className + (this.props.disabled ? ' disabled' : '') } onClick={this.state.loading ? null : this.toggle} > {/* {this.state.loading ? ( <Spinner animation='border' size='sm' /> ) : ( this.props.children )} */} {this.props.children} </a> ); } }
0
/content/gmx-projects/gmx-admin/frontend/components/modal
/content/gmx-projects/gmx-admin/frontend/components/modal/company/AddBrand.js
import React, { useEffect, useRef, useState } from 'react'; /* global google */ import { faAngleRight, faLocation } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Button, Col, Form, Modal, Row, Spinner } from 'react-bootstrap'; import 'react-datetime/css/react-datetime.css'; import { useDispatch } from 'react-redux'; import { fetchCompanies } from '../../../app/slices/companySlice'; import API from '../../../config/endpoints.config'; import Rest from '../../../config/rest.config'; import { getSingle } from '../../../services/Auth'; import FormValidator from '../../FormValidator'; import Notifier from '../../Notifier'; function AddBrand(props) { const dispatch = useDispatch(); const noti = new Notifier(); const locationRef = useRef(null); const brandLocationRef = useRef(null); const validationHandler = () => { const validationArr = [ { field: 'brandName', method: 'isEmpty', validWhen: false, message: 'Please enter brand name.', }, ]; return validationArr; }; const validator = new FormValidator(validationHandler()); const [state, setState] = useState({ /* ---- Brand Field ---- */ brandName: '', year: '', website: '', profileDocument: '', description: '', avgProductRating: '', reviewsProductCount: '', avgDOTRating: '', reviewsDOTCount: '', avgGeneralRating: '', reviewsGeneralCount: '', avgRating: '', }); const [showLoading, setShowLoading] = useState(false); const [submitted, setSubmitted] = useState(false); const [validation, setValidation] = useState(validator.valid()); const handleCloseModal = () => { props?.closeModal(); }; const logoHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if (fileCheck && fileCheck.length > 0) { setState((prevState) => ({ ...prevState, profileDocument: event.target.files[0], })); } else { event.target.value = null; setState((prevState) => ({ ...prevState, profileDocument: '' })); noti.notify('Please upload Image file only.', 'danger'); } } }; const onChangeHandler = async (event) => { const { name, value } = event.target; if (name === 'zipCode' && value < 1) { return; } setState((prevState) => ({ ...prevState, [name]: name === 'password' || name === 'confirmPassword' ? value.trim() : value, })); }; const handleSubmit = async () => { const validation = validator.validate(state); setValidation(validation); setSubmitted(true); if (validation.isValid) { let formData = new FormData(); /* ----- brand ----- */ formData.append('company', props?.modal?.company); formData.append('brandName', state.brandName); formData.append('year', state.year); formData.append('website', state.website); formData.append('profileDocument', state.profileDocument); formData.append('description', state.description); setShowLoading(true); const jsonResponse = await Rest.axiosRequest( `${API.companies}/add-brand`, formData, 'POST', true, getSingle('token') ); const response = jsonResponse; if (response.status === 201) { setShowLoading(false); handleCloseModal(); dispatch(fetchCompanies()); noti.notify('Brand has been successfully added.', 'success'); } else { setShowLoading(false); noti.notify(response.data.message, 'danger'); } } }; useEffect(async () => { const autoCompleteAddress = new google.maps.places.Autocomplete( document.getElementById('address'), { componentRestrictions: { country: ['US'] } } ); google.maps.event.addListener( autoCompleteAddress, 'place_changed', function () { setState((prevState) => ({ ...prevState, address: locationRef.current.value, })); } ); }, []); let checkValidation = submitted ? validator.validate(state) : validation; return ( <> <Modal show={props?.modal?.open} onHide={handleCloseModal} centered className='modal-dark modal-medium' > <Modal.Header closeButton> <Modal.Title>Add Brand</Modal.Title> </Modal.Header> <Modal.Body> <h3 className='fs-18 fw-700 color-dcdcdc mb-14'>Brand Details</h3> <Form className='form-dark modal-medium'> <Row> <Col md={6}> <Form.Group className='mb-20'> <Form.Label>Brand Name</Form.Label> <Form.Control type='text' placeholder='Enter Brand Name' name='brandName' onChange={onChangeHandler} /> <div className={ checkValidation.brandName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.brandName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label> Brand Establish Year<span>(optional)</span> </Form.Label> <Form.Control type='number' name='year' onChange={onChangeHandler} placeholder='Enter Brand Establish Year' min='0' /> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label> Website<span>(optional)</span> </Form.Label> <Form.Control type='text' name='website' onChange={onChangeHandler} placeholder='Enter Website' /> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-20'> <Form.Label> Logo<span>(optional)</span> </Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*' name='profileDocument' className='uploadImg' id='document_upload' onChange={(e) => logoHandler(e)} /> <div className='my-3'>{state.profileDocument.name}</div> </div> </Form.Group> </Col> <Col md={12}> <Form.Group className='mb-4'> <Form.Label> Description<span>(optional)</span> </Form.Label> <Form.Control as='textarea' name='description' onChange={onChangeHandler} placeholder='Enter Description' style={{ height: '100px' }} /> </Form.Group> </Col> </Row> <Row> <Col md={12}> <div className='d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap'> <Button variant='secondary' type='button' className='btn btn-wh-160-54 btn-rounded btn-secondary btn-right-icons m-10' onClick={handleCloseModal} > Cancel <span> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> <Button variant='primary' className='btn-wh-150-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? handleSubmit : null} disabled={showLoading} > {showLoading ? <Spinner animation='border' /> : 'Save'} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </Col> <Col md={12}> {!checkValidation.isValid ? ( <div className='error text-center'> You have missed to provide details for some mandatory fields </div> ) : null} </Col> </Row> </Form> </Modal.Body> </Modal> </> ); } export default AddBrand;
0
/content/gmx-projects/gmx-admin/frontend/components/modal
/content/gmx-projects/gmx-admin/frontend/components/modal/company/AddCompany.js
import React, { useEffect, useRef, useState } from 'react'; import InputMask from 'react-input-mask'; /* global google */ import { faAngleRight, faLocation } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Button, Col, Form, Modal, Row, Spinner } from 'react-bootstrap'; import 'react-datetime/css/react-datetime.css'; import Select from 'react-select'; import CustomDatePicker from '../../../components/CustomDatePicker'; import { DropdownIndicator, react_select_lg_Styles_light, } from '../../../components/DropDown'; import FormValidator from '../../../components/FormValidator'; import Notifier from '../../../components/Notifier'; import API from '../../../config/endpoints.config'; import Rest from '../../../config/rest.config'; import { getSingle } from '../../../services/Auth'; import { useDispatch } from 'react-redux'; import { fetchCompanies } from '../../../app/slices/companySlice'; function AddCompany(props) { const dispatch = useDispatch(); const noti = new Notifier(); const locationRef = useRef(null); const brandLocationRef = useRef(null); const medRecCertificateMatch = (confirmation, state) => { if ( (state.medRecId === 3 && state.medCertificatePath !== '' && state.recCertificatePath !== '') || ((state.medRecId === 1 || state.medRecId === 2) && state.medRecCertificatePath !== '') ) { return false; } else { return true; } }; const validationHandler = () => { const validationArr = [ { field: 'companyName', method: 'isEmpty', validWhen: false, message: 'Please enter company name.', }, { field: 'medRecId', method: 'isEmpty', validWhen: false, message: 'Please enter license type.', }, { field: 'licenseNumber', method: 'isEmpty', validWhen: false, message: 'Please enter license number.', }, { field: 'licenseExpirationDate', method: 'isEmpty', validWhen: false, message: 'Please enter license expire date.', }, { field: 'medRecCertificatePath', method: medRecCertificateMatch, validWhen: false, message: 'Please upload license document.', }, { field: 'resaleLicensePath', method: 'isEmpty', validWhen: false, message: 'Please upload resale license document.', }, { field: 'address', method: 'isEmpty', validWhen: false, message: 'Please enter address.', }, { field: 'selectedState', method: 'isEmpty', validWhen: false, message: 'Please select state.', }, { field: 'zipCode', method: 'isEmpty', validWhen: false, message: 'Please enter zip code.', }, { field: 'zipCode', method: 'isLength', args: [5, 5], validWhen: true, message: 'Zipcode should be 5 characters long.', }, { field: 'phoneNumber', method: 'isEmpty', validWhen: false, message: 'Please enter phone number.', }, { field: 'phoneNumber', method: 'isLength', args: [10, 10], validWhen: true, message: 'Store number should comprise ten digits.', }, { field: 'brandName', method: 'isEmpty', validWhen: false, message: 'Please enter brand name.', }, { field: 'description', method: 'isEmpty', validWhen: false, message: 'Please enter description.', }, ]; return validationArr; }; const validator = new FormValidator(validationHandler()); const [state, setState] = useState({ /* ---- Company Field ---- */ companyName: '', medRecId: '', medRecTitle: '', licenseNumber: '', licenseExpirationDate: '', medCertificatePath: '', recCertificatePath: '', medRecCertificatePath: '', resaleLicensePath: '', address: '', selectedState: '', zipCode: '', phoneNumber: '', /* ---- Brand Field ---- */ brandName: '', year: '', website: '', profileDocument: '', description: '', avgProductRating: '', reviewsProductCount: '', avgDOTRating: '', reviewsDOTCount: '', avgGeneralRating: '', reviewsGeneralCount: '', avgRating: '', }); const [showLoading, setShowLoading] = useState(false); const [submitted, setSubmitted] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [states, setStates] = useState([]); const [medRecs, setMedRecs] = useState([]); const handleCloseModal = () => { props?.closeModal(); }; const handleChangeSelectState = (val) => { if (val) { setState((prevState) => ({ ...prevState, selectedState: val.value })); } else { setState((prevState) => ({ ...prevState, selectedState: '' })); } }; const handleChangeSelectLicenseType = (val) => { if (val) { setState((prevState) => ({ ...prevState, medRecId: val.value })); setState((prevState) => ({ ...prevState, medRecTitle: val.label })); } else { setState((prevState) => ({ ...prevState, medRecId: '' })); setState((prevState) => ({ ...prevState, medRecTitle: '' })); } }; const handleChangeDate = (date) => { setState((prevState) => ({ ...prevState, licenseExpirationDate: date.format('YYYY-MM-DD'), })); }; const medRecDocumentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setState((prevState) => ({ ...prevState, medRecCertificatePath: event.target.files[0], })); } else { event.target.value = null; setState((prevState) => ({ ...prevState, medRecCertificatePath: '' })); noti.notify('Please upload Image or PDF file only.', 'danger'); } } }; const resaledocumentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setState((prevState) => ({ ...prevState, resaleLicensePath: event.target.files[0], })); } else { event.target.value = null; setState((prevState) => ({ ...prevState, resaleLicensePath: '' })); notifier.notify('Please upload Image or PDF file only.', 'danger'); } } }; const logoHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if (fileCheck && fileCheck.length > 0) { setState((prevState) => ({ ...prevState, profileDocument: event.target.files[0], })); } else { event.target.value = null; setState((prevState) => ({ ...prevState, profileDocument: '' })); noti.notify('Please upload Image file only.', 'danger'); } } }; const onChangeHandler = async (event) => { const { name, value } = event.target; if (name === 'zipCode' && value < 1) { return; } setState((prevState) => ({ ...prevState, [name]: name === 'password' || name === 'confirmPassword' ? value.trim() : value, })); }; const handleSubmit = async () => { const validation = validator.validate(state); setValidation(validation); setSubmitted(true); if (validation.isValid) { let formData = new FormData(); /* ----- company ----- */ formData.append('companyName', state.companyName); formData.append('medRecId', state.medRecId); formData.append('licenseNumber', state.licenseNumber); formData.append('licenseExpirationDate', state.licenseExpirationDate); formData.append('medRecCertificatePath', state.medRecCertificatePath); formData.append('medCertificatePath', state.medCertificatePath); formData.append('recCertificatePath', state.recCertificatePath); formData.append('resaleLicensePath', state.resaleLicensePath); formData.append('address', state.address); formData.append('selectedState', state.selectedState); formData.append('zipCode', state.zipCode); formData.append('phoneNumber', state.phoneNumber); /* ----- brand ----- */ formData.append('brandName', state.brandName); formData.append('year', state.year); formData.append('website', state.website); formData.append('profileDocument', state.profileDocument); formData.append('description', state.description); setShowLoading(true); const jsonResponse = await Rest.axiosRequest( API.companies, formData, 'POST', true, getSingle('token') ); const response = jsonResponse; if (response.status === 201) { setShowLoading(false); handleCloseModal(); dispatch(fetchCompanies()); noti.notify( 'Account verification is pending, you will receive a confirmation email if your account is validated.', 'success' ); } else { setShowLoading(false); noti.notify(response.data.message, 'danger'); } } }; useEffect(async () => { const statesData = await Rest.axiosRequest(API.getStates, {}, 'GET'); if (statesData.status === 200) { const states = []; statesData.data.data.map((state) => { states.push({ id: state.id, value: state.id, name: state.name, label: state.name, }); }); setStates(states); } else { noti.notify(statesData.data.message, 'danger'); } const medRecData = await Rest.axiosRequest(API.getMedrec, {}, 'GET'); if (medRecData && medRecData.status === 200) { const medRecs = []; medRecData.data.data.map((medRec) => { medRecs.push({ id: medRec.id, value: medRec.id, name: medRec.title, label: medRec.title, }); }); setMedRecs(medRecs); } else { noti.notify(medRecData.data.message, 'danger'); } const autoCompleteAddress = new google.maps.places.Autocomplete( document.getElementById('address'), { componentRestrictions: { country: ['US'] } } ); google.maps.event.addListener( autoCompleteAddress, 'place_changed', function () { setState((prevState) => ({ ...prevState, address: locationRef.current.value, })); } ); }, []); let checkValidation = submitted ? validator.validate(state) : validation; return ( <> <Modal show={props?.modal} onHide={handleCloseModal} centered className='modal-dark modal-medium' > <Modal.Header closeButton> <Modal.Title>Add Comapny</Modal.Title> </Modal.Header> <Modal.Body> <h3 className='fs-18 fw-700 color-dcdcdc mb-14'>Company Details</h3> <Form className='form-dark'> <Row> <Col md={6}> <Form.Group className='mb-20'> <Form.Label>Company Name</Form.Label> <Form.Control type='text' placeholder='Enter Company Name' name='companyName' onChange={onChangeHandler} /> <div className={ checkValidation.companyName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.companyName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>License Type</Form.Label> <Select classNamePrefix='react-select' styles={react_select_lg_Styles_light} options={medRecs.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectLicenseType(val)} placeholder='Select License Type' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='medRecId' isClearable={true} /> <div className={ checkValidation.medRecId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecId.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>License Number</Form.Label> <Form.Control type='text' name='licenseNumber' onChange={onChangeHandler} placeholder='Enter License Number' /> <div className={ checkValidation.licenseNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>License Expire Date</Form.Label> <CustomDatePicker responsive={true} selectedDate={state.licenseExpirationDate} handleOnChange={(date) => handleChangeDate(date)} disableFutureDates={false} disablePastDates={true} /> <div className={ checkValidation.licenseExpirationDate.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseExpirationDate.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>License Document</Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='medRecCertificate' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' name='medRecCertificate' className='uploadImg' id='medRecCertificate' onChange={(e) => medRecDocumentHandler(e)} /> <div className='my-3'> {state.medRecCertificatePath.name} </div> </div> <div className={ checkValidation.medRecCertificatePath.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecCertificatePath.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>Resale License Document</Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' name='license-upload' className='uploadImg' id='document_upload' onChange={(e) => resaledocumentHandler(e)} /> <div className='my-3'>{state.resaleLicensePath.name}</div> </div> <div className={ checkValidation.resaleLicensePath.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.resaleLicensePath.message} </div> </div> </Form.Group> </Col> <Col md={12}> <Form.Group className='mb-4'> <Form.Label>Address</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type='text' name='address' onChange={onChangeHandler} placeholder='Enter Address' ref={locationRef} id='address' /> <span className='icon'> <FontAwesomeIcon icon={faLocation} /> </span> </div> <div className={ checkValidation.address.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.address.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>State</Form.Label> <Select classNamePrefix='react-select' styles={react_select_lg_Styles_light} options={states.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectState(val)} placeholder='Select State' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='state_id' isClearable={true} /> <div className={ checkValidation.selectedState.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.selectedState.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>Zipcode</Form.Label> <Form.Control type='number' name='zipCode' onChange={onChangeHandler} placeholder='Enter Zip Code' min='1' /> <div className={ checkValidation.zipCode.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.zipCode.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-20'> <Form.Label>Phone Number</Form.Label> <InputMask name='phoneNumber' placeholder='Enter Phone Number' onChange={onChangeHandler} onBlur={onChangeHandler} maskChar={null} className='form-control' mask='9999999999' /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.phoneNumber.message} </div> </div> </Form.Group> </Col> <Col md={12}> <h3 className='fs-18 fw-700 color-dcdcdc mb-17 mt-13 '> Brand Details </h3> </Col> <Col md={6}> <Form.Group className='mb-20'> <Form.Label>Brand Name</Form.Label> <Form.Control type='text' placeholder='Enter Brand Name' name='brandName' onChange={onChangeHandler} /> <div className={ checkValidation.brandName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.brandName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label> Brand Establish Year<span>(optional)</span> </Form.Label> <Form.Control type='number' name='year' onChange={onChangeHandler} placeholder='Enter Brand Establish Year' min='0' /> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label> Website<span>(optional)</span> </Form.Label> <Form.Control type='text' name='website' onChange={onChangeHandler} placeholder='Enter Website' /> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-20'> <Form.Label> Logo<span>(optional)</span> </Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*' name='profileDocument' className='uploadImg' id='document_upload' onChange={(e) => logoHandler(e)} /> <div className='my-3'>{state.profileDocument.name}</div> </div> </Form.Group> </Col> <Col md={12}> <Form.Group className='mb-4'> <Form.Label>Description</Form.Label> <Form.Control as='textarea' name='description' onChange={onChangeHandler} placeholder='Enter Description' style={{ height: '100px' }} /> <div className={ checkValidation.description.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.description.message} </div> </div> </Form.Group> </Col> </Row> <Row> <Col md={12}> <div className='d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap'> <Button variant='secondary' type='button' className='btn btn-wh-160-54 btn-rounded btn-secondary btn-right-icons m-10' onClick={handleCloseModal} > Cancel <span> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> <Button variant='primary' className='btn-wh-150-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? handleSubmit : null} disabled={showLoading} > {showLoading ? <Spinner animation='border' /> : 'Save'} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </Col> <Col md={12}> {!checkValidation.isValid ? ( <div className='error text-center'> You have missed to provide details for some mandatory fields </div> ) : null} </Col> </Row> </Form> </Modal.Body> </Modal> </> ); } export default AddCompany;
0
/content/gmx-projects/gmx-admin/frontend/components/modal
/content/gmx-projects/gmx-admin/frontend/components/modal/stores/Add.js
import { faAngleRight, faLocation } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Link from 'next/link'; import { useRouter } from 'next/router'; import React, { useEffect, useRef, useState } from 'react'; import InputMask from 'react-input-mask'; import { Button, Card, Col, Container, Form, Modal, Row, Spinner, } from 'react-bootstrap'; import 'react-dropzone-uploader/dist/styles.css'; import Select from 'react-select'; import CustomDatePicker from '../../../components/CustomDatePicker'; import { DropdownIndicator, react_select_lg_Styles, } from '../../../components/DropDown'; import FormValidator from '../../../components/FormValidator'; import Meta from '../../../components/Meta'; import Notifier from '../../../components/Notifier'; import API from '../../../config/endpoints.config'; import Rest from '../../../config/rest.config'; import { APP_NAME } from '../../../config/server.config'; import { useDispatch } from 'react-redux'; import { fetchStores } from '../../../app/slices/cartSlice'; const Add = (props) => { const dispatch = useDispatch(); const router = useRouter(); const noti = new Notifier(); const locationRef = useRef(null); const validator = new FormValidator([ { field: 'managerName', method: 'isEmpty', validWhen: false, message: 'Please enter store name.', }, { field: 'address', method: 'isEmpty', validWhen: false, message: 'Please enter address.', }, { field: 'stateId', method: 'isEmpty', validWhen: false, message: 'Please select state.', }, { field: 'zipCode', method: 'isEmpty', validWhen: false, message: 'Please enter zip code.', }, { field: 'zipCode', method: 'isLength', args: [5, 5], validWhen: true, message: 'Zipcode should be 5 characters long.', }, { field: 'phoneNumber', method: 'isEmpty', validWhen: false, message: 'Please enter phone number.', }, { field: 'phoneNumber', method: 'isLength', args: [10, 10], validWhen: true, message: 'Store number should comprise ten digits.', }, { field: 'licenseNumber', method: 'isEmpty', validWhen: false, message: 'Please enter license number.', }, { field: 'licenseExpirationDate', method: 'isEmpty', validWhen: false, message: 'Please enter license expire date.', }, { field: 'medRecCertificatePath', method: 'isEmpty', validWhen: false, message: 'Please upload license document.', }, { field: 'resaleLicensePath', method: 'isEmpty', validWhen: false, message: 'Please upload resale license document.', }, ]); const [storeData, setStoreData] = useState({ managerName: '', address: '', stateId: '', zipCode: '', phoneNumber: '', licenseNumber: '', licenseExpirationDate: '', medRecCertificatePath: '', resaleLicensePath: '', isDefault: false, }); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const [states, setStates] = useState([]); const handleCloseModal = () => { props?.closeModal(); }; const handleChangeSelectState = (val) => { if (val) { setStoreData((prevState) => ({ ...prevState, stateId: val.value })); } else { setStoreData((prevState) => ({ ...prevState, stateId: '' })); } }; const handleChangeDate = (date) => { setStoreData((prevState) => ({ ...prevState, licenseExpirationDate: date.format('YYYY-MM-DD'), })); }; const medRecDocumentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setStoreData((prevState) => ({ ...prevState, medRecCertificatePath: event.target.files[0], })); } else { event.target.value = null; setStoreData((prevState) => ({ ...prevState, medRecCertificatePath: '', })); noti.notify('Please upload Image or PDF file only.', 'danger'); } } }; const resaledocumentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setStoreData((prevState) => ({ ...prevState, resaleLicensePath: event.target.files[0], })); } else { event.target.value = null; setStoreData((prevState) => ({ ...prevState, resaleLicensePath: '' })); notifier.notify('Please upload Image or PDF file only.', 'danger'); } } }; const handleChange = (event) => { const { name, value } = event.target; setStoreData((prevState) => ({ ...prevState, [name]: value })); }; const handleSubmit = async (e) => { e.preventDefault(); const validation = validator.validate(storeData); setValidation(validation); setSubmitted(true); if (validation.isValid) { let formData = new FormData(); formData.append('managerName', storeData.managerName); formData.append('address', storeData.address); formData.append('stateId', storeData.stateId); formData.append('zipCode', storeData.zipCode); formData.append('phoneNumber', storeData.phoneNumber); formData.append('licenseNumber', storeData.licenseNumber); formData.append('licenseExpirationDate', storeData.licenseExpirationDate); formData.append('medRecCertificatePath', storeData.medRecCertificatePath); formData.append('resaleLicensePath', storeData.resaleLicensePath); formData.append('isDefault', storeData.isDefault); setShowLoading(true); let response; response = await Rest.axiosRequest(API.stores, formData, 'POST', true); if (response.status === 201) { noti.notify(response.data.message, 'success'); setSubmitted(false); dispatch(fetchStores()); handleCloseModal(); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); } }; let checkValidation = submitted ? validator.validate(storeData) : validation; useEffect(async () => { const statesData = await Rest.axiosRequest(API.getStates, {}, 'GET'); if (statesData.status === 200) { const states = []; statesData.data.data.map((state) => { states.push({ id: state.id, value: state.id, name: state.name, label: state.name, }); }); setStates(states); } else { noti.notify(statesData.data.message, 'danger'); } const autoCompleteAddress = new google.maps.places.Autocomplete( document.getElementById('address'), { componentRestrictions: { country: ['US'] } } ); google.maps.event.addListener( autoCompleteAddress, 'place_changed', function () { setStoreData((prevState) => ({ ...prevState, address: locationRef.current.value, })); } ); }, []); const handleAddressKeyUp = (e) => { setStoreData((prevState) => ({ ...prevState, address: e.target.value })); }; return ( <> <Modal show={props?.modal} onHide={handleCloseModal} centered className='modal-dark modal-medium' > <Modal.Header closeButton> <Modal.Title>Add your delivery address</Modal.Title> </Modal.Header> <Modal.Body> <Form> <Row> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Store Name</Form.Label> <Form.Control type='text' placeholder='Enter Store Name' value={storeData.managerName} name='managerName' onChange={handleChange} /> <div className={ checkValidation.managerName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.managerName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Address</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type='text' name='address' placeholder='Enter Address' ref={locationRef} onChange={handleAddressKeyUp} id='address' /> <span className='icon'> <FontAwesomeIcon icon={faLocation} /> </span> </div> <div className={ checkValidation.address.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.address.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>State</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={states.filter( (item) => item.id == storeData.stateId )} options={states.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectState(val)} placeholder='Select State' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='stateId' isClearable={true} /> <div className={ checkValidation.stateId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.stateId.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Zip Code</Form.Label> <Form.Control type='number' name='zipCode' placeholder='Enter Zip Code' value={storeData.zipCode} onChange={handleChange} min='1' /> <div className={ checkValidation.zipCode.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.zipCode.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Phone Number</Form.Label> <InputMask name='phoneNumber' placeholder='Enter Phone Number' onChange={handleChange} onBlur={handleChange} maskChar={null} className='form-control' mask='9999999999' /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.phoneNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>License Number</Form.Label> <Form.Control type='text' name='licenseNumber' onChange={handleChange} placeholder='Enter License Number' /> <div className={ checkValidation.licenseNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>License Expire Date</Form.Label> <CustomDatePicker responsive={true} selectedDate={storeData.licenseExpirationDate} handleOnChange={(date) => handleChangeDate(date)} disableFutureDates={false} disablePastDates={true} /> <div className={ checkValidation.licenseExpirationDate.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseExpirationDate.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>License Document</Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='medRecCertificate' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' name='medRecCertificate' className='uploadImg' id='medRecCertificate' onChange={(e) => medRecDocumentHandler(e)} /> <div className='my-3'> {storeData.medRecCertificatePath.name} </div> </div> <div className={ checkValidation.medRecCertificatePath.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecCertificatePath.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Resale License Document</Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' name='license-upload' className='uploadImg' id='document_upload' onChange={(e) => resaledocumentHandler(e)} /> <div className='my-3'> {storeData.resaleLicensePath.name} </div> </div> <div className={ checkValidation.resaleLicensePath.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.resaleLicensePath.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <div className='mb-3'> <Form.Check inline label='Mark this my default address' name='isDefault' type={'checkbox'} value={!storeData?.isDefault} id={'isDefault'} onChange={handleChange} /> </div> </Form.Group> </Col> <Col md={12}> <div className='d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap'> <Button variant='secondary' type='button' className='btn btn-wh-160-54 btn-rounded btn-secondary btn-right-icons m-10' onClick={handleCloseModal} > Cancel <span> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> <Button variant='primary' type='submit' className='btn-wh-150-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? handleSubmit : null} disabled={showLoading} > {showLoading ? <Spinner animation='border' /> : 'Save'} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </Col> </Row> </Form> </Modal.Body> </Modal> </> ); }; export default Add;
0
/content/gmx-projects/gmx-admin/frontend/components/modal
/content/gmx-projects/gmx-admin/frontend/components/modal/stores/Edit.js
import { useEffect, useRef, useState } from 'react'; import InputMask from 'react-input-mask'; /* global google */ import { faAngleRight, faLocation } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { saveAs } from 'file-saver'; import { Button, Col, Form, Modal, Row, Spinner } from 'react-bootstrap'; import { useDispatch, useSelector } from 'react-redux'; import Select from 'react-select'; import { fetchStores, resetStore } from '../../../app/slices/cartSlice'; import API from '../../../config/endpoints.config'; import Rest from '../../../config/rest.config'; import { REACT_APP_API_BASE_URL } from '../../../config/server.config'; import CustomDatePicker from './../../CustomDatePicker'; import { DropdownIndicator, react_select_lg_Styles } from './../../DropDown'; import FormValidator from './../../FormValidator'; import Notifier from './../../Notifier'; const Edit = (props) => { const dispatch = useDispatch(); const noti = new Notifier(); const locationRef = useRef(null); const store = useSelector((state) => state?.cart?.store); const validator = new FormValidator([ { field: 'managerName', method: 'isEmpty', validWhen: false, message: 'Please enter store name.', }, { field: 'address', method: 'isEmpty', validWhen: false, message: 'Please enter address.', }, { field: 'stateId', method: 'isEmpty', validWhen: false, message: 'Please select state.', }, { field: 'zipCode', method: 'isEmpty', validWhen: false, message: 'Please enter zip code.', }, { field: 'zipCode', method: 'isLength', args: [5, 5], validWhen: true, message: 'Zipcode should be 5 characters long.', }, { field: 'phoneNumber', method: 'isEmpty', validWhen: false, message: 'Please enter phone number.', }, { field: 'phoneNumber', method: 'isLength', args: [10, 10], validWhen: true, message: 'Store number should comprise ten digits.', }, { field: 'licenseNumber', method: 'isEmpty', validWhen: false, message: 'Please enter license number.', }, { field: 'licenseExpirationDate', method: 'isEmpty', validWhen: false, message: 'Please enter license expire date.', }, ]); const [storeData, setStoreData] = useState({ managerName: '', address: '', stateId: '', zipCode: '', phoneNumber: '', licenseNumber: '', licenseExpirationDate: '', medRecCertificatePath: '', resaleLicensePath: '', isDefault: false, }); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const [states, setStates] = useState([]); const handleCloseModal = () => { dispatch(resetStore()); props?.closeModal(); }; const handleChangeSelectState = (val) => { if (val) { setStoreData((prevState) => ({ ...prevState, stateId: val.value })); } else { setStoreData((prevState) => ({ ...prevState, stateId: '' })); } }; const handleChangeDate = (date) => { setStoreData((prevState) => ({ ...prevState, licenseExpirationDate: date.format('YYYY-MM-DD'), })); }; const medRecDocumentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setStoreData((prevState) => ({ ...prevState, medRecCertificatePath: event.target.files[0], })); } else { event.target.value = null; setStoreData((prevState) => ({ ...prevState, medRecCertificatePath: '', })); noti.notify('Please upload Image or PDF file only.', 'danger'); } } }; const resaledocumentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setStoreData((prevState) => ({ ...prevState, resaleLicensePath: event.target.files[0], })); } else { event.target.value = null; setStoreData((prevState) => ({ ...prevState, resaleLicensePath: '' })); notifier.notify('Please upload Image or PDF file only.', 'danger'); } } }; const downloadFile = (filePath) => { saveAs(REACT_APP_API_BASE_URL + '/get/file' + filePath); }; const handleChange = (event) => { const { name, value } = event.target; setStoreData((prevState) => ({ ...prevState, [name]: value })); }; const handleSubmit = async (e) => { e.preventDefault(); const validation = validator.validate(storeData); setValidation(validation); setSubmitted(true); if (validation.isValid) { let formData = new FormData(); formData.append('managerName', storeData.managerName); formData.append('address', storeData.address); formData.append('stateId', storeData.stateId); formData.append('zipCode', storeData.zipCode); formData.append('phoneNumber', storeData.phoneNumber); formData.append('licenseNumber', storeData.licenseNumber); formData.append('licenseExpirationDate', storeData.licenseExpirationDate); formData.append('medRecCertificatePath', storeData.medRecCertificatePath); formData.append('resaleLicensePath', storeData.resaleLicensePath); formData.append('isDefault', storeData.isDefault); setShowLoading(true); let response; response = await Rest.axiosRequest( `${API.stores}/${storeData?.id}`, formData, 'PUT', true ); if (response.status === 200) { noti.notify(response.data.message, 'success'); setSubmitted(false); dispatch(fetchStores()); handleCloseModal(); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); } }; const handleAddressKeyUp = (e) => { setStoreData((prevState) => ({ ...prevState, address: e.target.value })); }; useEffect(async () => { const statesData = await Rest.axiosRequest(API.getStates, {}, 'GET'); if (statesData.status === 200) { const states = []; statesData.data.data.map((state) => { states.push({ id: state.id, value: state.id, name: state.name, label: state.name, }); }); setStates(states); } else { noti.notify(statesData.data.message, 'danger'); } const autoCompleteAddress = new google.maps.places.Autocomplete( document.getElementById('address'), { componentRestrictions: { country: ['US'] } } ); google.maps.event.addListener( autoCompleteAddress, 'place_changed', function () { setStoreData((prevState) => ({ ...prevState, address: locationRef.current.value, })); } ); }, []); useEffect(() => { setStoreData(JSON.parse(JSON.stringify(store))); }, [store]); let checkValidation = submitted ? validator.validate(storeData) : validation; return ( <> <Modal show={props?.modal} onHide={handleCloseModal} centered className='modal-dark modal-medium' > <Modal.Header closeButton> <Modal.Title>Update your delivery address</Modal.Title> </Modal.Header> <Modal.Body> <Form> <Row> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Store Name</Form.Label> <Form.Control type='text' placeholder='Enter Store Name' value={storeData.managerName} name='managerName' onChange={handleChange} /> <div className={ checkValidation.managerName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.managerName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Address</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type='text' value={storeData.address} name='address' placeholder='Enter Address' ref={locationRef} onChange={handleAddressKeyUp} id='address' /> <span className='icon'> <FontAwesomeIcon icon={faLocation} /> </span> </div> <div className={ checkValidation.address.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.address.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>State</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={states.filter( (item) => item.id == storeData.stateId )} options={states.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectState(val)} placeholder='Select State' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='stateId' isClearable={true} /> <div className={ checkValidation.stateId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.stateId.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Zip Code</Form.Label> <Form.Control type='number' name='zipCode' placeholder='Enter Zip Code' value={storeData.zipCode} onChange={handleChange} min='1' /> <div className={ checkValidation.zipCode.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.zipCode.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Phone Number</Form.Label> <InputMask name='phoneNumber' placeholder='Enter Phone Number' onChange={handleChange} onBlur={handleChange} value={storeData.phoneNumber} maskChar={null} className='form-control' mask='9999999999' /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.phoneNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>License Number</Form.Label> <Form.Control type='text' name='licenseNumber' onChange={handleChange} placeholder='Enter License Number' value={storeData.licenseNumber} /> <div className={ checkValidation.licenseNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>License Expire Date</Form.Label> <CustomDatePicker responsive={true} selectedDate={storeData.licenseExpirationDate} handleOnChange={(date) => handleChangeDate(date)} disableFutureDates={false} disablePastDates={true} /> <div className={ checkValidation.licenseExpirationDate.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseExpirationDate.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>License Document</Form.Label> {storeData.certificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile(storeData.certificatePath)} > (Download Certificate File) </a> )} <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='medRecCertificate' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' name='medRecCertificate' className='uploadImg' id='medRecCertificate' onChange={(e) => medRecDocumentHandler(e)} /> <div className='my-3'> {storeData.medRecCertificatePath?.name} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Resale License Document</Form.Label> {storeData.resaleLicensePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile(storeData.resaleLicensePath)} > (Download Certificate File) </a> )} <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' name='license-upload' className='uploadImg' id='document_upload' onChange={(e) => resaledocumentHandler(e)} /> <div className='my-3'> {storeData.resaleLicensePath?.name} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <div className='mb-3'> <Form.Check inline label='Mark this my default address' name='isDefault' type={'checkbox'} value={!storeData?.isDefault} id={'isDefault'} checked={storeData.isDefault} onChange={handleChange} /> </div> </Form.Group> </Col> <Col md={12}> <div className='d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap'> <Button variant='secondary' type='button' className='btn btn-wh-160-54 btn-rounded btn-secondary btn-right-icons m-10' onClick={handleCloseModal} > Cancel <span> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> <Button variant='primary' type='submit' className='btn-wh-150-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? handleSubmit : null} disabled={showLoading} > {showLoading ? <Spinner animation='border' /> : 'Save'} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </Col> </Row> </Form> </Modal.Body> </Modal> </> ); }; export default Edit;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/styles/utils.module.css
.heading2Xl { font-size: 2.5rem; line-height: 1.2; font-weight: 800; letter-spacing: -0.05rem; margin: 1rem 0; } .headingXl { font-size: 2rem; line-height: 1.3; font-weight: 800; letter-spacing: -0.05rem; margin: 1rem 0; } .headingLg { font-size: 1.5rem; line-height: 1.4; margin: 1rem 0; } .headingMd { font-size: 1.2rem; line-height: 1.5; } .borderCircle { border-radius: 9999px; } .colorInherit { color: inherit; } .padding1px { padding-top: 1px; } .list { list-style: none; padding: 0; margin: 0; } .listItem { margin: 0 0 1.25rem; } .lightText { color: #666; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/blob-url.js
import { useEffect, useState } from 'react'; // async function getFileFromLink(url) { // const fileRes = await fetch(url); // const blob = await fileRes.blob(); // const blobUrl = URL.createObjectURL(blob) // console.log('blobUrl', blobUrl); // return blobUrl; // } function Video() { // const url = getFileFromLink('https://livshows-dev.s3.us-east-2.amazonaws.com/mintback/1656046417_1654544094_1.png'); const [url, setUrl] = useState(''); // async () => { // const fileRes = await fetch('https://livshows-dev.s3.us-east-2.amazonaws.com/mintback/1656046417_1654544094_1.png'); // const blob = await fileRes.blob(); // const blobUrl = URL.createObjectURL(blob) // // console.log(blobUrl); // // return blobUrl // setUrl(blobUrl); // return; // } useEffect(async () => { // getUrl(); const fileRes = await fetch( 'https://livshows-dev.s3.us-east-2.amazonaws.com/mintback/1656046417_1654544094_1.png' ); const blob = await fileRes.blob(); const blobUrl = URL.createObjectURL(blob); }, []); return <div>{/* <a href={url}>{url}</a> */}</div>; } export default Video;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/dashboard.js
import { useEffect, useState } from 'react'; import { Button, Card, Col, Container, Row, Table } from 'react-bootstrap'; import { Chart as ChartJS, CategoryScale, BarElement, Title, Tooltip, Legend, Filler, LinearScale, } from 'chart.js'; import Notifier from '../components/Notifier'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import { dateTimeFormat, Helper } from '../services/Helper'; import { Bar } from 'react-chartjs-2'; import { faAngleLeft, faAngleRight } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Meta from '../components/Meta'; import { APP_NAME } from '../config/server.config'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; const moment = require('moment'); ChartJS.register( CategoryScale, BarElement, Title, Tooltip, Legend, Filler, LinearScale ); const options = (chartType) => { const opt = { responsive: true, elements: { point: { radius: 5, }, }, plugins: { legend: { position: 'top', display: false, }, }, scales: { y: { display: true, position: 'right', grid: { lineWidth: 0, borderColor: 'rgba(233,233,233,0.32)', }, ticks: { font: { size: 15, weight: 'bold', }, color: '#969696', }, title: { color: 'white', align: 'center', display: true, text: 'Quantity', padding: 0, }, }, x: { grid: { borderColor: 'rgba(233,233,233,0.32)', lineWidth: 0, }, ticks: { font: { size: 15, weight: 'bold', }, color: 'white', }, }, }, }; return opt; }; function Dashboard(props) { const noti = new Notifier(); const [ordersHistory, setOrdersHistory] = useState([]); const [strainChart, setStrainChart] = useState([]); const [categoryChart, setCategoryChart] = useState([]); const [soldByStrainMonth, setSoldByStrainMonth] = useState( moment().format('MMMM YYYY') ); const [soldByCategoryMonth, setSoldByCategoryMonth] = useState( moment().format('MMMM YYYY') ); // useEffect(async () => { // const ordersHistoryRes = await Rest.axiosRequest( // API.dashboardOrdersHistory, // {}, // 'GET' // ); // if (ordersHistoryRes.data.status) { // setOrdersHistory(ordersHistoryRes.data.data); // } else { // noti.notify(ordersHistoryRes.data.message, 'danger'); // } // }, []); useEffect(async () => { const productSoldByStrainRes = await Rest.axiosRequest( API.dashboardProductSoldByStrain, { selectedMonth: soldByStrainMonth } ); if (productSoldByStrainRes.data.status) { let chartData = { labels: [], data: [], }; productSoldByStrainRes.data.data.map((singleData) => { chartData['labels'] = [ ...chartData['labels'], singleData['strainTitle'], ]; chartData['data'] = [...chartData['data'], singleData['totalLbSold']]; }); setStrainChart(chartData); } else { noti.notify(productSoldByStrainRes.data.message, 'danger'); } }, [soldByStrainMonth]); const updateSoldByStrainMonth = (action) => { let selectedMonth; if (action === 'prev') { selectedMonth = moment(soldByStrainMonth) .subtract(1, 'month') .format('MMMM YYYY'); } else { selectedMonth = moment(soldByStrainMonth) .add(1, 'month') .format('MMMM YYYY'); } if ( moment(selectedMonth).diff(moment().format('MMMM YYYY'), 'month', true) <= 0 ) { setSoldByStrainMonth(selectedMonth); } }; useEffect(async () => { const productSoldByCategoryRes = await Rest.axiosRequest( API.dashboardProductSoldByCategory, { selectedMonth: soldByCategoryMonth } ); if (productSoldByCategoryRes.data.status) { let chartData = { labels: [], data: [], }; productSoldByCategoryRes.data.data.map((singleData) => { chartData['labels'] = [ ...chartData['labels'], singleData['categoryTitle'], ]; chartData['data'] = [...chartData['data'], singleData['totalLbSold']]; }); setCategoryChart(chartData); } else { noti.notify(productSoldByCategoryRes.data.message, 'danger'); } }, [soldByCategoryMonth]); const updateSoldByCategoryMonth = (action) => { let selectedMonth; if (action === 'prev') { selectedMonth = moment(soldByCategoryMonth) .subtract(1, 'month') .format('MMMM YYYY'); } else { selectedMonth = moment(soldByCategoryMonth) .add(1, 'month') .format('MMMM YYYY'); } if ( moment(selectedMonth).diff(moment().format('MMMM YYYY'), 'month', true) <= 0 ) { setSoldByCategoryMonth(selectedMonth); } }; return ( <> <Meta title={`Dashboard | ${APP_NAME}`} keywords="Dashboard" description="Dashboard" /> <section className="bg-black p-30-0-60"> <Container> <Row> <Col lg={12} className="mx-auto"> <Card className="card-dark border-gray p-8-21-30 br-10"> <Card.Header className="d-flex justify-content-between align-items-center border-btm-gray mb-20 px-0"> <Card.Title className="fs-18 fw-600 color-dcdcdc"> Dashboard </Card.Title> </Card.Header> <Card.Body className="p-0"> <Row> <Col md={6} className="mb-30"> <Card className="card-dark border-gray overflow-hidden h-100"> <Card.Header className="bg-color-3d3d3d fs-14 fw-600 color-white border-bottom-gray-light p-13-20"> <div className="d-flex align-items-center justify-content-between"> <span className="cursor-pointer"> <FontAwesomeIcon icon={faAngleLeft} onClick={() => updateSoldByStrainMonth('prev')} /> </span> <span>{soldByStrainMonth}</span> <span className="cursor-pointer"> <FontAwesomeIcon icon={faAngleRight} onClick={() => updateSoldByStrainMonth('next')} /> </span> </div> </Card.Header> <div className="bg-color-191919 fs-14 fw-600 color-white o-09 border-bottom-gray-light p-13-20 color-dcdcdc"> Most Products Sold by Strain </div> <Card.Body className="bg-color-191919 fs-14 fw-30 color-white o-09"> {strainChart['data'] && strainChart['data'].length ? ( <Bar id="strainChart" options={options('soldByStrainChart')} data={{ labels: strainChart['labels'], datasets: [ { fill: true, data: strainChart['data'], backgroundColor: '#22a612', pointBackgroundColor: '#fff', }, ], }} /> ) : ( <div className="d-flex align-items-center justify-content-center mh-275"> <div className="data-not-found"> No Data Available </div> </div> )} </Card.Body> </Card> </Col> <Col md={6} className="mb-30"> <Card className="card-dark border-gray overflow-hidden h-100"> <Card.Header className="bg-color-3d3d3d fs-14 fw-600 color-white border-bottom-gray-light p-13-20"> <div className="d-flex align-items-center justify-content-between"> <span className="cursor-pointer"> <FontAwesomeIcon icon={faAngleLeft} onClick={() => updateSoldByCategoryMonth('prev') } /> </span> <span>{soldByCategoryMonth}</span> <span className="cursor-pointer"> <FontAwesomeIcon icon={faAngleRight} onClick={() => updateSoldByCategoryMonth('next') } /> </span> </div> </Card.Header> <div className="bg-color-191919 fs-14 fw-600 color-white o-09 border-bottom-gray-light p-13-20 color-dcdcdc"> Most Products Sold by Product Category </div> <Card.Body className="bg-color-191919 fs-14 fw-30 color-white o-09"> {categoryChart['data'] && categoryChart['data'].length ? ( <Bar id="categoryChart" options={options('soldByCategoryChart')} data={{ labels: categoryChart['labels'], datasets: [ { fill: true, data: categoryChart['data'], backgroundColor: '#22a612', pointBackgroundColor: '#fff', }, ], }} /> ) : ( <div className="d-flex align-items-center justify-content-center mh-275"> <div className="data-not-found"> No Data Available </div> </div> )} </Card.Body> </Card> </Col> {/* <Col md={12}> <Card className="card-dark border-gray mb-30 overflow-hidden"> <Card.Header className="bg-color-3d3d3d fs-18 fw-600 color-white border-bottom-gray-light p-13-20"> Order History </Card.Header> <Card.Body className="bg-color-191919 fs-14 fw-30 color-white o-09"> <div className="table-wrap"> <ResponsiveTable className="table table-bordered table-hover table-dark" id="seller-subscription" > <Thead> <Tr> <Th className="text-center" width="20px;"> Order ID </Th> <Th className="text-center" width="80px;"> Date </Th> <Th className="text-center" width="200px;"> Product </Th> <Th className="text-center" width="200px;"> Category </Th> <Th className="text-center" width="100px;"> Quantity </Th> <Th className="text-center" width="100px;"> Total </Th> <Th className="text-center" width="100px;"> Status </Th> </Tr> </Thead> <Tbody> {ordersHistory.length > 0 ? ( ordersHistory.map((order, index) => ( <Tr key={order.id}> <Td className="text-center"> <p className="fs-14 color-dcdcdc fw-500"> #{order.orderId ?? ''} </p> </Td> <Td className="text-center"> <p className="fs-14 color-dcdcdc fw-500 o-08"> {dateTimeFormat( order.createdAt, "DD MMM 'YY" )} </p> </Td> <Td className="text-center"> <p className="fs-16 fw-600 color-f3772c"> {order.product?.title ? Helper.niceString( order.product?.title, 15, true ) : ''} </p> </Td> <Td className="text-center"> <p className="fs-14 fw-500 color-bfbfbf"> {order.category?.title ?? ''} </p> </Td> <Td className="text-center"> {order.quantity ?? ''} </Td> <Td className="text-center"> {order.totalPrice ?? ''} </Td> <Td className="text-center"> {order.status === '1' ? ( <p className="placed">Placed</p> ) : order.status === '2' ? ( <p className="placed">Accepted</p> ) : order.status === '3' ? ( <p className="cancel">Cancelled</p> ) : order.status === '4' ? ( <p className="received">Delivered</p> ) : order.status === '5' ? ( <p className="received">Received</p> ) : order.status === '6' ? ( <p className="completed">Completed</p> ) : ( '' )} </Td> </Tr> )) ) : ( <Tr> <Td className="text-center" colSpan={7}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> </Card.Body> </Card> </Col> */} </Row> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default Dashboard;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/video.js
import { useState } from "react"; import { REACT_APP_API_BASE_URL } from "../config/server.config"; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; function Video() { const [file, setFile] = useState(''); const [type, setType] = useState(''); const handleFileChange = (e) => { let formData = new FormData(); formData.append("file", e.target.files[0]); // const res = Rest.axiosRequest(API.storeFile, formData, 'POST', true) // console.log(res); // setFile(e.target.files[0]) // setType(e.target.files[0]['type']) } return ( <> <input type='file' onChange={handleFileChange}/> <video width="520" height="440"> <source src={file} type={type}/> </video> </> ); } export default Video;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/verification-pending.js
import Link from "next/link"; import { Col, Row } from "react-bootstrap"; function VerificationPending() { /* Thank you for your submission! Accout verfification is pending, you will receive a confirmation email if your account is validated.Please email GMX support for any questions. */ return ( <> <section className="pagenotfound"> <Row> <Col lg={10} className="text-center mt-3 mx-auto"> <h2 className={"change-hover-color"}> Thank you for your submission! <br /> <br /> Account verification is pending, you will receive a confirmation email if your account is validated. <br /> <br /> Please email GMX{" "} <Link href="mailto:support@greenmarketexchange.com"> support </Link>{" "} for any questions. </h2> </Col> </Row> </section> </> ); } export default VerificationPending;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/_app.js
import axios from "axios"; import https from "https"; import Layout from '../components/Layout'; import "bootstrap/dist/css/bootstrap.min.css"; import "slick-carousel/slick/slick.css"; import "slick-carousel/slick/slick-theme.css"; import 'react-loading-skeleton/dist/skeleton.css'; import 'react-dropzone-uploader/dist/styles.css'; import "../public/assets/fonts/theme-icon/style.css"; import 'react-super-responsive-table/dist/SuperResponsiveTableStyle.css'; import "../public/assets/css/designer.css"; import { ReactNotifications } from 'react-notifications-component'; import SSRProvider from 'react-bootstrap/SSRProvider' import { Provider } from 'react-redux'; import { store } from '../app/store'; import { NProgressBar } from "../components/NProgressBar"; import Script from "next/script"; axios.defaults.httpsAgent = new https.Agent({ rejectUnauthorized: false }) export default function App({ Component, pageProps: { session, ...pageProps } }) { if (pageProps.error) { return <Error statusCode={pageProps.error.statusCode} title={pageProps.error.message} />; } return ( <SSRProvider> <Provider store={store}> <NProgressBar /> <ReactNotifications /> <Layout> <Script src={`https://www.googletagmanager.com/gtm.js?id=G-K71WP0PP3F`} /> <Component {...pageProps} /> </Layout> </Provider> </SSRProvider> ) }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/orders.js
import React, { useEffect, useState } from 'react'; import { Card, Col, Container, Row, Form, Button, Table, Modal, OverlayTrigger, Tooltip, Spinner, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight, faChevronCircleRight, faCommentDots, faMagnifyingGlass, faReceipt, faRotateRight, faTimes, } from '@fortawesome/free-solid-svg-icons'; import { saveAs } from 'file-saver'; import FormValidator from '../components/FormValidator'; import Notifier from '../components/Notifier'; import CustomDatePicker from '../components/CustomDatePicker'; import Link from 'next/link'; import { useRouter } from 'next/router'; import Rest from '../config/rest.config'; import API from '../config/endpoints.config'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../services/SkeletonOptions'; import moment from 'moment'; import Select from 'react-select'; import { DropdownIndicator, react_select_lg_Styles, react_select_xs_Styles, } from '../components/DropDown'; import ReactPaginate from 'react-paginate'; import { Helper } from '../services/Helper'; import { CustomLadda } from '../components/CustomLadda'; import { contextCookie } from '../services/Auth'; import Meta from '../components/Meta'; import { APP_NAME, REACT_APP_API_BASE_URL } from '../config/server.config'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; function MyOrdersSeller(props) { const noti = new Notifier(); const router = useRouter(); const [params, setParams] = useState({ //category: props.queryString.category ?? '', sortBy: props.queryString.sortBy ?? '', keyword: props.queryString.keyword ?? '', offset: props.queryString.offset ?? 0, }); const [showSkeleton, setShowSkeleton] = useState(true); const [orderInvoices, setOrderInvoices] = useState([]); const [categories, setCategories] = useState([]); const [drivers, setDrivers] = useState([]); const [paymentStatus, setPaymentStatus] = useState([]); const [keyword, setKeyword] = useState(props.queryString.keyword ?? ''); const sortBy = [ { id: 'desc', value: 'desc', name: 'Newest to Oldest', label: 'Newest to Oldest', }, { id: 'asc', value: 'asc', name: 'Oldest to Newest', label: 'Oldest to Newest', }, ]; const [limit, setLimit] = useState(10); const [totalPages, setTotalPages] = useState(); const [updateList, setUpdateList] = useState(false); const [disableAllBtn, setDisableAllBtn] = useState(false); const [show, setShow] = useState(false); const [selectedInvoiceItemId, setSelectedInvoiceItemId] = useState(''); const [declineReasonData, setDeclineReasonData] = useState({ declineReason: '', }); const [showLoading, setShowLoading] = useState(false); const [isInvoiceLoading, setIsInvoiceLoading] = useState({}); const validator = new FormValidator([ { field: 'declineReason', method: 'isEmpty', validWhen: false, message: 'Please explain to the retailer why the order was declined.', }, ]); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const handleDeclineSubmit = async (e) => { e.preventDefault(); const validation = validator.validate(declineReasonData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); const response = await Rest.axiosRequest( API.updateOrder + '/' + selectedInvoiceItemId + '/declined', declineReasonData ); if (response.data.status) { noti.notify(response.data.message, 'success'); setSubmitted(false); handleClose(); setUpdateList(!updateList); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); } }; const [tableVisibility, setTableVisibility] = useState({}); const toggleTable = (orderId) => { setTableVisibility((prevState) => ({ ...prevState, [orderId]: !prevState[orderId], })); }; useEffect(async () => { setShowSkeleton(true); router.push('/orders', { query: { ...params } }, undefined, { shallow: true, }); const response = await Rest.axiosRequest( API.myOrdersSeller + '?' + `limit=${limit}&` + new URLSearchParams(params).toString(), {}, 'GET' ); if (response.status === 200) { setOrderInvoices(response.data.data.orders); setTotalPages(response.data.data.totalPages); } else { noti.notify(response.data.message, 'danger'); } if (!categories.length) { const categoriesData = await Rest.axiosRequest( API.getCategories, {}, 'GET' ); if (categoriesData.status === 200) { const categories = []; categoriesData.data.data.map((category) => { categories.push({ id: category.id, value: category.id, name: category?.title, label: category?.title, }); }); setCategories(categories); } else { noti.notify(categoriesData.data.message, 'danger'); } } if (!drivers.length) { const driversData = await Rest.axiosRequest( `${API.getDrivers}?status=1`, {}, 'GET' ); if (driversData.status === 200) { const drivers = []; driversData?.data?.data?.drivers?.map((driver) => { drivers.push({ id: driver.id, value: driver.id, name: driver?.driversName, label: driver?.driversName, }); }); setDrivers(drivers); } else { noti.notify(driversData.data.message, 'danger'); } } if (!paymentStatus.length) { const paymentStatus = []; const data = [ { id: 2, lable: 'Unpaid' }, { id: 1, lable: 'Paid' }, ]; data.map((status) => { paymentStatus.push({ id: status.id, value: status.id, name: status?.lable, label: status?.lable, }); }); setPaymentStatus(paymentStatus); } setShowSkeleton(false); }, [new URLSearchParams(params).toString(), updateList]); const handleFilterChange = (val, e) => { if (val) { setParams((prevState) => ({ ...prevState, [e.name]: val.value })); } else { setParams((prevState) => ({ ...prevState, [e.name]: '' })); } }; const onChangeSearch = (e) => { if (e.target.value) { setKeyword(e.target.value); } else { setKeyword(''); } }; const handlePageChange = (event) => { setParams((prevState) => ({ ...prevState, offset: event.selected })); }; const handleManifestOrderUpdate = async (e, orderId) => { const { name, value } = e.target; const editData = orderInvoices.map((item) => item.invoiceId === invoiceId && name ? { ...item, [name]: value } : item ); setOrderInvoices(editData); await Rest.axiosRequest(API.updateOrderDetail + '/' + orderId, { [name]: value, }); }; const handleOrderUpdate = async (invoiceId, val, e) => { const { value } = val; const { name } = e; const editData = orderInvoices.map((item) => item.invoiceId === invoiceId && name ? { ...item, [name]: value } : item ); setOrderInvoices(editData); await Rest.axiosRequest(API.updateOrderDetail + '/' + invoiceId, { [name]: value, }); }; const handleChangeDate = async (invoiceId, fieldNmae, date) => { const name = fieldNmae; const value = date instanceof moment ? date.format('YYYY-MM-DD') : ''; const editData = orderInvoices.map((item) => item.invoiceId === invoiceId && name ? { ...item, [name]: value } : item ); setOrderInvoices(editData); await Rest.axiosRequest(API.updateOrderDetail + '/' + invoiceId, { [name]: value, }); }; const handleChangeDeliveryDate = async ( invoiceId, invoiceItemId, fieldNmae, date ) => { const name = fieldNmae; const value = date instanceof moment ? date.format('YYYY-MM-DD') : ''; const editData = orderInvoices.map((item) => { if (item.invoiceId === invoiceId) { const updatedOrderInvoiceItems = item.orderInvoiceItems.map( (orderInvoiceItem) => { if (orderInvoiceItem.id === invoiceItemId) { return { ...orderInvoiceItem, [name]: value }; } else { return orderInvoiceItem; } } ); return { ...item, orderInvoiceItems: updatedOrderInvoiceItems }; } else { return item; } }); setOrderInvoices(editData); await Rest.axiosRequest(API.orderInvoiceItemDetail + '/' + invoiceItemId, { [name]: value, }); }; const handleAction = async (buttonId, invoiceItemId, action) => { setDisableAllBtn(true); const response = await Rest.axiosRequest( API.updateOrder + '/' + invoiceItemId + '/' + action, {} ); if (response.data.status) { setDisableAllBtn(false); noti.notify(response.data.message, 'success'); setUpdateList(!updateList); } else { setDisableAllBtn(false); setUpdateList(!updateList); noti.notify(response.data.message, 'danger'); } }; const handleNotifyRetailer = async (orderId) => { const response = await Rest.axiosRequest( API.notifyRetailer + '/' + orderId, {} ); if (response.data.status) { noti.notify(response.data.message, 'success'); } else { noti.notify(response.data.message, 'danger'); } }; const handleDeclineReasonChange = (e) => { const { name, value } = e.target; setDeclineReasonData((prevState) => ({ ...prevState, [name]: value })); }; const handleShow = async (invoiceItemId, slug) => { setSelectedInvoiceItemId(invoiceItemId); setShow(true); }; const handleClose = () => { setShow(false); setSelectedInvoiceItemId(''); setDeclineReasonData(''); }; const downloadInvoice = async (id) => { setIsInvoiceLoading((prevState) => ({ ...prevState, [id]: !prevState[id], })); const response = await Rest.axiosRequest( API.orderInvoice + `${id}`, {}, 'GET' ); if (response.status === 200) { const data = response.data.data; setIsInvoiceLoading({}); saveAs(REACT_APP_API_BASE_URL + '/get/file' + data?.path, data?.filename); } else { setIsInvoiceLoading({}); noti.notify('Something went wrong please try again!', 'danger'); } }; let checkValidation = submitted ? validator.validate(declineReasonData) : validation; return ( <> <Meta title={`My Orders | ${APP_NAME}`} keywords='My Orders' description='My Orders' /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-20 br-10 card'> <Card.Header className='border-btm-gray mb-20 px-0'> <Card.Title className='fs-18 fw-600 color-dcdcdc'> My Orders </Card.Title> </Card.Header> <Card.Body className='p-0'> <div className='d-flex justify-content-between flex-wrap mb-20'> <Form className='d-flex justify-content-flex-start align-items-center filter-form flex-md-nowrap flex-wrap filter-form order-filter'> {/* <Form.Group className="form-inline form-dark form-group-h-33 me-md-3 me-0 mb-sm-2 flex-fill"> <Form.Label className="my-2">Category:</Form.Label> <Select classNamePrefix="react-select" className="react-select-lg maxw-200" styles={react_select_xs_Styles} options={categories.map(({ id, name }) => ({ value: id, label: name, }))} value={categories.filter( (item) => item.id == params.category )} onChange={(val, e) => handleFilterChange(val, e)} placeholder="Category" components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name="category" isClearable={true} /> </Form.Group> */} <Form.Group className='form-inline form-dark form-group-h-33 me-md-3 me-0 mb-2 flex-fill'> <Form.Label className='my-2'>Sort By:</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg maxw-150' styles={react_select_xs_Styles} options={sortBy.map(({ value, name }) => ({ value: value, label: name, }))} value={sortBy.filter( (item) => item.value == params.sortBy )} onChange={(val, e) => handleFilterChange(val, e)} placeholder='Sort By' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='sortBy' isClearable={true} /> </Form.Group> </Form> <Form className='mb-7 d-flex search-form-main'> <Form.Group className='search-form form-dark maxw-150 '> <Form.Control type='search' placeholder='Search by Invoice ID' name='keyword' onChange={onChangeSearch} value={keyword} /> <Button variant='primary' className='btn-wh-35 br-8 bg-f3772c' onClick={() => setParams((prevState) => ({ ...prevState, ['keyword']: keyword, })) } > <FontAwesomeIcon icon={faMagnifyingGlass} /> </Button> </Form.Group> {params.category !== '' || params.sortBy !== '' || params.keyword !== '' ? ( <Form.Group className='form-inline form-dark form-group-h-33 mr-10'> <OverlayTrigger placement='top' overlay={<Tooltip>Clear All</Tooltip>} > <Button variant='secondary' className='btn-wh-35 br-8 bg-f3772c ms-3' onClick={() => { setParams({ category: '', sortBy: '', keyword: '', offset: 0, }); setKeyword(''); }} > <FontAwesomeIcon icon={faTimes} /> </Button> </OverlayTrigger> </Form.Group> ) : null} </Form> </div> <div className='table-wrap CustomScrollbar CustomScrollbarY'> {/* <Table bordered hover variant="dark" id="seller-my-order"> */} <ResponsiveTable className='table form-dark table-bordered table-hover table-dark' id='seller-my-order' > <Thead> <Tr> <Th className='text-center' width='85px;'> Invoice # </Th> <Th className='text-center' width='130px;'> Customer </Th> <Th className='text-center' width='85px;'> Order Date </Th> <Th className='text-center' width='85px;'> Order Total </Th> <Th className='text-center' width='85px;'> Payment Due </Th> <Th className='text-center' width='70px;'> Payment </Th> <Th className='text-center' width='150px;'> Action </Th> </Tr> </Thead> <Tbody> {showSkeleton ? ( [...Array(6)].map((index) => { return ( <Tr key={index}> {[...Array(7)].map((i) => { return ( <Td key={i}> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Td> ); })} </Tr> ); }) ) : orderInvoices.length ? ( orderInvoices.map((orderInvoice, i) => { const isLastRow = i === orderInvoices.length - 1 && orderInvoices.length > 1 ? 'top' : 'auto'; return ( <> <Tr> <Td className='text-center'> <p className='fs-14 color-dcdcdc fw-500'> #{orderInvoice.invoiceId ?? ''} </p> </Td> <Td className='text-center'> <p className='fs-14 color-dcdcdc fw-500'> <Link href={ '/customer/' + orderInvoice?.retailer ?.retailerCompany?.slug } > <a className='color-f3772c'> {orderInvoice.managerName ? Helper.niceString( orderInvoice.managerName, 20, true ) : ''} </a> </Link> </p> <Link href={`/messages/${orderInvoice?.retailer?.retailerCompany?.slug}`} > <a className='btn-rounded w-30 h-30 btn-outline-secondary-transparent d-block table-chat-btn mx-auto'> <span className='icon'> <FontAwesomeIcon icon={faCommentDots} /> </span> </a> </Link> </Td> <Td className='text-start white-space'> {moment(orderInvoice.createdAt).format( "DD MMM 'YY" )} </Td> <Td className='text-center white-space'> {orderInvoice.finalOrderTotal ?? ''} </Td> <Td className='text-center'> <CustomDatePicker responsive={false} selectedDate={ orderInvoice.paymentDue ? moment( orderInvoice.paymentDue ).format('DD MMM, YYYY') : '' } handleOnChange={(date) => handleChangeDate( orderInvoice.invoiceId, 'paymentDue', date ) } disableFutureDates={false} disablePastDates={true} /> </Td> <Td className='text-center'> <Select classNamePrefix='react-select' className='react-select-lg mw-100' styles={react_select_lg_Styles} value={paymentStatus.filter( (item) => item.id == orderInvoice.paymentStatus )} options={paymentStatus.map( ({ id, name }) => ({ value: id, label: name, }) )} onChange={(val, e) => handleOrderUpdate( orderInvoice.invoiceId, val, e ) } placeholder='Payment Status' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='paymentStatus' isClearable={false} menuPlacement={isLastRow} /> </Td> <Td className='text-right'> <p className='d-flex justify-content-end align align-items-center'> <a className='btn-outline-green-transparent w-30 h-30 btn-circle close-btn m-l-10' title='Download Invoice' onClick={() => downloadInvoice( orderInvoice.invoiceId ) } > {isInvoiceLoading[ orderInvoice.invoiceId ] ? ( <Spinner animation='border' size='sm' /> ) : ( <span className='icon'> <FontAwesomeIcon icon={faReceipt} /> </span> )} </a> <button className='toggle-button fas fa-sort-down' onClick={() => toggleTable(orderInvoice.orderId) } ></button> </p> </Td> </Tr> <Tr className={`table-container ${ tableVisibility[orderInvoice.orderId] ? 'visible' : 'hidden' }`} > <Td colSpan='11'> <ResponsiveTable className='table table-bordered table-hover table-dark' id='seller-order-items' > <Thead> <Tr> <Th className='text-center' width='85px;' > Product </Th> <Th className='text-center' width='85px;' > Brand </Th> <Th className='text-start' width='85px;' > Category </Th> <Th className='text-start' width='85px;' > Units Per Package </Th> <Th className='text-start' width='85px;' > Package Price </Th> <Th className='text-start' width='85px;' > Package </Th> <Th className='text-start' width='85px;' > Delivery Date </Th> <Th className='text-start' width='85px;' > Status </Th> <Th className='text-start' width='85px;' > Total </Th> <Th className='text-center' width='150px;' > Action </Th> </Tr> </Thead> <Tbody> {showSkeleton ? ( [...Array(6)].map((value, index) => { return ( <Tr key={index}> {[...Array(6)].map((v, i) => { return ( <Td key={i}> <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Td> ); })} </Tr> ); }) ) : orderInvoice?.orderInvoiceItems .length ? ( orderInvoice?.orderInvoiceItems.map( (orderInvoiceItem, index) => { return ( <Tr key={`item-${index}`}> <Td className='text-center'> {orderInvoiceItem.product ?.title ? Helper.niceString( orderInvoiceItem .product?.title, 20, true ) : ''} </Td> <Td className='text-start'> {orderInvoiceItem?.product ?.brand?.brandName ? Helper.niceString( orderInvoiceItem ?.product?.brand ?.brandName, 20, true ) : ''} </Td> <Td className='text-start'> {orderInvoiceItem?.product ?.category?.title ?? ''} </Td> <Td className='text-start'> { orderInvoiceItem.unitPerPackage } </Td> <Td className='text-start'> { orderInvoiceItem.displayPrice } </Td> <Td className='text-start'> {orderInvoiceItem.quantity} </Td> <Td className='text-start'> {orderInvoiceItem.status === '1' || orderInvoiceItem.status === '2' ? ( <> <CustomDatePicker responsive={false} selectedDate={ orderInvoiceItem.deliveryDate ? moment( orderInvoiceItem.deliveryDate ).format( 'DD MMM, YYYY' ) : '' } handleOnChange={( date ) => handleChangeDeliveryDate( orderInvoice?.invoiceId, orderInvoiceItem.id, 'deliveryDate', date ) } disableFutureDates={ false } disablePastDates={ true } /> </> ) : ( <> {orderInvoiceItem.deliveryDate ? moment( orderInvoiceItem.deliveryDate ).format( "DD MMM 'YY" ) : '-'} </> )} </Td> <Td className='text-start'> {orderInvoiceItem.status === '1' ? ( <p className='placed'> Requested </p> ) : orderInvoiceItem.status === '2' ? ( <p className='placed'> Confirmed </p> ) : orderInvoiceItem.status === '3' ? ( <p className='cancel'> Declined </p> ) : orderInvoiceItem.status === '4' ? ( <p className='received'> Completed </p> ) : orderInvoiceItem.status === '5' ? ( <p className='received'> Reviewed </p> ) : ( '' )} </Td> <Td className='text-start'> <p> { orderInvoiceItem.finalOrderTotal } </p> </Td> <Td className='text-right'> <p className='d-flex justify-content-end align align-items-center'> {orderInvoiceItem.status !== '5' && ( <a className='btn-outline-green-transparent w-30 h-30 btn-circle close-btn m-l-10' title='Notify Retailer' onClick={() => handleNotifyRetailer( orderInvoiceItem.id ) } > <span className='icon'> <FontAwesomeIcon icon={ faRotateRight } /> </span> </a> )} {orderInvoiceItem.status === '1' ? ( <> <CustomLadda className='btn-outline-secondary-transparent br-30 p-7-15 fs-13 text-decoration-none m-l-10' onClick={() => handleAction( 'confirm-' + orderInvoiceItem.id, orderInvoiceItem.id, 'confirmed' ) } disabled={ disableAllBtn } > Confirm </CustomLadda> <a className='btn-outline-red-transparent w-30 h-30 btn-circle close-btn m-l-10' title='Decline Order' onClick={() => handleShow( orderInvoiceItem.id ) } disabled={ disableAllBtn } > <span className='icon'> <FontAwesomeIcon icon={faTimes} /> </span> </a> </> ) : orderInvoiceItem.status === '2' ? ( <> <CustomLadda className='btn-outline-green-transparent br-30 p-7-15 fs-13 text-decoration-none m-l-10' onClick={() => handleAction( 'completed-' + orderInvoiceItem.id, orderInvoiceItem.id, 'completed' ) } disabled={ disableAllBtn } > Complete </CustomLadda> </> ) : null} </p> </Td> </Tr> ); } ) ) : ( <Tr> <Td className='text-center' colSpan={8} > No records found! </Td> </Tr> )} {orderInvoices.offerTotal > 0 && ( <> <Tr key={`order-deal`}> <Td></Td> <Td></Td> <Td></Td> <Td></Td> <Td></Td> <Td className='text-start'> <p> {orderInvoices.totalPrice} </p> <p> - { orderInvoices.displayOfferTotal }{' '} <small> ( {orderInvoices.offerTitle ? Helper.niceString( orderInvoices.offerTitle, 12, true ) : ''} ) </small> </p> <hr /> <p> { orderInvoices.finalOrderTotal } </p> </Td> </Tr> </> )} </Tbody> </ResponsiveTable> </Td> </Tr> </> ); }) ) : ( <Tr> <Td className='text-center' colSpan={9}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> <div className='mt-5 d-flex justify-content-center'> {totalPages > 1 ? ( <ReactPaginate previousLabel={ <i className='fas fa-long-arrow-alt-left'></i> } nextLabel={ <i className='fas fa-long-arrow-alt-right'></i> } pageClassName='page-item' pageLinkClassName='page-link' previousClassName='page-item prev-item' previousLinkClassName='page-link' nextClassName='page-item next-item' nextLinkClassName='page-link' breakLabel='...' breakClassName='page-item' breakLinkClassName='page-link' pageCount={totalPages} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName='pagination' activeClassName='active' forcePage={parseInt(params.offset)} /> ) : null} </div> </Card.Body> </Card> </Col> </Row> </Container> </section> <Modal show={show} onHide={handleClose} centered className='modal-dark'> <Modal.Header closeButton> <Modal.Title>Decline Order</Modal.Title> </Modal.Header> <Modal.Body> <Row> <Col lg={12}> <Form.Group className='form-dark'> <Form.Control as='textarea' name='declineReason' placeholder='Explain to the retailer why the order was declined' style={{ height: '150px' }} onChange={handleDeclineReasonChange} value={declineReasonData.declineReason} /> <div className={ checkValidation.declineReason.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.declineReason.message} </div> </div> </Form.Group> </Col> </Row> <Row> <Col lg={12}> <Form.Group className='text-center'> <Button variant='primary' type='submit' className='btn-wh-180-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? handleDeclineSubmit : null} disabled={showLoading} > {showLoading ? <Spinner animation='border' /> : 'Submit'} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </Form.Group> </Col> </Row> </Modal.Body> </Modal> </> ); } export default MyOrdersSeller; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: { queryString: context.query, }, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/privacy-policy.js
import React, { useState } from 'react'; import { Container } from "react-bootstrap"; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import Meta from '../components/Meta'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import { dateTimeFormat } from '../services/Helper'; const baseColor = "#202020"; const highlightColor = "#444"; function PrivacyPolicy({ cmsData }) { // const [cmsData, setCmsData] = useState(props.data.content ?? []); return ( <> <Meta title={cmsData.content ? cmsData.content.meta_title : ''} keyword={cmsData.content ? cmsData.content.meta_keyword : ''} description={cmsData.content ? cmsData.content.meta_desc : ''} /> <section className="p-0 bg-black"> <div className="page-title-wrap mb-60 bg-black border-btm-white-light"> <Container> <h2 className="page-title text-center fs-26 color-dcdcdc fw-700 p-30-0 mb-0">{cmsData.content.main_title}</h2> </Container> </div> <div className="cms-pages"> <Container> <div className="p-b-30 m-l-r-30"> <div className="content-box"> <p>Last modified: {dateTimeFormat(cmsData.updatedAt, "DD MMM YYYY")}</p> <div dangerouslySetInnerHTML={{ __html: cmsData.content.main_content }}></div> </div> </div> </Container> </div> </section> </> ) } export default PrivacyPolicy; export const getServerSideProps = async () => { try { const response = await Rest.axiosRequest(API.getCmsData + '/privacy-policy', {}, 'GET') const { data, status } = response.data if (status) { return { props: { cmsData: data, }, } } else { return { redirect: { destination: '/500' } } } } catch { return { redirect: { destination: '/500' } } } }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/social.js
import React, { useEffect, useState } from 'react'; import { Card, Col, Container, Figure, ListGroup, Row } from 'react-bootstrap'; import Link from 'next/link'; import 'react-image-lightbox/style.css'; // This only needs to be imported once in your app import InfiniteScroll from 'react-infinite-scroll-component'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { useDispatch, useSelector } from 'react-redux'; import { addActivity, fetchAxisPointPost, handleOnComment, resetActivities, } from '../app/slices/activitiesSlice'; import { showModal } from '../app/slices/commentSlice'; import { fetchUsersWiseCompany, resetCompanies, } from '../app/slices/companySlice'; import { fetchUserById } from '../app/slices/userSlice'; import ActivityList from '../components/ActivityList'; import CommentModal from '../components/CommentModal'; import CompanyList from '../components/CompanyList'; import LightboxModal from '../components/LightboxModal'; import LikeModal from '../components/LikeModal'; import Meta from '../components/Meta'; import Notifier from '../components/Notifier'; import RepostModal from '../components/RepostModal'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import { APP_NAME, ASSETS_URL } from '../config/server.config'; import ActivityPost from '../services/ActivityPost'; import { contextCookie, getSingle } from '../services/Auth'; const baseColor = '#202020'; const highlightColor = '#444'; function Social({ isLoggedIn, userImage }) { const noti = new Notifier(); // const userImage = getSingle('userImage'); const dispatch = useDispatch(); const [activityPage, setActivityPage] = useState(0); const [companyPage, setCompanyPage] = useState(0); const activities = useSelector((state) => state.activities.activities); const { companies, totalCompanies } = useSelector((state) => state.company); const { user, followersCount, followingsCount, userSlug } = useSelector( (state) => state.user ); const totalActivities = useSelector( (state) => state.activities.totalActivites ); const [activityComment, setActivityComment] = useState(''); const [mentions, setMentions] = useState([]); const [searchValue, setSearchValue] = useState(''); const [attachments, setAttachments] = useState([]); const [selectedMediaFile, setSelectedMediaFile] = useState([]); const [individualPostAttachments, setIndividualPostAttachments] = useState( [] ); const [users, setUsers] = useState([]); // LightBox Images const [show, setShow] = useState(false); const [isEnable, setIsEnable] = useState(true); const [isMediaEnable, setIsMediaEnable] = useState(false); const { isCommentModal } = useSelector((state) => state.comment); const [selectedPostId, setSelectedPostId] = useState(0); const [activeIndex, setActiveIndex] = useState(0); const [isPosted, setIsPosted] = useState(false); //RepostModal const [reposts, setReposts] = useState([]); const [repostsPage, setRepostsPage] = useState(0); const [repostsCount, setRepostsCount] = useState(0); const [currentRepostPost, setCurrentRepostPost] = useState(null); const resetRepostModal = () => { setCurrentRepostPost(null); setReposts([]); setRepostsPage(0); setRepostsCount(0); }; const [showRepostModal, setShowRepostModal] = useState(false); const [isLoading, setIsLoading] = useState(false); const repostsModalClose = () => { setShowRepostModal(false); resetRepostModal(); }; const repostsModalShow = () => setShowRepostModal(true); const repostsClickhandler = (e, postUniqueId) => { setCurrentRepostPost(postUniqueId); repostsModalShow(); }; const fetchMoreReposts = () => { setRepostsPage(repostsPage + 1); }; useEffect(() => { const getRepostsBy = async () => { let repostRes = await Rest.axiosRequest( API.posts + '/' + currentRepostPost + `/reposts?limit=10&page=${repostsPage}`, {}, 'GET' ); repostRes = repostRes.data; if (repostRes.status) { const { count, rows } = repostRes.data; setRepostsCount(count); if (rows.length > 0) { setReposts([...reposts, ...rows]); } } }; if (currentRepostPost != null) { getRepostsBy(); } }, [currentRepostPost, repostsPage]); //LikeModal const [likes, setLikes] = useState([]); const [likesPage, setLikesPage] = useState(0); const [likesCount, setLikesCount] = useState(0); const [currenLikePost, setCurrentLikePost] = useState(null); const fetchMoreLikes = () => { setLikesPage(likesPage + 1); }; useEffect(() => { const getLikesBy = async () => { let likeRes = await Rest.axiosRequest( API.posts + '/' + currenLikePost + `/likes?limit=10&page=${likesPage}`, {}, 'GET' ); likeRes = likeRes?.data; if (likeRes?.status) { const { count, rows } = likeRes?.data; setLikesCount(count); if (rows?.length > 0) { setLikes([...likes, ...rows]); } } }; if (currenLikePost != null) { getLikesBy(); } }, [currenLikePost, likesPage]); const resetLikesModal = () => { setCurrentLikePost(null); setLikes([]); setLikesPage(0); setLikesCount(0); }; const [showLikeModal, setShowLikeModal] = useState(false); const likesModalClose = () => { setShowLikeModal(false); resetLikesModal(); }; const likesModalShow = () => setShowLikeModal(true); const likesClickHandler = (e, postUniqueId) => { setCurrentLikePost(postUniqueId); likesModalShow(); }; useEffect(() => { if (isLoggedIn) { dispatch(fetchUserById()); } return () => { dispatch(resetActivities()); }; }, [dispatch]); const { createCommentStatus, postId, postCommentCount } = useSelector( (state) => state.comment ); useEffect(() => { if (createCommentStatus === 'succeeded') { dispatch(handleOnComment({ postId, postCommentCount })); } }, [dispatch, createCommentStatus]); useEffect(() => { let formData = { page: activityPage, limit: 10, }; dispatch(fetchAxisPointPost(formData)); }, [dispatch, activityPage]); useEffect(async () => { let formData = { keyword: '', page: 0, limit: 10, }; const response = await Rest.axiosRequest( API.axisPointUsers, formData, 'POST' ); setUsers(response?.data?.data?.rows); }, []); // useEffect(() => { // if (isLoggedIn) { // let formData = { // page: companyPage, // limit: 10, // }; // setIsLoading(true); // dispatch(fetchUsersWiseCompany(formData)) // .unwrap() // .then((result) => { // if (result.status) setIsLoading(false); // else setIsLoading(false); // }) // .catch((rejectedValueOrSerializedError) => { // setIsLoading(false); // noti.notify(rejectedValueOrSerializedError.message, 'danger'); // }); // } // }, [dispatch, companyPage]); useEffect(() => { return () => dispatch(resetCompanies()); }, [dispatch]); const fetchMoreCompanies = () => { setCompanyPage(companyPage + 1); }; const fetchMoreActivity = () => { setActivityPage(activityPage + 1); }; const formatBytes = (bytes, decimals = 2) => { if (!+bytes) return '0 Bytes'; const k = 1024; const dm = decimals < 0 ? 0 : decimals; const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return { valueWithSize: `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${ sizes[i] }`, value: parseFloat((bytes / Math.pow(k, i)).toFixed(dm)), size: sizes[i], }; }; const attachmentsHandler = (event) => { let filesCount = selectedMediaFile.length + event.target.files.length; if (filesCount > 10) { noti.notify('Please choose up to 10 media.', 'danger'); return false; } else { if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } if (event.target.files.length > 0) { setIsEnable(false); } else { setIsEnable(true); } const selectedFiles = event.target.files; const selectedFilesArray = Array.from(selectedFiles); const imagesArray = selectedFilesArray.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); // videos and images validation let previousAndSelectedMediaFile = selectedMediaFile.concat(imagesArray); let fileTypeCount = {}; let videoSize = {}; let imageSize = {}; previousAndSelectedMediaFile.map(function (item) { fileTypeCount[item.type] = (fileTypeCount[item.type] || 0) + 1; if (item.type === 'video') { videoSize[item.type] = item.size; } if (item.type === 'image') { imageSize[item.type] = item.size; } }); if (fileTypeCount.video > 1) { noti.notify('You can upload only one video.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'GB' || videoSize?.video?.size === 'TB' || videoSize?.video?.size === 'PB' || videoSize?.video?.size === 'EB' || videoSize?.video?.size === 'ZB' || videoSize?.video?.size === 'YB' ) { noti.notify('Max video file limit is 256 MB.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'MB' && videoSize?.video?.value > 256.05 ) { noti.notify('Max video file limit is 256 MB.', 'danger'); return false; } } } if ( imageSize?.image?.size === 'GB' || imageSize?.image?.size === 'TB' || imageSize?.image?.size === 'PB' || imageSize?.image?.size === 'EB' || imageSize?.image?.size === 'ZB' || imageSize?.image?.size === 'YB' ) { noti.notify('Max image file limit is 5 MB.', 'danger'); return false; } else { if (imageSize?.image?.size === 'MB' && imageSize?.image?.value > 5.05) { noti.notify('Max image file limit is 5 MB.', 'danger'); return false; } } setSelectedMediaFile((previousMediaFile) => previousMediaFile.concat(imagesArray) ); //setAttachments((previousattachments) => previousattachments.concat(event.target.files)); let f = event.target.files; let sf = attachments; // setAttachments((prevState)=>{ // return {...prevState, ...f}; // }) //setAttachments((prevState)=> ({prevState, ...f})) // setAttachments({ attachments, ...f }); for (let i = 0; i < event.target.files.length; i++) { setAttachments((prevfiles) => [...prevfiles, event.target.files[i]]); // let f = event.target.files[i]; // setAttachments((prevfiles)=>({...prevfiles, ...f})) } } }; function deleteHandler(selectedIndex, selectedFile, selectedId) { setSelectedMediaFile( selectedMediaFile.filter((e, index) => index !== selectedIndex) ); const copiedAttachment = [...attachments]; delete copiedAttachment[selectedId]; const newFiles = []; for (let i = 0; i < copiedAttachment.length; i++) { if (copiedAttachment[i]) { newFiles.push(copiedAttachment[i]); } } setAttachments(newFiles); const imagesArray = newFiles.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); setSelectedMediaFile(imagesArray); if (Object.keys(copiedAttachment).length === 0 && activityComment === '') { setIsEnable(true); } else { setIsEnable(false); } URL.revokeObjectURL(selectedFile); let filesCount = selectedMediaFile.length - 1; if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } } const postContentHandler = (event, newValue, newPlainTextValue, mentions) => { const { value } = event.target; setActivityComment(newValue); setMentions(mentions); setSearchValue( newPlainTextValue?.substring(newPlainTextValue.lastIndexOf('@') + 1) ); if (value !== '' || Object.keys(selectedMediaFile).length > 0) { setIsEnable(false); } else { setIsEnable(true); } }; const postContentHandlerSelect = (id, display) => { const mentionText = `@${display}`; setActivityComment(mentionText); setMentions([...mentions, { id, display }]); }; const submitPost = async () => { if (activityComment != '' || Object.keys(attachments).length > 0) { setIsEnable(false); setIsMediaEnable(false); let formData = new FormData(); formData.append('type', 1); // Remove round brackets formData.append('post', activityComment?.replace(/\(([^)]+)\)/g, '$1')); formData.append('mentions', JSON.stringify(mentions)); formData.append('attachableType', 'post'); for (const key of Object.keys(attachments)) { formData.append('attachment', attachments[key]); } const response = await Rest.axiosRequest( API.postActivity, formData, 'POST', true ); if (response.status === 201) { noti.notify(response.data.message, 'success'); const activity = response.data.data; // console.log([activity, ...activities]) // setActivities([activity, ...activities]); dispatch(addActivity(activity)); resetPostForm(); } else { noti.notify('Something went wrong!', 'danger'); } } else { setIsEnable(true); } }; const resetPostForm = () => { setActivityComment(''); setAttachments([]); setSelectedMediaFile([]); setIsEnable(true); }; const handleClose = () => setShow(false); const handleShow = (value, index, id) => { setActiveIndex(index); setShow(true); let singleActivity = activities.find((data) => data.id === id); let mainPost = singleActivity.type == '2' ? singleActivity.parentPost : singleActivity; setIndividualPostAttachments(mainPost.attachments); }; //comment const handleCloseCommentModal = () => dispatch(showModal({ modalStatus: false, modalType: 'comment' })); const handleShowCommentModal = async (postId) => { await setSelectedPostId(postId); await dispatch(showModal({ modalStatus: true, modalType: 'comment' })); }; // useEffect(()=>{ // console.log("use Effect attachement has been changes", attachments) // },[attachments]); return ( <> <Meta title={`Social | ${APP_NAME}`} keyword={''} description={''} /> <section className='bg-black p-27-0-55'> <Container> <Row> <Col lg> <Card className='card-dark card-post card-axis-point border-gray-1'> <Card.Header> <div className='d-flex align-items-center'> <h3 className='text-white fs-18 mb-0'>Social</h3> </div> </Card.Header> <Card.Body> {isLoggedIn && ( <ActivityPost activityComment={activityComment} searchValue={searchValue} attachments={attachments} attachmentsHandler={attachmentsHandler} deleteHandler={deleteHandler} postContentHandler={postContentHandler} postContentHandlerSelect={postContentHandlerSelect} submitPost={submitPost} userImage={userImage} isEnable={isEnable} isMediaEnable={isMediaEnable} selectedMediaFile={selectedMediaFile} users={users} /> )} <ActivityList activities={activities} totalActivities={totalActivities} fetchMoreActivity={fetchMoreActivity} handleShow={handleShow} handleShowCommentModal={handleShowCommentModal} likesClickHandler={likesClickHandler} repostsClickhandler={repostsClickhandler} /> </Card.Body> </Card> </Col> {isLoggedIn ? ( <Col lg={3} className='mw-375'> <Card className='card-dark card-post bs-none border-gray-1 mb-4'> <Card.Body className='p-3'> <div className='text-center'> <Figure className='figure-circle figure-gray-4 figure-100 figure mb-2'> <img className='cover' src={ ASSETS_URL + user?.profilePath ?? '/profile/no-profile-image.jpg' } alt='image' /> </Figure> <h3 className='fs-20 fw-500 text-white'> {user?.companyName ?? user?.brandName} </h3> </div> <hr></hr> <div> <ul className='listing-50p'> <li className='border-end'> {followersCount > 0 ? ( <Link href={'/followers/' + user.slug}> <a> <span className='color-777777 fs-16 fw-500 text-center d-block'> Followers </span> <p className='fs-18 fw-600 color-white mb-0 text-center'> {followersCount} </p> </a> </Link> ) : ( <div> <span className='color-777777 fs-16 fw-500 text-center d-block'> Followers </span> <p className='fs-18 fw-600 color-white mb-0 text-center'> {followersCount} </p> </div> )} </li> <li> {followingsCount > 0 ? ( <Link href={'/following/' + user.slug}> <a> <span className='color-777777 fs-16 fw-500 text-center d-block'> Following </span> <p className='fs-18 fw-600 color-white mb-0 text-center'> {followingsCount} </p> </a> </Link> ) : ( <div> <span className='color-777777 fs-16 fw-500 text-center d-block'> Following </span> <p className='fs-18 fw-600 color-white mb-0 text-center'> {followingsCount} </p> </div> )} </li> </ul> </div> </Card.Body> </Card> <Card className='card-dark card-post card-axis-point border-gray-1'> <Card.Header className='px-4'> <h3 className='text-white fs-18 mb-0'> Companies You May know </h3> </Card.Header> <Card.Body className='p-0'> <ListGroup variant='flush' className='list-gray'> { <div id='myScrollable' className='scroll-component' style={{ maxHeight: '450px', minHeight: '100px', overflow: 'auto', }} > <InfiniteScroll dataLength={companies.length} next={fetchMoreCompanies} hasMore={ totalCompanies > companies.length ? true : false } scrollableTarget='myScrollable' loader={[...Array(8)].map((arrayData, aIndex) => { return ( <div key={aIndex + 'skeleton'} className='d-flex justify-content-between align-items-center px-5 list-group-item' > <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <div className='d-flex align-items-center'> <Skeleton circle={true} height={40} width={40} className='mb-0 me-3' /> <Skeleton width={200} height={20} /> </div> <Skeleton width={100} height={30} className='me-2' /> </SkeletonTheme> </div> ); })} > {isLoading ? ( [...Array(10)].map((arrayData, index) => { return ( <div key={index + 'skeleton-company'} className='d-flex justify-content-between align-items-center px-5 list-group-item' > <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <div className='d-flex align-items-center'> <Skeleton circle={true} height={40} width={40} className='mb-0 me-3' /> <Skeleton width={200} height={20} /> </div> <Skeleton width={100} height={30} className='me-2' /> </SkeletonTheme> </div> ); }) ) : companies.length > 0 ? ( companies.map((company, cIndex) => ( <ListGroup.Item key={cIndex}> <CompanyList key={cIndex} company={company} /> </ListGroup.Item> )) ) : ( <ListGroup.Item className='text-center'> No records found! </ListGroup.Item> )} </InfiniteScroll> </div> } </ListGroup> </Card.Body> </Card> </Col> ) : null} </Row> </Container> </section> <LightboxModal sliderIndex={activeIndex} images={individualPostAttachments} show={show} handleClose={handleClose} /> <CommentModal showCommentModal={isCommentModal} handleCloseCommentModal={handleCloseCommentModal} postId={selectedPostId} userImage={userImage} users={users} /> <RepostModal show={showRepostModal} hide={repostsModalClose} reposts={reposts} repostsCount={repostsCount} fetchMoreReposts={fetchMoreReposts} /> <LikeModal show={showLikeModal} hide={likesModalClose} likes={likes} likesCount={likesCount} fetchMoreLikes={fetchMoreLikes} /> </> ); } export default Social; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); const userImage = contextCookie(context, 'userImage'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: { isLoggedIn, userImage }, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/set-minimum-order-amount.js
import { useEffect, useRef, useState } from 'react'; import { useRouter } from 'next/router'; import { Container, Row, Col, Card, Form, Button, Spinner, } from 'react-bootstrap'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import Notifier from '../components/Notifier'; import { contextCookie } from '../services/Auth'; import { APP_NAME } from '../config/server.config'; import Meta from '../components/Meta'; function MyAccountSeller({ data }) { const noti = new Notifier(); const [profileData, setProfileData] = useState({ orderAmount: data?.brand?.orderAmount, }); const [showLoading, setShowLoading] = useState(false); const [submitted, setSubmitted] = useState(false); const handleChange = (event) => { const { name, value } = event.target; setProfileData((prevState) => ({ ...prevState, [name]: value })); }; const updateProfileDetails = async (e) => { e.preventDefault(); setSubmitted(true); setShowLoading(true); const response = await Rest.axiosRequest( API.setMinimumOrderAmount, profileData, 'POST' ); setShowLoading(false); if (response.status === 201) { noti.notify(response.data.message, 'success'); setSubmitted(false); } else { noti.notify(response.data.message, 'danger'); } }; return ( <> <Meta title={`Set Minimum Order Amount | ${APP_NAME}`} keywords={''} description={''} /> <section className="bg-black p-30-0-60"> <Container> <Row> <Col lg={6} className="mx-auto"> <Card className="card-dark border-gray p-15-20-20 br-10"> <Card.Header className="border-btm-gray mb-20 d-flex align-items-center"> <Card.Title className="fs-18 fw-600 color-dcdcdc mb-0"> Set Minimum Order Amount </Card.Title> </Card.Header> <Card.Body className="p-0"> <Row> <Col lg={12}> <Form.Group className="mb-4 form-dark"> {/* <Form.Label>Set Minimum Order Amount</Form.Label> */} <Form.Control type="number" placeholder="Enter Minimum Order Amount" value={profileData.orderAmount} name="orderAmount" onChange={handleChange} /> </Form.Group> </Col> <Col lg={12}> <div className="text-center m-0-0-45"> <Button variant="primary" type="submit" className="btn-wh-184-51 btn-rounded" onClick={!showLoading ? updateProfileDetails : null} disabled={showLoading} > {showLoading ? ( <Spinner animation="border" /> ) : ( 'Save' )} </Button> </div> </Col> </Row> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default MyAccountSeller; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } try { const token = contextCookie(context, 'token'); const response = await Rest.axiosRequest( API.sellerProfile, {}, 'GET', false, token ); return { props: { data: response.data.data ?? [] }, }; } catch { return { props: { data: [] }, }; } }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/brands.js
import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Container, Row, Col, Card, Table, Figure, Image, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faTrashAlt } from '@fortawesome/free-solid-svg-icons'; import ReactPaginate from 'react-paginate'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import Notifier from '../components/Notifier'; import { SkeletonOptions } from '../services/SkeletonOptions'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import { customFormat, dateTimeFormat, Helper } from '../services/Helper'; import { contextCookie } from '../services/Auth'; import Meta from '../components/Meta'; import { APP_NAME, ASSETS_URL } from '../config/server.config'; function Brands(props) { const noti = new Notifier(); const router = useRouter(); const [showSkeleton, setShowSkeleton] = useState(true); const [brands, setBrands] = useState([]); const [limit, setLimit] = useState(10); const [totalPages, setTotalPages] = useState(); const [params, setParams] = useState({ offset: props.queryString.offset ?? 0, }); const [disabled, setDisabled] = useState(false); useEffect(async () => { setShowSkeleton(true); router.push('/brands', { query: { ...params } }, undefined, { shallow: true, }); const response = await Rest.axiosRequest( API.retailerDetails + '/brands' + '?' + `limit=${limit}&` + new URLSearchParams(params).toString(), {}, 'GET' ); if (response.status === 200) { setBrands(response.data.data.brands); setTotalPages(response.data.data.totalPages); } else { noti.notify(response.data.message, 'danger'); } setShowSkeleton(false); }, [new URLSearchParams(params).toString()]); const handlePageChange = (event) => { setParams((prevState) => ({ ...prevState, offset: event.selected })); }; return ( <> <Meta title={`Brands | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-30 br-10'> {/* <Card.Header className="border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13"> <Card.Title className="fs-18 fw-600 color-white mb-0">My Favourite</Card.Title> </Card.Header> */} <Card.Body className='p-0'> <div className='table-wrap CustomScrollbar CustomScrollbarY'> <Table bordered hover className='table-head-bg-000 table-td-bg-191919' variant='dark' id='seller-favourite' > <thead> <tr> <th width='280px;'>Name</th> <th width='200px;'>Total Orders Completed</th> <th width='100px;'>Brand Score</th> <th width='200px;'>State</th> <th width='120px;'>No. of Products</th> <th width='100px;'>Year Founded</th> </tr> </thead> <tbody> {showSkeleton ? ( [...Array(7)].map((data, index) => { return ( <tr key={index}> {[...Array(6)].map((data, i) => { return ( <td key={i}> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </td> ); })} </tr> ); }) ) : brands.length ? ( brands.map((brand) => { return ( <tr key={brand.id}> <td> <Link href={`/brand/${brand.slug}`}> <a className='color-f3772c text-decoration-none d-flex align-items-center'> <Figure className='figure-40 figure-circle mb-0 me-3'> <Image alt='profile' height={150} src={ASSETS_URL + brand?.profilePath} className='cover' /> </Figure> {brand.brandName} </a> </Link> </td> <td> {brand?.totalOrdersCompleted}</td> <td> {brand?.avgRating}</td> <td> {brand?.brandCompany?.state?.name}</td> <td>{brand?.product?.length}</td> <td>{brand?.year}</td> </tr> ); }) ) : ( <tr> <td className='text-center' colSpan={11}> No records found! </td> </tr> )} </tbody> </Table> </div> <div className='mt-5 d-flex justify-content-center'> {totalPages > 1 ? ( <ReactPaginate previousLabel={ <i className='fas fa-long-arrow-alt-left'></i> } nextLabel={ <i className='fas fa-long-arrow-alt-right'></i> } pageClassName='page-item' pageLinkClassName='page-link' previousClassName='page-item prev-item' previousLinkClassName='page-link' nextClassName='page-item next-item' nextLinkClassName='page-link' breakLabel='...' breakClassName='page-item' breakLinkClassName='page-link' pageCount={totalPages} //marginPagesDisplayed={1} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName='pagination' activeClassName='active' forcePage={parseInt(params.offset)} /> ) : null} </div> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default Brands; export async function getServerSideProps(context) { return { props: { queryString: context.query, }, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/manage-subscription.js
import React, { useEffect, useState } from 'react'; import { Button, Card, Col, Container, Form, Modal, OverlayTrigger, Row, Spinner, Tooltip, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight, faCrown, faQuestionCircle, faStar, } from '@fortawesome/free-solid-svg-icons'; import Rest from '../config/rest.config'; import API from '../config/endpoints.config'; import moment from 'moment'; import { customFormat } from '../services/Helper'; import { contextCookie } from '../services/Auth'; import { saveAs } from 'file-saver'; import { APP_NAME, REACT_APP_API_BASE_URL } from '../config/server.config'; import Notifier from '../components/Notifier'; import Meta from '../components/Meta'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; import FormValidator from '../components/FormValidator'; import InputMask from 'react-input-mask'; import { cardImages, getCardTypeByValue, isExpiryInvalid, CARD_TYPES, } from '../services/CardInput'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../services/SkeletonOptions'; function ManageSubscription() { const noti = new Notifier(); const validator = new FormValidator([ { field: 'cardNumber', method: 'isEmpty', validWhen: false, message: 'Please enter card number.', }, { field: 'cardHolder', method: 'isEmpty', validWhen: false, message: "Please enter card holder's name.", }, { field: 'cardExpiry', method: 'isEmpty', validWhen: false, message: 'Please enter card expiry.', }, { field: 'cardCvc', method: 'isEmpty', validWhen: false, message: 'Please enter card cvv.', }, ]); const [isSideEffect, setIsSideEffect] = useState(false); const [isLoadingActiveSubscription, setIsLoadingActiveSubscription] = useState(false); const [activeSubscription, setActiveSubscription] = useState({}); const [activePlan, setActivePlan] = useState({}); const [pastSubscriptionsList, setPastSubscriptionsList] = useState([]); const [isLoadingPlans, setIsLoadingPlans] = useState(false); const [plans, setPlans] = useState([]); const [show, setShow] = useState(false); const [submitted, setSubmitted] = useState(false); const [showPaymentLoading, setShowPaymentLoading] = useState(false); const [showDowngradeLoading, setShowDowngradeLoading] = useState(false); const [isLoading, setIsLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [state, setState] = useState({ cardHolder: '', cardNumber: '', cardExpiry: '', cardCvc: '', }); const [maskInput, setMaskInput] = useState('9999 9999 9999 9999 9999'); const [card, setCard] = useState('unknown'); const [expiryError, setExpiryError] = useState(''); const [cardError, setCardError] = useState(''); const [cvvError, setCvvError] = useState(''); useEffect(async () => { //const token = contextCookie(context, "token"); setIsLoadingActiveSubscription(true); const subscriptionsDetails = await Rest.axiosRequest( API.subscribedPlan, {}, 'GET', false ); const response = subscriptionsDetails; if (response.status === 200) { setIsLoadingActiveSubscription(false); setActiveSubscription({ id: response?.data?.data?.activeSubscription ? response?.data?.data?.activeSubscription?.planId : 0, activePlan: response?.data?.data?.activeSubscription ? response.data?.data?.activeSubscription?.userSubscription[0]?.plans ?.title : [], price: response?.data?.data?.activeSubscription ? response?.data?.data?.activeSubscription?.userSubscription[0]?.plans ?.planPrice : '', startDate: response?.data?.data?.activeSubscription ? response?.data?.data?.activeSubscription?.userSubscription[0] ?.startDate : '', endDate: response?.data?.data?.activeSubscription ? response?.data?.data?.activeSubscription?.userSubscription[0] ?.endDate : '', }); setActivePlan(response?.data?.data?.activePlanDetails); setPastSubscriptionsList( response?.data?.data?.pastSubscriptionsList ? response?.data?.data?.pastSubscriptionsList?.userSubscription : [] ); } setIsLoadingPlans(true); const plansData = await Rest.axiosRequest(API.getPlans, {}, 'GET'); if (plansData.status === 200) { setIsLoadingPlans(false); setPlans(plansData?.data?.data); } }, [isSideEffect]); const downloadInvoice = async (id) => { setIsLoading(true); const response = await Rest.axiosRequest(API.invoice + `${id}`, {}, 'GET'); if (response.status === 200) { setIsLoading(false); saveAs(REACT_APP_API_BASE_URL + '/get/file' + response.data.data); } else { setIsLoading(false); noti.notify('Something went wrong please try again!', 'danger'); } }; const handleClose = () => { setShow(false); }; const handleShow = async (orderId, slug) => { setShow(true); // const response = await Rest.axiosRequest( // API.getMyProduct + `/${slug}`, // {}, // "GET" // ); // if (response.data.status) { // setProductDetails(response.data.data); // setSelectedOrderId(orderId); // setShow(true); // } else { // noti.notify(response.data.message, "danger"); // } }; const onChangeHandler = async (event) => { const { name, value } = event.target; setState((prevState) => ({ ...prevState, [name]: value, })); }; const cardChangeHandler = (event) => { setState((prevState) => ({ ...prevState, cardNumber: event.target.value })); let cardType = getCardTypeByValue(event.target.value) ? getCardTypeByValue(event.target.value).type : 'unknown'; setCard(cardType); CARD_TYPES.map((card) => { if (cardType === card.type) { setMaskInput(card.cardInputMask); } }); if (event.target.value.length != 0 && event.target.value.length < 15) { setCardError('Card number is invalid'); } else { setCardError(''); } }; const dateChangeHandler = (event) => { const expiryDate = event.target.value; const errorMsg = isExpiryInvalid(expiryDate); setState((prevState) => ({ ...prevState, cardExpiry: expiryDate })); if (!checkValidation.cardExpiry.isInvalid) { setExpiryError(errorMsg); } else { setExpiryError(''); } }; const csvChangeHandler = (event) => { const cvvData = event.target.value; const errorMsg = 'CVV is invalid'; if ( !checkValidation.cardCvc.isInvalid && cvvData !== '' && cvvData.length < 3 ) { setCvvError(errorMsg); } else { setState((prevState) => ({ ...prevState, cardCvc: event.target.value })); setCvvError(''); } // if (event.target.value !== null || event.target.value == '') { // setCardError(event.target.value) // } }; const handleUpgrade = async (e, slug) => { e.preventDefault(); const validation = validator.validate(state); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowPaymentLoading(true); const response = await Rest.axiosRequest( API.upgradeSubscription + '/' + slug, state ); if (response.data.status) { setIsSideEffect(true); setIsSideEffect(false); noti.notify(response.data.message, 'success'); setSubmitted(false); handleClose(); } else { noti.notify(response.data.message, 'danger'); } setShowPaymentLoading(false); } }; const handleDowngrade = async () => { setShowDowngradeLoading(true); const response = await Rest.axiosRequest(API.downgradeSubscription); if (response.data.status) { setIsSideEffect(true); setIsSideEffect(false); noti.notify(response.data.message, 'success'); } else { noti.notify(response.data.message, 'danger'); } setShowDowngradeLoading(false); }; let checkValidation = submitted ? validator.validate(state) : validation; return ( <> <Meta title={`Manage Subscription | ${APP_NAME}`} keywords={''} description={''} /> <section className="bg-black p-30-0-60"> <Container> <Row> <Col lg={12} className="mx-auto"> <Card className="card-dark border-gray p-8-21-30 br-10"> <Card.Header className="border-btm-gray mb-20 px-0"> <Card.Title className="fs-18 fw-600 color-dcdcdc"> Manage Subscription </Card.Title> </Card.Header> <Card.Body className="p-0"> <div className="brown-box p-20 d-flex justify-content-between align-items-center mb-30 flex-wrap"> <ul className="listing-with-title"> {isLoadingActiveSubscription ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <li> <span className="title fs-15 fw-500 color-dcdcdc"> <Skeleton count={1} /> </span> <span className="fs-15 fw-600 color-dcdcdc"> <Skeleton count={1} /> </span> </li> </SkeletonTheme> ) : ( <> <li> <span className="title fs-15 fw-500 color-dcdcdc"> Active Plan </span> <span className="fs-15 fw-600 color-dcdcdc"> {activePlan?.title} </span> </li> {activeSubscription.id != 1 && activeSubscription.startDate && ( <> <li> <span className="title fs-15 fw-500 color-dcdcdc"> Start Date </span> <span className="fs-15 fw-600 color-dcdcdc"> {moment( activeSubscription.startDate ).format(customFormat)} </span> </li> <li> <span className="title fs-15 fw-500 color-dcdcdc"> End Date </span> <span className="fs-15 fw-600 color-dcdcdc"> {moment(activeSubscription.endDate).format( customFormat )} </span> </li> </> )} </> )} </ul> {/* <Button className="btn-outline-secondary-transparent bs-none br-30 m-5-0"> Cancel Subscription </Button> */} </div> <div> <Card.Title className="fs-18 fw-600 color-dcdcdc mb-15"> Upgrade Plan </Card.Title> </div> <Row> {isLoadingPlans ? [...Array(2)].map((value, key) => ( <Col key={'col-' + key} sm="auto" className="mb-30"> <div className={`box-dark p-20 br-15 subscribed-plan h-100`} key={'div-' + key} > <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton count={14} width={200} /> </SkeletonTheme> </div> </Col> )) : plans.length > 0 && plans.map((item, index) => ( <> <Col sm="auto" className="mb-30" key={index}> <div className={`box-dark p-20 br-15 subscribed-plan h-100 ${ activeSubscription.id === item.id ? `plan-active` : null }`} > <span className="fs-30 color-22a612 mb-10 d-block"> {item.price > 0 ? ( <FontAwesomeIcon icon={faCrown} /> ) : ( <FontAwesomeIcon icon={faStar} /> )} </span> <p className="mb-0 price fs-28 fw-700 color-dcdcdc"> {item.price > 0 ? `$ ${item.price}` : 'FREE'} <span className="fs-13 color-a5a5a5 fw-400"> {item.price > 0 ? '/Month' : ''} </span> </p> <p className="plan-type fs-16 fw-500 color-dcdcdc mb-20"> {item.title} </p> <div className="border-btm-white-light mb-20"></div> <ul className="listing-true-false "> <li className="true fs-14 fw-400 color-dcdcdc"> List and showcase product offerings </li> <li className="true fs-14 fw-400 color-dcdcdc"> Receive order requests </li> <li className="true fs-14 fw-400 color-dcdcdc"> Build Brand credibility and reputation </li> </ul> {activeSubscription.id != item.id ? ( <> <div className="p-b-15 text-center"> {item.id == 2 ? ( <button type="button" className="btn btn-primary btn-wh-180-46 btn-h-38 btn-rounded mb-3" onClick={() => handleShow(item.id)} > Upgrade </button> ) : activeSubscription.id == 2 ? ( <button type="button" className="btn btn-primary btn-wh-180-46 btn-h-38 btn-rounded mb-3" onClick={ !showDowngradeLoading ? handleDowngrade : null } disabled={showDowngradeLoading} > {showDowngradeLoading ? ( <Spinner animation="border" /> ) : ( 'Downgrade' )} </button> ) : null} </div> </> ) : null} </div> </Col> </> ))} </Row> <h4 className="fs-18 fw-600 color-dcdcdc mb-15"> Past Subscriptions List </h4> <div className="table-wrap"> {/* <Table bordered hover variant="dark" id="seller-subscription"> */} <ResponsiveTable className="table table-bordered table-hover table-dark" id="seller-subscription" > <Thead> <Tr> <Th width="13px;">Subscriptions</Th> <Th className="text-center" width="130px;"> Price </Th> <Th className="text-center" width="130px;"> Start Date </Th> <Th className="text-center" width="130px;"> End Date </Th> <Th className="text-center" width="100px;"> Download Invoice </Th> </Tr> </Thead> <Tbody> {pastSubscriptionsList.length > 0 ? ( pastSubscriptionsList.map((rowData, keyIndex) => ( <Tr key={keyIndex + 'past'}> <Td>{rowData.plans.title}</Td> <Td className="text-center"> {rowData.plans.planPrice}/Month </Td> <Td className="text-center"> {moment(rowData.startDate).format(customFormat)} </Td> <Td className="text-center"> {moment(rowData.endDate).format(customFormat)} </Td> <Td className="text-center"> <a onClick={ !isLoading ? () => downloadInvoice(rowData.id) : null } disabled={isLoading} className={`btn btn-outline-primary btn-wh-130-38 btn-h-30 b-w-2 br-30 p-5-21 fs-14 text-decoration-none${ isLoading ? ' disabled' : '' }`} > {isLoading ? ( <Spinner animation="border" size="sm" /> ) : ( 'Download' )} </a> </Td> </Tr> )) ) : ( <Tr> <Td className="text-center" colSpan={10}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> </Card.Body> </Card> </Col> </Row> </Container> </section> <Modal show={show} onHide={handleClose} centered className="modal-dark"> <Modal.Header closeButton> <Modal.Title>Upgrade Plan</Modal.Title> </Modal.Header> <Modal.Body> {/* <p className="fs-14 fw-500 color-white"> <p className="mb-0 price fs-28 fw-700 color-dcdcdc"> 99 <span className="fs-13 color-a5a5a5 fw-400">/Month</span> </p> <p className="plan-type fs-16 fw-500 color-dcdcdc mb-20"> Marketplace </p> </p> */} <Form className="form-dark"> <Row> <Col md={12}> <h3 className="fs-18 fw-700 color-dcdcdc mb-17 mt-13"> Payment Details </h3> </Col> {/* <Form> */} <Col md={6}> <Form.Group className="mb-4"> <Form.Label>Card Holder's Name</Form.Label> <Form.Control type="text" name="cardHolder" onChange={onChangeHandler} placeholder="Enter Card Holder's Name" />{' '} <div className={ checkValidation.cardHolder.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.cardHolder.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="mb-4"> <Form.Label>Card Number</Form.Label> <div className="card_img"> <InputMask name="cardNumber" className="form-control" placeholder="Card number" mask={maskInput} maskChar={null} onChange={cardChangeHandler} onBlur={cardChangeHandler} /> <img src={`${cardImages[card ?? 'unknown'].src}`} style={{ width: '40px', height: 'auto' }} /> </div> {cardError && <div className="error"> {cardError} </div>} <div className={ checkValidation.cardNumber.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.cardNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="mb-4"> <Form.Label>Expiry</Form.Label> <InputMask name="cardExpiry" className="form-control" mask="99/99" maskChar={null} placeholder="MM / YY" onChange={dateChangeHandler} onBlur={dateChangeHandler} /> {expiryError && <div className="error"> {expiryError} </div>} <div className={ checkValidation.cardExpiry.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.cardExpiry.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="mb-4"> <Form.Label> CVV <OverlayTrigger overlay={ <Tooltip id="tooltip-disabled"> CVV number on the back of the card </Tooltip> } > <span className="d-inline-block"> <FontAwesomeIcon icon={faQuestionCircle} /> </span> </OverlayTrigger> </Form.Label> <InputMask name="cardCvc" maskChar={null} //maskPlaceholder={null} className="form-control" mask="999" placeholder="CVV" onChange={csvChangeHandler} onBlur={csvChangeHandler} /> {cvvError && <div className="error"> {cvvError} </div>} <div className={ checkValidation.cardCvc.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.cardCvc.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <Form.Group className="text-center"> <Button variant="primary" type="submit" className="btn-wh-180-54 btn-rounded btn-right-icons m-10" onClick={(e) => !showPaymentLoading ? handleUpgrade(e, 'marketplace') : null } disabled={showPaymentLoading} > {showPaymentLoading ? ( <Spinner animation="border" /> ) : ( 'Submit' )} <span className="color-22a612"> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </Form.Group> </Col> </Row> </Form> </Modal.Body> </Modal> </> ); } export default ManageSubscription; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: { queryString: context.query, }, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/my-orders.js
import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Card, Col, Container, Row, Form, Button, Table, OverlayTrigger, Tooltip, Spinner, Modal, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCommentDots, faMagnifyingGlass, faTimes, faAngleRight, faReceipt, faSpinner, } from '@fortawesome/free-solid-svg-icons'; import Select from 'react-select'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import moment from 'moment'; import ReactPaginate from 'react-paginate'; import ReactStars from 'react-rating-stars-component'; import { saveAs } from 'file-saver'; import Notifier from '../components/Notifier'; import Rest from '../config/rest.config'; import API from '../config/endpoints.config'; import { DropdownIndicator, react_select_xs_Styles, } from '../components/DropDown'; import { SkeletonOptions } from '../services/SkeletonOptions'; import FormValidator from '../components/FormValidator'; import { Helper } from '../services/Helper'; import { contextCookie } from '../services/Auth'; import { APP_NAME, REACT_APP_API_BASE_URL } from '../config/server.config'; import Meta from '../components/Meta'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; function MyOrdersRetailer(props) { const [show, setShow] = useState(false); const noti = new Notifier(); const router = useRouter(); const [params, setParams] = useState({ category: props.queryString.category ?? '', sortBy: props.queryString.sortBy ?? '', keyword: props.queryString.keyword ?? '', offset: props.queryString.offset ?? 0, }); const [showSkeleton, setShowSkeleton] = useState(true); const [orders, setOrders] = useState([]); const [categories, setCategories] = useState([]); const [keyword, setKeyword] = useState(props.queryString.keyword ?? ''); const sortBy = [ { id: 'desc', value: 'desc', name: 'Newest to Oldest', label: 'Newest to Oldest', }, { id: 'asc', value: 'asc', name: 'Oldest to Newest', label: 'Oldest to Newest', }, ]; const [limit, setLimit] = useState(10); const [totalPages, setTotalPages] = useState(); const [updateList, setUpdateList] = useState(false); const [orderDetails, setOrderDetails] = useState([]); const validator = new FormValidator([ // { // field: 'quality_rating', // method: 'isEmpty', // validWhen: false, // message: 'Please give rating', // }, // { // field: 'quality_review', // method: 'isEmpty', // validWhen: false, // message: 'Please write your review', // }, { field: 'dot_rating', method: 'isEmpty', validWhen: false, message: 'Please give rating', }, { field: 'dot_review', method: 'isEmpty', validWhen: false, message: 'Please write your review', }, { field: 'general_rating', method: 'isEmpty', validWhen: false, message: 'Please give rating', }, { field: 'general_review', method: 'isEmpty', validWhen: false, message: 'Please write your review', }, ]); const [tableVisibility, setTableVisibility] = useState({}); const toggleTable = (orderId) => { setTableVisibility((prevState) => ({ ...prevState, [orderId]: !prevState[orderId], })); }; const [showLoading, setShowLoading] = useState(false); const [isInvoiceLoading, setIsInvoiceLoading] = useState({}); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const [products, setProducts] = useState([]); const [reviewData, setReviewData] = useState({ products: products, dot_rating: 0, dot_review: '', general_rating: 0, general_review: '', }); const [selectedOrderId, setSelectedOrderId] = useState(''); const [disableAllBtn, setDisableAllBtn] = useState(false); useEffect(async () => { setShowSkeleton(true); router.push('/my-orders', { query: { ...params } }, undefined, { shallow: true, }); const response = await Rest.axiosRequest( API.myOrdersRetailer + '?' + `limit=${limit}&` + new URLSearchParams(params).toString(), {}, 'GET' ); if (response.status === 200) { setOrders(response.data.data.orders); setTotalPages(response.data.data.totalPages); } else { noti.notify(response.data.message, 'danger'); } if (!categories.length) { const categoriesData = await Rest.axiosRequest( API.getCategories, {}, 'GET' ); if (categoriesData.status === 200) { const categories = []; categoriesData.data.data.map((category) => { categories.push({ id: category.id, value: category.id, name: category?.title, label: category?.title, }); }); setCategories(categories); } else { noti.notify(categoriesData.data.message, 'danger'); } } setShowSkeleton(false); }, [new URLSearchParams(params).toString(), updateList]); const handleFilterChange = (val, e) => { if (val) { setParams((prevState) => ({ ...prevState, [e.name]: val.value })); } else { setParams((prevState) => ({ ...prevState, [e.name]: '' })); } }; const onChangeSearch = (e) => { if (e.target.value) { setKeyword(e.target.value); } else { setKeyword(''); } }; const handlePageChange = (event) => { setParams((prevState) => ({ ...prevState, offset: event.selected })); }; const handleClose = () => { setShow(false); setSelectedOrderId(''); setReviewData({ quality_rating: 0, quality_review: '', dot_rating: 0, dot_review: '', general_rating: 0, general_review: '', }); }; const handleShow = async (orderId) => { await Rest.axiosRequest(API.getOrder + `/${orderId}`, {}, 'GET').then( (response) => { if (response.data.status) { const products = []; response?.data?.data?.orderInvoiceItems?.map((item) => { products.push({ id: item?.product?.id, title: item?.product?.title, quality_rating: 0, quality_review: '', }); }); setProducts(products); setOrderDetails(response.data.data); setSelectedOrderId(orderId); setShow(true); } else { noti.notify(response.data.message, 'danger'); } } ); }; const qualityRatingChanged = (value, index, name) => { const editData = products.map((item, i) => i === index && name ? { ...item, [name]: value } : item ); setProducts(editData); }; const dotRatingChanged = (nextValue, prevValue, name) => { setReviewData((prevState) => ({ ...prevState, dot_rating: nextValue })); }; const generalRatingChanged = (nextValue, prevValue, name) => { setReviewData((prevState) => ({ ...prevState, general_rating: nextValue })); }; const handleProductsReviewChange = (e, index) => { const { name, value } = e.target; const editData = products.map((item, i) => i === index && name ? { ...item, [name]: value } : item ); setProducts(editData); setReviewData((prevState) => ({ ...prevState, products: editData })); }; const handleReviewChange = (e) => { const { name, value } = e.target; setReviewData((prevState) => ({ ...prevState, [name]: value })); }; const handleAction = async (orderId, action) => { setDisableAllBtn(true); const response = await Rest.axiosRequest( API.updateOrder + '/' + orderId + '/' + action, {} ); if (response.data.status) { setDisableAllBtn(false); noti.notify(response.data.message, 'success'); setUpdateList(!updateList); } else { noti.notify(response.data.message, 'danger'); } }; const handleReviewSubmit = async (e) => { e.preventDefault(); const validation = validator.validate(reviewData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); const response = await Rest.axiosRequest( API.updateOrder + '/' + selectedOrderId + '/review', reviewData ); if (response.data.status) { noti.notify(response.data.message, 'success'); setSubmitted(false); handleClose(); setUpdateList(!updateList); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); } }; const downloadInvoice = async (id) => { setIsInvoiceLoading((prevState) => ({ ...prevState, [id]: !prevState[id], })); const response = await Rest.axiosRequest( API.orderInvoice + `${id}`, {}, 'GET' ); if (response.status === 200) { const data = response.data.data; setIsInvoiceLoading({}); saveAs(REACT_APP_API_BASE_URL + '/get/file' + data?.path, data?.filename); } else { setIsInvoiceLoading({}); noti.notify('Something went wrong please try again!', 'danger'); } }; let checkValidation = submitted ? validator.validate(reviewData) : validation; return ( <> <Meta title={`My Orders | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-20 br-10 card'> <Card.Header className='border-btm-gray mb-20 px-0'> <Card.Title className='fs-18 fw-600 color-dcdcdc'> My Orders </Card.Title> </Card.Header> <Card.Body className='p-0'> <div className='d-flex justify-content-between flex-wrap mb-20'> <Form className='d-flex justify-content-flex-start align-items-center filter-form flex-md-nowrap flex-wrap filter-form order-filter'> {/* <Form.Group className="form-inline form-dark form-group-h-33 me-md-3 me-0 mb-sm-2 flex-fill"> <Form.Label className="my-2">Category:</Form.Label> <Select classNamePrefix="react-select" className="react-select-lg maxw-200" styles={react_select_xs_Styles} options={categories.map(({ id, name }) => ({ value: id, label: name, }))} value={categories.filter( (item) => item.id == params.category )} onChange={(val, e) => handleFilterChange(val, e)} placeholder="Category" components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name="category" isClearable={true} /> </Form.Group> */} <Form.Group className='form-inline form-dark form-group-h-33 me-md-3 me-0 mb-2 flex-fill'> <Form.Label className='my-2'>Sort By:</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg maxw-150' styles={react_select_xs_Styles} options={sortBy.map(({ value, name }) => ({ value: value, label: name, }))} value={sortBy.filter( (item) => item.value == params.sortBy )} onChange={(val, e) => handleFilterChange(val, e)} placeholder='Sort By' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='sortBy' isClearable={true} /> </Form.Group> </Form> <Form className='mb-7 d-flex search-form-main'> <Form.Group className='search-form form-dark maxw-150 mb-3'> <Form.Control type='search' placeholder='Search by Order ID' name='keyword' onChange={onChangeSearch} value={keyword} /> <Button variant='primary' className='btn-wh-35 br-8 bg-f3772c' onClick={() => setParams((prevState) => ({ ...prevState, ['keyword']: keyword, })) } > <FontAwesomeIcon icon={faMagnifyingGlass} /> </Button> </Form.Group> {params.category !== '' || params.sortBy !== '' || params.keyword !== '' ? ( <Form.Group className='form-inline form-dark form-group-h-33 mb-3'> <OverlayTrigger placement='top' overlay={<Tooltip>Clear All</Tooltip>} > <Button variant='secondary' className='btn-wh-35 br-8 bg-f3772c' onClick={() => { setParams({ category: '', sortBy: '', keyword: '', offset: 0, }); setKeyword(''); }} > <FontAwesomeIcon icon={faTimes} /> </Button> </OverlayTrigger> </Form.Group> ) : null} </Form> </div> <div className='table-wrap CustomScrollbar CustomScrollbarY'> <ResponsiveTable className='table table-bordered table-hover table-dark' id='seller-order' > <Thead> <Tr> <Th className='text-center' width='85px;'> Order ID </Th> <Th className='text-center' width='90px;'> Order Date </Th> <Th className='text-center' width='85px;'> Order Total </Th> <Th className='text-center' width='50px;'> Action </Th> </Tr> </Thead> <Tbody> {showSkeleton ? ( [...Array(6)].map((index) => { return ( <Tr key={index}> {[...Array(4)].map((i) => { return ( <Td key={i}> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Td> ); })} </Tr> ); }) ) : orders.length ? ( orders.map((order) => { return ( <> <Tr key={order.id}> <Td className='text-center'> <p className='fs-14 color-dcdcdc fw-500'> #{order.orderId ?? ''} </p> </Td> <Td className='text-start'> {moment(order.createdAt).format( "DD MMM 'YY" )} </Td> <Td className='text-center'> {order.finalOrderTotal ?? ''} <p className='fs-14 color-dcdcdc fw-400 o-08'> {order.totalProducts > 1 ? `${order.totalProducts} Products` : `${order.totalProducts} Product`} </p> </Td> <Td className='text-right'> <div className='d-flex justify-content-end align-items-center'> <button className='toggle-button fas fa-sort-down' onClick={() => toggleTable(order.orderId) } ></button> </div> </Td> </Tr> <Tr className={`table-container ${ tableVisibility[order.orderId] ? 'visible' : 'hidden' }`} > <Td colSpan='4'> <ResponsiveTable className='table table-bordered table-hover table-dark' id='seller-order-items' > <Thead> <Tr> <Th className='text-center'> Invoice # </Th> <Th className='text-start'> Company </Th> <Th className='text-start'> Payment Due </Th> <Th className='text-start'> Payment </Th> <Th className='text-start'>Action</Th> </Tr> </Thead> <Tbody> {showSkeleton ? ( [...Array(5)].map((value, index) => { return ( <Tr key={index}> {[...Array(6)].map((v, i) => { return ( <Td key={i}> <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Td> ); })} </Tr> ); }) ) : order?.orderInvoices.length ? ( order?.orderInvoices.map( (orderInvoice, index) => { return ( <> <Tr key={`order-invoice-${index}`} > <Td className='text-center'> {orderInvoice.invoiceId ?? ''} </Td> <Td className='text-start'> {orderInvoice ?.brandCompany ?.companyName ?? ''} </Td> <Td className='text-start'> {orderInvoice.paymentDue ? moment( orderInvoice.paymentDue ).format("DD MMM 'YY") : '-'} </Td> <Td className='text-start'> {orderInvoice.paymentStatus === '1' ? ( <p className='received'> Paid </p> ) : orderInvoice.paymentStatus === '2' ? ( <p className='placed'> Unpaid </p> ) : ( '-' )} </Td> <Td className='text-right'> <div className='d-flex justify-content-end align-items-center'> <Link href={`/messages/${orderInvoice?.brand?.slug}`} > <a className='btn-rounded btn-outline-secondary-transparent table-chat-btn text-center'> <span className='icon'> <FontAwesomeIcon icon={ faCommentDots } /> </span> </a> </Link> <a className='btn-outline-green-transparent w-30 h-30 btn-circle close-btn m-l-10' title='Download Invoice' onClick={() => downloadInvoice( orderInvoice?.invoiceId ) } > {isInvoiceLoading[ orderInvoice ?.invoiceId ] ? ( <Spinner animation='border' size='sm' /> ) : ( <span className='icon'> <FontAwesomeIcon icon={faReceipt} /> </span> )} </a> {orderInvoice.status === '4' && ( <a className='btn-outline-secondary-transparent br-30 fs-13 text-decoration-none' style={{ marginLeft: '10px', whiteSpace: 'nowrap', }} onClick={() => handleShow( orderInvoice?.invoiceId ) } disabled={ disableAllBtn } > Write Review </a> )} </div> </Td> </Tr> <Tr> <Td colSpan='11'> <ResponsiveTable className='table table-bordered table-hover table-dark' id='seller-order-items' > <Thead> <Tr> <Th className='text-center' width='85px;' > Product </Th> <Th className='text-center' width='85px;' > Brand </Th> <Th className='text-start' width='85px;' > Category </Th> <Th className='text-start' width='85px;' > Units Per Package </Th> <Th className='text-start' width='85px;' > Package Price </Th> <Th className='text-start' width='85px;' > Package </Th> <Th className='text-start' width='85px;' > Delivery Date </Th> <Th className='text-start' width='85px;' > Status </Th> <Th className='text-start' width='85px;' > Total </Th> </Tr> </Thead> <Tbody> {showSkeleton ? ( [...Array(5)].map( ( value, index ) => { return ( <Tr key={index} > {[ ...Array( 6 ), ].map( ( v, i ) => { return ( <Td key={ i } > <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Td> ); } )} </Tr> ); } ) ) : orderInvoice ?.orderInvoiceItems .length ? ( orderInvoice?.orderInvoiceItems.map( ( orderInvoiceItem, index ) => { return ( <Tr key={`order-invoice-item-${index}`} > <Td className='text-center'> {orderInvoiceItem .product ?.title ? Helper.niceString( orderInvoiceItem .product ?.title, 20, true ) : ''} </Td> <Td className='text-start'> {orderInvoiceItem ?.product ?.brand ?.brandName ?? ''} </Td> <Td className='text-start'> {orderInvoiceItem ?.product ?.category ?.title ?? ''} </Td> <Td className='text-start'> { orderInvoiceItem.unitPerPackage } </Td> <Td className='text-start'> { orderInvoiceItem.displayPrice } </Td> <Td className='text-start'> { orderInvoiceItem.quantity } </Td> <Td className='text-start'> {orderInvoiceItem.deliveryDate ? moment( orderInvoiceItem.deliveryDate ).format( "DD MMM 'YY" ) : '-'} </Td> <Td className='text-center'> {orderInvoiceItem.status === '1' ? ( <p className='placed'> Requested </p> ) : orderInvoiceItem.status === '2' ? ( <p className='placed'> Confirmed </p> ) : orderInvoiceItem.status === '3' ? ( <p className='cancel'> Declined </p> ) : orderInvoiceItem.status === '4' ? ( <p className='received'> Completed </p> ) : orderInvoiceItem.status === '5' ? ( <p className='received'> Reviewed </p> ) : ( '' )} </Td> <Td className='text-start'> <p> { orderInvoiceItem.totalPrice } </p> </Td> </Tr> ); } ) ) : ( <Tr> <Td className='text-center' colSpan={8} > No records found! </Td> </Tr> )} {order.offerTotal > 0 && ( <> <Tr key={`order-deal`} > <Td></Td> <Td></Td> <Td></Td> <Td></Td> <Td></Td> <Td className='text-start'> <p> { order.totalPrice } </p> <p> - { order.displayOfferTotal }{' '} <small> ( {order.offerTitle ? Helper.niceString( order.offerTitle, 12, true ) : ''} ) </small> </p> <hr /> <p> { order.finalOrderTotal } </p> </Td> </Tr> </> )} </Tbody> </ResponsiveTable> </Td> </Tr> </> ); } ) ) : ( <Tr> <Td className='text-center' colSpan={8} > No records found! </Td> </Tr> )} {order.offerTotal > 0 && ( <> <Tr key={`order-deal`}> <Td></Td> <Td></Td> <Td></Td> <Td></Td> <Td></Td> <Td className='text-start'> <p>{order.totalPrice}</p> <p> -{order.displayOfferTotal}{' '} <small> ( {order.offerTitle ? Helper.niceString( order.offerTitle, 12, true ) : ''} ) </small> </p> <hr /> <p>{order.finalOrderTotal}</p> </Td> </Tr> </> )} </Tbody> </ResponsiveTable> </Td> </Tr> </> ); }) ) : ( <Tr> <Td className='text-center' colSpan={8}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> <div className='mt-5 d-flex justify-content-center'> {totalPages > 1 ? ( <ReactPaginate previousLabel={ <i className='fas fa-long-arrow-alt-left'></i> } nextLabel={ <i className='fas fa-long-arrow-alt-right'></i> } pageClassName='page-item' pageLinkClassName='page-link' previousClassName='page-item prev-item' previousLinkClassName='page-link' nextClassName='page-item next-item' nextLinkClassName='page-link' breakLabel='...' breakClassName='page-item' breakLinkClassName='page-link' pageCount={totalPages} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName='pagination' activeClassName='active' forcePage={parseInt(params.offset)} /> ) : null} </div> </Card.Body> </Card> </Col> </Row> </Container> </section> <Modal show={show} onHide={handleClose} centered className='modal-dark'> <Modal.Header closeButton> <Modal.Title>Review Product & Brand</Modal.Title> </Modal.Header> <Modal.Body> {products?.length > 0 && products?.map((item, index) => ( <> <Row key={index}> <p className='fs-14 fw-500 color-white'> Product Name : <span className='o-08'>{item?.title}</span> </p> <Col lg={12}> <Form.Group className='form-label-top form-dark form-rating mb-15'> <Form.Label>Product Quality</Form.Label> <div className='form-control'> <ReactStars name='quality_rating' emptyIcon={<i className='fal fa-star'></i>} halfIcon={<i className='fas fa-star-half-alt'></i>} filledIcon={<i className='fas fa-star'></i>} size={30} count={5} color='#656565' activeColor='#22a612' value={item.quality_rating} a11y={true} isHalf={true} editing={true} onChange={(e) => qualityRatingChanged(e, index, 'quality_rating') } /> </div> {/* <div className={ checkValidation.quality_rating.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.quality_rating.message} </div> </div> */} </Form.Group> <Form.Group className='form-dark'> <Form.Label>Write Review</Form.Label> <Form.Control as='textarea' name='quality_review' placeholder='Write Review' style={{ height: '85px' }} onChange={(e) => handleProductsReviewChange(e, index)} value={item.quality_review} /> {/* <div className={ checkValidation.quality_review.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.quality_review.message} </div> </div> */} </Form.Group> </Col> </Row> <hr className='solid' /> </> ))} <p className='fs-14 fw-400 color-white'> Brand :{' '} <span className='o-08'>{orderDetails?.brand?.brandName}</span> </p> <Row> <Col lg={12}> <Form.Group className='form-label-top form-dark form-rating mb-15'> <Form.Label>Delivery On Time</Form.Label> <div className='form-control'> <ReactStars name='dot_rating' count={5} size={30} value={reviewData.dot_rating} isHalf={true} a11y={true} onChange={dotRatingChanged} emptyIcon={<i className='fal fa-star'></i>} halfIcon={<i className='fas fa-star-half-alt'></i>} filledIcon={<i className='fas fa-star'></i>} activeColor='#22a612' editing={true} /> </div> <div className={ checkValidation.dot_rating.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.dot_rating.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <Form.Group className='form-dark mb-30'> <Form.Label>Write Review</Form.Label> <Form.Control as='textarea' name='dot_review' placeholder='Write Review' style={{ height: '85px' }} onChange={handleReviewChange} value={reviewData.dot_review} /> <div className={ checkValidation.dot_review.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.dot_review.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <Form.Group className='form-label-top form-dark form-rating mb-15'> <Form.Label>Response Time</Form.Label> <div className='form-control'> <ReactStars name='general_rating' count={5} size={30} value={reviewData.general_rating} isHalf={true} onChange={generalRatingChanged} emptyIcon={<i className='fal fa-star'></i>} halfIcon={<i className='fas fa-star-half-alt'></i>} filledIcon={<i className='fas fa-star'></i>} activeColor='#22a612' editing={true} /> </div> <div className={ checkValidation.general_rating.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.general_rating.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <Form.Group className='form-dark mb-30'> <Form.Label>Write Review</Form.Label> <Form.Control as='textarea' name='general_review' placeholder='Write Review' style={{ height: '85px' }} onChange={handleReviewChange} value={reviewData.general_review} /> <div className={ checkValidation.general_review.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.general_review.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <Form.Group className='text-center'> <Button variant='primary' type='submit' className='btn-wh-180-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? handleReviewSubmit : null} disabled={showLoading} > {showLoading ? <Spinner animation='border' /> : 'Submit'} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </Form.Group> </Col> </Row> </Modal.Body> </Modal> </> ); } export default MyOrdersRetailer; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: { queryString: context.query, }, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/about-us.js
import React, { useEffect, useState } from 'react'; import { Container, Row, Col, Figure } from 'react-bootstrap'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faQuoteLeft } from '@fortawesome/free-solid-svg-icons'; import { SkeletonOptions } from '../services/SkeletonOptions'; import Meta from '../components/Meta'; import Custom500 from './500'; import { useRouter } from 'next/router'; import { APP_NAME, ASSETS_URL } from '../config/server.config'; const baseColor = '#202020'; const highlightColor = '#444'; function Aboutus({ data }) { if (!data) { return Custom500; } const router = useRouter(); return ( <> <Meta title={data.content ? data.content.meta_title + ` | ${APP_NAME}` : ''} keyword={data.content ? data.content.meta_keyword : ''} description={data.content ? data.content.meta_desc : ''} /> <section className="p-0 bg-black"> <div className="page-title-wrap mb-60 bg-black border-btm-white-light"> <Container className="text-center"> <h2 className="page-title text-center fs-26 color-dcdcdc fw-700 p-30-0 mb-0"> {data.content.section1_main_title} </h2> </Container> </div> <section className="p-30-0 pt-0"> <Container> <Row> <Col lg={6} md={6}> <div className="about-img-col"> <Figure className="mb-0 w-100p br-15 overflow-hidden"> <img className="" src={ASSETS_URL + data.content.section1_list_image1} /> </Figure> </div> </Col> <Col lg={6} md={6}> <div className="content-box about-content-box p-t-30"> <h4 className="fs-18 fw-600 color-dcdcdc o-09 mb-2"> {data.content.section1_title} </h4> <div className="mb-4 color-dcdcdc" dangerouslySetInnerHTML={{ __html: data.content.section1_description, }} ></div> <ul className="listing-icon"> <li> <Figure className="mb-0 w-40 h-40 bg-transparent"> <img className="" src={'assets/images/diam.png'} /> </Figure> <div className="p-t-7"> <strong className="fs-18 fw-700 d-block color-dcdcdc mbottom-5"> {data.content.section1_list_title1} </strong> <div dangerouslySetInnerHTML={{ __html: data.content.section1_list_description1, }} ></div> </div> </li> <li> <Figure className="mb-0 w-40 h-40 bg-transparent"> <img className="" src={'assets/images/dollor-hand.png'} /> </Figure> <div className="p-t-7"> <strong className="fs-18 fw-700 d-block color-dcdcdc mbottom-5"> {data.content.section1_list_title2} </strong> <div dangerouslySetInnerHTML={{ __html: data.content.section1_list_description2, }} ></div> </div> </li> </ul> </div> </Col> </Row> </Container> </section> <section className="bg-color-282828 about-tagline-section p-0-0-80-0"> <Container> <Row> <Col lg={6} md={6}> <div className="content-box p-t-100"> <h4 className="fs-18 fw-600 color-dcdcdc o-09"> {data.content.section2_main_title} </h4> <div dangerouslySetInnerHTML={{ __html: data.content.section2_description, }} ></div> </div> </Col> <Col lg={6} md={6}> <div className="about-tagline-box"> <Figure className="mb-0 w-100p br-15"> <img className="" src={ASSETS_URL + data.content.section1_list_image2} /> </Figure> <div className="tagline-wrap"> <span className="quote-icon"> <FontAwesomeIcon icon={faQuoteLeft} /> </span> <h3 className="fs-18 fw-600 color-black o-09"> {data.content.section2_quote} </h3> </div> </div> </Col> </Row> </Container> </section> </section> </> ); } export default Aboutus; export async function getServerSideProps() { try { const response = await Rest.axiosRequest( API.getCmsData + '/about-us', {}, 'GET' ); return { props: { data: response.data.data ?? [] }, }; } catch { return { props: { data: [] }, }; } }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/_document.js
import { Html, Head, Main, NextScript } from "next/document"; export default function Document() { return ( <Html> <Head> <meta name="theme-color" content="#000000" /> <link rel="icon" href="/favicon.ico" /> <link rel="stylesheet" href="/assets/fonts/kit-pro.fontawesome.com/v5.12.1/css/pro.min.css" /> <link rel="stylesheet" href="/assets/fonts/poppins/stylesheet.css" /> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDlXP-Nx4Vdn88KZ8ELkkANr-OjhJBbmTU&libraries=places" defer ></script> <script dangerouslySetInnerHTML={{ __html: `(function(w,l){` + `w[l] = w[l] || [];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});` + `})(window,'dataLayer');`, }} /> </Head> <body> <Main /> <NextScript /> </body> </Html> ); }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/index.js
import Slider from "react-slick"; import { useState } from "react"; import { Button, Card, Container, Row, Col, Figure } from "react-bootstrap"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleRight } from "@fortawesome/free-solid-svg-icons"; import { faCheckCircle } from "@fortawesome/free-regular-svg-icons"; import Rest from "../config/rest.config"; import API from "../config/endpoints.config"; import Skeleton, { SkeletonTheme } from "react-loading-skeleton"; import { SkeletonOptions } from "../services/SkeletonOptions"; import background from "../public/assets/images/banner-slide1.jpg"; import Meta from "../components/Meta"; import { APP_NAME, ASSETS_URL } from "../config/server.config"; export default function Home({ data }) { return ( <> <Meta title={data.content ? data.content.meta_title + ` | ${APP_NAME}` : ""} keywords={data.content ? data.content.meta_keyword : ""} description={data.content ? data.content.meta_desc : ""} /> <section className="p-0"> <section className="banner-section p-0"> <Slider dots={true}> {data.content.banner_content.length > 0 ? ( data.content.banner_content.map((slider, keyIndex) => ( <div key={keyIndex} className="banner-slide-wrap"> <div className="banner-slide" style={{ backgroundImage: `url(${ASSETS_URL + slider.image})`, }} > <div className="banner-content"> <h2 className="fs-60 fw-300 text-center color-white mb-0"> {slider.preTitle} </h2> <h2 className="fs-60 fw-600 text-center color-white mb-0"> {slider.title} </h2> <p className="fs-17 text-center color-white"> {slider.description} </p> <div className="text-center"> <Button href={slider.buttonLink} type="submit" className="btn-wh-180-54 btn-rounded btn-right-icons btn-bg-white fw-600" > {slider.buttonText} <span className=""> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </div> </div> </div> )) ) : ( <Slider dots={true}> <div className="banner-slide-wrap"> <div className="banner-slide" style={{ backgroundImage: `url(${background})` }} > <div className="banner-content"> <h2 className="fs-60 fw-300 text-center color-white mb-0"> Curabi est felis </h2> <h2 className="fs-60 fw-600 text-center color-white mb-0"> Duis Mis Sien Digni </h2> <p className="fs-17 text-center color-white"> usce eros nulla euismod elementum ante vulputate venenatis ipsum suspendisse vestibulum. </p> <div className="text-center"> <Button type="submit" className="btn-wh-180-54 btn-rounded btn-right-icons btn-bg-white fw-600" > Read More <span className=""> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </div> </div> </div> <div className="banner-slide-wrap"> <div className="banner-slide" style={{ backgroundImage: `url(${background})` }} > <div className="banner-content"> <h2 className="fs-60 fw-300 text-center color-white mb-0"> Curabi est felis </h2> <h2 className="fs-60 fw-600 text-center color-white mb-0"> Duis Mis Sien Digni </h2> <p className="fs-17 text-center color-white"> usce eros nulla euismod elementum ante vulputate venenatis ipsum suspendisse vestibulum. </p> <div className="text-center"> <Button type="submit" className="btn-wh-180-54 btn-rounded btn-right-icons btn-bg-white fw-600" > Read More <span className=""> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </div> </div> </div> </Slider> )} </Slider> </section> <section className="p-70-0-80 vision-section"> <Container> <Row> <Col lg={6} className="mx-auto vision-img-col"> <div className="vision-ing-box"> <Figure className="mb-0 w-100p br-8 overflow-hidden"> <Figure.Image className="cover" src={ASSETS_URL + data.content.section2_image} /> </Figure> </div> </Col> <Col lg={6} className="mx-auto"> <Card className="content-box vision-box br-8 bg-color-white bs-box b-none"> <Card.Body className="p-0"> <span className="fs-18 fw-600 color-22a612"> {data.content.section2_count} </span> <h3 className="title color-dcdcdc fs-35 fw-700"> {data.content.section2_main_title} </h3> <div dangerouslySetInnerHTML={{ __html: data.content.section2_description, }} ></div> <Button href={data.content.section2_button_link} type="submit" className="btn-wh-180-54 btn-rounded btn-right-icons btn-outline-primary-transparent fw-600" > {" "} {data.content.section2_button_title} <span className=""> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </Card.Body> </Card> </Col> </Row> </Container> </section> <section className="p-80-0 brand-section"> <Container> <Row> <Col lg={6} className="mx-auto"> <Card className="content-box brand-content b-none bs-none bg-transparent"> <Card.Body className="p-0"> <span className="fs-18 fw-600 color-white"> {data.content.section3_count} </span> <h3 className="title color-white fs-35 fw-700"> {data.content.section3_main_title} </h3> <ul className="listing-icon"> <li> <i className={ data.content.section3_list_icon1 + " color-white fs-24" } ></i> <p> <strong className="color-white fs-20 fw-500 d-block"> {data.content.section3_list_title1} </strong> <span className="color-white fs-16 fw-300 d-block"> {data.content.section3_list_description1} </span> </p> </li> <li> <i className={ data.content.section3_list_icon2 + " color-white fs-18" } ></i> <p> <strong className="color-white fs-20 fw-500 d-block"> {data.content.section3_list_title2} </strong> <span className="color-white fs-16 fw-300 d-block"> {data.content.section3_list_description2} </span> </p> </li> </ul> <Button href={data.content.section3_button_link} type="submit" className="btn-wh-180-54 btn-rounded btn-right-icons btn-bg-white fw-600" > {data.content.section3_button_title} <span className=""> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </Card.Body> </Card> </Col> <Col lg={6} className="mx-auto"> { <Figure className="mb-0 w-100p br-8 overflow-hidden"> <Figure.Image className="cover" src={ASSETS_URL + data.content.section3_image} /> </Figure> } </Col> </Row> </Container> </section> <section className="p-88-0-78 retailer-section"> <Container> <Row> <Col lg={6} className="mx-auto retailer-img-col"> <div className="retailer-img-box"> <Figure className="mb-0 br-8 large-img"> <Figure.Image className="cover" src={ASSETS_URL + data.content.section4_image} /> </Figure> <Figure className="mb-0 br-8 small-img"> <Figure.Image className="cover" src={ASSETS_URL + data.content.section4_small_image} /> </Figure> </div> </Col> <Col lg={6} className="mx-auto"> <Card className="content-box retailer-box bs-none b-none p-l-46 bg-transparent"> <Card.Body className="p-0"> <span className="fs-18 fw-600 color-22a612"> {data.content.section4_count} </span> <h3 className="title b-btm-none color-dcdcdc fs-35 fw-700"> {data.content.section4_main_title} </h3> <div dangerouslySetInnerHTML={{ __html: data.content.section4_description, }} ></div> <ul className="listing-icon border-top-light p-t-35 mt-8"> <li> <span className={ data.content.section4_list_icon1 + " fs-20" } > <FontAwesomeIcon icon={faCheckCircle} /> </span> <p> <strong className="fs-17 fw-600 color-dcdcdc"> {data.content.section4_list_title1} </strong> <span className="fs-16 fw-400 color-dcdcdc"> {data.content.section4_list_description1} </span> </p> </li> <li> <span className={ data.content.section4_list_icon2 + " fs-20" } > <FontAwesomeIcon icon={faCheckCircle} /> </span> <p> <strong className="fs-17 fw-600 color-dcdcdc"> {data.content.section4_list_title2} </strong> <span className="fs-16 fw-400 color-dcdcdc"> {" "} {data.content.section4_list_description2} </span> </p> </li> <li> <span className={ data.content.section4_list_icon3 + " fs-20" } > <FontAwesomeIcon icon={faCheckCircle} /> </span> <p> <strong className="fs-17 fw-600 color-dcdcdc"> {data.content.section4_list_title3} </strong> <span className="fs-16 fw-400 color-dcdcdc"> {" "} {data.content.section4_list_description3} </span> </p> </li> </ul> <Button href={data.content.section4_button_link} varient="primary" type="submit" className="btn-wh-180-54 btn-rounded btn-right-icons fw-600" > {data.content.section4_button_title} <span className=""> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </Card.Body> </Card> </Col> </Row> </Container> </section> </section> </> ); } export async function getServerSideProps() { try { const res = await Rest.axiosRequest(API.getCmsData + "/home", {}, "GET"); const { data, status } = res.data; if (status) { return { props: { data, }, }; } else { return { redirect: { destination: "/500", }, }; } } catch { return { redirect: { destination: "/500", }, }; } }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/video-bkp.js
const axios = require('axios'); import { useEffect, useRef, useState } from "react"; import { REACT_APP_API_BASE_URL } from "../config/server.config"; import { VideoJS } from "../components/VideoJs"; // const Blob = require('node-blob'); // function typedArrayToURL(typedArray, mimeType) { // if(typedArray){ // return URL.createObjectURL(typedArray) // } // } // function getFilenameFromContentDisposition(res) { // let filename = null; // const disposition = res.headers.get("content-disposition"); // if (disposition?.includes("attachment")) { // const filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/; // const matches = filenameRegex.exec(disposition); // if (matches?.[1]) { // filename = matches[1].replace(/['"]/g, ""); // // Sometimes the filename comes in a URI encoded format so decode it // filename = decodeURIComponent(filename); // // Sometimes the filename starts with UTF-8, remove that // filename = filename.replace(/^UTF-8/i, "").trim(); // } // } // return filename; // } // async function getFileFromLink(url) { // const fileRes = await fetch(url); // const blob = await fileRes.blob(); // let fileName = getFilenameFromContentDisposition(fileRes); // if (!fileName) { // fileName = url.split("/").pop(); // } // const file = new File([blob], fileName, { // type: blob.type, // }); // console.log('file', file); // return file; // } function Video() { const playerRef = useRef(null); const files = [ 'sample_960x400_ocean_with_audio.3gp', 'sample_960x400_ocean_with_audio.asf', 'sample_960x400_ocean_with_audio.avi', 'sample_960x400_ocean_with_audio.f4v', 'sample_960x400_ocean_with_audio.flv', 'sample_960x400_ocean_with_audio.hevc', 'sample_960x400_ocean_with_audio.m2ts', 'sample_960x400_ocean_with_audio.m2v', 'sample_960x400_ocean_with_audio.m4v', 'sample_960x400_ocean_with_audio.mjpeg', 'sample_960x400_ocean_with_audio.mkv', 'sample_960x400_ocean_with_audio.mov', 'sample_960x400_ocean_with_audio.mp4', 'sample_960x400_ocean_with_audio.mpeg', 'sample_960x400_ocean_with_audio.mpg', 'sample_960x400_ocean_with_audio.mts', 'sample_960x400_ocean_with_audio.mxf', 'sample_960x400_ocean_with_audio.rm', 'sample_960x400_ocean_with_audio.ts', 'sample_960x400_ocean_with_audio.vob', 'sample_960x400_ocean_with_audio.webm', 'sample_960x400_ocean_with_audio.wmv', 'sample_960x400_ocean_with_audio.wtv', 'sample_1280x720.swf', 'sample_1280x720_surfing_with_audio.ogv', 'file_example_OGG_640_2_7mg.ogg' ] const types = [ 'video/3gpp', 'video/x-ms-asf', 'video/x-msvideo', 'video/mp4', 'video/x-flv', 'application/octet-stream', 'video/mp2t', 'video/mpeg', 'video/x-m4v', 'image/jpeg', 'video/x-matroska', 'video/quicktime', 'video/mp4', 'video/mpeg', 'video/mpeg', 'video/MP2T', 'application/mxf', 'video/ogg', 'video/mp2t', 'application/x-shockwave-flash', 'video/webm', 'video/x-ms-wmv', 'video/webm', 'application/x-shockwave-flash', 'video/ogg', 'video/ogg' ] const [blobUrls, setBlobUrls] = useState([]); const sources = files.map((file) => { return ( { 'src': REACT_APP_API_BASE_URL + '/get/file/axis-point-media/'+file, } ) }) // useEffect(async () => { // let urls = []; // for await (const file of files){ // const fileRes = await fetch(REACT_APP_API_BASE_URL + '/get/file/axis-point-media/'+file); // const blob = await fileRes.blob(); // urls.push(URL.createObjectURL(blob)); // } // setBlobUrls([...urls]); // }, []) // const videoJsOptions = { // autoplay: true, // controls: true, // responsive: true, // fluid: true, // sources: [{ // src: REACT_APP_API_BASE_URL + '/get/file/axis-point-media/SampleVideo_1280x720_1mb.mp4', // type: 'video/mp4' // }], // // sources: sources // // src: REACT_APP_API_BASE_URL + '/get/file/axis-point-media/sample_960x400_ocean_with_audio.mkv', // // data-setup: { "techOrder": ["youtube"], "sources": [{ "type": "video/youtube", "src": "https://www.youtube.com/watch?v=xjS6SftYQaQ"}] } // }; const handlePlayerReady = (player) => { playerRef.current = player; // You can handle player events here, for example: player.on('waiting', () => { videojs.log('player is waiting'); }); player.on('dispose', () => { videojs.log('player will dispose'); }); }; // const file = REACT_APP_API_BASE_URL + '/get/file/axis-point-media/sample_960x400_ocean_with_audio.mkv'; // const file = async () => ( // await axios.get( REACT_APP_API_BASE_URL + '/get/file/axis-point-media/sample_960x400_ocean_with_audio.mkv' , {responseType: 'blob'}) // .then((res) => {console.log(res)} // // axios.spread((...responses) => { // // console.log(responses); // // responses.map((res) => ( // // console.log(URL.createObjectURL(res.data)) // // )) // // }) // ) // ) // console.log('getFileFromLink()', getFileFromLink(REACT_APP_API_BASE_URL + '/get/file/axis-point-media/sample_960x400_ocean_with_audio.mkv')); // var reader = new FileReader(); // reader.readAsDataURL(file); // const url = typedArrayToURL(getFileFromLink(REACT_APP_API_BASE_URL + '/get/file/axis-point-media/sample_960x400_ocean_with_audio.mkv'), 'video/mkv'); return ( // <video width="320" height="240" controls src={REACT_APP_API_BASE_URL + '/get/file/axis-point-media/sample_960x400_ocean_with_audio.mkv'}> <> {/* <video> <source src={REACT_APP_API_BASE_URL + '/get/file/axis-point-media/sample_960x400_ocean_with_audio.mkv'} type="video/mp4"/> </video> */} {/* <VideoJS options={videoJsOptions} onReady={handlePlayerReady} /> */} { files.map((file, index) => { return ( // blobUrls[index] ? <div className="mb-3"> <div style={{backgroundColor: 'red'}}><span style={{color:'white'}}>{file}</span></div> <div style={{backgroundColor: 'blue'}}><span style={{color:'white'}}>{types[index]}</span></div> {/* <div style={{backgroundColor: 'green'}}><span style={{color:'white'}}>{blobUrls[index]}</span></div> */} <VideoJS key={index} options={ { autoplay: false, controls: true, responsive: true, fluid: true, sources: [{ src: REACT_APP_API_BASE_URL + '/get/file/axis-point-media/'+file, // type: types[index] type: 'video/mp4' }], // sources: [{ // src: blobUrls[index], // type: types[index] // // type: 'video/mp4' // }], } } onReady={handlePlayerReady} /> </div> // : null ) }) } </> // <video // id="vid1" // class="video-js vjs-default-skin" // controls // autoplay // width="640" height="264" // data-setup='{ "techOrder": ["youtube"], "sources": [{ "type": "video/youtube", "src": "https://www.youtube.com/watch?v=xjS6SftYQaQ"}] }' // > // </video> ); } export default Video;
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/reset-password.js
import React, { useState } from 'react'; import { Card, Col, Container, Row, Form, Button, Spinner, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight } from '@fortawesome/free-solid-svg-icons'; import Rest from '../config/rest.config'; import API from '../config/endpoints.config'; import Notifier from '../components/Notifier'; import FormValidator from '../components/FormValidator'; import { useRouter } from 'next/router'; function ResetPassword() { const noti = new Notifier(); let router = useRouter(); const params = router.query; const passwordMatch = (confirmation, state) => { if ( passwordState.password !== '' && passwordState.confirm_password !== '' && passwordState.password === passwordState.confirm_password ) { return false; } else { return true; } }; const validator = new FormValidator([ { field: 'password', method: 'isEmpty', validWhen: false, message: 'Please enter password.', }, { field: 'password', method: 'isLength', args: [6, 20], validWhen: true, message: 'Password should be minimum 6 and maximum 20 characters.', }, { field: 'confirm_password', method: 'isEmpty', validWhen: false, message: 'Please enter confirm password.', }, { field: 'confirm_password', method: 'isLength', args: [6, 20], validWhen: true, message: 'Current password should be minimum 6 and maximum 20 characters.', }, { field: 'confirm_password', method: passwordMatch, validWhen: false, message: 'Please enter same as new password.', }, ]); const token = params.token ?? ''; const [passwordState, setPasswordState] = useState({ password: '', confirm_password: '', }); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const onChangeHandler = (event) => { const { name, value } = event.target; setPasswordState((prevState) => ({ ...prevState, [name]: value.trim() })); }; async function handleOnSubmit(e) { e.preventDefault(); const validation = validator.validate(passwordState); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); const response = await Rest.axiosRequest(API.resetPassword, { token, ...passwordState, }); setShowLoading(false); if (response.data.status) { setSubmitted(false); noti.notify(response.data.message, 'success'); router.replace('/sign-in'); } else { if (response.data.message instanceof Array) { for (let msg in response.data.message) { noti.notify(response.data.message[msg], 'danger'); } } else { noti.notify(response.data.message, 'danger'); } } } } let checkValidation = submitted ? validator.validate(passwordState) : validation; return ( <> <section className="bg-black"> <Container> <Row> <Col lg={5} md={8} className="mx-auto"> <Card className="card-post border-gray bs-none"> <Card.Body className="p-md-5 py-md-4 p-4"> <Card.Title className="text-center fs-26 fw-700 color-dcdcdc mt-3 mb-4"> Reset Password </Card.Title> <Form className="form-dark"> <Form.Group className="mb-4"> <Form.Label>Password</Form.Label> <Form.Control type="password" name="password" placeholder="Enter Password" value={passwordState.password} onChange={onChangeHandler} /> <div className={ checkValidation.password.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.password.message} </div> </div> </Form.Group> <Form.Group className="mb-4"> <Form.Group className="mb-4"> <Form.Label>Confirm Password</Form.Label> <Form.Control type="password" name="confirm_password" placeholder="Enter Confirm Password" value={passwordState.confirm_password} onChange={onChangeHandler} /> <div className={ checkValidation.confirm_password.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.confirm_password.message} </div> </div> </Form.Group> </Form.Group> <Form.Group className="mb-4 text-center"> <Button variant="primary" type="submit" className="btn-wh-180-56 btn-rounded btn-right-icons" onClick={!showLoading ? handleOnSubmit : null} disabled={showLoading} > {showLoading ? ( <Spinner animation="border" /> ) : ( <> Reset Password <span className="color-22a612"> <FontAwesomeIcon icon={faAngleRight} /> </span> </> )} </Button> </Form.Group> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default ResetPassword; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/terms-of-use.js
import React, { useState } from 'react'; import { Container } from "react-bootstrap"; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import Meta from '../components/Meta'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; const baseColor = "#202020"; const highlightColor = "#444"; function TermsOfUse({ cmsData }) { // const [cmsData, setCmsData] = useState(props.data.content ?? []); return ( <> <Meta title={cmsData.content ? cmsData.content.meta_title : ''} keyword={cmsData.content ? cmsData.content.meta_keyword : ''} description={cmsData.content ? cmsData.content.meta_desc : ''} /> <section className="p-0 bg-black"> <div className="page-title-wrap mb-60 bg-black border-btm-white-light"> <Container> <h2 className="page-title text-center fs-26 color-dcdcdc fw-700 p-30-0 mb-0">{cmsData.content.main_title}</h2> </Container> </div> <div className="cms-pages"> <Container> <div className="p-b-30 m-l-r-30"> <div className="content-box"> <div dangerouslySetInnerHTML={{ __html: cmsData.content.main_content }}></div> </div> </div> </Container> </div> </section> </> ) } export default TermsOfUse; export const getServerSideProps = async () => { try { const response = await Rest.axiosRequest(API.getCmsData + '/terms-of-use', {}, 'GET') const { data, status } = response.data if (status) { return { props: { cmsData: data, }, } } else { return { redirect: { destination: '/500' } } } } catch { return { redirect: { destination: '/500' } } } }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/block-retailers.js
import React, { useEffect, useState } from 'react'; import { useRouter } from 'next/router'; import { Card, Col, Container, Row, Form, Button, Spinner, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight } from '@fortawesome/free-solid-svg-icons'; import 'react-dropzone-uploader/dist/styles.css'; import 'react-datetime/css/react-datetime.css'; import Rest from '../config/rest.config'; import Notifier from '../components/Notifier'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../services/SkeletonOptions'; import { APP_NAME } from '../config/server.config'; import Meta from '../components/Meta'; import { MultiSelect } from 'react-multi-select-component'; import { contextCookie } from '../services/Auth'; import API from '../config/endpoints.config'; function BlockRetailers({ profileDetails }) { const router = useRouter(); const noti = new Notifier(); const [brandData, setBrandData] = useState({ retailerIds: profileDetails?.brandData?.retailers ? profileDetails?.brandData?.retailers : [], }); const [showLoading, setShowLoading] = useState(false); const [retailers, setRetailers] = useState([]); const [showSkeleton, setShowSkeleton] = useState(true); useEffect(async () => { const retailersData = await Rest.axiosRequest( API.findAllRetailers, {}, 'GET' ); if (retailersData.status === 200) { const retailers = []; retailersData.data.data.map((retailer) => { retailers.push({ id: retailer.id, value: retailer.id, name: retailer.fullName, label: retailer.fullName, }); }); setRetailers(retailers); } else { noti.notify(retailersData.data.message, 'danger'); } setShowSkeleton(false); }, []); const handleChangeSelect = (val, name) => { if (val) { setBrandData((prevState) => ({ ...prevState, [name]: val.map((item) => item.value), })); } else { setBrandData((prevState) => ({ ...prevState, [name]: [], })); } }; const handleSubmit = async (e) => { e.preventDefault(); setShowLoading(true); const response = await Rest.axiosRequest( API.updateBlockRetailers, brandData, 'PUT' ); if (response.status === 200) { noti.notify(response.data.message, 'success'); router.push('/block-retailers'); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); }; return ( <> <Meta title={`Block Price Viewing and Ordering | ${APP_NAME}`} keywords={''} description={''} /> <section className="bg-black p-30-0-60"> <Container> <Row> <Col lg={6} className="mx-auto"> <Card className="card-dark border-gray p-15-20-30 br-10"> <Card.Header className="border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13"> <Card.Title className="fs-18 fw-600 color-white mb-0"> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={150} /> </SkeletonTheme> ) : ( 'Block Price Viewing and Ordering' )} </Card.Title> </Card.Header> <Card.Body className="p-0"> <Form> <Row> <Col md={12}> <Form.Group className="form-dark mb-4"> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Retailer</Form.Label> <MultiSelect options={retailers?.map(({ id, name }) => ({ value: id, label: name, }))} value={retailers?.filter((item) => brandData?.retailerIds?.includes(item.value) )} onChange={(val) => handleChangeSelect(val, 'retailerIds') } labelledBy="Retailer" /> </> )} </Form.Group> </Col> <Col md={12}> <div className="d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap"> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={300} height={50} inline={true} count={2} className="m-10" /> </SkeletonTheme> ) : ( <> <Button variant="primary" type="submit" className="btn-wh-150-54 btn-rounded btn-right-icons m-10" onClick={!showLoading ? handleSubmit : null} disabled={showLoading} > {showLoading ? ( <Spinner animation="border" /> ) : ( 'Save' )} <span className="color-22a612"> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </> )} </div> </Col> </Row> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default BlockRetailers; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } try { const token = contextCookie(context, 'token'); let profileDetails = {}; const response = await Rest.axiosRequest( API.getProfileDetails, {}, 'GET', false, token ); if (response.status === 200) { profileDetails = response.data.data; } else { return { notFound: true, }; } return { props: { profileDetails, }, }; } catch (e) { return { redirect: { destination: '/' }, }; } }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/sign-up.js
import React, { useEffect, useRef, useState } from 'react'; import InputMask from 'react-input-mask'; import { Card, Col, Container, Row, Form, Button, Nav, Spinner, } from 'react-bootstrap'; import Link from 'next/link'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight, faEye, faEyeSlash, faLocation, } from '@fortawesome/free-solid-svg-icons'; import Select from 'react-select'; import { DropdownIndicator, react_select_lg_Styles_light, } from '../components/DropDown'; // import Datetime from "react-datetime"; //import moment from "moment"; import 'react-datetime/css/react-datetime.css'; import FormValidator from '../components/FormValidator'; import Rest from '../config/rest.config'; import API from '../config/endpoints.config'; import Notifier from '../components/Notifier'; import { contextCookie, isLoggedIn } from '../services/Auth'; import { Helper } from '../services/Helper'; import { useRouter } from 'next/router'; import Meta from '../components/Meta'; import { APP_NAME, RECAPTCHA_SITE_KEY } from '../config/server.config'; const axios = require('axios'); import ReCAPTCHA from 'react-google-recaptcha'; import CustomDatePicker from '../components/CustomDatePicker'; function SignUp(props) { const locationRef = useRef(null); const reCaptchaRef = useRef(); const notifier = new Notifier(); const passwordMatch = (confirmation, state) => { if ( state.password !== '' && state.confirmPassword !== '' && state.password === state.confirmPassword ) { return false; } else { return true; } }; const validator = new FormValidator([ // { // field: "firstName", // method: "isEmpty", // validWhen: false, // message: "Please enter first name.", // }, // { // field: "lastName", // method: "isEmpty", // validWhen: false, // message: "Please enter last name.", // }, { field: 'name', method: 'isEmpty', validWhen: false, message: 'Please enter name.', }, { field: 'companyName', method: 'isEmpty', validWhen: false, message: 'Please enter store name.', }, { field: 'email', method: 'isEmpty', validWhen: false, message: 'Please enter email.', }, { field: 'email', method: 'isEmail', validWhen: true, message: 'Please enter valid email address.', }, { field: 'password', method: 'isEmpty', validWhen: false, message: 'Please enter password.', }, { field: 'password', method: 'isLength', args: [6, 20], validWhen: true, message: 'Password should be minimum 6 and maximum 20 characters.', }, { field: 'confirmPassword', method: 'isEmpty', validWhen: false, message: 'Please enter confirm password.', }, { field: 'confirmPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'Confirm password should be minimum 6 and maximum 20 characters.', }, { field: 'confirmPassword', method: passwordMatch, validWhen: false, message: 'Please enter same as password.', }, { field: 'selectedState', method: 'isEmpty', validWhen: false, message: 'Please select state.', }, { field: 'zipCode', method: 'isEmpty', validWhen: false, message: 'Please enter zip code.', }, { field: 'zipCode', method: 'isLength', args: [5, 5], validWhen: true, message: 'Zipcode should be 5 characters long.', }, { field: 'phoneNumber', method: 'isEmpty', validWhen: false, message: 'Please enter store phone number.', }, { field: 'phoneNumber', method: 'isLength', args: [10, 10], validWhen: true, message: 'Store number should comprise ten digits.', }, { field: 'address', method: 'isEmpty', validWhen: false, message: 'Please enter address.', }, { field: 'licenseNumber', method: 'isEmpty', validWhen: false, message: 'Please enter license number.', }, { field: 'medRecId', method: 'isEmpty', validWhen: false, message: 'Please select license type.', }, // { // field: 'licenseExpirationDate', // method: 'isEmpty', // validWhen: false, // message: 'Please enter expiration date.', // }, { field: 'medRecCertificatePath', method: 'isEmpty', validWhen: false, message: 'Please upload license document.', }, { field: 'resaleLicensePath', method: 'isEmpty', validWhen: false, message: 'Please upload resale license document.', }, ]); const router = useRouter(); const [state, setState] = useState({ // firstName: "", // lastName: "", name: '', companyName: '', profileDocument: '', email: '', role: '3', password: '', confirmPassword: '', website: '', selectedState: '', zipCode: '', phoneNumber: '', address: '', licenseNumber: '', medRecId: '', //licenseExpirationDate: '', medRecCertificatePath: '', resaleLicensePath: '', }); const [showLoading, setShowLoading] = useState(false); const [submitted, setSubmitted] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [states, setStates] = useState([]); const [medRecs, setMedRecs] = useState([]); const [passwordType, setPasswordType] = useState({ password: 'password', confirmPassword: 'password', }); const [recaptchaMessage, setRecaptchaMessage] = useState(''); useEffect(async () => { if (isLoggedIn()) { router.replace('/my-account'); } const statesData = await Rest.axiosRequest(API.getStates, {}, 'GET'); if (statesData && statesData.status === 200) { const states = []; statesData.data.data.map((state) => { states.push({ id: state.id, value: state.id, name: state.name, label: state.name, }); }); setStates(states); } else { notifier.notify(statesData.data.message, 'danger'); } const medRecData = await Rest.axiosRequest(API.getMedrec, {}, 'GET'); if (medRecData && medRecData.status === 200) { const medRecs = []; medRecData.data.data.map((medRec) => { if (medRec.id !== 3) { medRecs.push({ id: medRec.id, value: medRec.id, name: medRec.title, label: medRec.title, }); } }); setMedRecs(medRecs); } else { noti.notify(medRecData.data.message, 'danger'); } const autoCompleteAddress = new google.maps.places.Autocomplete( document.getElementById('address'), { componentRestrictions: { country: ['US'] } } ); google.maps.event.addListener( autoCompleteAddress, 'place_changed', function () { setState((prevState) => ({ ...prevState, address: locationRef.current.value, })); } ); }, []); const handleReCaptcha = () => { if (reCaptchaRef.current && reCaptchaRef.current.getValue()) { setRecaptchaMessage(''); } }; const handleChangeSelectState = (val) => { if (val) { setState((prevState) => ({ ...prevState, selectedState: val.value })); } else { setState((prevState) => ({ ...prevState, selectedState: '' })); } }; const handleChangeSelectLicenseType = (val) => { if (val) { setState((prevState) => ({ ...prevState, medRecId: val.value })); } else { setState((prevState) => ({ ...prevState, medRecId: '' })); } }; // const handleChangeDate = (date) => { // // setState({ licenseExpirationDate: date.format("YYYY-MM-DD") }) // setState((prevState) => ({ // ...prevState, // licenseExpirationDate: date.format('YYYY-MM-DD'), // })); // }; const documentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setState((prevState) => ({ ...prevState, medRecCertificatePath: event.target.files[0], })); } else { event.target.value = null; setState((prevState) => ({ ...prevState, medRecCertificatePath: '' })); notifier.notify('Please upload Image or PDF file only.', 'danger'); } } }; const resaledocumentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setState((prevState) => ({ ...prevState, resaleLicensePath: event.target.files[0], })); } else { event.target.value = null; setState((prevState) => ({ ...prevState, resaleLicensePath: '' })); notifier.notify('Please upload Image or PDF file only.', 'danger'); } } }; const logoHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); if (fileCheck && fileCheck.length > 0) { setState((prevState) => ({ ...prevState, profileDocument: event.target.files[0], })); } else { event.target.value = null; setState((prevState) => ({ ...prevState, profileDocument: '' })); noti.notify('Please upload Image file only.', 'danger'); } } }; const onChangeHandler = async (event) => { const { name, value } = event.target; if (name === 'zipCode' && value < 1) { return; } setState((prevState) => ({ ...prevState, [name]: name === 'password' || name === 'confirmPassword' ? value.trim() : value, })); }; const signUp = async () => { const validation = validator.validate(state); setValidation(validation); setSubmitted(true); if (validation.isValid) { if (reCaptchaRef.current && reCaptchaRef.current.getValue()) { let formData = new FormData(); // formData.append("firstName", state.firstName); // formData.append("lastName", state.lastName); formData.append('name', state.name); formData.append('companyName', state.companyName); formData.append('profileDocument', state.profileDocument); formData.append('email', state.email); formData.append('role', state.role); formData.append('password', state.password); formData.append('confirmPassword', state.confirmPassword); formData.append('website', state.website); formData.append('selectedState', state.selectedState); formData.append('zipCode', state.zipCode); formData.append('address', state.address); formData.append('phoneNumber', state.phoneNumber); formData.append('licenseNumber', state.licenseNumber); formData.append('medRecId', state.medRecId); // formData.append('licenseExpirationDate', state.licenseExpirationDate); formData.append('medRecCertificatePath', state.medRecCertificatePath); formData.append('resaleLicensePath', state.resaleLicensePath); setShowLoading(true); const jsonResponse = await Rest.axiosRequest( API.signUp, formData, 'POST', true ); const response = jsonResponse; if (response.status === 201) { reCaptchaRef.current.reset(); setShowLoading(false); notifier.notify( 'Signed up successfully you can log in now.', 'success' ); router.replace('/sign-in'); } else { notifier.notify(response.data.message, 'danger'); setShowLoading(false); } } else { setRecaptchaMessage('Please verify captcha.'); } } }; let inputProps = { placeholder: 'Select Expiration Date', readOnly: true, }; const showHide = (fieldName) => { // e.preventDefault(); // e.stopPropagation(); setPasswordType((prevState) => ({ ...prevState, [fieldName]: prevState[fieldName] === 'password' ? 'text' : 'password', })); }; let checkValidation = submitted ? validator.validate(state) : validation; /* useEffect(() => { checkValidation = submitted ? validator.validate(state) : validation }) */ return ( <> <Meta title={`Sign Up | ${APP_NAME}`} keyword={`Sign Up | ${APP_NAME}`} description={`Sign Up | ${APP_NAME}`} /> <section className='bg-black'> <Container> <Row> <Col lg={7} md={10} className='mx-auto'> <Card className='card-post border-gray bs-none'> <Card.Body className='p-md-5 py-md-4 p-3'> <Card.Title className='text-center fs-26 fw-700 color-dcdcdc mt-3 mb-4'> Sign Up </Card.Title> <Nav variant='tabs' defaultActiveKey='/seller-sign-up' className='custom_tabs mb-4' > <Link href='/sign-up'> <Nav.Item> <Nav.Link href='/sign-up' className='active'> Retailers </Nav.Link> </Nav.Item> </Link> <Link href='/seller/sign-up'> <Nav.Item> <Nav.Link href='/seller/sign-up'>Brands</Nav.Link> </Nav.Item> </Link> </Nav> <Form className='form-dark'> <Row> {/* <Col md={6}> <Form.Group className="mb-4"> <Form.Label>First Name</Form.Label> <Form.Control type="text" name="firstName" onChange={onChangeHandler} placeholder="Enter First Name" /> <div className={ checkValidation.firstName.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.firstName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="mb-4"> <Form.Label>Last Name</Form.Label> <Form.Control type="text" placeholder="Enter Last Name" name="lastName" onChange={onChangeHandler} /> <div className={ checkValidation.lastName.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.lastName.message} </div> </div> </Form.Group> </Col> */} <h3 className='fs-18 fw-700 color-dcdcdc mb-14'> Personal Details </h3> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>Name</Form.Label> <Form.Control type='text' placeholder='Enter Name' name='name' onChange={onChangeHandler} /> <div className={ checkValidation.name.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.name.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>Email</Form.Label> <Form.Control type='email' name='email' onChange={onChangeHandler} placeholder='Enter Email' /> <div className={ checkValidation.email.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.email.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-3'> <Form.Label>Password</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type={passwordType['password']} name='password' onChange={onChangeHandler} value={state.password} placeholder='Enter Password' /> <span className='icon' onClick={() => showHide('password')} > {passwordType['password'] === 'password' ? ( <FontAwesomeIcon icon={faEye} /> ) : ( <FontAwesomeIcon icon={faEyeSlash} /> )} </span> </div> <div className={ checkValidation.password.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.password.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-3'> <Form.Label>Confirm Password</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type={passwordType['confirmPassword']} name='confirmPassword' onChange={onChangeHandler} value={state.confirmPassword} placeholder='Enter Confirm Password' /> <span className='icon' onClick={() => showHide('confirmPassword')} > {passwordType['confirmPassword'] === 'password' ? ( <FontAwesomeIcon icon={faEye} /> ) : ( <FontAwesomeIcon icon={faEyeSlash} /> )} </span> </div> <div className={ checkValidation.confirmPassword.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.confirmPassword.message} </div> </div> </Form.Group> </Col> <Col md={12}> <h3 className='fs-18 fw-700 color-dcdcdc mb-17 mt-13 '> Retailer Details </h3> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>Store Name</Form.Label> <Form.Control type='text' placeholder='Enter Store Name' name='companyName' onChange={onChangeHandler} /> <div className={ checkValidation.companyName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.companyName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-20'> <Form.Label> Logo<span>(optional)</span> </Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*' name='profileDocument' className='uploadImg' id='document_upload' onChange={(e) => logoHandler(e)} /> <div className='my-3'> {state.profileDocument.name} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label> Website<span>(optional)</span> </Form.Label> <Form.Control type='text' placeholder='Enter Website' name='website' onChange={onChangeHandler} /> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>Store Phone</Form.Label> <InputMask name='phoneNumber' placeholder='Enter Store Phone' onChange={onChangeHandler} onBlur={onChangeHandler} maskChar={null} className='form-control' mask='9999999999' /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.phoneNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>State</Form.Label> <Select classNamePrefix='react-select' styles={react_select_lg_Styles_light} //value={state.selectedState} options={states.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectState(val)} placeholder='Select State' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='state_id' isClearable={true} /> <div className={ checkValidation.selectedState.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.selectedState.message} </div> </div> {/* <Form.Select className="form-control"> <option>Default State</option> <option>Default State</option> </Form.Select> */} </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>Zip Code</Form.Label> <Form.Control type='number' name='zipCode' onChange={onChangeHandler} placeholder='Enter Zip Code' min='1' /> <div className={ checkValidation.zipCode.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.zipCode.message} </div> </div> </Form.Group> </Col> <Col md={12}> <Form.Group className='mb-4'> <Form.Label>Address</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type='text' name='address' onChange={onChangeHandler} placeholder='Enter Address' ref={locationRef} id='address' /> <span className='icon'> <FontAwesomeIcon icon={faLocation} /> </span> </div> <div className={ checkValidation.address.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.address.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>License Number</Form.Label> <Form.Control type='text' name='licenseNumber' onChange={onChangeHandler} placeholder='Enter License Number' /> <div className={ checkValidation.licenseNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <Form.Label>License Type</Form.Label> <Select classNamePrefix='react-select' styles={react_select_lg_Styles_light} options={medRecs.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectLicenseType(val) } placeholder='Select License Type' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='medRecId' isClearable={true} /> <div className={ checkValidation.medRecId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecId.message} </div> </div> </Form.Group> </Col> {/* <Col md={6}> <Form.Group className="mb-4"> <Form.Label>Expiration Date</Form.Label> <CustomDatePicker responsive={true} selectedDate={state.licenseExpirationDate} handleOnChange={(date) => handleChangeDate(date)} disableFutureDates={false} disablePastDates={true} /> <div className={ checkValidation.licenseExpirationDate.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.licenseExpirationDate.message} </div> </div> </Form.Group> </Col> */} <Col md={12}> <Form.Group className='mb-4'> <Form.Label>License Document</Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' name='license-upload' className='uploadImg' id='document_upload' onChange={(e) => documentHandler(e)} /> <div className='my-3'> {state.medRecCertificatePath.name} </div> </div> <div className={ checkValidation.medRecCertificatePath.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecCertificatePath.message} </div> </div> </Form.Group> </Col> <Col md={12}> <Form.Group className='mb-4'> <Form.Label>Resale License Document</Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' name='license-upload' className='uploadImg' id='document_upload' onChange={(e) => resaledocumentHandler(e)} /> <div className='my-3'> {state.resaleLicensePath.name} </div> </div> <div className={ checkValidation.resaleLicensePath.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.resaleLicensePath.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='mb-4'> <div className='recaptcha'> <ReCAPTCHA ref={reCaptchaRef} sitekey={RECAPTCHA_SITE_KEY} onChange={handleReCaptcha} /> </div> <div className='error'>{recaptchaMessage}</div> </Form.Group> </Col> <Col md={12}> {!checkValidation.isValid ? ( <div className='error text-center'> You have missed to provide details for some mendatory fields </div> ) : null} </Col> <Col md={12}> <Form.Group className='mt-3 text-center'> <Button variant='primary' //type="submit" className='btn-wh-180-56 btn-rounded btn-right-icons' onClick={!showLoading ? signUp : null} disabled={showLoading} //onClick={signUp} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Sign Up' )} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </Form.Group> </Col> <Col md={12}> <Form.Group className='mt-4 mb-3 text-center'> <p className='color-dcdcdc'> Already have an account?{' '} <Link href='/sign-in'> <a className='color-22a612 fw-500'>Sign In</a> </Link> </p> </Form.Group> </Col> </Row> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default SignUp; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/forgot-password.js
import React, { useEffect, useState } from 'react'; import { Card, Col, Container, Row, Form, Button, Spinner } from "react-bootstrap"; import Link from "next/link"; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight } from '@fortawesome/free-solid-svg-icons'; import Rest from '../config/rest.config'; import API from '../config/endpoints.config'; import { isLoggedIn, getSingle, contextCookie } from '../services/Auth'; import Notifier from '../components/Notifier'; import FormValidator from '../components/FormValidator'; import { useRouter } from 'next/router'; import Meta from '../components/Meta'; import { APP_NAME } from '../config/server.config'; function ForgotPassword() { const [email, setEmail] = useState({ email: '' }); const noti = new Notifier(); const validator = new FormValidator([ { field: "email", method: "isEmpty", validWhen: false, message: "Please enter email.", }, ]); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false) const [showLoading, setShowLoading] = useState(false); const router = useRouter(); useEffect(async () => { if (isLoggedIn()) { if (getSingle('role') === '2') { router.replace('/my-account-seller') } else { router.replace('/my-account') } } }, []) const onChangeHandler = (event) => { const { name, value } = event.target; setEmail((prevState) => ({ [name]: value })) } async function handleOnSubmit(e) { e.preventDefault(); const validation = validator.validate(email) setValidation(validation) setSubmitted(true) if (validation.isValid) { setShowLoading(true) const response = await Rest.axiosRequest(API.forgotPassword, email) setShowLoading(false) if (response.data.status) { setSubmitted(false) noti.notify(response.data.message, "success") } else { if (response.data.message instanceof Array) { for (let msg in response.data.message) { noti.notify(response.data.message[msg], "danger") } } else { noti.notify(response.data.message, "danger") } } } } let checkValidation = submitted ? validator.validate(email) : validation return ( <> <Meta title={`Forgot Password | ${APP_NAME}`} keywords={''} description={''} /> <section className="bg-black"> <Container> <Row> <Col lg={5} md={8} className="mx-auto"> <Card className="card-post border-gray bs-none"> <Card.Body className="p-md-5 py-md-4 p-3"> <Card.Title className='text-center fs-26 fw-700 color-dcdcdc mt-3 mb-4'>Forgot Password</Card.Title> <Form className="form-dark"> <Form.Group className="mb-4"> <Form.Label>Email</Form.Label> <Form.Control type="email" name="email" placeholder="Enter Email" value={email.email} onChange={onChangeHandler} /> <div className={checkValidation.email.isInvalid ? 'animated fadeIn' : ''} > <div className="error"> {checkValidation.email.message} </div> </div> </Form.Group> <Form.Group className="mb-4 text-center"> <Button variant="primary" type="submit" className="btn-wh-180-56 btn-rounded btn-right-icons" onClick={!showLoading ? handleOnSubmit : null} disabled={showLoading}>{showLoading ? <Spinner animation="border" /> : <>Send Link<span className="color-22a612"><FontAwesomeIcon icon={faAngleRight} /></span></>}</Button> </Form.Group> <Form.Group className="mb-3 text-center"> <p className="color-dcdcdc">I remembered my password back to <Link href="/sign-in"><a className="color-22a612 fw-500">Login</a></Link></p> </Form.Group> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ) } export default ForgotPassword export async function getServerSideProps(context){ const isLoggedIn = contextCookie(context, 'isLogin'); if (isLoggedIn) { return { redirect: { destination: "/" }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/subscription-policy.js
import React, { useState } from 'react'; import { Container } from "react-bootstrap"; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import Meta from '../components/Meta'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; const baseColor = "#202020"; const highlightColor = "#444"; function SubscriptionPolicy({ cmsData }) { // const [cmsData, setCmsData] = useState(props.data.content ?? []); return ( <> <Meta title={cmsData.content ? cmsData.content.meta_title : ''} keyword={cmsData.content ? cmsData.content.meta_keyword : ''} description={cmsData.content ? cmsData.content.meta_desc : ''} /> <section className="p-0 bg-black"> <div className="page-title-wrap mb-60 bg-black border-btm-white-light"> <Container> <h2 className="page-title text-center fs-26 color-dcdcdc fw-700 p-30-0 mb-0">{cmsData.content.main_title}</h2> </Container> </div> <div className="cms-pages"> <Container> <div className="p-b-30 m-l-r-30"> <div className="content-box"> <div dangerouslySetInnerHTML={{ __html: cmsData.content.main_content }}></div> </div> </div> </Container> </div> </section> </> ) } export default SubscriptionPolicy; export const getServerSideProps = async () => { try { const response = await Rest.axiosRequest(API.getCmsData + '/subscription-policy', {}, 'GET') const { data, status } = response.data if (status) { return { props: { cmsData: data, }, } } else { return { redirect: { destination: '/500' } } } } catch { return { redirect: { destination: '/500' } } } }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/sign-in.js
import { useEffect, useState } from 'react'; import { useRouter } from 'next/router'; import Link from 'next/link'; import cookie from 'react-cookies'; import { Card, Col, Container, Row, Form, Button, Spinner, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight, faEye, faEyeSlash, } from '@fortawesome/free-solid-svg-icons'; import Rest from '../config/rest.config'; import FormValidator from '../components/FormValidator'; import { contextCookie, getSingle, isLoggedIn, saveData, } from '../services/Auth'; import Notifier from '../components/Notifier'; import API from '../config/endpoints.config'; import { roles } from '../services/Role'; import Meta from '../components/Meta'; import { APP_NAME } from '../config/server.config'; function SignIn() { const noti = new Notifier(); const router = useRouter(); const validator = new FormValidator([ { field: 'username', method: 'isEmpty', validWhen: false, message: 'Please enter email address.', }, { field: 'username', method: 'isEmail', validWhen: true, message: 'Please enter valid email address.', }, { field: 'password', method: 'isEmpty', validWhen: false, message: 'Please enter password.', }, { field: 'password', method: 'isLength', args: [6, 20], validWhen: true, message: 'Password should be minimum 6 and maximum 20 characters.', }, ]); const [state, setState] = useState({ username: '', password: '', }); const [showLoading, setShowLoading] = useState(false); const [submitted, setSubmitted] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [type, setType] = useState('password'); const [remember, setRemember] = useState(false); const handleChange = (event) => { const { name, value } = event.target; setState((prevState) => ({ ...prevState, [name]: value })); }; const handleSubmit = async () => { try { const validation = validator.validate(state); setValidation(validation); setSubmitted(true); if (validation.isValid) { let userData = { username: state.username, password: state.password, }; setShowLoading(true); const jsonResponse = await Rest.axiosRequest(API.signIn, userData); const response = jsonResponse.data; setShowLoading(false); if (response?.status || !response) { if (response?.data?.user?.organization?.isApproved != 1) { router.replace('/verification-pending'); } else { await saveData(response?.data, remember); if (response?.data?.user?.organization?.role == roles?.retailer) { router.replace('/marketplace'); // router.replace("/account"); } else { router.replace('/dashboard'); // router.replace("/account/seller"); } } } else { if (response?.statusCode === 403) { noti.notify(response?.message, 'danger'); } else if (response?.statusCode) { noti.notify( 'Invalid username or password, Please try again.', 'danger' ); } } } } catch (e) { console.log(e); } }; const showHide = (e) => { e.preventDefault(); setType(type === 'password' ? 'text' : 'password'); }; let checkValidation = submitted ? validator.validate(state) : validation; return ( <> <Meta title={`Sign in | ${APP_NAME}`} keywords='Sign in' description='Sign in' /> <section className='bg-black'> <Container> <Row> <Col lg={5} md={8} sm={10} className='mx-auto'> <Card className='card-post border-gray bs-none'> <Card.Body className='p-md-5 py-md-4 p-3'> <Card.Title className='text-center fs-26 fw-700 color-dcdcdc mt-3 mb-4'> Sign In </Card.Title> <Form className='form-dark'> <Form.Group className='mb-3'> <Form.Label>Email</Form.Label> <Form.Control type='email' placeholder='Enter Email' name='username' onChange={handleChange} value={state.username} /> <div className={ checkValidation.username.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.username.message} </div> </div> </Form.Group> <Form.Group className='mb-3'> <Form.Label>Password</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type={type} placeholder='Enter Password' name='password' onChange={handleChange} value={state.password} /> <span className='icon' onClick={showHide}> {type === 'password' ? ( <FontAwesomeIcon icon={faEye} /> ) : ( <FontAwesomeIcon icon={faEyeSlash} /> )} </span> </div> <div className={ checkValidation.password.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.password.message} </div> </div> </Form.Group> <div className='d-flex justify-content-between mb-3 form-btmbox'> <Form.Group className='mb-3'> <Form.Check type='checkbox' label='Remember Me' id='rememberme' className='fw-500 color-white' onChange={() => setRemember(!remember)} /> </Form.Group> <Form.Group className='mb-3'> <Link href='/forgot-password'> <a className='color-22a612 fw-500 text-decoration-underline'> Forgot Password? </a> </Link> </Form.Group> </div> <Form.Group className='mb-4 text-center'> <Button variant='primary' className='btn-wh-180-56 btn-rounded btn-right-icons fw-500' onClick={!showLoading ? handleSubmit : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Sign In ' )} <span className='color-177b0b'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </Form.Group> <Form.Group className='mb-3 text-center'> <p className='color-dcdcdc'> Don’t have an account yet?{' '} <Link href='/sign-up'> <a className='color-22a612 fw-500'>Sign Up</a> </Link> </p> </Form.Group> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default SignIn; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/retailers.js
import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Container, Row, Col, Card, Table, Figure, Image, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faTrashAlt } from '@fortawesome/free-solid-svg-icons'; import ReactPaginate from 'react-paginate'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import Notifier from '../components/Notifier'; import { SkeletonOptions } from '../services/SkeletonOptions'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import { customFormat, dateTimeFormat, Helper } from '../services/Helper'; import { contextCookie } from '../services/Auth'; import Meta from '../components/Meta'; import { APP_NAME, ASSETS_URL } from '../config/server.config'; function Retailers(props) { const noti = new Notifier(); const router = useRouter(); const [showSkeleton, setShowSkeleton] = useState(true); const [retailers, setRetailers] = useState([]); const [limit, setLimit] = useState(10); const [totalPages, setTotalPages] = useState(); const [params, setParams] = useState({ offset: props.queryString.offset ?? 0, }); const [disabled, setDisabled] = useState(false); useEffect(async () => { setShowSkeleton(true); router.push('/retailers', { query: { ...params } }, undefined, { shallow: true, }); const response = await Rest.axiosRequest( API.retailerDetails + '/retailers' + '?' + `limit=${limit}&` + new URLSearchParams(params).toString(), {}, 'GET' ); if (response.status === 200) { setRetailers(response.data.data.retailers); setTotalPages(response.data.data.totalPages); } else { noti.notify(response.data.message, 'danger'); } setShowSkeleton(false); }, [new URLSearchParams(params).toString()]); const handlePageChange = (event) => { setParams((prevState) => ({ ...prevState, offset: event.selected })); }; return ( <> <Meta title={`Retailers | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-30 br-10'> {/* <Card.Header className="border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13"> <Card.Title className="fs-18 fw-600 color-white mb-0">My Favourite</Card.Title> </Card.Header> */} <Card.Body className='p-0'> <div className='table-wrap CustomScrollbar CustomScrollbarY'> <Table bordered hover className='table-head-bg-000 table-td-bg-191919' variant='dark' id='seller-favourite' > <thead> <tr> <th>Name</th> <th width='275px;'>State</th> <th width='200px;'>Zipcode</th> <th width='250px;'>Registerd on</th> </tr> </thead> <tbody> {showSkeleton ? ( [...Array(5)].map((index) => { return ( <tr key={index}> {[...Array(4)].map((i) => { return ( <td key={i}> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </td> ); })} </tr> ); }) ) : retailers.length ? ( retailers.map((retailer) => { return ( <tr key={retailer.id}> <td> <Link href={`/customer/${retailer.slug}`}> <a className='color-f3772c text-decoration-none d-flex align-items-center'> <Figure className='figure-40 figure-circle mb-0 me-3'> <Image alt='profile' height={150} src={ ASSETS_URL + retailer.profilePath } className='cover' /> </Figure> {retailer.companyName} </a> </Link> </td> <td> {retailer?.store?.state?.name}</td> <td>{retailer?.store?.zipCode}</td> <td> {dateTimeFormat( retailer.createdAt, customFormat )} </td> </tr> ); }) ) : ( <tr> <td className='text-center' colSpan={11}> No records found! </td> </tr> )} </tbody> </Table> </div> <div className='mt-5 d-flex justify-content-center'> {totalPages > 1 ? ( <ReactPaginate previousLabel={ <i className='fas fa-long-arrow-alt-left'></i> } nextLabel={ <i className='fas fa-long-arrow-alt-right'></i> } pageClassName='page-item' pageLinkClassName='page-link' previousClassName='page-item prev-item' previousLinkClassName='page-link' nextClassName='page-item next-item' nextLinkClassName='page-link' breakLabel='...' breakClassName='page-item' breakLinkClassName='page-link' pageCount={totalPages} //marginPagesDisplayed={1} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName='pagination' activeClassName='active' forcePage={parseInt(params.offset)} /> ) : null} </div> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default Retailers; export async function getServerSideProps(context) { return { props: { queryString: context.query, }, }; }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/500.js
import Link from "next/link"; export default function Custom500(){ return ( <> <section className='pagenotfound'> <h1>5<span>0</span>0</h1> <h2>Opps, Something went wrong</h2> <div className='text-center mt-3'> <Link href='/'> <a className='btn btn-secondary btn-wh-220-46 btn-rounded'>Navigation Back Home</a> </Link> </div> </section> </> ) }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/404.js
import Link from 'next/link'; function Custom404() { return ( <> <section className='pagenotfound'> <h1>4<span>0</span>4</h1> <h2>Page Not Found</h2> <div className='text-center mt-3'> <Link href='/'> <a className='btn btn-secondary btn-wh-220-46 btn-rounded'>Navigation Back Home</a> </Link> </div> </section> </> ) } export default Custom404
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/contact-us.js
import React, { useEffect, useRef, useState } from 'react'; import { Container, Row, Col, Card, Form, Button, Spinner } from "react-bootstrap"; import Link from "next/link"; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight } from '@fortawesome/free-solid-svg-icons'; import FormValidator from '../components/FormValidator'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import Notifier from '../components/Notifier'; import ReCAPTCHA from "react-google-recaptcha"; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../services/SkeletonOptions'; import Meta from '../components/Meta'; import { APP_NAME, RECAPTCHA_SITE_KEY } from '../config/server.config'; function Contact({ socialDetails }) { const recaptchaRef = useRef() const notifier = new Notifier(); const validator = new FormValidator([ { field: "firstName", method: "isEmpty", validWhen: false, message: "Please enter first name.", }, { field: "lastName", method: "isEmpty", validWhen: false, message: "Please enter last name.", }, { field: "email", method: "isEmpty", validWhen: false, message: "Please enter email.", }, { field: "email", method: "isEmail", validWhen: true, message: "Please enter valid email.", }, { field: "phoneNumber", method: "isEmpty", validWhen: false, message: "Please enter phone number.", }, { field: "contactMessage", method: "isEmpty", validWhen: false, message: "Please enter message.", } ]); const [submitted, setSubmitted] = useState(false) const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [contactData, setContactData] = useState({ firstName: "", lastName: "", email: "", phoneNumber: "", contactMessage: "" }); const [recaptchaMessage, setRecaptchaMessage] = useState('') const onChangeHandler = async (event) => { const { name, value } = event.target; const numberRegex = /^[0-9\b]+$/; if (name == 'phoneNumber') { if (value === '' || numberRegex.test(value)) { setContactData((prevState) => ({ ...prevState, [name]: value })); } } else { setContactData((prevState) => ({ ...prevState, [name]: value })); } }; const handleSubmit = async () => { const validation = validator.validate(contactData) setValidation(validation) setSubmitted(true) if (validation.isValid) { if (recaptchaRef.current.getValue()) { recaptchaRef.current.reset() let formData = { firstName: contactData.firstName, lastName: contactData.lastName, email: contactData.email, phoneNumber: contactData.phoneNumber, message: contactData.contactMessage } setShowLoading(true) const response = await Rest.axiosRequest(API.postContactUs, formData); setShowLoading(false) if (response.status === 201) { notifier.notify(response.data.message, "success"); resetForm() } else { notifier.notify(response.data.message, "danger"); } } else { setRecaptchaMessage('Please select captcha box.') } } }; let checkValidation = submitted ? validator.validate(contactData) : validation const resetForm = async () => { setSubmitted(false) setContactData({ firstName: "", lastName: "", email: "", phoneNumber: "", contactMessage: "" }); setRecaptchaMessage("") } const capthcaHandler = () => { const recaptchaValue = recaptchaRef.current.getValue(); if (recaptchaRef.current.getValue()) { setRecaptchaMessage('') } } return ( <> <Meta title={`Contact Us | ${APP_NAME}`} keywords={''} description={''} /> <section className="p-0-0-60 contact-section bg-black"> <div className="page-title-wrap mb-60 bg-black border-btm-white-light"> <h2 className="page-title text-center fs-26 color-dcdcdc fw-700 p-30-0 mb-0">Contact Us</h2> </div> <Container> <Row className="align-items-center"> <Col lg={8} md={12}> <Card className="card-contact-form p-30-150-38-50 card-dark"> <Card.Header className="btn-block p-0 bg-transparent mb-20"> <h4 className="fs-23 color-dcdcdc fw-700 mb-0">Leave us your info</h4> <p className="fs-15 fw-400 color-dcdcdc p-b-15">and we will get back to you</p> </Card.Header> <Card.Body className="p-0"> <Row> <Col md={6}> <Form.Group className="mb-4 form-dark"> <Form.Label>First Name</Form.Label> <Form.Control value={contactData.firstName} onChange={onChangeHandler} name='firstName' type="text" placeholder="Enter Name" /> <div className={ checkValidation.firstName.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.firstName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="mb-4 form-dark"> <Form.Label>Last Name</Form.Label> <Form.Control value={contactData.lastName} onChange={onChangeHandler} name='lastName' type="text" placeholder="Enter Last Name" /> <div className={ checkValidation.lastName.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.lastName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="mb-4 form-dark"> <Form.Label>Email Address</Form.Label> <Form.Control value={contactData.email} onChange={onChangeHandler} name='email' type="email" placeholder="Enter Email Address" /> <div className={ checkValidation.email.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.email.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="mb-4 form-dark"> <Form.Label>Phone Number</Form.Label> <Form.Control value={contactData.phoneNumber} onChange={onChangeHandler} name='phoneNumber' type="text" placeholder="Enter Phone Number" /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.phoneNumber.message} </div> </div> </Form.Group> </Col> <Col md={12}> <Form.Group className="mb-4 form-dark"> <Form.Label>Message</Form.Label> <Form.Control value={contactData.contactMessage} onChange={onChangeHandler} name='contactMessage' as="textarea" placeholder="Enter Message" rows={5} /> <div className={ checkValidation.contactMessage.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.contactMessage.message} </div> </div> </Form.Group> </Col> <Col lg={6}> <div className="captch mb-4"> <ReCAPTCHA ref={recaptchaRef} sitekey={RECAPTCHA_SITE_KEY} onChange={capthcaHandler} /> <div className="error"> {recaptchaMessage} </div> </div> </Col> <Col lg={6}> <div className="d-flex justify-content-lg-end flex-wrap"> <Button variant="primary" onClick={!showLoading ? () => handleSubmit() : null} disabled={showLoading} className="btn-wh-180-54 btn-rounded btn-right-icons">{showLoading ? <Spinner animation="border" /> : "Submit"}<span><FontAwesomeIcon icon={faAngleRight} /></span></Button> </div> </Col> </Row> </Card.Body> </Card> </Col> <Col lg={4} md={12}> <Card className="card-contact-detail p-30"> <Card.Header className="btn-block p-0 bg-transparent mb-18"> <h4 className="fs-18 color-dcdcdc fw-700 mb-12">Get In Touch</h4> </Card.Header> <Card.Body className="p-0"> <ul className='get_in_touch'> <li> <a href="#"> <span className="icon-round"> <i className="icon icon-phone"></i> </span> {socialDetails.contactNumber} </a> </li> <li> <a href={"mailto:" + socialDetails.infoEmail}> <span className="icon-round"> <i className="icon-envelop"></i> </span>{socialDetails.infoEmail}</a> </li> </ul> <ul className="social_media_links"> <li> <a href={socialDetails.facebookLink} target="_blank" className="btn btn-secondery btn-wh-30"> <i className="fab fa-facebook-f"></i> </a> </li> <li> <a href={socialDetails.twitterLink} target="_blank" className="btn btn-secondery btn-wh-30"> <i className="fab fa-twitter"></i> </a> </li> <li> <a href={socialDetails.linkedinLink} target="_blank" className="btn btn-secondery btn-wh-30"> <i className="fab fa-linkedin-in"></i> </a> </li> <li> <a href={socialDetails.instagramLink} target="_blank" className="btn btn-secondery btn-wh-30"> <i className="fab fa-instagram"></i> </a> </li> </ul> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ) } export default Contact; export async function getServerSideProps(context) { try { let socialDetails = []; const response = await Rest.axiosRequest(API.getContactUs, {}) if (response.data.status) { socialDetails = { infoEmail: response.data.data[0].description ?? '', contactNumber: response.data.data[1].description ?? '', facebookLink: response.data.data[3].description ?? '', instagramLink: response.data.data[4].description ?? '', twitterLink: response.data.data[5].description ?? '', linkedinLink: response.data.data[6].description ?? '', recaptcha_key: response.data.data[10].description ?? '', }; } return { props: { socialDetails }, }; } catch (e) { console.log(e.message); return { redirect: { destination: '/500' }, }; } }
0
/content/gmx-projects/gmx-admin/frontend
/content/gmx-projects/gmx-admin/frontend/pages/profile.js
import React, { useEffect, useState } from 'react'; import { Card, Col, Container, Row, Table, Tabs, Tab } from 'react-bootstrap'; import Link from 'next/link'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faStar, faCommentDots, faCalendarAlt, faExternalLink, } from '@fortawesome/free-solid-svg-icons'; import Figure from 'react-bootstrap/Figure'; import API from '../config/endpoints.config'; import Rest from '../config/rest.config'; import Notifier from '../components/Notifier'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../services/SkeletonOptions'; import { saveAs } from 'file-saver'; import { Helper, customFormat } from '../services/Helper'; import InfiniteScroll from 'react-infinite-scroll-component'; import moment from 'moment'; import ReactStars from 'react-rating-stars-component'; import { APP_NAME, ASSETS_URL, REACT_APP_API_BASE_URL, } from '../config/server.config'; import { useRouter } from 'next/router'; import { contextCookie } from '../services/Auth'; import Meta from '../components/Meta'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; function Profile({ profileDetails, products }) { const noti = new Notifier(); const router = useRouter(); const [tabIndex, setTabIndex] = useState(0); const [showSkeleton, setShowSkeleton] = useState(true); const [isLoading, setIsLoading] = useState(false); const [productQuality, setProductQuality] = useState([]); const [deliveryTime, setDeliveryTime] = useState([]); const [general, setGeneral] = useState([]); const [hasMore, setHasMore] = useState(true); const [page, setPage] = useState(0); const [count, setCount] = useState(''); const [reviewsType, setReviewsType] = useState(1); const downloadLicense = () => { saveAs( REACT_APP_API_BASE_URL + '/get/file' + profileDetails.medRecCertificatePath ); }; const typeChangeHandler = async (type) => { await setReviewsType(type); await setPage(0); await getReviews(); }; const fetchMoreData = () => { setPage(page + 1); getReviews(); }; const getReviews = async () => { setIsLoading(true); const review = await Rest.axiosRequest( API.reviews + `?slug=${profileDetails.slug}&page=${page}&limit=${5}`, {}, 'GET' ); if (review.status === 200) { const response = review.data; setCount(response.data[1].count); if (response.data[1].reviews.length) { setProductQuality([...productQuality, ...response.data[1].reviews]); setDeliveryTime([...deliveryTime, ...response.data[2].reviews]); setGeneral([...general, ...response.data[3].reviews]); setHasMore(true); setTimeout(() => { setIsLoading(false); }, 200); } else { setIsLoading(false); setHasMore(false); return; } } else { setIsLoading(false); noti.notify(review.data.message, 'danger'); } }; const handleMessage = () => { // if(!profileDetails.canMessage){ // noti.notify('You can message seller who is in your state only', "danger"); // } else { router.push(`/messages/${slug}`); // } }; return ( <> <Meta title={ profileDetails.brandName ? profileDetails.brandName + ` | ${APP_NAME}` : '' } keyword={''} description={''} /> <section className="bg-black p-27-0-55"> <Container> <Row> <Col lg={12}> <div className="m-l-r-30"> <div className="box-dark mb-30 overflow-hidden"> <ul className="d-flex justify-start flex-wrap"> <li className="logo-box d-flex justify-content-center align-items-center "> <Figure className="mb-0 figure-circle figure-green-2 figure-120"> <Figure.Image src={ASSETS_URL + profileDetails.brandLogo} className="cover circle" /> </Figure> </li> <li className="seller-detail-wrap"> <ul> <li className="seller-infor"> <h5 className="fs-24 fw-600 color-22a612 mb-2"> {Helper.niceString( profileDetails.brandName, 90, true )} </h5> <ul className="inline-listing"> <li> <a href={profileDetails.brandWebsite ?? ''} target="_blank" className="fs-14 fw-500 color-0598ff text-decoration-none" > { <> <i className="icon-globe"></i> {Helper.niceString( profileDetails.brandWebsite, 20 )} </> }{' '} {!showSkeleton ? ( profileDetails.brandWebsite ? ( <FontAwesomeIcon icon={faExternalLink} /> ) : null ) : null} </a> </li> <li> <a onClick={downloadLicense} className="fs-15 fw-600 color-22a612 text-decoration-none" > <i className="icon-pdf-download"></i> <span className="text-decoration-underline"> Operating Licenses </span> </a> </li> </ul> </li> <li> <ul className="listing-33p"> <li> <> <span className="color-777777 fs-14 fw-500 text-center d-block"> State </span> <p className="fs-18 fw-600 color-white mb-0 text-center"> {profileDetails.state} </p> </> </li> <li> <> <span className="color-777777 fs-14 fw-500 text-center d-block"> Year Founded </span> <p className="fs-18 fw-600 color-white mb-0 text-center"> {profileDetails.year ?? 'N/A'} </p> </> </li> </ul> </li> </ul> </li> </ul> <ul className="listing-25p rating-listing"> <li> <span className="fs-16 fw-500 color-777777 d-block mb-6"> Product Quality </span> <p className="mb-0"> <> <span className="color-22a612"> {' '} <FontAwesomeIcon icon={faStar} /> </span> <span className="star-count"> {profileDetails.avgProductRating}/5 </span> <span className="fs-14 fw-300 color-white"> {' '} ({profileDetails.reviewsProductCount} Reviews) </span> </> </p> </li> <li> <span className="fs-16 fw-500 color-777777 d-block mb-6"> Delivers on Times </span> <p className="mb-0"> <> <span className="color-22a612"> <FontAwesomeIcon icon={faStar} /> </span> <span className="star-count"> {profileDetails.avgDOTRating}/5 </span> <span className="fs-14 fw-300 color-white"> ({profileDetails.reviewsDOTCount} Reviews) </span> </> </p> </li> <li> <span className="fs-16 fw-500 color-777777 d-block mb-6"> Professionalism </span> <p className="mb-0"> <> <span className="color-22a612"> <FontAwesomeIcon icon={faStar} /> </span> <span className="star-count"> {profileDetails.avgGeneralRating}/5 </span> <span className="fs-14 fw-300 color-white"> ({profileDetails.reviewsGeneralCount} Reviews) </span> </> </p> </li> <li> <span className="fs-16 fw-500 color-white d-block mb-6"> Brand Score </span> <p className="mb-0"> <> <span className="color-22a612"> <FontAwesomeIcon icon={faStar} /> </span> <span className="fs-20 fw-600 color-22a612 m-l-10"> {profileDetails.avgRating}/15 </span> </> </p> </li> </ul> </div> <Card className="card-dark border-gray mb-30 overflow-hidden"> <Card.Header className="bg-color-3d3d3d fs-18 fw-600 color-white border-bottom-gray-light p-13-20"> Description </Card.Header> <Card.Body className="bg-color-191919 fs-14 fw-30 color-white o-09 p-20-20-30-20"> {profileDetails.description} </Card.Body> </Card> <Card className="card-dark border-gray mb-30 overflow-hidden"> <Card.Header className="bg-color-3d3d3d fs-18 fw-600 color-white border-bottom-gray-light p-13-20"> Product </Card.Header> <Card.Body className="bg-color-191919 p-0"> <div className="table-wrap br-t-l-0 br-t-r-0"> {/* <Table bordered hover variant="dark" id="seller_detail"> */} <ResponsiveTable className="table table-bordered table-hover table-dark" id="seller_detail" > <Thead> { <Tr> <Th width="180px;">Product Name</Th> <Th className="text-center" width="180px;"> Category </Th> <Th className="text-center" width="130px;"> Med/Rec </Th> {/* <Th className="text-center" width="110px;">Price Per lb</Th> */} <Th className="text-center" width="100px;"> Strain </Th> <Th className="text-center" width="100px;"> THC% </Th> <Th width="160px;">Dominant Terpene</Th> <Th className="text-center" width="100px;"> I/O </Th> <Th className="text-center" width="140px;"> Harvested </Th> </Tr> } </Thead> <Tbody> {products.length > 0 ? ( products.map((rowData, keyIndex) => ( <Tr key={keyIndex + 'product'}> <Td> <Link href={'/product/' + rowData.slug}> <a className="color-f3772c"> {Helper.niceString(rowData.title, 15)} </a> </Link> </Td> <Td className="text-center"> <Link href="#"> <a className="color-white text-decoration-none"> {rowData.category?.title} </a> </Link> </Td> <Td className="text-center"> {rowData.medRec?.title} </Td> {/* <Td className="text-center">{rowData.productPrice}</Td> */} <Td className="text-center"> {rowData.strain?.title} </Td> <Td className="text-center">{rowData?.thc}%</Td> <Td> {Helper.niceString(rowData.dominant, 15)} </Td> <Td className="text-center"> {rowData.io?.title} </Td> <Td className="text-center"> {rowData.niceHarvested} </Td> </Tr> )) ) : ( <Tr> <Td className="text-center" colSpan={10}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> </Card.Body> </Card> <div className="custom-tabs"> <Tabs defaultActiveKey="product" id="uncontrolled-tab"> <Tab eventKey="product" title="Product Quality"> <ul className="comment-listing"> {isLoading ? ( [...Array(5)].map((d, index) => { return ( <li className="comment-wrap" key={index}> <Figure className="mb-0 w-60 h-60 br-50p"> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={60} height={60} /> </SkeletonTheme> </Figure> <div className="comment-detail"> <h5 className="fs-16 fw-600 color-white mb-0"> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} /> </SkeletonTheme> ) : ( <> 'Tina Lee'{' '} <date className="fs-13 fw-500 color-8c8c8c f-style-italic p-l-10"> <FontAwesomeIcon icon={faCalendarAlt} />{' '} 11 Jan'22 </date> </> )} </h5> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} className="product-rating" /> </SkeletonTheme> ) : ( <p className="product-rating"> Product Quality{' '} <span> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> </span> </p> )} <p className="fs-14 fw-300 color-white o-08 mt-6"> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton count={5} /> </SkeletonTheme> ) : ( 'dummy text' )} </p> </div> </li> ); }) ) : ( <> <InfiniteScroll dataLength={productQuality.length} next={fetchMoreData} hasMore={hasMore} loader={ isLoading ? [...Array(3)].map( (elementInArray, index) => ( <Card key={index}> <Card.Header> <Row> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> </Row> </Card.Header> </Card> ) ) : null } > <> {productQuality.length > 0 ? ( productQuality.map((rowData, keyIndex) => ( <li key={keyIndex + 'rview'} className="comment-wrap" > <Figure className="mb-0 w-60 h-60 br-50p border-white-2"> <Figure.Image src={ ASSETS_URL + (rowData.retailer.profilePath ?? '/profile/no-profile-image.jpg') } className="cover circle" /> </Figure> <div className="comment-detail"> <h5 className="fs-16 fw-600 color-white mb-0"> {rowData.retailer.fullName}{' '} <date className="fs-13 fw-500 color-8c8c8c f-style-italic p-l-10"> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {moment(rowData.createdAt).format( customFormat )} </date> </h5> <p className="product-rating"> Product Quality <span> <ReactStars count={5} size={13} value={rowData.ratings} isHalf={true} emptyIcon={ <div style={{ color: '#8c8c8c' }} > {' '} <i className="fas fa-star" /> </div> } halfIcon={ <i className="fa fa-star-half-alt" /> } filledIcon={ <i className="fa fa-star" /> } activeColor="#22a612" edit={false} /> </span> </p> <p className="fs-14 fw-300 color-white o-08 mt-6"> {rowData.description} </p> </div> </li> )) ) : ( <div className="text-center"> {' '} No records found!{' '} </div> )} </> </InfiniteScroll> </> )} </ul> </Tab> <Tab eventKey="deliveryTime" title="Delivery Time"> <ul className="comment-listing"> {isLoading ? ( [...Array(5)].map((d, index) => { return ( <li className="comment-wrap" key={index + 'dot'}> <Figure className="mb-0 w-60 h-60 br-50p"> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={60} height={60} /> </SkeletonTheme> </Figure> <div className="comment-detail"> <h5 className="fs-16 fw-600 color-white mb-0"> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} /> </SkeletonTheme> ) : ( <> 'Tina Lee'{' '} <date className="fs-13 fw-500 color-8c8c8c f-style-italic p-l-10"> <FontAwesomeIcon icon={faCalendarAlt} />{' '} 11 Jan'22 </date> </> )} </h5> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} className="product-rating" /> </SkeletonTheme> ) : ( <p className="product-rating"> Product Quality{' '} <span> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> </span> </p> )} <p className="fs-14 fw-300 color-white o-08 mt-6"> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton count={5} /> </SkeletonTheme> ) : ( 'dummy text' )} </p> </div> </li> ); }) ) : ( <> <InfiniteScroll dataLength={deliveryTime.length} next={fetchMoreData} hasMore={hasMore} loader={ isLoading ? [...Array(3)].map( (elementInArray, index) => ( <Card key={index + 'infiniteScroll'}> <Card.Header> <Row> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> </Row> </Card.Header> </Card> ) ) : null } > <> {deliveryTime.length > 0 ? ( deliveryTime.map((rowData, keyIndex) => ( <li key={keyIndex + 'delivery'} className="comment-wrap" > <Figure className="mb-0 w-60 h-60 br-50p border-white-2"> <Figure.Image src={ ASSETS_URL + (rowData.retailer.profilePath ?? '/profile/no-profile-image.jpg') } className="cover circle" /> </Figure> <div className="comment-detail"> <h5 className="fs-16 fw-600 color-white mb-0"> {rowData.retailer.fullName}{' '} <date className="fs-13 fw-500 color-8c8c8c f-style-italic p-l-10"> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {moment(rowData.createdAt).format( customFormat )} </date> </h5> <p className="product-rating"> Delivery on Time{' '} <span> <ReactStars count={5} size={13} value={rowData.ratings} isHalf={true} emptyIcon={ <div style={{ color: '#8c8c8c' }} > {' '} <i className="fas fa-star" /> </div> } halfIcon={ <i className="fa fa-star-half-alt" /> } filledIcon={ <i className="fa fa-star" /> } activeColor="#22a612" edit={false} /> </span> </p> <p className="fs-14 fw-300 color-white o-08 mt-6"> {rowData.description} </p> </div> </li> )) ) : ( <div className="text-center"> {' '} No records found!{' '} </div> )} </> </InfiniteScroll> </> )} </ul> </Tab> <Tab eventKey="general" title="Professionalism"> <ul className="comment-listing"> {isLoading ? ( [...Array(5)].map((d, index) => { return ( <li key={index + 'list'} className="comment-wrap"> <Figure className="mb-0 w-60 h-60 br-50p"> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={60} height={60} /> </SkeletonTheme> </Figure> <div className="comment-detail"> <h5 className="fs-16 fw-600 color-white mb-0"> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} /> </SkeletonTheme> ) : ( <> 'Tina Lee'{' '} <date className="fs-13 fw-500 color-8c8c8c f-style-italic p-l-10"> <FontAwesomeIcon icon={faCalendarAlt} />{' '} 11 Jan'22 </date> </> )} </h5> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} className="product-rating" /> </SkeletonTheme> ) : ( <p className="product-rating"> Product Quality{' '} <span> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> </span> </p> )} <p className="fs-14 fw-300 color-white o-08 mt-6"> {isLoading ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton count={5} /> </SkeletonTheme> ) : ( 'dummy text' )} </p> </div> </li> ); }) ) : ( <> <InfiniteScroll dataLength={general.length} next={fetchMoreData} hasMore={hasMore} loader={ isLoading ? [...Array(3)].map( (elementInArray, index) => ( <Card key={index + 'infi'}> <Card.Header> <Row> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> </Row> </Card.Header> </Card> ) ) : null } > <> {general.length > 0 ? ( general.map((rowData, keyIndex) => ( <li className="comment-wrap" key={keyIndex + 'gen'} > <Figure className="mb-0 w-60 h-60 br-50p border-white-2"> <Figure.Image src={ ASSETS_URL + (rowData.retailer.profilePath ?? '/profile/no-profile-image.jpg') } className="cover circle" /> </Figure> <div className="comment-detail"> <h5 className="fs-16 fw-600 color-white mb-0"> {rowData.retailer.fullName}{' '} <date className="fs-13 fw-500 color-8c8c8c f-style-italic p-l-10"> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {moment(rowData.createdAt).format( customFormat )} </date> </h5> <p className="product-rating"> Professionalism{' '} <span> <ReactStars count={5} size={13} value={rowData.ratings} isHalf={true} emptyIcon={ <div style={{ color: '#8c8c8c' }} > {' '} <i className="fas fa-star" /> </div> } halfIcon={ <i className="fa fa-star-half-alt" /> } filledIcon={ <i className="fa fa-star" /> } activeColor="#22a612" edit={false} /> </span> </p> <p className="fs-14 fw-300 color-white o-08 mt-6"> {rowData.description} </p> </div> </li> )) ) : ( <div className="text-center"> {' '} No records found!{' '} </div> )} </> </InfiniteScroll> </> )} </ul> </Tab> </Tabs> </div> </div> </Col> </Row> </Container> </section> </> ); } export default Profile; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } try { let profileDetails = {}; let products = []; const token = contextCookie(context, 'token'); const response = await Rest.axiosRequest( API.getProfileDetails, {}, 'GET', false, token ); if (response.status === 200) { profileDetails = { brandName: response.data.data.brandData.brandName ?? '', slug: response.data.data.brandData.slug ?? '', brandWebsite: response.data.data.brandData.website ?? '', brandLogo: response.data.data.brandData.user.profilePath ?? 'uploads/profile/seller-default.png', state: response.data.data.brandData.user.states.name ?? '', year: response.data.data.brandData.year ?? '', avgProductRating: response.data.data.brandData.avgProductRating ?? 0, avgDOTRating: response.data.data.brandData.avgDOTRating ?? 0, avgGeneralRating: response.data.data.brandData.avgGeneralRating ?? 0, avgRating: response.data.data.brandData.avgRating ?? 0, description: response.data.data.brandData.description ?? '', // reviewsCount: response.data.data.brandData.reviewsCount ?? 0, reviewsDOTCount: response.data.data.brandData.reviewsDOTCount ?? 0, reviewsGeneralCount: response.data.data.brandData.reviewsGeneralCount ?? 0, reviewsProductCount: response.data.data.brandData.reviewsProductCount ?? 0, medRecCertificatePath: response.data.data.brandData.user.medRecCertificatePath ?? '', }; products = response.data.data.products ?? []; } else { return { notFound: true, }; } return { props: { profileDetails, products, }, }; } catch (e) { // console.log(e.message); return { redirect: { destination: '/500' }, }; } }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/product/list.js
import React, { useEffect, useState, createContext } from 'react'; import { Card, Col, Container, Row, Form, Button, OverlayTrigger, Tooltip, } from 'react-bootstrap'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCirclePlus, faMagnifyingGlass, faTimes, } from '@fortawesome/free-solid-svg-icons'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import Notifier from '../../components/Notifier'; import Select from 'react-select'; import { DropdownIndicator, react_select_xs_Styles, } from '../../components/DropDown'; import ReactPaginate from 'react-paginate'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { contextCookie, getSingle } from '../../services/Auth'; import Meta from '../../components/Meta'; import { APP_NAME } from '../../config/server.config'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; import ProductRow from '../../components/ProductRow'; const baseColor = '#202020'; const highlightColor = '#444'; export const CategoriesContext = createContext(); function MyProducts(props) { const noti = new Notifier(); const router = useRouter(); const [params, setParams] = useState({ brand: props.queryString.brand ?? '', category: props.queryString.category ?? '', sortBy: props.queryString.sortBy ?? '', keyword: props.queryString.keyword ?? '', offset: props.queryString.offset ?? 0, }); const [showSkeleton, setShowSkeleton] = useState(true); const [products, setProducts] = useState([]); const [brands, setBrands] = useState([]); const [categories, setCategories] = useState([]); const [keyword, setKeyword] = useState(props.queryString.keyword ?? ''); const sortBy = [ { id: 'desc', value: 'desc', name: 'Newest to Oldest', label: 'Newest to Oldest', }, { id: 'asc', value: 'asc', name: 'Oldest to Newest', label: 'Oldest to Newest', }, ]; const [limit, setLimit] = useState(10); const [totalPages, setTotalPages] = useState(); useEffect(async () => { setShowSkeleton(true); router.push('/product/list', { query: { ...params } }, undefined, { shallow: true, }); const response = await Rest.axiosRequest( API.getMyProducts + '?' + `limit=${limit}&` + new URLSearchParams(params).toString(), {}, 'GET' ); if (response.status === 200) { setProducts(response.data.data.product); setTotalPages(response.data.data.totalPages); } else { noti.notify(response.data.message, 'danger'); } if (!categories.length) { // Brands const brandsData = await Rest.axiosRequest( `${API.product}/brands`, {}, 'GET', false, getSingle('token') ); if (brandsData.status === 200) { const brands = []; brandsData?.data?.data?.map((brand) => { brands.push({ id: brand.id, value: brand.id, name: brand.brandName, label: brand.brandName, }); }); setBrands(brands); } // Categories const categoriesData = await Rest.axiosRequest( API.getCategories, {}, 'GET' ); if (categoriesData.status === 200) { const categories = []; categoriesData.data.data.map((category) => { categories.push({ id: category.id, value: category.id, name: category.title, label: category.title, }); }); setCategories(categories); } else { noti.notify(categoriesData.data.message, 'danger'); } } setShowSkeleton(false); }, [new URLSearchParams(params).toString()]); const handleFilterChange = (val, e) => { if (val) { setParams((prevState) => ({ ...prevState, [e.name]: val.value })); } else { setParams((prevState) => ({ ...prevState, [e.name]: '' })); } }; const onChangeSearch = (e) => { if (e.target.value) { setKeyword(e.target.value); } else { setKeyword(''); } }; const handlePageChange = (event) => { setParams((prevState) => ({ ...prevState, offset: event.selected })); }; const handleStatusChange = async (slug) => { const response = await Rest.axiosRequest( API.changeProductStatus + '/' + slug, {} ); if (response.data.status) { if (+response.data.data.isActive === 1) { document.getElementById('action-' + slug).classList.remove('fa-check'); document.getElementById('action-' + slug).classList.add('fa-ban'); } else { document.getElementById('action-' + slug).classList.add('fa-check'); document.getElementById('action-' + slug).classList.remove('fa-ban'); } noti.notify(response.data.message, 'success'); } else { noti.notify(response.data.message, 'danger'); } }; const handleCategoryFilter = (catId) => { setParams((prevState) => ({ ...prevState, category: catId })); }; return ( <> <CategoriesContext.Provider value={{ categories }}> <Meta title={`My Products | ${APP_NAME}`} keywords={'My Products'} description={'My Products'} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-8-21-30 br-10'> <Card.Header className='d-flex justify-content-between align-items-center border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-6'> <Card.Title className='fs-18 fw-600 color-dcdcdc mb-0'> My Product </Card.Title> <Link href='/product/add'> <a className='btn btn-primary btn-wh-130-38 br-6'> <span className='me-2'> <FontAwesomeIcon icon={faCirclePlus} /> </span> Add Product </a> </Link> </Card.Header> <Card.Body className='p-0'> <div className='d-flex justify-content-between flex-wrap mb-20'> <Form className='d-flex justify-content-flex-start align-items-center filter-form flex-md-nowrap flex-wrap filter-form order-filter'> <Form.Group className='form-inline form-dark form-group-h-33 me-md-3 me-0 mb-sm-2 flex-fill'> <Form.Label className='my-2'>Brand:</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg maxw-200' styles={react_select_xs_Styles} options={brands.map(({ id, name }) => ({ value: id, label: name, }))} value={brands.filter( (item) => item.id == params.brand )} onChange={(val, e) => handleFilterChange(val, e)} placeholder='Brand' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='brand' isClearable={true} /> </Form.Group> <Form.Group className='form-inline form-dark form-group-h-33 me-md-3 me-0 mb-sm-2 flex-fill'> <Form.Label className='my-2'>Category:</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg maxw-200' styles={react_select_xs_Styles} options={categories.map(({ id, name }) => ({ value: id, label: name, }))} value={categories.filter( (item) => item.id == params.category )} onChange={(val, e) => handleFilterChange(val, e)} placeholder='Category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='category' isClearable={true} /> </Form.Group> <Form.Group className='form-inline form-dark form-group-h-33 me-md-3 me-0 mb-2 flex-fill'> <Form.Label className='my-2'>Sort By:</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg maxw-150' styles={react_select_xs_Styles} options={sortBy.map(({ value, name }) => ({ value: value, label: name, }))} value={sortBy.filter( (item) => item.value == params.sortBy )} onChange={(val, e) => handleFilterChange(val, e)} placeholder='Sort By' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='sortBy' isClearable={true} /> </Form.Group> </Form> <Form className='mb-7 d-flex search-form-main'> <Form.Group className='search-form form-dark maxw-150 '> <Form.Control type='search' placeholder='Search by Keywords' name='keyword' onChange={onChangeSearch} value={keyword} /> <Button variant='primary' className='btn-wh-35 br-8 bg-f3772c' onClick={() => setParams((prevState) => ({ ...prevState, ['keyword']: keyword, })) } > <FontAwesomeIcon icon={faMagnifyingGlass} /> </Button> </Form.Group> {params.brand !== '' || params.category !== '' || params.sortBy !== '' || params.keyword !== '' ? ( <Form.Group className='form-inline form-dark form-group-h-33 mr-10'> <OverlayTrigger placement='top' overlay={<Tooltip>Clear All</Tooltip>} > <Button variant='secondary' className='btn-wh-35 br-8 bg-f3772c ms-3' onClick={() => { setParams({ category: '', sortBy: '', keyword: '', offset: 0, }); setKeyword(''); }} > <FontAwesomeIcon icon={faTimes} /> </Button> </OverlayTrigger> </Form.Group> ) : null} </Form> </div> <div className='table-wrap CustomScrollbar CustomScrollbarY'> {/* <Table bordered hover variant="dark" id="seller-product" className='form-dark'> */} <ResponsiveTable className='table table-bordered table-hover table-dark form-dark' id='seller-product' > <Thead> <Tr> <Th width='250px'>Product</Th> <Th width='130px'>Brand</Th> <Th width='130px'>Category</Th> <Th width='150px'>Unit Weight</Th> <Th width='180px'>Unit Per Package</Th> <Th width='100px'>Price</Th> <Th width='100px'>Stock</Th> <Th width='280px'>'Unit Stock' Visibility</Th> <Th width='150px'>Action</Th> </Tr> </Thead> <Tbody> {showSkeleton ? ( [...Array(5)].map((arrayData, index) => { return ( <Tr key={index + 'loader'}> {[...Array(11)].map((data, sIndex) => { return ( <Td key={sIndex + 'skeleton'}> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton /> </SkeletonTheme> </Td> ); })} </Tr> ); }) ) : products.length ? ( products.map((product, i) => { return ( <ProductRow key={i} product={product} handleStatusChange={handleStatusChange} categories={categories} handleCategoryFilter={handleCategoryFilter} isLastRow={ i === products.length - 1 && products.length > 1 } /> ); }) ) : ( <Tr> <Td className='text-center' colSpan={10}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> <div className='mt-5 d-flex justify-content-center'> {totalPages > 1 ? ( <ReactPaginate previousLabel={ <i className='fas fa-long-arrow-alt-left'></i> } nextLabel={ <i className='fas fa-long-arrow-alt-right'></i> } pageClassName='page-item' pageLinkClassName='page-link' previousClassName='page-item prev-item' previousLinkClassName='page-link' nextClassName='page-item next-item' nextLinkClassName='page-link' breakLabel='...' breakClassName='page-item' breakLinkClassName='page-link' pageCount={totalPages} //marginPagesDisplayed={1} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName='pagination' activeClassName='active' forcePage={parseInt(params.offset)} /> ) : null} </div> </Card.Body> </Card> </Col> </Row> </Container> </section> </CategoriesContext.Provider> </> ); } export default MyProducts; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: { queryString: context.query, }, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/product/add.js
import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Card, Col, Container, Row, Form, Button, Spinner, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight } from '@fortawesome/free-solid-svg-icons'; import 'react-dropzone-uploader/dist/styles.css'; import Dropzone from 'react-dropzone-uploader'; import API from '../../config/endpoints.config'; import { getSingle } from '../../services/Auth'; import FormValidator from '../../components/FormValidator'; import Datetime from 'react-datetime'; import moment from 'moment'; import 'react-datetime/css/react-datetime.css'; import Select from 'react-select'; import { DropdownIndicator, react_select_lg_Styles, } from '../../components/DropDown'; import Rest from '../../config/rest.config'; import Notifier from '../../components/Notifier'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../../services/SkeletonOptions'; import { APP_NAME, ASSETS_URL } from '../../config/server.config'; import Meta from '../../components/Meta'; import CustomDatePicker from '../../components/CustomDatePicker'; function AddProduct() { const router = useRouter(); const noti = new Notifier(); // const validateImage = (confirmation, state) => { // if(state.productImages.length === 0){ // return true; // }else if(state.imagesExistArr.length === 0 && state.productImages.length === 0){ // return true; // }else{ // return false; // } // } const validator = new FormValidator([ { field: 'title', method: 'isEmpty', validWhen: false, message: 'Please enter product name.', }, { field: 'categoryId', method: 'isEmpty', validWhen: false, message: 'Please select category.', }, // { // field: 'medRecId', // method: 'isEmpty', // validWhen: false, // message: 'Please select med/rec.', // }, { field: 'price', method: 'isEmpty', validWhen: false, message: 'Please enter price per package.', }, { field: 'thc', method: 'isEmpty', validWhen: false, message: 'Please enter thc%.', }, { field: 'unitWeight', method: 'isEmpty', validWhen: false, message: 'Please enter unit weight.', }, { field: 'unitPerPackage', method: 'isEmpty', validWhen: false, message: 'Please enter unit per package.', }, ]); const [productData, setProductData] = useState({ brandCompanyId: getSingle('currentBrandCompanyId'), brandId: getSingle('currentBrandId'), title: '', categoryId: '', subCategoryId: '', medRecId: getSingle('medRecId'), unitWeight: '', unitPerPackage: '', price: '', packagesInStock: '', isShowStock: false, strainId: '', dominant: '', harvested: '', thc: '', flavor: '', description: '', productImages: [], imagesExistArr: [], labResults: '', }); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const [categories, setCategories] = useState([]); const [subCategories, setSubCategories] = useState([]); //const [medrec, setMedRec] = useState([]); const [strains, setStrains] = useState([]); const [showSkeleton, setShowSkeleton] = useState(true); const [maxFiles, setMaxFiles] = useState(5); useEffect(async () => { const categoriesData = await Rest.axiosRequest( API.getCategories, {}, 'GET' ); if (categoriesData.status === 200) { const categories = []; categoriesData.data.data.map((category) => { categories.push({ id: category.id, value: category.id, name: category.title, label: category.title, }); }); setCategories(categories); } else { noti.notify(categoriesData.data.message, 'danger'); } // const medrecData = await Rest.axiosRequest(API.getMedrec, {}, 'GET'); // if (medrecData.status === 200) { // const medrec = []; // medrecData.data.data.map((value) => { // if (getSingle('medRecId') === 3 && value.id !== 3) { // medrec.push({ // id: value.id, // value: value.id, // name: value.title, // label: value.title, // }); // } else if (getSingle('medRecId') === 1 && value.id === 1) { // medrec.push({ // id: value.id, // value: value.id, // name: value.title, // label: value.title, // }); // } else if (getSingle('medRecId') === 2 && value.id === 2) { // medrec.push({ // id: value.id, // value: value.id, // name: value.title, // label: value.title, // }); // } // }); // setMedRec(medrec); // } else { // noti.notify(medrecData.data.message, 'danger'); // } const strainsData = await Rest.axiosRequest(API.getStrains, {}, 'GET'); if (strainsData.status === 200) { const strains = []; strainsData.data.data.map((value) => { strains.push({ id: value.id, value: value.id, name: value.title, label: value.title, }); }); setStrains(strains); } else { noti.notify(strainsData.data.message, 'danger'); } setShowSkeleton(false); }, []); const handleChange = (event) => { const { name, value } = event.target; setProductData((prevState) => ({ ...prevState, [name]: value })); }; const getUploadParams = ({ file, headers, meta }) => { const url = API.productImageUpload; return { url, headers: { Authorization: `Bearer ${getSingle('token')}` }, meta: { userid: getSingle('token') }, }; }; const handleChangeStatus = ({ meta, remove, xhr }, status) => { if (status === 'error_validation') { remove(); document.getElementById('max-files-err').classList.remove('d-none'); } else if (status === 'headers_received') { if (xhr) { xhr.onreadystatechange = () => { if (xhr.readyState === 4) { const result = JSON.parse(xhr.response); setProductData((prevState) => ({ ...prevState, productImages: [...productData.productImages, result.data], })); setMaxFiles(maxFiles - 1); document.getElementById('max-files-err').classList.add('d-none'); } }; } } else if (status === 'removed') { if (xhr) { if (xhr.response) { const result = JSON.parse(xhr.response); const removefilename = result.data; const response = Rest.axiosRequest( API.productImageRemove, { filePath: removefilename }, 'DELETE' ) .then(() => { productData.productImages = productData.productImages.filter( function (item) { return item !== removefilename; } ); setProductData((prevState) => ({ ...prevState, productImages: [...productData.productImages], })); setMaxFiles(maxFiles + 1); document.getElementById('max-files-err').classList.add('d-none'); }) .catch((err) => noti.notify(err, 'danger')); } } } // else if(status === "aborted") {} }; const handleSelectChange = (val, e) => { if (val) { setProductData((prevState) => ({ ...prevState, [e.name]: val.value })); } else { setProductData((prevState) => ({ ...prevState, [e.name]: '' })); } }; const handleSelectChangeSubCategory = async (val, e) => { if (val) { setProductData((prevState) => ({ ...prevState, [e.name]: val.value })); const subCategoriesData = await Rest.axiosRequest( `${API.getSubCategories}/${val.value}`, {}, 'GET' ); if (subCategoriesData.status === 200) { const subCategories = []; subCategoriesData.data.data.map((subCategory) => { subCategories.push({ id: subCategory.id, value: subCategory.id, name: subCategory.title, label: subCategory.title, }); }); setSubCategories(subCategories); } } else { setProductData((prevState) => ({ ...prevState, [e.name]: '' })); } }; const handleChangeDate = (date) => { setProductData((prevState) => ({ ...prevState, harvested: date instanceof moment ? date.format('YYYY-MM-DD') : '', })); }; const handleShowStock = (isShowStock) => { setProductData((prevState) => ({ ...prevState, isShowStock: isShowStock, })); }; const addProduct = async (e) => { e.preventDefault(); const validation = validator.validate(productData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); let formData = new FormData(); for (const key in productData) { if (Object.hasOwnProperty.call(productData, key)) { if (key === 'productImages' || key === 'imagesExistArr') { for (var i = 0; i < productData[key].length; i++) { formData.append(key, JSON.stringify(productData[key][i])); } } else { formData.append(key, productData[key]); } } } let response; response = await Rest.axiosRequest(API.product, formData, 'POST', true); if (response.status === 200) { noti.notify(response.data.message, 'success'); setSubmitted(false); router.push('/product/list'); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); } }; const removeComponent = async (file_name) => { await Rest.axiosRequest( API.productImageRemove, { filePath: file_name }, 'DELETE' ) .then((response) => { if (response.status === 200) { productData.imagesExistArr = productData.imagesExistArr.filter( function (item) { return item.image !== file_name; } ); setProductData((prevState) => ({ ...prevState, imagesExistArr: [...productData.imagesExistArr], })); setMaxFiles(maxFiles + 1); noti.notify('Image removed successfully', 'success'); document.getElementById('max-files-err').classList.add('d-none'); } else { noti.notify(response.statusText, 'danger'); } }) .catch((err) => noti.notify(err, 'danger')); }; const documentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; if (fileType === 'application/pdf') { setProductData((prevState) => ({ ...prevState, labResults: event.target.files[0], })); } else { event.target.value = null; setProductData((prevState) => ({ ...prevState, labResults: '' })); noti.notify('Please upload PDF file only.', 'danger'); } } }; let checkValidation = submitted ? validator.validate(productData) : validation; return ( <> <Meta title={`Add Product | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-30 br-10'> <Card.Header className='border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13'> <Card.Title className='fs-18 fw-600 color-white mb-0'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={150} /> </SkeletonTheme> ) : ( 'Add Product' )} </Card.Title> </Card.Header> <Card.Body className='p-0'> <Form> <Row> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Product Name</Form.Label> <Form.Control type='text' placeholder='Enter Product Name' value={productData.title} name='title' onChange={handleChange} /> <div className={ checkValidation.title.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.title.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Unit Weight</Form.Label> <Form.Control type='text' placeholder='Enter Unit Weight' value={productData.unitWeight} name='unitWeight' onChange={handleChange} /> <div className={ checkValidation.unitWeight.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.unitWeight.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Category</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={categories.filter( (item) => item.id == productData.categoryId )} options={categories.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChangeSubCategory(val, e) } placeholder='Category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='categoryId' isClearable={true} /> <div className={ checkValidation.categoryId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.categoryId.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Sub Category</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={subCategories.filter( (item) => item.id == productData.subCategoryId )} options={subCategories.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChange(val, e) } placeholder='Sub Category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='subCategoryId' isClearable={true} /> </> )} </Form.Group> </Col> {/* <Col md={6}> <Form.Group className="form-dark mb-4"> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Med/Rec</Form.Label> <Select classNamePrefix="react-select" className="react-select-lg" styles={react_select_lg_Styles} value={medrec.filter( (item) => item.id == productData.medRecId )} options={medrec.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChange(val, e) } placeholder="Med/Rec" components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name="medRecId" isClearable={true} /> <div className={ checkValidation.medRecId.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.medRecId.message} </div> </div> </> )} </Form.Group> </Col> */} <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Unit Per Package</Form.Label> <Form.Control type='number' placeholder='Enter Unit Per Package' value={productData.unitPerPackage} name='unitPerPackage' onChange={handleChange} /> <div className={ checkValidation.unitPerPackage.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.unitPerPackage.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Price Per Package</Form.Label> <Form.Control type='number' placeholder='Enter Price Per Package' value={productData.price} name='price' onChange={handleChange} /> <div className={ checkValidation.price.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.price.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Packages in Stock</Form.Label> <Form.Control type='number' placeholder='Enter Packages in Stock' value={productData.packagesInStock} name='packagesInStock' onChange={handleChange} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label></Form.Label> <Form.Check type='checkbox' label="Show 'Unit Stock' on marketplace" id='isShowStock' className='fw-500 color-white' onChange={() => handleShowStock(!productData.isShowStock) } /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Expiration Date</Form.Label> <CustomDatePicker responsive={true} selectedDate={ productData.harvested ? moment(productData.harvested).format( 'DD MMM, YYYY' ) : '' } handleOnChange={(date) => handleChangeDate(date) } disableFutureDates={false} disablePastDates={true} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Strain</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={strains.filter( (item) => item.id == productData.strainId )} options={strains.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChange(val, e) } placeholder='Strain' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='strainId' isClearable={true} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Dominant Terpene</Form.Label> <Form.Control type='text' placeholder='Enter Dominant Terpene' value={productData.dominant} name='dominant' onChange={handleChange} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Flavor</Form.Label> <Form.Control type='text' placeholder='Enter Flavor' value={productData.flavor} name='flavor' onChange={handleChange} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Lab Results</Form.Label> <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='labResults' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='application/pdf' name='labResults' className='uploadImg' id='labResults' onChange={(e) => documentHandler(e)} /> <div className='my-3'> {productData.labResults.name} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>THC%</Form.Label> <Form.Control type='number' placeholder='Enter THC%' value={productData.thc} name='thc' onChange={handleChange} /> <div className={ checkValidation.thc.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.thc.message} </div> </div> </> )} </Form.Group> </Col> <Col md={12}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={200} /> </SkeletonTheme> ) : ( <> <Form.Label>Upload Images</Form.Label> <div className='d-flex justify-content-start align-items-center flex-wrap mt-10'> {/* <div className="upload_file upload_file_btn mr-10"> <Form.Label for="document_upload" className="btn btn-outline-gray bs-none"><i className="icon-file-upload"></i>Upload Image</Form.Label> <Form.Control type="file" id="document_upload" /> </div> */} <p className='fs-14 color-dcdcdc fw-400 mb-2'> Max 5 Images That Might be Helpful in Describing About Product </p> </div> {productData.imagesExistArr && ( <div className='dzu-previewMain'> {productData.imagesExistArr.map((row, i) => ( <div className='dzu-previewContainer mb-3' key={i} id={'removeImg-' + row.id} > <img className='dzu-previewImage' src={ASSETS_URL + row.image} alt={row.image} title={row.Image} /> <div className='dzu-previewStatusContainer'> <span className='dzu-previewButton' onClick={() => removeComponent(row.image) } > {/* <img className="dzu-previewImage" src={require('../../assets/images/fas-fa-times.svg').default} alt="img"/> */} </span> </div> </div> ))} </div> )} <Dropzone getUploadParams={getUploadParams} onChangeStatus={handleChangeStatus} inputContent='Drag files to upload' inputWithFilesContent='Upload Image' accept='image/*' maxFiles={5} validate={({ meta }) => maxFiles > 0 ? false : 'You can not upload more than 5 images' } // styles={{ dropzone: { minHeight: 200, maxHeight: 250 } }} /> {/* <div className={ checkValidation.productImages.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.productImages.message} </div> </div> */} <div className='animated fadeIn d-none' id='max-files-err' > <div className='error'> You can not upload more than 5 images </div> </div> </> )} </Form.Group> </Col> <Col md={12}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={100} /> </SkeletonTheme> ) : ( <> <Form.Label>Description</Form.Label> <Form.Control as='textarea' placeholder='Enter Description' style={{ height: '107px' }} value={productData.description} name='description' onChange={handleChange} /> </> )} </Form.Group> </Col> <Col md={12}> <div className='d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={300} height={50} inline={true} count={2} className='m-10' /> </SkeletonTheme> ) : ( <> <Link href='/product/list'> <a className='btn btn-wh-160-54 btn-rounded btn-secondary btn-right-icons m-10'> Cancel <span> <FontAwesomeIcon icon={faAngleRight} /> </span> </a> </Link> <Button variant='primary' type='submit' className='btn-wh-150-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? addProduct : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Save' )} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </> )} </div> </Col> </Row> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default AddProduct;
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/product/[slug].js
import { faCalendarAlt, faCommentDots, faStar, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { saveAs } from 'file-saver'; import Link from 'next/link'; import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; import { Button, Card, Col, Container, Row, Spinner } from 'react-bootstrap'; import Figure from 'react-bootstrap/Figure'; import Lightbox from 'react-image-lightbox'; import 'react-image-lightbox/style.css'; // This only needs to be imported once in your app import InfiniteScroll from 'react-infinite-scroll-component'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import ReactStars from 'react-rating-stars-component'; import { useDispatch, useSelector } from 'react-redux'; import { addProductToCart, fetchCartProducts, } from '../../app/slices/cartSlice'; import FavouriteBtn from '../../components/FavouriteBtn'; import Meta from '../../components/Meta'; import Notifier from '../../components/Notifier'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { APP_NAME, ASSETS_URL, REACT_APP_API_BASE_URL, } from '../../config/server.config'; import { contextCookie, getSingle, isLoggedIn } from '../../services/Auth'; import { Helper, commaSeparatedStringWithIncludes, customFormat, } from '../../services/Helper'; import { SkeletonOptions } from '../../services/SkeletonOptions'; const moment = require('moment'); // ChartJS.register( // CategoryScale, // LinearScale, // PointElement, // LineElement, // Title, // Tooltip, // Legend, // Filler, // ); // const options = { // responsive: true, // elements: { // point: { // radius: 5, // } // }, // layout: { // padding: 10 // }, // plugins: { // legend: { // position: 'top', // display: false, // }, // title: { // display: false, // text: 'Price chart', // }, // tooltip: { // callbacks: { // label: function (context) { // let label = context.dataset.label || ''; // if (label) { // label += ': '; // } // if (context.parsed.y !== null) { // label += '$ ' + (Math.round(context.parsed.y * 100) / 100).toFixed(2); // } // return label; // } // } // } // }, // scales: { // y: { // display: true, // position: 'right', // grid: { // color: "transparent", // display: true, // drawBorder: true, // zeroLineColor: "#323232", // zeroLineWidth: 1, // lineWidth: 0, // }, // ticks: { // font: { // size: 15, // weight: "bold", // }, // color: "white", // // Include a dollar sign in the ticks // callback: function (value, index, ticks) { // return '$ ' + (Math.round(value * 100) / 100).toFixed(2); // }, // } // }, // x: { // grid: { // color: "transparent", // display: true, // drawBorder: true, // zeroLineColor: "#323232", // zeroLineWidth: 1, // lineWidth: 0, // }, // ticks: { // font: { // size: 15, // weight: "bold", // }, // color: "white" // } // } // }, // }; function ProductDetails(props) { // let labels = []; // let data = []; // props.productPriceHistory.map((history) => { // labels = [...labels, moment(history['createdAt']).format("DD MMM")] // data = [...data, history['price']] // }) const router = useRouter(); const dispatch = useDispatch(); const cartProducts = useSelector((state) => state?.cart?.data?.cartItems); const productStatus = useSelector((state) => state.cart.status); const currentBrandId = useSelector((state) => state.cart?.data?.brandId); const { slug } = router.query; const noti = new Notifier(); const [showModal, setShowModal] = useState(false); const [isLoading, setIsLoading] = useState(false); const [quantity, setQuantity] = useState(1); const [quantityError, setQuantityError] = useState(false); const [productReviews, setProductReviews] = useState([]); const [hasMore, setHasMore] = useState(true); const [page, setPage] = useState(0); const [count, setCount] = useState(''); const [skeletonLoading, setSkeletonLoading] = useState(true); const [photoIndex, setPhotoIndex] = useState(0); const [isOpen, setIsOpen] = useState(false); // state for displaying total amount and chart // const [totalAmount, setTotalAmount] = useState(0); // const [chartLabels, setChartLabels] = useState(labels) // const [chartData, setChartData] = useState(data) // const [gradient, setGradient] = useState('') //useEffect for creating chart gradient // useEffect(() => { // if (document.getElementById('canvas')) { // const ctx = document.getElementById('canvas').getContext("2d") // const gradientData = ctx.createLinearGradient(0, 0, 0, 400) // gradientData.addColorStop(0, 'rgba(53, 100, 48, 1)'); // gradientData.addColorStop(1, 'rgba(65, 65, 65, 1)'); // setGradient(gradientData) // } // }, []) useEffect(() => { if (productStatus === 'idle') { if (isLoggedIn()) { dispatch(fetchCartProducts()); } } }, [productStatus, dispatch]); const isInt = (n) => { if (n.length == 0) { return false; } return !isNaN(n % 1) && n % 1 == 0; }; const handleRequestOrder = async () => { if (quantity > 0 && !quantityError) { setQuantityError(false); dispatch( addProductToCart({ productSlug: slug, quantity: parseInt(quantity) }) ) .unwrap() .then(() => { noti.notify('Product added to cart', 'success'); }) .catch((rejectedValueOrSerializedError) => { setIsLoading(false); setQuantity(''); setShowModal(false); noti.notify(rejectedValueOrSerializedError.message, 'danger'); }); } else if (quantity === '') { // setTotalAmount(0); setQuantityError('Please enter your required quantity of product'); } else { // setTotalAmount(0); setQuantityError('Please enter valid quantity of product'); } }; const fetchMoreData = () => { setPage(page + 1); getReviews(); }; const getReviews = async () => { setSkeletonLoading(true); const review = await Rest.axiosRequest( API.productReview + `?slug=${slug}&page=${page}&limit=${5}`, {}, 'GET' ); if (review.status === 200) { const response = review.data; setCount(response.data.count); if (response.data.productReviews.length) { await setProductReviews([ ...productReviews, ...response.data.productReviews, ]); setHasMore(true); setSkeletonLoading(false); } else { setSkeletonLoading(false); setHasMore(false); return; } } else { setSkeletonLoading(false); noti.notify(response.data.message, 'danger'); } }; const lightboxHandler = (index) => { setIsOpen(true); setPhotoIndex(index); }; const downloadLicense = () => { saveAs( REACT_APP_API_BASE_URL + '/get/file' + props.productDetail.labResultsPath ); }; return ( <> <Meta title={ props.productDetail.title ? props.productDetail.title + ` | ${APP_NAME}` : '' } keyword={''} description={''} /> <section className='bg-black p-27-0-55'> <Container> <Row> <Col lg={12}> <div className='m-l-r-30'> <div className='box-dark mb-30 overflow-hidden'> <ul className='listing-w-100 d-flex justify-start flex-wrap p-20'> <li className='product-detail-wrap d-flex align-items-start justify-content-between flex-wrap border-bottom-greenlight'> <div className='product-name'> <h5 className='fs-24 fw-600 color-22a612 mb-0'> {Helper.niceString( props.productDetail?.title, 30, true )} </h5> <ul className='category-list d-flex flex-wrap mt-2 mb-2'> <li>{props.productDetail.categoryTitle}</li> {props?.productDetail?.subCategoryTitle && ( <> <li>{props?.productDetail?.subCategoryTitle}</li> </> )} </ul> </div> {props.productDetail?.labResultsPath && props.productDetail?.labResultsPath !== 'null' && ( <a onClick={downloadLicense} className='fs-15 fw-600 color-22a612 text-decoration-none' > <i className='icon-pdf-download'></i> <span className='text-decoration-underline'> {' '} Lab Results </span> </a> )} <div className='product-price d-flex align-items-center justify-content-between flex-wrap'> {!commaSeparatedStringWithIncludes( props.productDetail?.blockedRetailers, getSingle('userId') ) && props.isLoggedIn && ( <> <span className='fs-14 fw-500 color-white product-price'> Price Per Package: <strong className='m-l-r-20 fs-24 fw-700 color-white'> {props.productDetail.productPrice} </strong> </span> </> )} {/* <span className="fs-14 fw-500 color-white product-price"> Price per lb: <strong className="m-l-r-20 fs-24 fw-700 color-white"> {props.productDetail.productPrice} </strong> </span> */} {props.isLoggedIn && getSingle('role') !== '2' ? ( <> <div> {!commaSeparatedStringWithIncludes( props.productDetail?.blockedRetailers, getSingle('userId') ) ? ( <> <Button variant='primary' className='btn-wh-188-51 btn br-30' onClick={handleRequestOrder} disabled={isLoading ? true : false} > <span> <i className='far fa-shopping-cart'></i> </span>{' '} {isLoading ? ( <Spinner animation='border' /> ) : ( 'Add to cart' )} </Button> <div className='text-center my-1'> {props.isLoggedIn && props.productDetail.isShowStock && ( <> {props.productDetail.packagesInStock}{' '} Left </> )} </div> </> ) : ( <> <Button variant='primary' disabled={true} className='btn-wh-188-51 btn br-30' > <span> <i className='far fa-shopping-cart'></i> </span>{' '} Add to cart </Button> </> )} </div> <ul className='d-flex align-items-center justify-content-between flex-wrap border-left-greenlight m-l-20'> <li> <span className='btn-favorite m-l-20'> <FavouriteBtn isFavourite={ props.productDetail.isProductFavourited } productSlug={slug} /> </span> </li> <li> <Link href={ '/messages/' + props.productDetail.brandSlug } > <a className='w-37 h-37 b-w-2 btn-circle color-f3772c b-c-f3772c d-inline-b text-center m-l-20'> {' '} <span> <FontAwesomeIcon icon={faCommentDots} /> </span>{' '} </a> </Link> </li> </ul> </> ) : getSingle('role') !== '2' ? ( <Link href='/sign-in'> <a className='btn-primary btn-wh-188-51 btn br-30'> <span> <i className='far fa-shopping-cart'></i> </span>{' '} Add to cart </a> </Link> ) : null} </div> </li> <li className='p-19-0-10'> <ul className='product-detail-listing-wrap'> <li> <ul className='listing-33p product-detail-listing border-none'> <li className='w-100'> <p className='fs-16 fw-500 color-white mb-3 d-flex align-items-center justify-content-start w-100'> Product Quality <span className='color-22a612 p-l-10'> <FontAwesomeIcon icon={faStar} /> </span> <span className='fs-18 fw-500 color-22a612 m-l-10'> {props.productDetail.avgProductRating}/5{' '} </span> <span className='fs-13 fw-300 color-white o-05 ml-2'> {' '} ({ props.productDetail.reviewsProductCount }{' '} Reviews) </span> </p> </li> <li> <span className='fs-14 color-777777 fw-500'> Unit Weight <text className='float-end me-3'>:</text> </span> <p className='fs-14 color-white fw-400'> {props?.productDetail?.unitWeight} </p> </li> <li> <span className='fs-14 color-777777 fw-500'> Unit Per Package <text className='float-end me-3'>:</text> </span> <p className='fs-14 color-white fw-400'> {props.productDetail.unitPerPackage} </p> </li> <li> <span className='fs-14 color-777777 fw-500'> Flavor <text className='float-end me-3'>:</text> </span> <p className='fs-14 color-white fw-400'> {props.productDetail.flavor} </p> </li> <li> <span className='fs-14 color-777777 fw-500'> Dominant Terpene <text className='float-end me-3'>:</text> </span> <p className='fs-14 color-white fw-400'> {Helper.niceString( props.productDetail.dominant, 15, true )} </p> </li> <li> <span className='fs-14 color-777777 fw-500'> THC% <text className='float-end me-3'>:</text> </span> <p className='fs-14 color-white fw-400'> {props.productDetail.thc}% </p> </li> <li> <span className='fs-14 color-777777 fw-500'> Strain <text className='float-end me-3'>:</text> </span> <p className='fs-14 color-white fw-400'> {props.productDetail.strainTitle} </p> </li> <li> <span className='fs-14 color-777777 fw-500'> Expiration Date <text className='float-end me-3'>:</text> </span> <p className='fs-14 color-white fw-400'> {props.productDetail.harvested ? moment( props.productDetail.harvested ).format("DD MMM 'YY") : 'N/A'} </p> </li> </ul> </li> <li className='product-quality-wrap text-right'> <div className='d-flex justify-content-center direction-column flex-wrap'> {props.isLoggedIn ? ( <> <div className='brand-name-icon'> <Figure className='mb-0 w-60 h-60 br-50p border-white-2'> <Figure.Image src={ ASSETS_URL + (props?.productDetail ?.brandProfilePath ?? '/profile/no-profile-image.jpg') } className='cover circle' /> </Figure> </div> <div className='text-center w-100 mt-15'> {Helper.niceString( props.productDetail.brandName, 15, true )} </div> <Link href={ '/brand/' + props.productDetail.brandSlug } > <a className='btn-wh-188-38 btn br-30 btn-gray mt-15'> <span> <i className='icon-user-view'></i> </span>{' '} View Brand </a> </Link> </> ) : ( <> <div className='brand-name-icon'> <Figure className='mb-0 w-60 h-60 br-50p border-white-2'> <Figure.Image src={ ASSETS_URL + (props?.productDetail ?.brandProfilePath ?? '/profile/no-profile-image.jpg') } className='cover circle' /> </Figure> </div> <div className='text-center w-100 mt-15'> {Helper.niceString( props.productDetail.brandName, 15, true )} </div> <Link href='/sign-in'> <a className='btn-wh-188-38 btn br-30 btn-gray mt-15'> <span> <i className='icon-user-view'></i> </span>{' '} View Brand </a> </Link> </> )} {/* <Link href={"/brand/" + props.productDetail.brandSlug} > <Button href={"/brand/" + props.productDetail.brandSlug} className="btn-wh-188-38 btn br-30 btn-gray mt-15"><span><i className="icon-user-view"></i></span> View Brand </Button></Link> */} </div> </li> </ul> </li> </ul> </div> {/* <div className={"box-dark mb-30 overflow-hidden" + (chartLabels.length && chartLabels.length === 1 ? ' d-none' : '')}> <Line id="canvas" options={options} data={ { labels: chartLabels, datasets: [ { fill: true, data: chartData, tension: 0.2, backgroundColor: gradient, borderColor: '#090', borderWidth: 2, pointBackgroundColor: '#fff', pointBorderColor: '#090', pointHoverBackgroundColor: '#fff', pointHoverBorderColor: 'rgb(54, 162, 235)', } ], } } /> </div> */} {props?.productDetail?.description && ( <Card className='card-dark border-gray mb-30 overflow-hidden'> <Card.Header className='bg-color-3d3d3d fs-18 fw-600 color-white border-bottom-gray-light p-13-20'> Description </Card.Header> <Card.Body className='bg-color-191919 fs-14 fw-30 color-white o-09 p-20-20-30-20'> {props.productDetail.description} </Card.Body> </Card> )} {props.productDetail.productImages && props.productDetail.productImages.length ? ( <Card className='card-dark border-gray mb-30 overflow-hidden'> <Card.Header className='bg-color-3d3d3d fs-18 fw-600 color-white border-bottom-gray-light p-13-20'> Gallery </Card.Header> <Card.Body className='bg-color-191919 fs-14 fw-30 color-white o-09 p-20'> <ul className='img-listing img-listing-5'> {props.productDetail.productImages.map( (row, keyIndex) => ( <li key={keyIndex + 'product-image'}> <Figure className='listing-img cursor-pointer' onClick={() => lightboxHandler(keyIndex)} > <Figure.Image width={60} height={60} src={ASSETS_URL + row.image} /> </Figure> </li> ) )} </ul> </Card.Body> </Card> ) : null} {isOpen && ( <Lightbox mainSrc={ ASSETS_URL + props.productDetail.productImages[photoIndex].image } nextSrc={ ASSETS_URL + props.productDetail.productImages[ (photoIndex + 1) % props.productDetail.productImages.length ] } prevSrc={ ASSETS_URL + props.productDetail.productImages[ (photoIndex + props.productDetail.productImages.length - 1) % props.productDetail.productImages.length ] } onCloseRequest={() => setIsOpen(false)} onMovePrevRequest={() => setPhotoIndex( (photoIndex + props.productDetail.productImages.length - 1) % props.productDetail.productImages.length ) } onMoveNextRequest={() => setPhotoIndex( (photoIndex + 1) % props.productDetail.productImages.length ) } /> )} <Card className='card-dark border-gray mb-30 overflow-hidden'> <Card.Header className='bg-color-3d3d3d fs-18 fw-600 color-white border-bottom-gray-light p-13-20'> Reviews </Card.Header> <Card.Body className='bg-color-191919 fs-14 fw-30 color-white o-09 p-25-28'> <ul className='comment-listing'> <InfiniteScroll dataLength={productReviews.length} next={fetchMoreData} hasMore={hasMore} scrollThreshold={0.45} loader={[...Array(3)].map((elementInArray, index) => ( <li key={index + 'abc'} className='comment-wrap'> <Figure className='mb-0 w-60 h-60 br-50p'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={60} height={60} /> </SkeletonTheme> </Figure> <div className='comment-detail'> <h5 className='fs-16 fw-600 color-white mb-0'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} /> </SkeletonTheme> </h5> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={250} className='product-rating' /> </SkeletonTheme> <p className='fs-14 fw-300 color-white o-08 mt-6'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton count={5} /> </SkeletonTheme> </p> </div> </li> ))} > {!skeletonLoading ? ( productReviews.length > 0 ? ( productReviews.map((rowData, keyIndex) => { return ( <li key={keyIndex + 'preview'} className='comment-wrap' > <Figure className='mb-0 w-60 h-60 br-50p border-white-2'> <Figure.Image src={ ASSETS_URL + (rowData.retailer.profilePath ?? '/profile/no-profile-image.jpg') } className='cover circle' /> </Figure> <div className='comment-detail'> <h5 className='fs-16 fw-600 color-white mb-0'> {rowData.retailer.fullName}{' '} <date className='fs-13 fw-500 color-8c8c8c f-style-italic p-l-10'> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {moment(rowData.createdAt).format( customFormat )} </date> </h5> <p className='product-rating'> Product Quality{' '} <span> <ReactStars count={5} size={13} value={rowData.ratings} isHalf={true} emptyIcon={ <div style={{ color: '#8c8c8c' }}> {' '} <i className='fas fa-star' /> </div> } halfIcon={ <i className='fa fa-star-half-alt' /> } filledIcon={ <i className='fa fa-star' /> } activeColor='#22a612' color='#656565' edit={false} /> </span> </p> <p className='fs-14 fw-300 color-white o-08 mt-6'> {rowData.description} </p> </div> </li> ); }) ) : ( <div className='text-center'> {' '} No records found!{' '} </div> ) ) : null} </InfiniteScroll> </ul> </Card.Body> </Card> </div> </Col> </Row> </Container> </section> </> ); } export default ProductDetails; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); try { const { slug } = context.params; let productDetail = {}; let price = ''; const token = contextCookie(context, 'token'); let response; if (token) { response = await Rest.axiosRequest( `${API.getMyProduct}/${slug}`, {}, 'GET', false, token ); if (response.status === 200) { const medRecId = contextCookie(context, 'medRecId'); if (medRecId !== response?.data?.data?.medRecId) { return { notFound: true }; } } } else { response = await Rest.axiosRequest( `${API.getMyProduct}/${slug}/admin`, {}, 'GET', false ); } if (response.status === 200) { const result = response?.data?.data; productDetail = { id: result?.id ?? '', avgProductRating: result?.avgProductRating ?? '', categoryTitle: result?.category?.title ?? '', subCategoryTitle: result?.subcategory?.title ?? '', description: result?.description ?? '', dominant: result?.dominant ?? '', unitWeight: result?.unitWeight ?? '', harvested: result?.harvested ?? '', ioTitle: result?.io?.title ?? '', medRecTitle: result?.medRec?.title ?? '', productImages: result?.productImages ?? [], productPrice: result?.productPrice ?? '', unitPerPackage: result?.unitPerPackage ?? '', isShowStock: result?.isShowStock ?? '', packagesInStock: result?.packagesInStock ?? '', reviewsProductCount: result?.reviewsProductCount ?? '', strainTitle: result?.strain?.title ?? '', thc: result?.thc ?? '', flavor: result?.flavor, title: result?.title ?? '', brandId: result?.user?.brand?.id ?? '', brandName: result?.user?.brand?.brandName ?? '', brandSlug: result?.user?.brand?.slug ?? '', brandProfilePath: result?.user?.brand?.profilePath ?? '', canOrder: result?.canOrder ?? '', userId: result?.user?.id ?? '', totalUnitSold: result?.totalUnitSold ?? 0, labResultsPath: result?.labResultsPath ?? '', blockedRetailers: result?.user?.brand?.blockedRetailers ?? '', // unit: result?.unit, }; price = result?.price; productDetail.isProductFavourited = result?.productFavourites ? result?.productFavourites.length : false; return { props: { productDetail, price, productPriceHistory: result?.productPriceHistory, isLoggedIn, }, }; } else { return { notFound: true, }; } } catch (e) { console.log(e.message); return { redirect: { destination: '/500' }, }; } }
0
/content/gmx-projects/gmx-admin/frontend/pages/product
/content/gmx-projects/gmx-admin/frontend/pages/product/edit/[slug].js
import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Card, Col, Container, Row, Form, Button, Spinner, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight } from '@fortawesome/free-solid-svg-icons'; import 'react-dropzone-uploader/dist/styles.css'; import Dropzone from 'react-dropzone-uploader'; import API from '../../../config/endpoints.config'; import { contextCookie, decodeData, getSingle } from '../../../services/Auth'; import FormValidator from '../../../components/FormValidator'; // import Datetime from "react-datetime"; import moment from 'moment'; import 'react-datetime/css/react-datetime.css'; import Select from 'react-select'; import { DropdownIndicator, react_select_lg_Styles, } from '../../../components/DropDown'; import Rest from '../../../config/rest.config'; import Notifier from '../../../components/Notifier'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../../../services/SkeletonOptions'; import { APP_NAME, ASSETS_URL, REACT_APP_API_BASE_URL, } from '../../../config/server.config'; import CustomDatePicker from '../../../components/CustomDatePicker'; import { saveAs } from 'file-saver'; import Meta from '../../../components/Meta'; function EditProduct({ editProductData }) { const router = useRouter(); const noti = new Notifier(); const { slug } = router.query; // const validateImage = (confirmation, state) => { // if(slug !== undefined && state.imagesExistArr.length === 0 && state.productImages.length === 0){ // return true; // }else{ // return false; // } // } const validator = new FormValidator([ { field: 'title', method: 'isEmpty', validWhen: false, message: 'Please enter product name.', }, { field: 'categoryId', method: 'isEmpty', validWhen: false, message: 'Please select category.', }, // { // field: 'medRecId', // method: 'isEmpty', // validWhen: false, // message: 'Please select med/rec.', // }, { field: 'price', method: 'isEmpty', validWhen: false, message: 'Please enter price per package.', }, { field: 'thc', method: 'isEmpty', validWhen: false, message: 'Please enter thc%.', }, { field: 'unitWeight', method: 'isEmpty', validWhen: false, message: 'Please enter unit weight.', }, { field: 'unitPerPackage', method: 'isEmpty', validWhen: false, message: 'Please enter unit per package.', }, ]); const [productData, setProductData] = useState(editProductData.data); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const [categories, setCategories] = useState(editProductData.categories); const [subCategories, setSubCategories] = useState([]); // const [medrec, setMedRec] = useState(editProductData.medrec); const [strains, setStrains] = useState(editProductData.strains); const [showSkeleton, setShowSkeleton] = useState(false); const [maxFiles, setMaxFiles] = useState(editProductData.maxFiles); useEffect(() => { if (editProductData?.data?.categoryId) { handleSelectChangeSubCategory( { value: editProductData?.data?.categoryId }, { name: 'categoryId' } ); } }, []); const handleChange = (event) => { const { name, value } = event.target; setProductData((prevState) => ({ ...prevState, [name]: value })); }; const getUploadParams = ({ file, headers, meta }) => { const url = API.productImageUpload; return { url, headers: { Authorization: `Bearer ${getSingle('token')}` }, meta: { userid: getSingle('token') }, }; }; const handleChangeStatus = ({ meta, remove, xhr }, status, files) => { // if(status === 'preparing'){ // setMaxFiles(maxFiles-1) // } if (status === 'error_validation') { remove(); document.getElementById('max-files-err').classList.remove('d-none'); } else if (status === 'headers_received') { if (xhr) { xhr.onreadystatechange = () => { if (xhr.readyState === 4) { const result = JSON.parse(xhr.response); setProductData((prevState) => ({ ...prevState, productImages: [...productData.productImages, result.data], })); setMaxFiles(maxFiles - 1); document.getElementById('max-files-err').classList.add('d-none'); } }; } } else if (status === 'removed') { if (xhr) { if (xhr.response) { const result = JSON.parse(xhr.response); const removefilename = result.data; const response = Rest.axiosRequest( API.productImageRemove, { filePath: removefilename }, 'DELETE' ) .then(() => { productData.productImages = productData.productImages.filter( function (item) { return item !== removefilename; } ); setProductData((prevState) => ({ ...prevState, productImages: [...productData.productImages], })); setMaxFiles(maxFiles + 1); document.getElementById('max-files-err').classList.add('d-none'); }) .catch((err) => noti.notify(err, 'danger')); } } } // else if(status === "aborted") {} }; const handleSelectChange = (val, e) => { if (val) { setProductData((prevState) => ({ ...prevState, [e.name]: val.value })); } else { setProductData((prevState) => ({ ...prevState, [e.name]: '' })); } }; const handleSelectChangeSubCategory = async (val, e) => { if (val) { setProductData((prevState) => ({ ...prevState, [e.name]: val.value })); const subCategoriesData = await Rest.axiosRequest( `${API.getSubCategories}/${val.value}`, {}, 'GET' ); if (subCategoriesData.status === 200) { const subCategories = []; subCategoriesData.data.data.map((subCategory) => { subCategories.push({ id: subCategory.id, value: subCategory.id, name: subCategory.title, label: subCategory.title, }); }); setSubCategories(subCategories); } } else { setProductData((prevState) => ({ ...prevState, [e.name]: '' })); } }; const handleChangeDate = (date) => { setProductData((prevState) => ({ ...prevState, harvested: date instanceof moment ? date.format('YYYY-MM-DD') : '', })); }; const handleShowStock = (isShowStock) => { setProductData((prevState) => ({ ...prevState, isShowStock: isShowStock, })); }; const addProduct = async (e) => { e.preventDefault(); const validation = validator.validate(productData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); let formData = new FormData(); for (const key in productData) { if (Object.hasOwnProperty.call(productData, key)) { if (key === 'productImages' || key === 'imagesExistArr') { for (var i = 0; i < productData[key].length; i++) { formData.append(key, JSON.stringify(productData[key][i])); } } else { formData.append(key, productData[key]); } } } let response; response = await Rest.axiosRequest( API.product + '/' + slug, formData, 'PUT', true ); if (response.status === 200) { noti.notify(response.data.message, 'success'); setSubmitted(false); router.push('/product/list'); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); } }; const removeComponent = async (file_name) => { await Rest.axiosRequest( API.productImageRemove, { filePath: file_name }, 'DELETE' ) .then((response) => { if (response.status === 200) { productData.imagesExistArr = productData.imagesExistArr.filter( function (item) { return item.image !== file_name; } ); setProductData((prevState) => ({ ...prevState, imagesExistArr: [...productData.imagesExistArr], })); setMaxFiles(maxFiles + 1); noti.notify('Image removed successfully', 'success'); document.getElementById('max-files-err').classList.add('d-none'); } else { noti.notify(response.statusText, 'danger'); } }) .catch((err) => noti.notify(err, 'danger')); }; let checkValidation = submitted ? validator.validate(productData) : validation; const downloadFile = (filePath) => { saveAs(REACT_APP_API_BASE_URL + '/get/file' + filePath); }; const documentHandler = (event) => { let file = event.target.files[0]; if (file) { let fileType = file.type; if (fileType === 'application/pdf') { setProductData((prevState) => ({ ...prevState, labResults: event.target.files[0], })); } else { event.target.value = null; setProductData((prevState) => ({ ...prevState, labResults: '' })); noti.notify('Please upload Image or PDF file only.', 'danger'); } } }; return ( <> <Meta title={`Edit Product | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-30 br-10'> <Card.Header className='border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13'> <Card.Title className='fs-18 fw-600 color-white mb-0'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={150} /> </SkeletonTheme> ) : ( 'Edit Product' )} </Card.Title> </Card.Header> <Card.Body className='p-0'> <Form> <Row> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Product Name</Form.Label> <Form.Control type='text' placeholder='Enter Product Name' value={productData.title} name='title' onChange={handleChange} /> <div className={ checkValidation.title.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.title.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Unit Weight</Form.Label> <Form.Control type='text' placeholder='Enter Unit Weight' value={productData.unitWeight} name='unitWeight' onChange={handleChange} /> <div className={ checkValidation.unitWeight.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.unitWeight.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Category</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={categories.filter( (item) => item.id == productData.categoryId )} options={categories.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChangeSubCategory(val, e) } placeholder='Category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='categoryId' isClearable={true} /> <div className={ checkValidation.categoryId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.categoryId.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Sub Category</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={subCategories.filter( (item) => item.id == productData.subCategoryId )} options={subCategories.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChange(val, e) } placeholder='Sub Category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='subCategoryId' isClearable={true} /> </> )} </Form.Group> </Col> {/* <Col md={6}> <Form.Group className="form-dark mb-4"> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Med/Rec</Form.Label> <Select classNamePrefix="react-select" className="react-select-lg" styles={react_select_lg_Styles} value={medrec.filter( (item) => item.id == productData.medRecId )} options={medrec.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChange(val, e) } placeholder="Med/Rec" components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name="medRecId" isClearable={true} /> <div className={ checkValidation.medRecId.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.medRecId.message} </div> </div> </> )} </Form.Group> </Col> */} <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Unit Per Package</Form.Label> <Form.Control type='number' placeholder='Enter Unit Per Package' value={productData.unitPerPackage} name='unitPerPackage' onChange={handleChange} /> <div className={ checkValidation.unitPerPackage.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.unitPerPackage.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Price Per Package</Form.Label> <Form.Control type='number' placeholder='Enter Price Per Package' value={productData.price} name='price' onChange={handleChange} /> <div className={ checkValidation.price.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.price.message} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Packages in Stock</Form.Label> <Form.Control type='number' placeholder='Enter Packages in Stock' value={productData.packagesInStock} name='packagesInStock' onChange={handleChange} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label></Form.Label> <Form.Check type='checkbox' label="Show 'Unit Stock' on marketplace" id='isShowStock' className='fw-500 color-white' checked={productData.isShowStock} onChange={() => handleShowStock(!productData.isShowStock) } /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Expiration Date</Form.Label> <CustomDatePicker responsive={true} selectedDate={ productData.harvested ? moment(productData.harvested).format( 'DD MMM, YYYY' ) : '' } handleOnChange={(date) => handleChangeDate(date) } disableFutureDates={false} disablePastDates={true} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Strain</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={strains.filter( (item) => item.id == productData.strainId )} options={strains.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val, e) => handleSelectChange(val, e) } placeholder='Strain' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='strainId' isClearable={true} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Dominant Terpene</Form.Label> <Form.Control type='text' placeholder='Enter Dominant Terpene' value={productData.dominant} name='dominant' onChange={handleChange} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Flavor</Form.Label> <Form.Control type='text' placeholder='Enter Flavor' value={productData.flavor} name='flavor' onChange={handleChange} /> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Lab Results</Form.Label> {productData.labResultsPath ? ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile(productData.labResultsPath) } > (Download File) </a> ) : ( '' )} <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='labResults' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='application/pdf' name='labResults' className='uploadImg' id='labResults' onChange={(e) => documentHandler(e)} /> <div className='my-3'> {productData.labResults ? productData.labResults.name : null} </div> </div> </> )} </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>THC%</Form.Label> <Form.Control type='number' placeholder='Enter THC%' value={productData.thc} name='thc' onChange={handleChange} /> <div className={ checkValidation.thc.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.thc.message} </div> </div> </> )} </Form.Group> </Col> <Col md={12}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={200} /> </SkeletonTheme> ) : ( <> <Form.Label>Upload Images</Form.Label> <div className='d-flex justify-content-start align-items-center flex-wrap mt-10'> {/* <div className="upload_file upload_file_btn mr-10"> <Form.Label for="document_upload" className="btn btn-outline-gray bs-none"><i className="icon-file-upload"></i>Upload Image</Form.Label> <Form.Control type="file" id="document_upload" /> </div> */} <p className='fs-14 color-dcdcdc fw-400 mb-2'> Max 5 Images That Might be Helpful in Describing About Product </p> </div> {productData.imagesExistArr && ( <div className='dzu-previewMain'> {productData.imagesExistArr.map((row, i) => ( <div className='dzu-previewContainer mb-3' key={i} id={'removeImg-' + row.id} > <img className='dzu-previewImage' src={ASSETS_URL + row.image} alt={row.image} title={row.Image} /> <div className='dzu-previewStatusContainer'> <span className='dzu-previewButton' onClick={() => removeComponent(row.image) } > {/* <img className="dzu-previewImage" src={require('../../assets/images/fas-fa-times.svg').default} alt="img"/> */} </span> </div> </div> ))} </div> )} <Dropzone getUploadParams={getUploadParams} onChangeStatus={handleChangeStatus} inputContent='Drag files to upload' inputWithFilesContent='Upload Image' accept='image/*' maxFiles={5} validate={({ meta }) => maxFiles > 0 ? false : 'You can not upload more than 5 images' } // styles={{ dropzone: { minHeight: 200, maxHeight: 250 } }} /> {/* <div className={ checkValidation.productImages.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.productImages.message} </div> </div> */} <div className='animated fadeIn d-none' id='max-files-err' > <div className='error'> You can not upload more than 5 images </div> </div> </> )} </Form.Group> </Col> <Col md={12}> <Form.Group className='form-dark mb-4'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={100} /> </SkeletonTheme> ) : ( <> <Form.Label>Description</Form.Label> <Form.Control as='textarea' placeholder='Enter Description' style={{ height: '107px' }} value={productData.description} name='description' onChange={handleChange} /> </> )} </Form.Group> </Col> <Col md={12}> <div className='d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton width={300} height={50} inline={true} count={2} className='m-10' /> </SkeletonTheme> ) : ( <> <Link href='/product/list'> <a className='btn btn-wh-160-54 btn-rounded btn-secondary btn-right-icons m-10'> Cancel <span> <FontAwesomeIcon icon={faAngleRight} /> </span> </a> </Link> <Button variant='primary' type='submit' className='btn-wh-150-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? addProduct : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Save' )} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </> )} </div> </Col> </Row> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default EditProduct; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } try { const { slug } = context.params; const token = contextCookie(context, 'token'); let editProductData = {}; const response = await Rest.axiosRequest( API.getMyProduct + '/' + slug, {}, 'GET', false, token ); if (response.status === 200) { const data = { title: response.data.data.title, categoryId: response.data.data.categoryId, subCategoryId: response.data.data.subCategoryId, medRecId: response.data.data.medRecId, unitWeight: response.data.data.unitWeight, unitPerPackage: response.data.data.unitPerPackage, price: response.data.data.price, packagesInStock: response.data.data.packagesInStock, isShowStock: response.data.data.isShowStock, strainId: response.data.data.strainId, dominant: response.data.data.dominant, harvested: response.data.data.harvested, thc: response.data.data.thc, description: response.data.data.description, flavor: response.data.data.flavor, imagesExistArr: response.data.data.productImages, productImages: [], labResultsPath: response.data.data.labResultsPath, }; editProductData.data = data; editProductData.maxFiles = 5 - response.data.data.productImages.length; } else { return { notFound: true, }; } const categoriesData = await Rest.axiosRequest( API.getCategories, {}, 'GET', false, token ); if (categoriesData.status === 200) { const categories = []; categoriesData.data.data.map((category) => { categories.push({ id: category.id, value: category.id, name: category.title, label: category.title, }); }); editProductData.categories = categories; } // const medrecData = await Rest.axiosRequest( // API.getMedrec, // {}, // 'GET', // false, // token // ); // if (medrecData.status === 200) { // const medrec = []; // medrecData.data.data.map((value) => { // if (contextCookie(context, 'medRecId') === 3 && value.id !== 3) { // medrec.push({ // id: value.id, // value: value.id, // name: value.title, // label: value.title, // }); // } else if (contextCookie(context, 'medRecId') === 1 && value.id === 1) { // medrec.push({ // id: value.id, // value: value.id, // name: value.title, // label: value.title, // }); // } else if (contextCookie(context, 'medRecId') === 2 && value.id === 2) { // medrec.push({ // id: value.id, // value: value.id, // name: value.title, // label: value.title, // }); // } // }); // editProductData.medrec = medrec; // } const strainsData = await Rest.axiosRequest( API.getStrains, {}, 'GET', false, token ); if (strainsData.status === 200) { const strains = []; strainsData.data.data.map((value) => { strains.push({ id: value.id, value: value.id, name: value.title, label: value.title, }); }); editProductData.strains = strains; } return { props: { editProductData, }, }; } catch (e) { console.log(e.message); return { redirect: { destination: '/product/list' }, }; } }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/favourites/index.js
import React, { useEffect, useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Container, Row, Col, Card, Table, OverlayTrigger, Tooltip, Button, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCommentDots, faEye, faSquareCheck, faTrashAlt, } from '@fortawesome/free-solid-svg-icons'; import ReactPaginate from 'react-paginate'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import Notifier from '../../components/Notifier'; import { SkeletonOptions } from '../../services/SkeletonOptions'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { Helper, commaSeparatedStringWithIncludes, } from '../../services/Helper'; import { contextCookie, getSingle } from '../../services/Auth'; import Meta from '../../components/Meta'; import { APP_NAME } from '../../config/server.config'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; import { addProductToCart, fetchCartProducts, } from '../../app/slices/cartSlice'; import Swal from 'sweetalert2'; import { useDispatch, useSelector } from 'react-redux'; function MyFavourite(props) { const dispatch = useDispatch(); const cartProducts = useSelector((state) => state?.cart?.data?.cartItems); const productStatus = useSelector((state) => state.cart.status); const currentBrandId = useSelector((state) => state.cart?.data?.brandId); const noti = new Notifier(); const router = useRouter(); const [showSkeleton, setShowSkeleton] = useState(true); const [favProducts, setFavProducts] = useState([]); const [limit, setLimit] = useState(10); const [updateList, setUpdateList] = useState(false); const [totalPages, setTotalPages] = useState(); const [isCartLoading, setIsCartLoading] = useState(false); const [params, setParams] = useState({ offset: props.queryString.offset ?? 0, }); const [disabled, setDisabled] = useState(false); useEffect(async () => { setShowSkeleton(true); router.push('/favourites', { query: { ...params } }, undefined, { shallow: true, }); const response = await Rest.axiosRequest( API.myFavourites + '?' + `limit=${limit}&` + new URLSearchParams(params).toString(), {}, 'GET' ); if (response.status === 200) { setFavProducts(response.data.data.favouriteProducts); setTotalPages(response.data.data.totalPages); } else { noti.notify(response.data.message, 'danger'); } setShowSkeleton(false); }, [new URLSearchParams(params).toString(), updateList]); const handlePageChange = (event) => { setParams((prevState) => ({ ...prevState, offset: event.selected })); }; const handleRemoveFavourite = async (slug) => { setDisabled(true); const response = await Rest.axiosRequest( API.addToFavourite + '/' + slug, {} ); setDisabled(false); if (response.data.status) { noti.notify(response.data.message, 'success'); setUpdateList(!updateList); } else { noti.notify(response.data.message, 'danger'); } }; useEffect(() => { if (productStatus === 'idle') { dispatch(fetchCartProducts()); } }, [productStatus, dispatch]); const handleRequestOrder = async (slug) => { const quantity = 1; dispatch( addProductToCart({ productSlug: slug, quantity: parseInt(quantity) }) ) .unwrap() .then(() => { noti.notify('Product added to cart', 'success'); }) .catch((rejectedValueOrSerializedError) => { setIsCartLoading(false); noti.notify(rejectedValueOrSerializedError.message, 'danger'); }); }; return ( <> <Meta title={`My Favourite | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-30 br-10'> <Card.Header className='border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13'> <Card.Title className='fs-18 fw-600 color-white mb-0'> My Favourite </Card.Title> </Card.Header> <Card.Body className='p-0'> <div className='table-wrap CustomScrollbar CustomScrollbarY'> {/* <Table bordered hover className="table-head-bg-000 table-td-bg-191919" variant="dark" id="seller-favourite"> */} <ResponsiveTable className='table table-bordered table-hover table-dark table-head-bg-101010' id='seller-favourite' > <Thead> <Tr> <Th width='250px;'>Product</Th> <Th width='250px;'>Brand</Th> <Th className='text-center' width='70px;'> Price/Package </Th> <Th className='text-center' width='120px;'> Unit Weight </Th> <Th className='text-center' width='90px;'> Unit/Package </Th> <Th className='text-center' width='90px;'> THC% </Th> <Th className='text-center' width='500px;'> Action </Th> </Tr> </Thead> <Tbody> {showSkeleton ? ( [...Array(10)].map((index) => { return ( <Tr key={index}> {[...Array(12)].map((i) => { return ( <Td key={i}> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Td> ); })} </Tr> ); }) ) : favProducts.length ? ( favProducts.map((favProduct) => { return ( <Tr key={favProduct.id}> <Td> <Link href={ '/product/' + favProduct?.product?.slug } > <a className='color-f3772c'> {Helper.niceString( favProduct?.product?.title, 20, true )} </a> </Link> <br /> {Helper.niceString( favProduct?.product?.category?.title, 14, true )} {favProduct?.product?.subcategory?.title && ( <> <br /> {Helper.niceString( favProduct?.product?.subcategory?.title, 16, true )} </> )} </Td> <Td> <Link href={ '/brand/' + favProduct?.product?.user?.brand?.slug } > <a className='color-22a612'> {Helper.niceString( favProduct?.product?.user?.brand ?.brandName, 20, true )} </a> </Link> </Td> <Td className='text-center'> {!commaSeparatedStringWithIncludes( favProduct?.product?.user?.brand?.retailers, getSingle('userId') ) ? ( <> {favProduct?.product?.productPrice} {favProduct?.product?.isShowStock && ( <> <br /> { favProduct?.product?.packagesInStock }{' '} Left </> )} </> ) : ( '-' )} </Td> <Td className='text-center'> {favProduct?.product?.unitWeight} </Td> <Td className='text-center'> {favProduct?.product?.unitPerPackage} </Td> <Td className='text-center'> {favProduct?.product?.thc}% </Td> <Td className='text-center'> <Link href={ '/product/' + favProduct?.product?.slug } > <a className='action-btn color-white text-decoration-none'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={ <Tooltip>View Product</Tooltip> } > <FontAwesomeIcon icon={faEye} /> </OverlayTrigger> </a> </Link> <a className='action-btn color-22a612 fs-16' onClick={() => handleRemoveFavourite( favProduct.product.slug ) } > <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={ <Tooltip>Remove Favourite</Tooltip> } > <FontAwesomeIcon icon={faSquareCheck} /> </OverlayTrigger> </a> <Link href={`/messages/${favProduct?.product?.user?.brand?.slug}`} > <a className='action-btn color-f3772c'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={<Tooltip>Message</Tooltip>} > <FontAwesomeIcon icon={faCommentDots} /> </OverlayTrigger> </a> </Link> <Link href={ '/brand/' + favProduct?.product?.user?.brand?.slug } > <a className='action-btn color-white text-decoration-none'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={<Tooltip>View Brand</Tooltip>} > <i className='icon-user-view'></i> </OverlayTrigger> </a> </Link> {!commaSeparatedStringWithIncludes( favProduct?.product?.user?.brand?.retailers, getSingle('userId') ) && getSingle('role') !== '2' && ( <> <Button varient='primary' onClick={() => { handleRequestOrder( favProduct?.product?.slug ); }} className='btn btn-wh-110-28 br-6 ' > <span className='fs-14 me-2'> <i className='far fa-shopping-cart'></i> </span>{' '} {isCartLoading ? ( <Spinner animation='border' /> ) : ( 'Add to cart' )} </Button> </> )} </Td> </Tr> ); }) ) : ( <Tr> <Td className='text-center' colSpan={11}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> <div className='mt-5 d-flex justify-content-center'> {totalPages > 1 ? ( <ReactPaginate previousLabel={ <i className='fas fa-long-arrow-alt-left'></i> } nextLabel={ <i className='fas fa-long-arrow-alt-right'></i> } pageClassName='page-item' pageLinkClassName='page-link' previousClassName='page-item prev-item' previousLinkClassName='page-link' nextClassName='page-item next-item' nextLinkClassName='page-link' breakLabel='...' breakClassName='page-item' breakLinkClassName='page-link' pageCount={totalPages} //marginPagesDisplayed={1} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName='pagination' activeClassName='active' forcePage={parseInt(params.offset)} /> ) : null} </div> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default MyFavourite; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: { queryString: context.query, }, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/messages/[[...slug]].js
import React, { useEffect, useRef, useState } from 'react'; import { Card, Col, Container, Row, Form, Button } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faSearch, faTimes } from '@fortawesome/free-solid-svg-icons'; import { io } from 'socket.io-client'; import md5 from 'md5'; import Rest from '../../config/rest.config'; import API from '../../config/endpoints.config'; import Notifier from '../../components/Notifier'; import ChatSection from '../../components/ChatSection'; import UserList from '../../components/UsersList'; import Meta from '../../components/Meta'; import { SOCKET_URL } from '../../config/server.config'; import { contextCookie, getSingle } from '../../services/Auth'; import { useRouter } from 'next/router'; import { APP_NAME } from '../../config/server.config'; const socket = io(SOCKET_URL); export default function Messages(props) { const [chatList, setChatList] = useState([]); // const [messages, setMessages] = useState([]) const [activeChat, setActiveChat] = useState(''); // const [selectedUser, setSelectedUser] = useState([]); const [searchQuery, setSearchQuery] = useState(''); const [showSkeleton, setShowSkeleton] = useState(true); const [isOpen, setIsOpen] = useState(false); const noti = new Notifier(); const scrollbarRef = useRef(null); const router = useRouter(); useEffect(() => { getUsersList(); if (props.slug) { // getMessages(props.slug) // setActiveChat(props.slug); // setIsOpen(true); updateOpenChat(props.slug); } // socket.emit('joinRoom', { // username: md5(parseInt(getSingle("userId"))) // }); // socket.on('new_message', function (data) { // if (selectedUser) { // if (md5(parseInt(selectedUser.id)) === data.sender) { // setMessages([...messages, data.msgData]) // //setMessages(messages.concat(data.msgData)) // // setMessages(prevMessages => ([...prevMessages, data.msgData])); // } // } // }); }, []); const updateOpenChat = (userSlug) => { setActiveChat(userSlug); setIsOpen(true); }; // const getMessages = async (anotherUserSlug) => { // setActiveChat(anotherUserSlug); // setIsOpen(true); // const response = await Rest.axiosRequest(API.getMessages, { anotherUserSlug: anotherUserSlug, offset: 0 }); // if (response.data.status) { // setMessages(response.data.data.messages); // setSelectedUser(response.data.data.user); // if (scrollbarRef.current) { // scrollbarRef.current.scrollToBottom() // } // } else { // noti.notify(response.data.message, "danger"); // router.push(`/messages`); // } // } const getUsersList = async (clearSearch = false) => { let response; if (clearSearch) { setSearchQuery(''); response = await Rest.axiosRequest( API.messagesUsersList + '?searchQuery=', {}, 'GET' ); } else { response = await Rest.axiosRequest( API.messagesUsersList + '?searchQuery=' + searchQuery, {}, 'GET' ); } if (response.status === 200) { setChatList(response.data.data); setShowSkeleton(false); } else { noti.notify(response.data.message, 'danger'); } }; const handleToggleChat = () => { setIsOpen(!isOpen); setActiveChat(''); }; return ( <> <Meta title={`Messages | ${APP_NAME}`} keywords='Messages' description='Messages' /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Row className='g-0'> <Col lg={4}> <Card className='br-0 bg-color-191919 bs-none'> <Card.Header className='p-3'> <Form className='search_form'> <div className='d-flex'> <Form.Control type='text' placeholder='Search by Name' value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} /> <Button type='button' variant='outline-primary' className='br-10 btn-wh-40 ms-3' onClick={() => getUsersList()} disabled={searchQuery !== '' ? '' : 'disabled'} > <FontAwesomeIcon icon={faSearch} />{' '} </Button> {searchQuery !== '' ? ( <Button type='button' variant='outline-primary' className='br-10 btn-wh-40 ms-3' onClick={() => { getUsersList(true); }} > <FontAwesomeIcon icon={faTimes} /> </Button> ) : null} </div> </Form> </Card.Header> {/* getMessages={getMessages} */} <UserList chatList={chatList} activeChat={activeChat} updateOpenChat={updateOpenChat} showSkeleton={showSkeleton} /> </Card> </Col> {/* messages={messages} */} {/* user={selectedUser} */} {activeChat != '' ? ( <ChatSection activeChat={activeChat} scrollbarRefrence={scrollbarRef} isOpen={isOpen} toggleChat={handleToggleChat} /> ) : null} </Row> </Col> </Row> </Container> </section> </> ); } export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } let slug; if (context.params.slug !== undefined) { slug = context.params.slug[0]; } else { slug = null; } return { props: { slug, }, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/marketplace/index.js
import { faCommentDots, faEye, faFilter, faMagnifyingGlass, faTimes, } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Link from 'next/link'; import { useRouter } from 'next/router'; import React, { useEffect, useRef, useState } from 'react'; import { Button, Col, Container, Form, OverlayTrigger, Row, Tooltip, } from 'react-bootstrap'; import Offcanvas from 'react-bootstrap/Offcanvas'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import ReactPaginate from 'react-paginate'; import { Range } from 'react-range'; import { useDispatch, useSelector } from 'react-redux'; import Select from 'react-select'; import { Table as ResponsiveTable, Tbody, Td, Th, Thead, Tr, } from 'react-super-responsive-table'; import { addProductToCart, fetchCartProducts, } from '../../app/slices/cartSlice'; import { DropdownIndicator, react_select_sm_Styles, react_select_xs_Styles, } from '../../components/DropDown'; import FavouriteBtn from '../../components/FavouriteBtn'; import Meta from '../../components/Meta'; import Notifier from '../../components/Notifier'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { APP_NAME } from '../../config/server.config'; import { contextCookie, getSingle } from '../../services/Auth'; import { Helper, commaSeparatedStringWithIncludes, } from '../../services/Helper'; import { SkeletonOptions } from '../../services/SkeletonOptions'; const moment = require('moment'); function ProductList(props) { const router = useRouter(); const dispatch = useDispatch(); const cartProducts = useSelector((state) => state?.cart?.data?.cartItems); const productStatus = useSelector((state) => state.cart.status); const currentBusinessId = useSelector( (state) => state.cart?.data?.businessId ); const noti = new Notifier(); const categoryRef = useRef(null); //const medRecRef = useRef(null); const strainRef = useRef(null); const ioRef = useRef(null); const [isLoading, setIsLoading] = useState(false); const [isCartLoading, setIsCartLoading] = useState(false); const [show, setShow] = useState(false); const [products, setProducts] = useState([]); const [categories, setCategories] = useState([]); // const [medRec, setMedRec] = useState([]) const [strain, setStrain] = useState([]); const [isFiltered, setIsFiltered] = useState(false); const sortBy = [ { id: 'desc', value: 'desc', name: 'Newest to Oldest', label: 'Newest to Oldest', }, { id: 'asc', value: 'asc', name: 'Oldest to Newest', label: 'Oldest to Newest', }, ]; const [params, setParams] = useState({ offset: props.queryString.offset ?? 0, sortBy: props.queryString.sortBy ?? '', keyword: props.queryString.keyword ?? '', category: props.queryString.category ?? '', // medRec: props.queryString.medRec ?? '', // priceMin: props.queryString.priceMin ?? '', // priceMax: props.queryString.priceMax ?? '', thcMin: props.queryString.thcMin ?? '', thcMax: props.queryString.thcMax ?? '', thc: props.queryString.thc ?? '', strain: props.queryString.strain ?? '', }); const [filters, setFilters] = useState({ filterKeyword: props.queryString.keyword ?? '', filterCategory: props.queryString.category ?? '', //filterMedRec: props.queryString.medRec ?? '', filterStrain: props.queryString.strain ?? '', }); const [maxPrice, setMaxPrice] = useState(props.queryString.priceMax ?? ''); const [maxThc, setMaxThc] = useState(props.queryString.thcMax ?? ''); // const [priceRange, setPriceRange] = useState([props.queryString.priceMin ?? '', props.queryString.priceMax ?? '']) const [thcRange, setThcRange] = useState([ props.queryString.thcMin ?? 0, props.queryString.thcMax ?? 0, ]); const [totalPages, setTotalPages] = useState(); const handleClose = () => setShow(false); const handleShow = () => setShow(true); const handlePageChange = (event) => { setParams({ ...params, offset: event.selected, }); }; const handleChangeSort = (val, e) => { if (val) { setParams((prevState) => ({ ...prevState, [e.name]: val.value })); } else { setParams((prevState) => ({ ...prevState, [e.name]: '' })); } }; const handleFilterChange = (val, e) => { if (val) { setFilters((prevState) => ({ ...prevState, [e.name]: val.value })); } else { setFilters((prevState) => ({ ...prevState, [e.name]: '' })); } }; useEffect(() => { setIsLoading(true); router.push('/marketplace/', { query: { ...params } }, undefined, { shallow: true, }); const getProducts = async () => { const result = await Rest.axiosRequest( API.getProductList + `?limit=10&` + new URLSearchParams(params).toString(), {}, 'GET' ); if (result.status === 200) { setIsLoading(false); const response = result.data; setProducts(response.data.products); setTotalPages(response.data.totalPages); setMaxPrice(response.data.maxValue.price); setMaxThc(response.data.maxValue.thc); // if ( // !isFiltered && // !router.query.priceMin && // !router.query.priceMax && // !router.query.thcMin && // !router.query.thcMax // ) { // setPriceRange([ // 0, response.data.maxValue.price, // ]) // setThcRange([0, response.data.maxValue.thc]) // } if (!isFiltered && !router.query.thcMin && !router.query.thcMax) { setThcRange([0, response.data.maxValue.thc]); } } else { setIsLoading(false); noti.notify(result.data.message, 'danger'); } }; getProducts(); }, [new URLSearchParams(params).toString()]); useEffect(() => { Promise.all([ Rest.axiosRequest(API.getCategories, {}, 'GET'), /* Rest.axiosRequest(API.getMedrec, {}, 'GET'),*/ Rest.axiosRequest( API.getStrains, {}, 'GET' ), ]).then(function (results) { const categoriesData = results[0].data.data; //const medRecData = results[1].data.data; const strainData = results[1].data.data; setCategories(categoriesData); // setMedRec(medRecData) setStrain(strainData); }); }, []); useEffect(() => { if (productStatus === 'idle') { if (props.isLoggedIn) { dispatch(fetchCartProducts()); } } }, [productStatus, dispatch]); const handleRequestOrder = async (slug) => { if (props.isLoggedIn) { const quantity = 1; dispatch( addProductToCart({ productSlug: slug, quantity: parseInt(quantity) }) ) .unwrap() .then(() => { noti.notify('Product added to cart', 'success'); }) .catch((rejectedValueOrSerializedError) => { setIsCartLoading(false); noti.notify(rejectedValueOrSerializedError.message, 'danger'); }); } else { router.push('/sign-in'); } }; const onChangeSearch = (e) => { if (e.target.value) { setFilters((prevState) => ({ ...prevState, filterKeyword: e.target.value, })); } else { setParams((prevState) => ({ ...prevState, keyword: '' })); } }; const onHandleSearch = (e) => { setShow(false); setParams((prevState) => ({ ...prevState, keyword: filters.filterKeyword, })); }; const filterSubmit = () => { setShow(false); setParams((prevState) => ({ ...prevState, category: filters.filterCategory, })); //setParams((prevState) => ({ ...prevState, medRec: filters.filterMedRec })) setParams((prevState) => ({ ...prevState, strain: filters.filterStrain })); // setParams((prevState) => ({ ...prevState, priceMin: priceRange[0] })) // setParams((prevState) => ({ ...prevState, priceMax: priceRange[1] })) setParams((prevState) => ({ ...prevState, thcMax: thcRange[1] })); setParams((prevState) => ({ ...prevState, thcMin: thcRange[0] })); setParams((prevState) => ({ ...prevState, keyword: filters.filterKeyword, })); setIsFiltered(true); }; const resetFilter = () => { setShow(false); setIsFiltered(false); setParams({ offset: 0, sortBy: '', keyword: '', category: '', // medRec: '', // priceMin: '', // priceMax: '', thc: '', strain: '', }); setFilters({ filterKeyword: '', filterCategory: '', filterMedRec: '', filterStrain: '', }); // setPriceRange([0, maxPrice]) setThcRange([0, maxThc]); categoryRef.current.clearValue(); // medRecRef.current.clearValue() strainRef.current.clearValue(); }; const handleCategoryFilter = (catId) => { setFilters((prevState) => ({ ...prevState, filterCategory: catId })); setParams((prevState) => ({ ...prevState, category: catId })); }; const onHandleSearchReset = (e) => { setParams((prevState) => ({ ...prevState, keyword: '' })); setFilters((prevState) => ({ ...prevState, filterKeyword: '' })); }; return ( <> <Meta title={`Marketplace | ${APP_NAME}`} keywords={'Marketplace'} description={'Marketplace'} /> <section className='bg-black p-20-0-50'> <Container> <Row> <Col lg={12} className='mx-auto'> <div className='tabel-with-filetr'> <div className='d-flex justify-content-between flex-wrap bg-color-282828 p-10-20-10-20 table-top-filter'> <Form className='d-flex justify-content-flex-start align-items-center filter-form mb-0'> <Form.Group className='form-inline form-dark form-group-h-33 mr-10'> <Form.Label>Sort By:</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg maxw-150' styles={react_select_xs_Styles} options={sortBy.map(({ value, name }) => ({ value: value, label: name, }))} value={sortBy.filter( (item) => item.value == params.sortBy )} onChange={(val, e) => handleChangeSort(val, e)} placeholder='Sort By' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='sortBy' isClearable={true} /> </Form.Group> </Form> <Button varient='primary' onClick={handleShow} className='btn btn-wh-110-28 br-6 ' > <span className='fs-14 me-2'> <FontAwesomeIcon icon={faFilter} /> </span>{' '} Filter </Button> <Offcanvas show={show} onHide={handleClose} placement={'end'} className='dark-canvas' > <Offcanvas.Header closeButton> <Offcanvas.Title>Filter</Offcanvas.Title> </Offcanvas.Header> <Offcanvas.Body> <Row> <Col md={12}> <div className='d-flex align-items-start'> <Form.Group className='search-form form-dark'> <Form.Control onChange={onChangeSearch} type='text' value={filters.filterKeyword} placeholder='Search by Keywords' /> <Button varient='primary' onClick={onHandleSearch} className='btn-wh-35 br-8 bg-f3772c' > <FontAwesomeIcon icon={faMagnifyingGlass} /> </Button> </Form.Group> {filters.filterKeyword !== '' ? ( <Form.Group className='mb-3 ms-3'> <OverlayTrigger placement='top' overlay={<Tooltip>Clear</Tooltip>} > <Button variant='secondary' className='btn-wh-42 br-8 bg-f3772c' onClick={onHandleSearchReset} > <FontAwesomeIcon icon={faTimes} /> </Button> </OverlayTrigger> </Form.Group> ) : null} </div> </Col> <Col md={12}> <Form.Group className='form-dark mb-4'> <Form.Label>Category</Form.Label> {params.category ? ( <Select ref={categoryRef} classNamePrefix='react-select' className='react-select-lg' styles={react_select_sm_Styles} options={categories.map(({ id, title }) => ({ value: id, label: title, }))} value={categories.map((data) => data.id == filters.filterCategory ? { value: data.id, label: data.title } : null )} onChange={(val, e) => handleFilterChange(val, e) } placeholder='Select category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='filterCategory' isClearable={true} /> ) : ( <Select ref={categoryRef} classNamePrefix='react-select' className='react-select-lg' styles={react_select_sm_Styles} options={categories.map(({ id, title }) => ({ value: id, label: title, }))} onChange={(val, e) => handleFilterChange(val, e) } placeholder='Select category' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='filterCategory' isClearable={true} /> )} </Form.Group> </Col> {/* <Col md={6}> <Form.Group className="form-dark mb-4"> <Form.Label>Med/Rec</Form.Label> {params.medRec ? ( <Select ref={medRecRef} classNamePrefix="react-select" className="react-select-lg" styles={react_select_sm_Styles} options={medRec.map(({ id, title }) => ({ value: id, label: title, }))} value={ medRec.map((data) => ( data.id == filters.filterMedRec ? { 'value': data.id, 'label': data.title } : null )) } onChange={(val, e) => handleFilterChange(val, e)} placeholder="Select Med / Rec" components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name="filterMedRec" isClearable={true} /> ) : ( <Select ref={medRecRef} classNamePrefix="react-select" className="react-select-lg" styles={react_select_sm_Styles} options={medRec.map(({ id, title }) => ({ value: id, label: title, }))} onChange={(val, e) => handleFilterChange(val, e)} placeholder="Select Med/Rec" components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name="filterMedRec" isClearable={true} /> )} </Form.Group> </Col> */} {/* <Col md={6}> <Form.Group className="form-dark mb-4"> <Form.Label>Price</Form.Label> <Form.Label className='float-end'>${priceRange[0] == '' ? 0 : priceRange[0]} - ${priceRange[1]}</Form.Label> <div className="form-control"> <Range values={priceRange} step={1} min={0} max={maxPrice} onChange={(priceRange) => { setPriceRange(priceRange); }} renderTrack={({ props, children }) => ( <div onMouseDown={props.onMouseDown} onTouchStart={props.onTouchStart} style={{ ...props.style, height: '40px', display: 'flex', width: '100%' }} > <div ref={props.ref} style={{ height: '5px', width: '100%', borderRadius: '4px', backgroundColor: '#575757', alignSelf: 'center' }} > {children} </div> </div> )} renderThumb={({ props, isDragged }) => ( <div {...props} style={{ ...props.style, height: '16px', width: '16px', borderRadius: '25px', backgroundColor: '#FFF', display: 'flex', justifyContent: 'center', alignItems: 'center', border: '3px solid #f3772c' }} > </div> )} allowOverlap={true} /> </div> </Form.Group> </Col> */} <Col md={12}> <Form.Group className='form-dark mb-4'> <Form.Label>THC%</Form.Label> <Form.Label className='float-end'> {thcRange[0] == '' ? 0 : thcRange[0]}% -{' '} {thcRange[1]}% </Form.Label> <div className='form-control'> <Range values={thcRange} step={1} min={0} max={maxThc ?? 5} onChange={(thcRange) => { setThcRange(thcRange); }} renderTrack={({ props, children }) => ( <div onMouseDown={props.onMouseDown} onTouchStart={props.onTouchStart} style={{ ...props.style, height: '40px', display: 'flex', width: '100%', }} > <div ref={props.ref} style={{ height: '5px', width: '100%', borderRadius: '4px', backgroundColor: '#575757', alignSelf: 'center', }} > {children} </div> </div> )} renderThumb={({ props, isDragged }) => ( <div {...props} style={{ ...props.style, height: '16px', width: '16px', borderRadius: '25px', backgroundColor: '#FFF', display: 'flex', justifyContent: 'center', alignItems: 'center', border: '3px solid #f3772c', }} ></div> )} /> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Strain</Form.Label> {params.strain ? ( <Select ref={strainRef} classNamePrefix='react-select' className='react-select-lg' styles={react_select_sm_Styles} options={strain.map(({ id, title }) => ({ value: id, label: title, }))} value={strain.map((data) => data.id == filters.filterStrain ? { value: data.id, label: data.title } : null )} onChange={(val, e) => handleFilterChange(val, e) } placeholder='Select strain' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='filterStrain' isClearable={true} /> ) : ( <Select ref={strainRef} classNamePrefix='react-select' className='react-select-lg' styles={react_select_sm_Styles} options={strain.map(({ id, title }) => ({ value: id, label: title, }))} onChange={(val, e) => handleFilterChange(val, e) } placeholder='Select strain' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='filterStrain' isClearable={true} /> )} </Form.Group> </Col> <Col md={12}> <div className='d-flex justify-content-between align-item-center'> <Button onClick={resetFilter} className='btn-wh-120-41 btn-outline-secondary-transparent br-6 bs-none' > Clear </Button> <Button variant='primary' onClick={filterSubmit} className='btn-wh-120-41 br-6 bs-none' > <span className='me-2'> <FontAwesomeIcon icon={faFilter} /> </span> Filter </Button> </div> </Col> </Row> </Offcanvas.Body> </Offcanvas> </div> <div className='table-wrap CustomScrollbar CustomScrollbarY'> {/* <Table bordered hover id="list_table" className="table-head-bg-101010" variant="dark"> */} <ResponsiveTable id='list_table' className='table table-bordered table-hover table-dark table-head-bg-101010' > <Thead> <Tr> <Th width='250px;'>Product</Th> <Th width='250px;'>Brand</Th> {props.isLoggedIn && ( <> <Th className='text-center' width='70px;'> Price/Package </Th> </> )} <Th className='text-center' width='120px;'> Unit Weight </Th> <Th className='text-center' width='90px;'> Unit/Package </Th> <Th className='text-center' width='90px;'> THC% </Th> <Th className='text-center' width='500px;'> Action </Th> </Tr> </Thead> <Tbody> {isLoading ? ( [...Array(10)].map((value, key) => ( <Tr key={'tr-' + key}> {[...Array(12)].map((v, k) => { return ( <Td key={'td-' + k}> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Td> ); })} </Tr> )) ) : products.length > 0 ? ( products.map((productRow, index) => ( <Tr key={index + 'product'}> <Td> <Link href={'/product/' + productRow.slug}> <a className='color-f3772c'> {Helper.niceString( productRow.title, 20, true )} </a> </Link> <br /> {Helper.niceString( productRow.category?.title, 14, true )} {productRow.subcategory?.title && ( <> <br /> {Helper.niceString( productRow.subcategory?.title, 16, true )} </> )} </Td> <Td> <Link href={`/brand/${productRow?.brand?.slug}`}> <a className='color-22a612'> {Helper.niceString( productRow?.brand?.brandName, 20, true )} </a> </Link> </Td> {props.isLoggedIn && ( <> <Td className='text-center'> {!commaSeparatedStringWithIncludes( productRow?.user?.brand?.blockedRetailers, getSingle('userId') ) ? ( <> {productRow.productPrice} {productRow.isShowStock && ( <> <br /> {productRow.packagesInStock} Left </> )} </> ) : ( '-' )} </Td> </> )} <Td className='text-center'> {productRow?.unitWeight} </Td> <Td className='text-center'> {productRow?.unitPerPackage} </Td> <Td className='text-center'>{productRow?.thc}%</Td> <Td className='text-center'> <Link href={'/product/' + productRow.slug}> <a className='action-btn color-white text-decoration-none'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={<Tooltip>View Product</Tooltip>} > <FontAwesomeIcon icon={faEye} /> </OverlayTrigger> </a> </Link> {getSingle('role') !== '2' ? ( <> {props.isLoggedIn ? ( <FavouriteBtn isFavourite={ productRow.productFavourites.length } productSlug={productRow.slug} /> ) : ( <Link href={'/sign-in'}> <a> <FavouriteBtn isFavourite={false} productSlug={productRow.slug} /> </a> </Link> )} {props.isLoggedIn ? ( <Link href={`/messages/${productRow?.brand?.slug}`} > <a className='action-btn color-f3772c'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={<Tooltip>Message</Tooltip>} > <FontAwesomeIcon icon={faCommentDots} /> </OverlayTrigger> </a> </Link> ) : ( <Link href={`/sign-in`}> <a className='action-btn color-f3772c'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={<Tooltip>Message</Tooltip>} > <FontAwesomeIcon icon={faCommentDots} /> </OverlayTrigger> </a> </Link> )} </> ) : null} <Link href={`/brand/${productRow?.brand?.slug}`}> <a className='action-btn color-white text-decoration-none'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={<Tooltip>View Brand</Tooltip>} > <i className='icon-user-view'></i> </OverlayTrigger> </a> </Link> {!commaSeparatedStringWithIncludes( productRow?.user?.brand?.blockedRetailers, getSingle('userId') ) ? ( getSingle('role') !== '2' && ( <> <Button varient='primary' onClick={() => { handleRequestOrder(productRow?.slug); }} className='btn btn-wh-110-28 br-6 ' > <span className='fs-14 me-2'> <i className='far fa-shopping-cart'></i> </span>{' '} {isCartLoading ? ( <Spinner animation='border' /> ) : ( 'Add to cart' )} </Button> </> ) ) : ( <> <Button varient='primary' disabled={true} className='btn btn-wh-110-28 br-6 ' > <span className='fs-14 me-2'> <i className='far fa-shopping-cart'></i> </span>{' '} Add to cart </Button> </> )} </Td> </Tr> )) ) : ( <Tr> <Td className='text-center' colSpan={11}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> </div> <div className='mt-5 d-flex justify-content-center'> {totalPages > 1 ? ( <ReactPaginate previousLabel={ <i className='fas fa-long-arrow-alt-left'></i> } nextLabel={<i className='fas fa-long-arrow-alt-right'></i>} pageClassName='page-item' pageLinkClassName='page-link' previousClassName='page-item prev-item' previousLinkClassName='page-link' nextClassName='page-item next-item' nextLinkClassName='page-link' breakLabel='...' breakClassName='page-item' breakLinkClassName='page-link' pageCount={totalPages} //marginPagesDisplayed={1} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName='pagination' activeClassName='active' forcePage={parseInt(router.query.offset ?? 0)} /> ) : null} </div> </Col> </Row> </Container> </section> </> ); } export default ProductList; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); // if (!isLoggedIn) { // return { // redirect: { destination: "/" }, // }; // } return { props: { queryString: context.query, isLoggedIn, }, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/followers/[slug].js
import React, { useEffect, useState } from 'react'; import { Container, Row, Col, Tabs, Tab, Button, Figure, ListGroup, Card, } from 'react-bootstrap'; import ReactPaginate from 'react-paginate'; import { useRouter } from 'next/router'; import { contextCookie, getSingle } from '../../services/Auth'; import Rest from '../../config/rest.config'; import API from '../../config/endpoints.config'; import FollowerListItem from '../../components/FollowerListItem'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faArrowLeft } from '@fortawesome/free-solid-svg-icons'; const baseColor = '#202020'; const highlightColor = '#444'; function Followers() { const router = useRouter(); const { slug } = router.query; const [showSkeleton, setShowSkeleton] = useState(true); const [followers, setFollowers] = useState([]); const [totalPages, setTotalPages] = useState(1); const [limit, setLimit] = useState(10); const handleSelect = (eventKey) => { switch (eventKey) { case 'followers': return router.push({ pathname: '/followers/[slug]', query: { slug: slug }, }); break; case 'following': return router.push({ pathname: '/following/[slug]', query: { slug: slug }, }); break; default: return router.reload(); } }; const handlePageChange = (event) => { router.push('?offset=' + event.selected, undefined, { shallow: true }); }; useEffect(() => { const getFollowers = async () => { setShowSkeleton(true); let response = await Rest.axiosRequest( `${API.followers}/${slug}` + `?` + new URLSearchParams({ limit: limit, offset: '0', ...router.query, }).toString(), {}, 'GET', false, getSingle('token') ); response = response.data; if (response.status) { setFollowers(response.data.followers); setTotalPages(response.data.totalPages); } setShowSkeleton(false); }; getFollowers(); }, [limit, router.query]); return ( <> <section className='bg-black p-27-0-55'> <Container> <Row> <Col lg={10} className='mx-auto'> <Card className='card-dark card-post card-axis-point border-gray-1'> <Card.Header> <div className='d-flex align-items-center'> <a className='d-flex align-items-center' onClick={() => router.back()} > <span className='text-white fs-20 me-3'> <FontAwesomeIcon icon={faArrowLeft} /> </span> </a> <h3 className='text-white fs-18 mb-0'> {getSingle('fullName')} </h3> </div> </Card.Header> <Card.Body> <div className='custom-tabs theme-dark'> <Tabs defaultActiveKey='followers' onSelect={handleSelect}> <Tab eventKey='followers' title='Followers'> <ListGroup variant='flush' className='list-black'> {showSkeleton ? ( [...Array(10)].map((arrayData, index) => { return ( <div key={index + 'skeleton'} className='d-flex justify-content-between align-items-center px-5 list-group-item' > <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <div className='d-flex align-items-center'> <Skeleton circle={true} height={40} width={40} className='mb-0 me-3' /> <Skeleton width={200} height={20} /> </div> <Skeleton width={100} height={30} className='me-2' /> </SkeletonTheme> </div> ); }) ) : followers.length > 0 ? ( followers.map((follower, index) => ( <ListGroup.Item key={index}> <FollowerListItem key={index} follower={follower} /> </ListGroup.Item> )) ) : ( <div className='d-flex justify-content-center align-items-center fs-16 fw-500 p-2'> No records found! </div> )} </ListGroup> </Tab> <Tab eventKey='following' title='Following'></Tab> </Tabs> <div className='mt-5 d-flex justify-content-center'> {totalPages > 1 && ( <ReactPaginate previousLabel={ <i className='fas fa-long-arrow-alt-left'></i> } nextLabel={ <i className='fas fa-long-arrow-alt-right'></i> } pageClassName='page-item' pageLinkClassName='page-link' previousClassName='page-item prev-item' previousLinkClassName='page-link' nextClassName='page-item next-item' nextLinkClassName='page-link' breakLabel='...' breakClassName='page-item' breakLinkClassName='page-link' pageCount={totalPages} //marginPagesDisplayed={1} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName='pagination' activeClassName='active' forcePage={parseInt(router.query.offset ?? 0)} /> )} </div> </div> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default Followers; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/post/[slug].js
import { faArrowLeft } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import Head from 'next/head'; import Link from 'next/link'; import { useRouter } from 'next/router'; import React, { useEffect, useState } from 'react'; import { Button, Card, Col, Container, Figure, Form, OverlayTrigger, Popover, Row, Spinner, Tooltip, } from 'react-bootstrap'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { Mention, MentionsInput } from 'react-mentions'; import ReactPlayer from 'react-player'; import { useDispatch, useSelector } from 'react-redux'; import { FacebookShareButton, LinkedinShareButton, TwitterShareButton, } from 'react-share'; import { handleDeletePost } from '../../app/slices/activitiesSlice'; import { createComment, fetchCommentReply, getSinglePost, resetComment, showModal, } from '../../app/slices/commentSlice'; import CommentList from '../../components/CommentList'; import CommentModal from '../../components/CommentModal'; import { CustomLadda } from '../../components/CustomLadda'; import LightboxModal from '../../components/LightboxModal'; import LikeModal from '../../components/LikeModal'; import Meta from '../../components/Meta'; import Notifier from '../../components/Notifier'; import RepostModal from '../../components/RepostModal'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { APP_NAME, APP_URL, ASSETS_URL } from '../../config/server.config'; import { contextCookie, getSingle, isLoggedIn } from '../../services/Auth'; import { dateTimeFormat } from '../../services/Helper'; import { roles } from '../../services/Role'; import mentionsInputStyle from '../../services/mentionsInputStyle'; const baseColor = '#202020'; const highlightColor = '#444'; export default function PostDetails({ slug, userImage }) { const notifier = new Notifier(); const dispatch = useDispatch(); const router = useRouter(); const { singlePost, comments, createCommentStatus, replyStatus, singlePostId, } = useSelector((state) => state.comment); const deletePostStatus = useSelector( (state) => state?.activities?.deletePost?.status ); const [openReplyBox, setOpenReplyBox] = useState(false); const [commentReplyText, setCommentReplyText] = useState(''); const [isLoading, setIsLoading] = useState(false); const [showSkeleton, setShowSkeleton] = useState(false); const [show, setShow] = useState(false); const [activeIndex, setActiveIndex] = useState(0); const [individualPostAttachments, setIndividualPostAttachments] = useState( [] ); const [replyAttachment, setReplyAttachment] = useState(''); const [users, setUsers] = useState([]); const [replyText, setReplyText] = useState(''); const [mentions, setMentions] = useState([]); const [searchValue, setSearchValue] = useState(''); const [attachments, setAttachments] = useState([]); const [isMediaEnable, setIsMediaEnable] = useState(false); const [selectedMediaFile, setSelectedMediaFile] = useState([]); const [selectedPostId, setSelectedPostId] = useState(0); const { isCommentModal } = useSelector((state) => state.comment); const [isLiked, setIsLiked] = useState(false); const [likeCount, setLikeCount] = useState(0); const [isReposted, setIsReposted] = useState(false); const [repostCount, setRepostCount] = useState(0); const [isEnable, setIsEnable] = useState(true); const handleCloseCommentModal = () => dispatch(showModal({ modalStatus: false, modalType: 'comment' })); const handleShowCommentModal = async (postId, type) => { await setSelectedPostId(postId); await dispatch(showModal({ modalStatus: true, modalType: type })); }; const filteredUserDatabase = users?.filter((user) => { return user?.display?.toLowerCase()?.includes(searchValue?.toLowerCase()); }); const replyTextChangeHandler = ( event, newValue, newPlainTextValue, mentions ) => { const { value } = event.target; setReplyText(newValue); setMentions(mentions); setSearchValue( newPlainTextValue?.substring(newPlainTextValue.lastIndexOf('@') + 1) ); if (value !== '' || Object.keys(selectedMediaFile).length > 0) { setIsEnable(false); } else { setIsEnable(true); } }; const replyContentHandlerSelect = (id, display) => { const mentionText = `@${display}`; setReplyText(mentionText); setMentions([...mentions, { id, display }]); }; const formatBytes = (bytes, decimals = 2) => { if (!+bytes) return '0 Bytes'; const k = 1024; const dm = decimals < 0 ? 0 : decimals; const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return { valueWithSize: `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${ sizes[i] }`, value: parseFloat((bytes / Math.pow(k, i)).toFixed(dm)), size: sizes[i], }; }; const attachmentsHandler = (event) => { let filesCount = selectedMediaFile.length + event.target.files.length; if (filesCount > 10) { notifier.notify('Please choose up to 10 media.', 'danger'); return false; } else { if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } if (event.target.files.length > 0) { setIsEnable(false); } else { setIsEnable(true); } const selectedFiles = event.target.files; const selectedFilesArray = Array.from(selectedFiles); const imagesArray = selectedFilesArray.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); // videos and images validation let previousAndSelectedMediaFile = selectedMediaFile.concat(imagesArray); let fileTypeCount = {}; let videoSize = {}; let imageSize = {}; previousAndSelectedMediaFile.map(function (item) { fileTypeCount[item.type] = (fileTypeCount[item.type] || 0) + 1; if (item.type === 'video') { videoSize[item.type] = item.size; } if (item.type === 'image') { imageSize[item.type] = item.size; } }); if (fileTypeCount.video > 1) { notifier.notify('You can upload only one video.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'GB' || videoSize?.video?.size === 'TB' || videoSize?.video?.size === 'PB' || videoSize?.video?.size === 'EB' || videoSize?.video?.size === 'ZB' || videoSize?.video?.size === 'YB' ) { notifier.notify('Max video file limit is 256 MB.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'MB' && videoSize?.video?.value > 256.05 ) { notifier.notify('Max video file limit is 256 MB.', 'danger'); return false; } } } if ( imageSize?.image?.size === 'GB' || imageSize?.image?.size === 'TB' || imageSize?.image?.size === 'PB' || imageSize?.image?.size === 'EB' || imageSize?.image?.size === 'ZB' || imageSize?.image?.size === 'YB' ) { notifier.notify('Max image file limit is 5 MB.', 'danger'); return false; } else { if (imageSize?.image?.size === 'MB' && imageSize?.image?.value > 5.05) { notifier.notify('Max image file limit is 5 MB.', 'danger'); return false; } } setSelectedMediaFile((previousMediaFile) => previousMediaFile.concat(imagesArray) ); //setAttachments((previousattachments) => previousattachments.concat(event.target.files)); let f = event.target.files; let sf = attachments; // setAttachments((prevState)=>{ // return {...prevState, ...f}; // }) //setAttachments((prevState)=> ({prevState, ...f})) // setAttachments({ attachments, ...f }); for (let i = 0; i < event.target.files.length; i++) { setAttachments((prevfiles) => [...prevfiles, event.target.files[i]]); // let f = event.target.files[i]; // setAttachments((prevfiles)=>({...prevfiles, ...f})) } } }; const deleteHandler = (selectedIndex, selectedFile, selectedId) => { setSelectedMediaFile( selectedMediaFile.filter((e, index) => index !== selectedIndex) ); const copiedAttachment = [...attachments]; delete copiedAttachment[selectedId]; const newFiles = []; for (let i = 0; i < copiedAttachment.length; i++) { if (copiedAttachment[i]) { newFiles.push(copiedAttachment[i]); } } setAttachments(newFiles); const imagesArray = newFiles.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); setSelectedMediaFile(imagesArray); if (Object.keys(copiedAttachment).length === 0 && replyText === '') { setIsEnable(true); } else { setIsEnable(false); } URL.revokeObjectURL(selectedFile); let filesCount = selectedMediaFile.length - 1; if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } }; const handleSubmit = () => { if (replyText != '' || Object.keys(attachments).length > 0) { setIsEnable(false); setIsMediaEnable(false); setIsLoading(true); let formData = new FormData(); // Remove round brackets formData.append('comment', replyText.replace(/\(([^)]+)\)/g, '$1')); formData.append('mentions', JSON.stringify(mentions)); formData.append( 'postId', parseInt( singlePost[0].parentPost === null ? singlePost[0].id : singlePost[0].parentPost.id ) ); for (let key in attachments) { formData.append('attachment', attachments[key]); } dispatch(createComment(formData)) .unwrap() .then((result) => { if (result.status) { notifier.notify(result.message, 'success'); } setIsLoading(false); }) .catch((rejectedValueOrSerializedError) => { setIsLoading(false); notifier.notify(rejectedValueOrSerializedError.message, 'danger'); }); } else { setIsEnable(true); } }; const handleClose = () => setShow(false); const handleShow = (value, index, id, type) => { setActiveIndex(index); setShow(true); if (type === 'post') { setIndividualPostAttachments(singlePost[0].attachments); } else { let singleComment = comments.find((comment) => comment.postId === id); setIndividualPostAttachments(singleComment.attachments); } }; useEffect(async () => { let formData = { keyword: '', page: 0, limit: 10, }; const response = await Rest.axiosRequest( API.axisPointUsers, formData, 'POST' ); setUsers(response?.data?.data?.rows); }, []); useEffect(() => { // setShowSkeleton(true) dispatch(getSinglePost(slug)) .unwrap() .then((result) => { if (result.status) { dispatch( fetchCommentReply({ postId: parseInt( result.data[0].parentPost === null ? result.data[0].id : result.data[0].parentPost.id ), }) ); resetForm(); } // setShowSkeleton(false) }) .catch((rejectedValueOrSerializedError) => { // setShowSkeleton(false) notifier.notify(rejectedValueOrSerializedError.message, 'danger'); router.push(`/social`); }); }, [dispatch, createCommentStatus, replyStatus]); useEffect(() => { return () => dispatch(resetComment()); //for unmount }, [dispatch]); function resetForm() { setReplyText(''); setAttachments([]); handleCloseCommentModal(); setSelectedMediaFile([]); setIsEnable(true); } useEffect(() => { if (singlePost.length != 0) { let [post] = singlePost; if (post.type == 2) { post = post.parentPost; } setIsLiked(post?.isLiked); setLikeCount(post?.likeCount); setIsReposted(post?.isReposted); setRepostCount(post?.repostCount); } }, [singlePost]); const handleLikeClick = async (pId) => { let response = await Rest.axiosRequest( API.posts + `/handlePostLike`, { pId: pId }, 'POST', false, getSingle('token') ); let result = response.data; if (result.status === true) { const { hasUserLikedPost, totalLikesOnPost } = result.data; setIsLiked(hasUserLikedPost); setLikeCount(totalLikesOnPost); } }; const handleRepostClick = async ({ postId, post }) => { let formData = { type: 2, repostId: postId, post: post, }; const response = await Rest.axiosRequest(API.repost, formData, 'POST'); let result = response.data; if (result.status === true) { const { hasUserReposted, totalRepostOnPost } = result.data; setIsReposted(hasUserReposted); setRepostCount(totalRepostOnPost); } }; //RepostModal const [reposts, setReposts] = useState([]); const [repostsPage, setRepostsPage] = useState(0); const [repostsCount, setRepostsCount] = useState(0); const [currentRepostPost, setCurrentRepostPost] = useState(null); useEffect(() => { const getRepostsBy = async () => { let repostRes = await Rest.axiosRequest( API.posts + '/' + currentRepostPost + `/reposts?limit=10&page=${repostsPage}`, {}, 'GET' ); repostRes = repostRes.data; if (repostRes.status) { const { count, rows } = repostRes.data; setRepostsCount(count); if (rows.length > 0) { setReposts([...reposts, ...rows]); } } }; if (currentRepostPost != null) { getRepostsBy(); } }, [currentRepostPost, repostsPage]); const fetchMoreReposts = () => { setRepostsPage(repostsPage + 1); }; const resetRepostModal = () => { setCurrentRepostPost(null); setReposts([]); setRepostsPage(0); setRepostsCount(0); }; const [showRepostModal, setShowRepostModal] = useState(false); const repostsModalClose = () => { setShowRepostModal(false); resetRepostModal(); }; const repostsModalShow = () => setShowRepostModal(true); const repostsClickhandler = (e, postUniqueId) => { setCurrentRepostPost(postUniqueId); repostsModalShow(); }; //LikeModal const [likes, setLikes] = useState([]); const [likesPage, setLikesPage] = useState(0); const [likesCount, setLikesCount] = useState(0); const [currenLikePost, setCurrentLikePost] = useState(null); const fetchMoreLikes = () => { setLikesPage(likesPage + 1); }; useEffect(() => { const getLikesBy = async () => { let likeRes = await Rest.axiosRequest( API.posts + '/' + currenLikePost + `/likes?limit=10&page=${likesPage}`, {}, 'GET' ); likeRes = likeRes.data; if (likeRes.status) { const { count, rows } = likeRes.data; setLikesCount(count); if (rows.length > 0) { setLikes([...likes, ...rows]); } } }; if (currenLikePost != null) { getLikesBy(); } }, [currenLikePost, likesPage]); const resetLikesModal = () => { setCurrentLikePost(null); setLikes([]); setLikesPage(0); setLikesCount(0); }; const [showLikeModal, setShowLikeModal] = useState(false); const likesModalClose = () => { setShowLikeModal(false); resetLikesModal(); }; const likesModalShow = () => setShowLikeModal(true); const likesClickHandler = (e, postUniqueId) => { setCurrentLikePost(postUniqueId); likesModalShow(); }; useEffect(() => { if (deletePostStatus === 'succeeded') { router.back(); } }, [dispatch, deletePostStatus]); return ( <section className='bg-black p-30-0-60'> <Meta title={APP_NAME} keyword={'post'} description={'post'} /> <Head> {/* <meta name="og:url" property="og:url" content={`${shareUrl}`} /> <meta name="og:type" property="og:type" content="article" /> <meta name="og:title" property="og:title" content={`${metaTitle}`} /> <meta name="og:description" property="og:description" content={`${metaDesc}`} /> <meta name="og:image" property="og:image" content={`${newsData.image}`} /> <meta name="og:site_name" property="og:site_name" content={`${APP_NAME}`} /> <meta name="twitter:card" property="twitter:card" content="summary_large_image" /> <meta name="twitter:site" property="twitter:site" content="@Nandini42491586" /> <meta name="twitter:creator" property="twitter:creator" content="@Nandini42491586" /> <meta name="twitter:title" property="twitter:title" content={`${metaTitle}`} /> <meta name="twitter:description" property="twitter:description" content={`${metaDesc}`} /> <meta name="twitter:image" property="twitter:image" content={`${newsData.image}`} /> */} </Head> <Container> <Row> <Col lg={11} className='mx-auto'> <Card className='card-dark card-post'> <Card.Header onClick={() => router.back()}> <div className='d-flex align-items-center'> <a href='#' className='text-white fs-20 me-3'> <FontAwesomeIcon icon={faArrowLeft} /> </a> <h3 className='text-white fs-18 mb-0'>Post</h3> </div> </Card.Header> <Card.Body> {showSkeleton ? [...Array(1)].map((arrayData, aIndex) => { return ( <div key={aIndex}> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Row> <Col lg='auto'> <Skeleton circle={true} height={40} width={40} className='mb-0 me-3' /> </Col> <Col lg> <Skeleton width={200} height={20} /> <Skeleton width={'100%'} count={3} /> </Col> </Row> </SkeletonTheme> </div> ); }) : singlePost?.length > 0 && singlePost.map((activity, index) => { let mainPost = activity.type == '2' ? activity.parentPost : activity; // Profile data const userRoleWiseId = getSingle('role') === '2' ? getSingle('currentBrandId') : getSingle('retailerCompanyId'); const role = mainPost?.role; const userName = role === '2' ? mainPost?.brand?.brandName : mainPost?.retailer?.companyName; const profilePath = role === '2' ? `${ASSETS_URL}${mainPost?.brand?.profilePath}` : `${ASSETS_URL}${mainPost?.retailer?.profilePath}`; const slug = role === '2' ? `/brand/${mainPost?.brand?.slug}` : `/customer/${mainPost?.retailer?.slug}`; return ( <Row key={index}> {activity.type == '2' && ( <div> <h3 className='text-white fs-18'> {' '} <i className='icon icon-reposts'></i>{' '} {getSingle('userId') == activity.user.id ? 'You' : activity.user.businessName}{' '} Reposted </h3> </div> )} <Col sm='auto'> <Figure className='figure figure-circle figure-gray-2 figure-62'> <img className='cover' src={ profilePath ?? '/profile/no-profile-image.jpg' } alt='profile' /> </Figure> </Col> <Col> <div className='d-flex flex-wrap justify-content-between'> <Link href={slug}> <a> <h3 className='text-white fs-18'> {userName}{' '} <span className='color-a5a5a5 fs-14 fw-normal ms-2'> {dateTimeFormat( mainPost.createdAt, 'DD MMM YYYY' )} </span> </h3> </a> </Link> {parseInt(userRoleWiseId) === activity?.userId && activity?.type == 1 && ( <> <CustomLadda className='action-btn color-f32c2c' onClick={() => dispatch(handleDeletePost(mainPost.id)) } > <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={<Tooltip>Delete Post</Tooltip>} > <i className='fas fa-trash-alt'></i> </OverlayTrigger> </CustomLadda> </> )} </div> <p className='color-bfbfbf'>{mainPost.post}</p> <Row> {mainPost.attachments?.length > 0 && mainPost.attachments.map( (attachmentFile, aIndex) => ( <Col lg={3} md={4} sm={6} key={'attachment' + aIndex} > {aIndex <= 3 ? ( attachmentFile.attachmentType == 2 ? ( <div className='gallery-image cursor-pointer' onClick={() => handleShow( true, aIndex, activity.id, 'post' ) } > <ReactPlayer className='react-player' width='100%' height='100%' url={ ASSETS_URL + attachmentFile.attachment } playing={false} controls={true} //volume={5} muted={true} /> {aIndex == 3 ? ( <span className='more-images'> {mainPost.attachments.length - 4 == 0 ? null : `+${ mainPost.attachments .length - 4 }`} </span> ) : null} </div> ) : ( <div className='gallery-image cursor-pointer' onClick={() => handleShow( true, aIndex, activity.id, 'post' ) } > <img className='cover' src={ ASSETS_URL + attachmentFile.attachment } alt='postedImage' /> {aIndex == 3 ? ( <span className='more-images'> {mainPost.attachments.length - 4 == 0 ? null : `+${ mainPost.attachments .length - 4 }`} </span> ) : null} </div> ) ) : null} </Col> ) )} </Row> <div className='d-sm-flex justify-content-between align-items-center'> <ul className='comment-icons nav mb-3'> <li> <OverlayTrigger placement='top' overlay={ <Tooltip> {' '} {!isLiked ? 'Like' : 'UnLike'} </Tooltip> } > {isLoggedIn() ? ( <a onClick={(e) => handleLikeClick(mainPost.id) } > {!isLiked ? ( <span> <i className='far fa-triangle'></i> </span> ) : ( <span className='color-22a612'> <i className='fas fa-triangle'></i> </span> )} </a> ) : ( <Link href={`/sign-in`}> <a> <span> <i className='far fa-triangle'></i> </span> </a> </Link> )} </OverlayTrigger> </li> <li> <OverlayTrigger placement='top' overlay={<Tooltip>Comment</Tooltip>} > {isLoggedIn() ? ( <a onClick={() => handleShowCommentModal( mainPost.id, 'comment' ) } > <i className='icon icon-chat-bubble'></i> </a> ) : ( <Link href={`/sign-in`}> <a> <i className='icon icon-chat-bubble'></i> </a> </Link> )} </OverlayTrigger> </li> <li> <OverlayTrigger placement='top' overlay={ <Tooltip> {!isReposted ? 'Repost' : 'Undo Repost'} </Tooltip> } > {isLoggedIn() ? ( <a onClick={() => handleRepostClick({ postId: mainPost.id, post: mainPost.post, }) } > {!isReposted ? ( <span> <i className='icon icon-reposts'></i> </span> ) : ( <span className='color-22a612'> <i className='icon icon-reposts'></i> </span> )} </a> ) : ( <Link href={`/sign-in`}> <a> <span> <i className='icon icon-reposts'></i> </span> </a> </Link> )} </OverlayTrigger> </li> <li> <OverlayTrigger placement='top' overlay={<Tooltip>Share</Tooltip>} > <OverlayTrigger trigger='click' placement='top' overlay={ <Popover id='popover-basic'> <Popover.Body> <ul className='comment-icons nav'> <li> <a> <FacebookShareButton url={ APP_URL + 'post/' + mainPost.postUniqueId } > <i className='fab fa-facebook-f'></i> </FacebookShareButton> </a> </li> <li> <a> <TwitterShareButton url={ APP_URL + 'post/' + mainPost.postUniqueId } > <i className='fab fa-twitter'></i> </TwitterShareButton> </a> </li> <li> <a> <LinkedinShareButton url={ APP_URL + 'post/' + mainPost.postUniqueId } > <i className='fab fa-linkedin-in'></i> </LinkedinShareButton> </a> </li> </ul> </Popover.Body> </Popover> } > <span> <i className='icon icon-share-file'></i> </span> </OverlayTrigger> </OverlayTrigger> </li> </ul> <ul className='likes-comments nav'> <li> <span className='text-white'> {likeCount} </span>{' '} {likeCount > 0 ? ( isLoggedIn() ? ( <a className='color-a5a5a5' onClick={(e) => { likesClickHandler( e, mainPost.postUniqueId ); }} > Likes </a> ) : ( <Link href={`/sign-in`}> <a className='color-a5a5a5'>Likes</a> </Link> ) ) : ( 'Likes' )} </li> <li> <span className='text-white'> {mainPost.commentCount} </span>{' '} Comments </li> <li> <span className='text-white'> {repostCount} </span>{' '} {repostCount > 0 ? ( isLoggedIn() ? ( <a className='color-a5a5a5' onClick={(e) => { repostsClickhandler( e, mainPost.postUniqueId ); }} > Reposts </a> ) : ( <Link href={`/sign-in`}> <a className='color-a5a5a5'>Reposts</a> </Link> ) ) : ( 'Reposts' )} </li> </ul> </div> <hr></hr> <Row> <Col sm='auto'> <Figure className='figure figure-circle figure-gray-2 figure-62'> <img className='cover' src={ASSETS_URL + userImage} alt='profile' /> </Figure> </Col> <Col> <Form.Group className='form-dark'> <MentionsInput className='mention-textarea' placeholder='Enter Your Reply' value={replyText} onChange={replyTextChangeHandler} style={mentionsInputStyle} > <Mention trigger='@' data={filteredUserDatabase} renderSuggestion={( suggestion, search, highlightedDisplay ) => ( <div className='d-flex justify-content-between align-items-center'> <div className='d-flex align-items-center'> <Figure className='figure figure-circle figure-40 mb-0 me-3'> <img className='cover mention-image' src={ ASSETS_URL + suggestion?.profilePath } alt={suggestion?.businessName} /> </Figure> <div> <h4 className='fs-16 fw-500 my-2'> {suggestion?.businessName} </h4> <span>@{highlightedDisplay}</span> </div> </div> </div> )} markup='@(__display__)' displayTransform={(id, display) => `@${display}` } onSelect={replyContentHandlerSelect} /> </MentionsInput> </Form.Group> {/* <Form.Group className="form-dark"> <Form.Control as="textarea" name='replyText' value={replyText} onChange={replyTextChangeHandler} placeholder="Enter Your Reply" /> </Form.Group> */} <Form.Group className='form-dark'> <div className='d-flex align-items-start flex-wrap'> <div className='multimediaFiles'> <label htmlFor='multimediaFilesPost' className={`btn btn-outline-gray btn-rounded btn-h-30 me-3 mt-3${ isLoading || isMediaEnable ? ' disabled' : '' }`} > <span className='color-20da97 me-2'> <i className='icon icon-image v-align-middle'></i> </span> Media </label> <input type='file' multiple accept='audio/*,video/*,image/*' onChange={attachmentsHandler} id='multimediaFilesPost' className='mediaFiles' /> {/* <a href="#" className="btn btn-outline-gray btn-rounded btn-h-30 mt-3"> <span className="color-f8bf52 me-2"><i className="icon icon-video v-align-middle"></i></span> Videos </a> */} </div> </div> </Form.Group> </Col> <Col sm='auto'> <button type='submit' onClick={ !isLoading ? () => handleSubmit() : null } disabled={isLoading || isEnable} className='btn btn-outline-gray btn-wh-150-48 btn-rounded mt-3' > {isLoading ? ( <Spinner animation='border' /> ) : ( 'Reply' )} </button> </Col> <Row> <Col sm='auto'> <div style={{ width: '58px' }}></div> </Col> <Col className=' mt-3'> <div className={ selectedMediaFile.length > 0 ? `grid-wrapper` : `` } > {selectedMediaFile && selectedMediaFile.map( (selectedFile, index) => { return ( <div key={selectedFile + index} className={ `gallery-image position-relative` + (selectedFile.type === 'video' ? ` gallery-video` : ``) } > <Button variant='' className='btn-remove' onClick={() => deleteHandler( index, selectedFile.previewFile, selectedFile.id ) } > <i className='fal fa-times'></i> </Button> {selectedFile.type === 'video' ? ( <video controls> <source src={ selectedFile.previewFile } type='video/mp4' /> Sorry, your browser doesn't support embedded videos. </video> ) : ( <img className='cover' src={selectedFile.previewFile} alt='upload' /> )} </div> ); } )} </div> </Col> </Row> {/* <Row className="images"> {selectedMediaFile && selectedMediaFile.map((selectedFile, index) => { return ( <Col key={selectedFile + index} className="image"> <div className="gallery-image position-relative"> <Button variant="" className="btn-remove" onClick={() => deleteHandler(index, selectedFile.previewFile, selectedFile.id)}> <i className="fal fa-times"></i> </Button> { selectedFile.type === 'video' ? <video className="gallery-image" controls> <source src={selectedFile.previewFile} type="video/mp4" /> Sorry, your browser doesn't support embedded videos. </video> : <img className="gallery-image" src={selectedFile.previewFile} alt="upload" /> } </div> </Col> ); })} </Row> */} </Row> {comments?.length > 0 && comments.map((commentData, cIndex) => activity.id === commentData.postId || mainPost.id === commentData.postId ? ( <CommentList key={cIndex} commentData={commentData} activity={activity} handleShow={handleShow} handleShowCommentModal={ handleShowCommentModal } /> ) : null )} </Col> </Row> ); })} </Card.Body> </Card> </Col> </Row> <LightboxModal sliderIndex={activeIndex} images={individualPostAttachments} show={show} handleClose={handleClose} /> <CommentModal showCommentModal={isCommentModal} handleCloseCommentModal={handleCloseCommentModal} postId={selectedPostId} userImage={userImage} users={users} /> <RepostModal show={showRepostModal} hide={repostsModalClose} reposts={reposts} repostsCount={repostsCount} fetchMoreReposts={fetchMoreReposts} /> <LikeModal show={showLikeModal} hide={likesModalClose} likes={likes} likesCount={likesCount} fetchMoreLikes={fetchMoreLikes} /> </Container> </section> ); } export async function getServerSideProps(context) { const { slug } = context.params; const userImage = contextCookie(context, 'userImage'); return { props: { slug, userImage, }, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages/post
/content/gmx-projects/gmx-admin/frontend/pages/post/comment/[slug].js
import React, { useEffect, useRef, useState } from 'react'; import { Button, Card, Col, Container, Figure, Form, OverlayTrigger, Row, Spinner, Tooltip, } from 'react-bootstrap'; import { useDispatch, useSelector } from 'react-redux'; import { createCommentReply, fetchReply, showModal, } from '../../../app/slices/commentSlice'; import { ASSETS_URL } from '../../../config/server.config'; import { contextCookie } from '../../../services/Auth'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faArrow, faArrowLeft } from '@fortawesome/free-solid-svg-icons'; import ReactPlayer from 'react-player'; import { customFormat, dateTimeFormat } from '../../../services/Helper'; import LightboxModal from '../../../components/LightboxModal'; import Link from 'next/link'; import { useRouter } from 'next/router'; import Notifier from '../../../components/Notifier'; import FormValidator from '../../../components/FormValidator'; import CommentModal from '../../../components/CommentModal'; import { roles } from '../../../services/Role'; export default function CommentDetails({ slug, userImage }) { // const validator = new FormValidator([ // { // field: "username", // method: "isEmpty", // validWhen: false, // message: "Please enter email address.", // }, // { // field: "password", // method: "isEmpty", // validWhen: false, // message: "Please enter password.", // } // ]); const dispatch = useDispatch(); const router = useRouter(); const notifier = new Notifier(); const { replies, replyStatus } = useSelector((state) => state.comment); const [show, setShow] = useState(false); const [activeIndex, setActiveIndex] = useState(0); const [individualPostAttachments, setIndividualPostAttachments] = useState( [] ); // const [replyData, setReplyData] = useState({ // commentReplyText: "", // replyAttachment: [], // }); const [commentReplyText, setCommentReplyText] = useState(''); const [replyAttachment, setReplyAttachment] = useState([]); const [selectedMediaFile, setSelectedMediaFile] = useState([]); const [isLoading, setIsLoading] = useState(false); const [isMediaEnable, setIsMediaEnable] = useState(false); const refReplyAttachment = useRef(null); // const [submitted, setSubmitted] = useState(false) // const [validation, setValidation] = useState(validator.valid()); const [selectedCommentId, setSelectedCommentId] = useState(0); const { isCommentModal } = useSelector((state) => state.comment); const [isEnable, setIsEnable] = useState(true); const handleCloseCommentModal = () => dispatch(showModal({ modalStatus: false, modalType: 'reply' })); const handleShowCommentModal = async (commentId) => { await setSelectedCommentId(commentId); await dispatch(showModal({ modalStatus: true, modalType: 'reply' })); }; const handleClose = () => setShow(false); const handleShow = (value, index, id, type) => { setActiveIndex(index); setShow(true); if (type === 'comment') { setIndividualPostAttachments(replies[0].attachments); } else { let singleReply = replies[0].replies.find( (replyData) => replyData.id === id ); setIndividualPostAttachments(singleReply.attachments); } }; const commentReplyHandler = (event) => { const { value } = event.target; setCommentReplyText(value); if (value !== '' || Object.keys(selectedMediaFile).length > 0) { setIsEnable(false); } else { setIsEnable(true); } }; const formatBytes = (bytes, decimals = 2) => { if (!+bytes) return '0 Bytes'; const k = 1024; const dm = decimals < 0 ? 0 : decimals; const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return { valueWithSize: `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${ sizes[i] }`, value: parseFloat((bytes / Math.pow(k, i)).toFixed(dm)), size: sizes[i], }; }; const attachmentsHandler = (event) => { let filesCount = selectedMediaFile.length + event.target.files.length; if (filesCount > 10) { notifier.notify('Please choose up to 10 media.', 'danger'); return false; } else { if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } if (event.target.files.length > 0) { setIsEnable(false); } else { setIsEnable(true); } const selectedFiles = event.target.files; const selectedFilesArray = Array.from(selectedFiles); const imagesArray = selectedFilesArray.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); // videos and images validation let previousAndSelectedMediaFile = selectedMediaFile.concat(imagesArray); let fileTypeCount = {}; let videoSize = {}; let imageSize = {}; previousAndSelectedMediaFile.map(function (item) { fileTypeCount[item.type] = (fileTypeCount[item.type] || 0) + 1; if (item.type === 'video') { videoSize[item.type] = item.size; } if (item.type === 'image') { imageSize[item.type] = item.size; } }); if (fileTypeCount.video > 1) { notifier.notify('You can upload only one video.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'GB' || videoSize?.video?.size === 'TB' || videoSize?.video?.size === 'PB' || videoSize?.video?.size === 'EB' || videoSize?.video?.size === 'ZB' || videoSize?.video?.size === 'YB' ) { notifier.notify('Max video file limit is 256 MB.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'MB' && videoSize?.video?.value > 256.05 ) { notifier.notify('Max video file limit is 256 MB.', 'danger'); return false; } } } if ( imageSize?.image?.size === 'GB' || imageSize?.image?.size === 'TB' || imageSize?.image?.size === 'PB' || imageSize?.image?.size === 'EB' || imageSize?.image?.size === 'ZB' || imageSize?.image?.size === 'YB' ) { notifier.notify('Max image file limit is 5 MB.', 'danger'); return false; } else { if (imageSize?.image?.size === 'MB' && imageSize?.image?.value > 5.05) { notifier.notify('Max image file limit is 5 MB.', 'danger'); return false; } } setSelectedMediaFile((previousMediaFile) => previousMediaFile.concat(imagesArray) ); //setAttachments((previousattachments) => previousattachments.concat(event.target.files)); let f = event.target.files; let sf = replyAttachment; // setAttachments((prevState)=>{ // return {...prevState, ...f}; // }) //setAttachments((prevState)=> ({prevState, ...f})) // setAttachments({ attachments, ...f }); for (let i = 0; i < event.target.files.length; i++) { setReplyAttachment((prevfiles) => [ ...prevfiles, event.target.files[i], ]); // let f = event.target.files[i]; // setAttachments((prevfiles)=>({...prevfiles, ...f})) } } // if (event.target.files.length > 0) { // setIsEnable(false) // } else { // setIsEnable(true) // } // setReplyAttachment(event.target.files) // const selectedFiles = event.target.files; // const selectedFilesArray = Array.from(selectedFiles); // const imagesArray = selectedFilesArray.map((file, index) => { // return { // 'previewFile': URL.createObjectURL(file), // 'type': file.type.substring(0, 5) === 'image' ? 'image' : 'video', // 'id': index, // }; // }); // setSelectedMediaFile((previousMediaFile) => previousMediaFile.concat(imagesArray)); }; const deleteHandler = (selectedIndex, selectedFile, selectedId) => { setSelectedMediaFile( selectedMediaFile.filter((e, index) => index !== selectedIndex) ); const copiedAttachment = [...replyAttachment]; delete copiedAttachment[selectedId]; const newFiles = []; for (let i = 0; i < copiedAttachment.length; i++) { if (copiedAttachment[i]) { newFiles.push(copiedAttachment[i]); } } setReplyAttachment(newFiles); const imagesArray = newFiles.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); setSelectedMediaFile(imagesArray); if (Object.keys(copiedAttachment).length === 0 && replyText === '') { setIsEnable(true); } else { setIsEnable(false); } URL.revokeObjectURL(selectedFile); let filesCount = selectedMediaFile.length - 1; if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } // setSelectedMediaFile(selectedMediaFile.filter((e, index) => index !== selectedIndex)); // const copiedAttachment = { ...replyAttachment }; // delete copiedAttachment[selectedId] // setReplyAttachment(copiedAttachment) // if (Object.keys(copiedAttachment).length === 0 && commentReplyText === '') { // setIsEnable(true) // } else { // setIsEnable(false) // } // URL.revokeObjectURL(selectedFile); }; const handleSubmit = async () => { // const validation = validator.validate(replyData) // setValidation(validation) // setSubmitted(true) // if (validation.isValid) { if (commentReplyText != '' || Object.keys(replyAttachment).length > 0) { setIsEnable(false); setIsMediaEnable(false); setIsLoading(true); let formData = new FormData(); formData.append('commentId', replies[0].id); formData.append('reply', commentReplyText); for (const key of Object.keys(replyAttachment)) { formData.append('attachment', replyAttachment[key]); } dispatch(createCommentReply(formData)) .unwrap() .then((result) => { setIsLoading(false); setIsMediaEnable(false); if (result.status) resetForm(); notifier.notify(result.message, 'success'); }) .catch((rejectedValueOrSerializedError) => { setIsLoading(false); setIsMediaEnable(false); notifier.notify(rejectedValueOrSerializedError.message, 'danger'); }); } else { setIsEnable(true); } // } }; useEffect(() => { if (replyStatus === 'loading') { setIsLoading(true); } else if (replyStatus === 'succeeded') { dispatch(fetchReply({ commentUniqueId: slug })); setIsLoading(false); } else if (replyStatus === 'failed') { setIsLoading(false); } }, [replyStatus]); useEffect(() => { dispatch(fetchReply({ commentUniqueId: slug })); }, []); function resetForm() { // console.log("resetForm"); setCommentReplyText(''); setReplyAttachment([]); refReplyAttachment.current.value = null; setSelectedMediaFile([]); setIsEnable(false); setIsMediaEnable(false); } // let checkValidation = submitted ? validator.validate(replyData) : validation return ( <section className="bg-black p-27-0-55"> <Container> <Row> <Col lg={11} className="mx-auto"> <Card className="card-dark card-post"> <Card.Header> <Link href="#"> <a className="d-flex align-items-center" onClick={() => router.back()} > <span className="text-white fs-20 me-3"> <FontAwesomeIcon icon={faArrowLeft} /> </span> <h3 className="text-white fs-18 mb-0">Comment</h3> </a> </Link> </Card.Header> <Card.Body> {replies?.length > 0 && replies.map((commentData, cIndex) => ( <div key={'comment' + cIndex}> <Row> <Col sm="auto"> <Figure className="figure figure-circle figure-gray-2 figure-62"> <img className="cover" src={ ASSETS_URL + commentData.user?.profilePath ?? '/profile/no-profile-image.jpg' } alt="profile" /> </Figure> </Col> <Col> <div> <Link href={ commentData.user?.role == roles.brand ? `/brand/${commentData.user.slug}` : `/customer/${commentData.user.slug}` } > <a> <h3 className="text-white fs-18"> {commentData.user?.fullName} <span className="color-a5a5a5 fs-14 fw-normal ms-2"> {dateTimeFormat( commentData.createdAt, 'DD MMM YYYY' )} </span> </h3> </a> </Link> <p className="color-bfbfbf"> {commentData.comment} </p> </div> <Row className="gallery-view"> {commentData.attachments?.length > 0 && commentData.attachments.map( (attachmentFile, aIndex) => ( <Col lg={3} md={4} sm={6} key={'aAttachment' + aIndex} > {aIndex <= 3 ? ( attachmentFile.attachmentType == 2 ? ( <div className="gallery-image cursor-pointer" onClick={() => handleShow( true, aIndex, commentData.id, 'comment' ) } > <ReactPlayer className="react-player" width="100%" height="100%" url={ ASSETS_URL + attachmentFile.attachment } playing={false} controls={true} //volume={5} muted={true} /> {aIndex == 3 ? ( <span className="more-images"> {commentData.attachments.length - 4 == 0 ? null : `+${ commentData.attachments .length - 4 }`} </span> ) : null} </div> ) : ( <div className="gallery-image cursor-pointer" onClick={() => handleShow( true, aIndex, commentData.id, 'comment' ) } > <img className="cover" src={ ASSETS_URL + attachmentFile.attachment } alt="postedImage" /> {aIndex == 3 ? ( <span className="more-images"> {commentData.attachments.length - 4 == 0 ? null : `+${ commentData.attachments .length - 4 }`} </span> ) : null} </div> ) ) : null} </Col> ) )} </Row> <div className="d-sm-flex justify-content-between align-items-center"> <ul className="comment-icons nav mb-3"> <li> <OverlayTrigger placement="top" overlay={<Tooltip>Comment</Tooltip>} > <a onClick={() => handleShowCommentModal(commentData.id) } > <i className="icon icon-chat-bubble"></i> </a> </OverlayTrigger> </li> </ul> <ul className="likes-comments nav"> <li> <span className="text-white"> {commentData.replyCount} </span>{' '} Comments </li> </ul> </div> <hr className="mb-4"></hr> <Row> <Col sm="auto"> <Figure className="figure figure-circle figure-gray-2 figure-62"> <img className="cover" src={ASSETS_URL + userImage} alt="profile" /> </Figure> </Col> <Col> <Form.Group className="form-dark"> <Form.Control onChange={commentReplyHandler} name="commentReplyText" value={commentReplyText} as="textarea" placeholder="Enter Your Reply" /> </Form.Group> <div className="d-flex align-items-start flex-wrap"> <div className="multimediaFiles"> <label htmlFor="multimediaFilesCommReply" className={`btn btn-outline-gray btn-rounded btn-h-30 me-3 mt-3${ isLoading || isMediaEnable ? ' disabled' : '' }`} > <span className="color-20da97 me-2"> <i className="icon icon-image v-align-middle"></i> </span> Media </label> <input type="file" ref={refReplyAttachment} multiple accept="audio/*,video/*,image/*" onChange={attachmentsHandler} id="multimediaFilesCommReply" className="mediaFiles" /> </div> {/* <span className="me-3 mt-3"> {(refReplyAttachment.current !== null && refReplyAttachment.current?.files.length !== 0) ? refReplyAttachment.current.files.length + `${refReplyAttachment.current.files.length > 1 ? ' files' : ' file'}` : null} </span> */} </div> </Col> <Col sm="auto"> <button onClick={ !isLoading ? () => handleSubmit() : null } disabled={isLoading || isEnable} type="submit" className="btn btn-outline-gray btn-wh-150-48 btn-rounded mt-3" > {isLoading ? ( <Spinner animation="border" /> ) : ( 'Reply' )} </button> </Col> <Row> <Col sm="auto"> <div style={{ width: '58px' }}></div> </Col> <Col className=" mt-3"> <div className={ selectedMediaFile.length > 0 ? `grid-wrapper` : `` } > {selectedMediaFile && selectedMediaFile.map( (selectedFile, index) => { return ( <div key={selectedFile + index} className={ `gallery-image position-relative` + (selectedFile.type === 'video' ? ` gallery-video` : ``) } > <Button variant="" className="btn-remove" onClick={() => deleteHandler( index, selectedFile.previewFile, selectedFile.id ) } > <i className="fal fa-times"></i> </Button> {selectedFile.type === 'video' ? ( <video controls> <source src={selectedFile.previewFile} type="video/mp4" /> Sorry, your browser doesn't support embedded videos. </video> ) : ( <img className="cover" src={selectedFile.previewFile} alt="upload" /> )} </div> ); } )} </div> </Col> </Row> {/* <Row className="images"> {selectedMediaFile && selectedMediaFile.map((selectedFile, index) => { return ( <Col key={selectedFile + index} className="image"> <div className="gallery-image position-relative"> <Button variant="" className="btn-remove" onClick={() => deleteHandler(index, selectedFile.previewFile, selectedFile.id)}> <i className="fal fa-times"></i> </Button> { selectedFile.type === 'video' ? <video className="gallery-image" controls> <source src={selectedFile.previewFile} type="video/mp4" /> Sorry, your browser doesn't support embedded videos. </video> : <img className="gallery-image" src={selectedFile.previewFile} alt="upload" /> } </div> </Col> ); })} </Row> */} <hr></hr> <div className="timeline-comment"> {commentData.replies.map((replyData, rIndex) => ( <Row key={'rIndex' + rIndex} className="timeline-row" > <Col sm="auto"> <Figure className="figure figure-circle figure-gray-2 figure-62"> <img className="cover" src={ ASSETS_URL + replyData.user?.profilePath ?? '/profile/no-profile-image.jpg' } alt="profile" /> </Figure> </Col> <Col> <div> <Link href={ replyData.user?.role == roles.brand ? `/brand/${replyData.user.slug}` : `/customer/${replyData.user.slug}` } > <a> <h3 className="text-white fs-18"> {replyData.user?.fullName} <span className="color-a5a5a5 fs-14 fw-normal ms-2"> {dateTimeFormat( replyData.createdAt, 'DD MMM YYYY' )} </span> </h3> </a> </Link> <p className="color-bfbfbf"> {replyData.reply} </p> </div> <Row className="gallery-view"> {replyData.attachments?.length > 0 && replyData.attachments.map( (attachmentFile, aIndex) => ( <Col lg={3} md={4} sm={6} key={'attachment' + aIndex} > {aIndex <= 3 ? ( attachmentFile.attachmentType == 2 ? ( <div className="gallery-image cursor-pointer" onClick={() => handleShow( true, aIndex, replyData.id, 'reply' ) } > <ReactPlayer className="react-player" width="100%" height="100%" url={ ASSETS_URL + attachmentFile.attachment } playing={false} controls={true} //volume={5} muted={true} /> {aIndex == 3 ? ( <span className="more-images"> {replyData.attachments .length - 4 == 0 ? null : `+${ replyData .attachments .length - 4 }`} </span> ) : null} </div> ) : ( <div className="gallery-image cursor-pointer" onClick={() => handleShow( true, aIndex, replyData.id, 'reply' ) } > <img className="cover" src={ ASSETS_URL + attachmentFile.attachment } alt="postedImage" /> {aIndex == 3 ? ( <span className="more-images"> {replyData.attachments .length - 4 == 0 ? null : `+${ replyData .attachments .length - 4 }`} </span> ) : null} </div> ) ) : null} </Col> ) )} </Row> </Col> </Row> ))} </div> </Row> </Col> </Row> </div> ))} </Card.Body> </Card> </Col> </Row> <LightboxModal sliderIndex={activeIndex} images={individualPostAttachments} show={show} handleClose={handleClose} /> <CommentModal showCommentModal={isCommentModal} handleCloseCommentModal={handleCloseCommentModal} postId={selectedCommentId} userImage={userImage} /> </Container> </section> ); } export async function getServerSideProps(context) { const { slug } = context.params; const userImage = contextCookie(context, 'userImage'); return { props: { slug, userImage, }, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/drivers/index.js
import React, { useEffect, useState } from 'react'; import { Card, Col, Container, Row, Form } from 'react-bootstrap'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faCirclePlus, faEdit } from '@fortawesome/free-solid-svg-icons'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import Notifier from '../../components/Notifier'; import ReactPaginate from 'react-paginate'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { contextCookie } from '../../services/Auth'; import Meta from '../../components/Meta'; import { APP_NAME } from '../../config/server.config'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; const baseColor = '#202020'; const highlightColor = '#444'; function Drivers(props) { const noti = new Notifier(); const router = useRouter(); const [params, setParams] = useState({ offset: props.queryString.offset ?? 0, }); const [showSkeleton, setShowSkeleton] = useState(true); const [drivers, setDrivers] = useState([]); const [limit, setLimit] = useState(10); const [totalPages, setTotalPages] = useState(); useEffect(async () => { setShowSkeleton(true); router.push('/drivers', { query: { ...params } }, undefined, { shallow: true, }); const response = await Rest.axiosRequest( API.drivers + '?' + `limit=${limit}&` + new URLSearchParams(params).toString(), {}, 'GET' ); if (response.status === 200) { setDrivers(response.data.data.drivers); setTotalPages(response.data.data.totalPages); } else { noti.notify(response.data.message, 'danger'); } setShowSkeleton(false); }, []); const handlePageChange = (event) => { setParams((prevState) => ({ ...prevState, offset: event.selected })); }; const handleStatusChange = async (id) => { const response = await Rest.axiosRequest( API.changeDriverStatus + '/' + id, {} ); if (response.data.status) { if (+response.data.data.isActive === 1) { document.getElementById('action-' + id).classList.remove('fa-check'); document.getElementById('action-' + id).classList.add('fa-ban'); } else { document.getElementById('action-' + id).classList.add('fa-check'); document.getElementById('action-' + id).classList.remove('fa-ban'); } noti.notify(response.data.message, 'success'); } else { noti.notify(response.data.message, 'danger'); } }; return ( <> <Meta title={`Drivers | ${APP_NAME}`} keywords={'Drivers'} description={'Drivers'} /> <section className="bg-black p-30-0-60"> <Container> <Row> <Col lg={12} className="mx-auto"> <Card className="card-dark border-gray p-8-21-30 br-10"> <Card.Header className="d-flex justify-content-between align-items-center border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-6"> <Card.Title className="fs-18 fw-600 color-dcdcdc mb-0"> Drivers </Card.Title> <Link href="/drivers/add"> <a className="btn btn-primary btn-wh-130-38 br-6"> <span className="me-2"> <FontAwesomeIcon icon={faCirclePlus} /> </span> Add Driver </a> </Link> </Card.Header> <Card.Body className="p-0"> <div className="table-wrap CustomScrollbar CustomScrollbarY"> <ResponsiveTable className="table table-bordered table-hover table-dark form-dark" id="seller-driver" > <Thead> <Tr> <Th width="150px">Transporter Name</Th> <Th width="150px">Driver's Name</Th> <Th width="200px">Cannabis Industry License#</Th> <Th width="150px">Phone Number</Th> <Th width="100px">Email</Th> <Th width="180px">Action</Th> </Tr> </Thead> <Tbody> {showSkeleton ? ( [...Array(5)].map((arrayData, index) => { return ( <Tr key={index + 'loader'}> {[...Array(11)].map((data, sIndex) => { return ( <Td key={sIndex + 'skeleton'}> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton /> </SkeletonTheme> </Td> ); })} </Tr> ); }) ) : drivers.length ? ( drivers.map((driver, i) => { return ( <Tr> <Td> <Link href={`/drivers/edit/${driver.id}`}> <a className="text-white"> {driver.transporterName} </a> </Link> </Td> <Td> <Link href={`/drivers/edit/${driver.id}`}> <a className="text-white"> {driver.driversName} </a> </Link> </Td> <Td> <Link href={`/drivers/edit/${driver.id}`}> <a className="text-white"> {driver.cannabisIndustryLicense} </a> </Link> </Td> <Td> <Link href={`/drivers/edit/${driver.id}`}> <a className="text-white"> {driver.phoneNumber} </a> </Link> </Td> <Td> <Link href={`/drivers/edit/${driver.id}`}> <a className="text-white">{driver.email}</a> </Link> </Td> <Td> <Link href={`/drivers/edit/${driver.id}`}> <a className="action-btn color-22a612"> <FontAwesomeIcon icon={faEdit} /> </a> </Link> <a className="action-btn color-f32c2c" onClick={() => handleStatusChange(driver.id) } > {+driver.isActive === 1 ? ( <i className="fa fa-ban" id={'action-' + driver.id} ></i> ) : ( <i className="fa fa-check" id={'action-' + driver.id} ></i> )} </a> </Td> </Tr> ); }) ) : ( <Tr> <Td className="text-center" colSpan={10}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> <div className="mt-5 d-flex justify-content-center"> {totalPages > 1 ? ( <ReactPaginate previousLabel={ <i className="fas fa-long-arrow-alt-left"></i> } nextLabel={ <i className="fas fa-long-arrow-alt-right"></i> } pageClassName="page-item" pageLinkClassName="page-link" previousClassName="page-item prev-item" previousLinkClassName="page-link" nextClassName="page-item next-item" nextLinkClassName="page-link" breakLabel="..." breakClassName="page-item" breakLinkClassName="page-link" pageCount={totalPages} //marginPagesDisplayed={1} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName="pagination" activeClassName="active" forcePage={parseInt(params.offset)} /> ) : null} </div> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default Drivers; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: { queryString: context.query, }, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/drivers/add.js
import React, { useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Card, Col, Container, Row, Form, Button, Spinner, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight } from '@fortawesome/free-solid-svg-icons'; import 'react-dropzone-uploader/dist/styles.css'; import API from '../../config/endpoints.config'; import FormValidator from '../../components/FormValidator'; import Rest from '../../config/rest.config'; import Notifier from '../../components/Notifier'; import { APP_NAME } from '../../config/server.config'; import Meta from '../../components/Meta'; function AddDriver() { const router = useRouter(); const noti = new Notifier(); const validator = new FormValidator([ { field: 'transporterName', method: 'isEmpty', validWhen: false, message: 'Please enter transporter name.', }, { field: 'driversName', method: 'isEmpty', validWhen: false, message: 'Please enter driver name.', }, { field: 'cannabisIndustryLicense', method: 'isEmpty', validWhen: false, message: 'Please enter cannabis industry license #.', }, { field: 'phoneNumber', method: 'isEmpty', validWhen: false, message: 'Please enter phone number.', }, { field: 'email', method: 'isEmpty', validWhen: false, message: 'Please enter email.', }, { field: 'email', method: 'isEmail', validWhen: true, message: 'Please enter valid email address.', }, ]); const [driverData, setDriverData] = useState({ transporterName: '', driversName: '', cannabisIndustryLicense: '', phoneNumber: '', email: '', }); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const handleChange = (event) => { const { name, value } = event.target; setDriverData((prevState) => ({ ...prevState, [name]: value })); }; const addDriver = async (e) => { e.preventDefault(); const validation = validator.validate(driverData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); let response; response = await Rest.axiosRequest(API.drivers, driverData, 'POST'); if (response.status === 201) { noti.notify(response.data.message, 'success'); setSubmitted(false); router.push('/drivers'); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); } }; let checkValidation = submitted ? validator.validate(driverData) : validation; return ( <> <Meta title={`Add Driver | ${APP_NAME}`} keywords={''} description={''} /> <section className="bg-black p-30-0-60"> <Container> <Row> <Col lg={12} className="mx-auto"> <Card className="card-dark border-gray p-15-20-30 br-10"> <Card.Header className="border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13"> <Card.Title className="fs-18 fw-600 color-white mb-0"> Add Driver </Card.Title> </Card.Header> <Card.Body className="p-0"> <Form> <Row> <Col md={6}> <Form.Group className="form-dark mb-4"> <Form.Label>Transporter Name</Form.Label> <Form.Control type="text" placeholder="Enter Transporter Name" value={driverData.transporterName} name="transporterName" onChange={handleChange} /> <div className={ checkValidation.transporterName.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.transporterName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="form-dark mb-4"> <Form.Label>Driver's Name</Form.Label> <Form.Control type="text" placeholder="Enter Driver's Name" value={driverData.driversName} name="driversName" onChange={handleChange} /> <div className={ checkValidation.driversName.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.driversName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="form-dark mb-4"> <Form.Label>Cannabis Industry License #</Form.Label> <Form.Control type="text" placeholder="Enter Cannabis Industry License #" value={driverData.cannabisIndustryLicense} name="cannabisIndustryLicense" onChange={handleChange} /> <div className={ checkValidation.cannabisIndustryLicense.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.cannabisIndustryLicense.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="form-dark mb-4"> <Form.Label>Conatct Phone Number</Form.Label> <Form.Control type="text" placeholder="Enter Conatct Phone Number" value={driverData.phoneNumber} name="phoneNumber" onChange={handleChange} min="0" minLength="10" /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.phoneNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className="form-dark mb-4"> <Form.Label>Conatct Email</Form.Label> <Form.Control type="email" placeholder="Enter Conatct Email" value={driverData.email} name="email" onChange={handleChange} /> <div className={ checkValidation.email.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.email.message} </div> </div> </Form.Group> </Col> <Col md={12}> <div className="d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap"> <Link href="/drivers"> <a className="btn btn-wh-160-54 btn-rounded btn-secondary btn-right-icons m-10"> Cancel <span> <FontAwesomeIcon icon={faAngleRight} /> </span> </a> </Link> <Button variant="primary" type="submit" className="btn-wh-150-54 btn-rounded btn-right-icons m-10" onClick={!showLoading ? addDriver : null} disabled={showLoading} > {showLoading ? ( <Spinner animation="border" /> ) : ( 'Save' )} <span className="color-22a612"> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </Col> </Row> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default AddDriver;
0
/content/gmx-projects/gmx-admin/frontend/pages/drivers
/content/gmx-projects/gmx-admin/frontend/pages/drivers/edit/[id].js
import React, { useState } from 'react'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { Card, Col, Container, Row, Form, Button, Spinner, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faAngleRight } from '@fortawesome/free-solid-svg-icons'; import 'react-dropzone-uploader/dist/styles.css'; import API from '../../../config/endpoints.config'; import FormValidator from '../../../components/FormValidator'; import Rest from '../../../config/rest.config'; import Notifier from '../../../components/Notifier'; import { APP_NAME } from '../../../config/server.config'; import Meta from '../../../components/Meta'; import { contextCookie } from '../../../services/Auth'; function EditDriver({ editDriverData }) { const router = useRouter(); const noti = new Notifier(); const { id } = router.query; const validator = new FormValidator([ { field: 'transporterName', method: 'isEmpty', validWhen: false, message: 'Please enter transporter name.', }, { field: 'driversName', method: 'isEmpty', validWhen: false, message: 'Please enter driver name.', }, { field: 'cannabisIndustryLicense', method: 'isEmpty', validWhen: false, message: 'Please enter cannabis industry license #.', }, { field: 'phoneNumber', method: 'isEmpty', validWhen: false, message: 'Please enter phone number.', }, { field: 'email', method: 'isEmpty', validWhen: false, message: 'Please enter email.', }, { field: 'email', method: 'isEmail', validWhen: true, message: 'Please enter valid email address.', }, ]); const [driverData, setDriverData] = useState(editDriverData); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const handleChange = (event) => { const { name, value } = event.target; setDriverData((prevState) => ({ ...prevState, [name]: value })); }; const updateDriver = async (e) => { e.preventDefault(); const validation = validator.validate(driverData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); let response; response = await Rest.axiosRequest( API.drivers + '/' + id, driverData, 'PUT' ); if (response.status === 200) { noti.notify(response.data.message, 'success'); setSubmitted(false); router.push('/drivers'); } else { noti.notify(response.data.message, 'danger'); } setShowLoading(false); } }; let checkValidation = submitted ? validator.validate(driverData) : validation; return ( <> <Meta title={`Edit Driver | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-30 br-10'> <Card.Header className='border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13'> <Card.Title className='fs-18 fw-600 color-white mb-0'> Edit Driver </Card.Title> </Card.Header> <Card.Body className='p-0'> <Form> <Row> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Transporter Name</Form.Label> <Form.Control type='text' placeholder='Enter Transporter Name' value={driverData.transporterName} name='transporterName' onChange={handleChange} /> <div className={ checkValidation.transporterName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.transporterName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Driver's Name</Form.Label> <Form.Control type='text' placeholder="Enter Driver's Name" value={driverData.driversName} name='driversName' onChange={handleChange} /> <div className={ checkValidation.driversName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.driversName.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Cannabis Industry License #</Form.Label> <Form.Control type='text' placeholder='Enter Cannabis Industry License #' value={driverData.cannabisIndustryLicense} name='cannabisIndustryLicense' onChange={handleChange} /> <div className={ checkValidation.cannabisIndustryLicense.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.cannabisIndustryLicense.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Conatct Phone Number</Form.Label> <Form.Control type='text' placeholder='Enter Conatct Phone Number' value={driverData.phoneNumber} name='phoneNumber' onChange={handleChange} min='0' minLength='10' /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.phoneNumber.message} </div> </div> </Form.Group> </Col> <Col md={6}> <Form.Group className='form-dark mb-4'> <Form.Label>Conatct Email</Form.Label> <Form.Control type='email' placeholder='Enter Conatct Email' value={driverData.email} name='email' onChange={handleChange} /> <div className={ checkValidation.email.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.email.message} </div> </div> </Form.Group> </Col> <Col md={12}> <div className='d-flex justify-content-center align-items-center mt-6 mbottom-5 flex-wrap'> <Link href='/drivers'> <a className='btn btn-wh-160-54 btn-rounded btn-secondary btn-right-icons m-10'> Cancel <span> <FontAwesomeIcon icon={faAngleRight} /> </span> </a> </Link> <Button variant='primary' type='submit' className='btn-wh-150-54 btn-rounded btn-right-icons m-10' onClick={!showLoading ? updateDriver : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Save' )} <span className='color-22a612'> <FontAwesomeIcon icon={faAngleRight} /> </span> </Button> </div> </Col> </Row> </Form> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default EditDriver; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } try { const { id } = context.params; const token = contextCookie(context, 'token'); let editDriverData = {}; const response = await Rest.axiosRequest( API.drivers + '/' + id, {}, 'GET', false, token ); if (response.status === 200) { editDriverData = response.data.data; } else { return { notFound: true, }; } return { props: { editDriverData, }, }; } catch (e) { return { redirect: { destination: '/drivers' }, }; } }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/brand/[slug].js
import React, { useEffect, useState } from 'react'; import { Card, Col, Container, Row, Table, Tabs, Tab, Button, Form, Modal, ListGroup, OverlayTrigger, Tooltip, } from 'react-bootstrap'; import Link from 'next/link'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faStar, faCommentDots, faCalendarAlt, faExternalLink, faEye, } from '@fortawesome/free-solid-svg-icons'; import Figure from 'react-bootstrap/Figure'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import Notifier from '../../components/Notifier'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../../services/SkeletonOptions'; import { saveAs } from 'file-saver'; import { Helper, commaSeparatedStringWithIncludes, customFormat, dateTimeFormat, } from '../../services/Helper'; import InfiniteScroll from 'react-infinite-scroll-component'; import moment from 'moment'; import ReactStars from 'react-rating-stars-component'; import { APP_NAME, ASSETS_URL, REACT_APP_API_BASE_URL, } from '../../config/server.config'; import { useRouter } from 'next/router'; import { contextCookie, getSingle } from '../../services/Auth'; import Meta from '../../components/Meta'; import { Table as ResponsiveTable, Thead, Tbody, Tr, Th, Td, } from 'react-super-responsive-table'; import ActivityPost from '../../services/ActivityPost'; import RepostModal from '../../components/RepostModal'; import LightboxModal from '../../components/LightboxModal'; import LikeModal from '../../components/LikeModal'; import CommentModal from '../../components/CommentModal'; import { useSelector, useDispatch } from 'react-redux'; import { fetchActivities, addActivity, resetActivities, setFollowerData, handleOnComment, } from '../../app/slices/activitiesSlice'; import ActivityList from '../../components/ActivityList'; import { showModal } from '../../app/slices/commentSlice'; import FavouriteBtn from '../../components/FavouriteBtn'; import { addProductToCart, fetchCartProducts, } from '../../app/slices/cartSlice'; import Swal from 'sweetalert2'; function SellerDetails({ businessDetails, products, userImage, isLoggedIn }) { const noti = new Notifier(); const dispatch = useDispatch(); const router = useRouter(); const { slug } = router.query; const [tabIndex, setTabIndex] = useState(0); const [showSkeleton, setShowSkeleton] = useState(true); const [isLoading, setIsLoading] = useState(false); const [isPostLoading, setIsPostLoading] = useState(false); const [isFollowClicked, setIsFollowClicked] = useState(false); const [followStatus, setFollowStatus] = useState( businessDetails.userFollowed ? 'Following' : 'Follow' ); const [followersCount, setFollowersCount] = useState( businessDetails.followersCount ); const [followingsCount, setFollowingsCount] = useState( businessDetails.followingsCount ); const [productQuality, setProductQuality] = useState([]); const [deliveryTime, setDeliveryTime] = useState([]); const [general, setGeneral] = useState([]); const [hasMore, setHasMore] = useState(true); const [page, setPage] = useState(0); const [count, setCount] = useState(''); const [reviewsType, setReviewsType] = useState(1); // Activity state const [activityPage, setActivityPage] = useState(0); // const [activities, setActivities] = useState([]) // const [totalActivities, setTotalActivities] = useState(0) //const [showActivityLoader, setShowActivityLoader] = useState(false) const activities = useSelector((state) => state.activities.activities); const totalActivities = useSelector( (state) => state.activities.totalActivites ); const showActivityLoader = useSelector((state) => state.activities.status); const { isCommentModal } = useSelector((state) => state.comment); const deletePostStatus = useSelector( (state) => state?.activities?.deletePost?.status ); const [activityComment, setActivityComment] = useState(''); const [mentions, setMentions] = useState([]); const [searchValue, setSearchValue] = useState(''); const [attachments, setAttachments] = useState([]); const [individualPostAttachments, setIndividualPostAttachments] = useState( [] ); const [users, setUsers] = useState([]); // LightBox Images // const [photoIndex, setPhotoIndex] = useState(false) // const [isOpen, setIsOpen] = useState(false) const [show, setShow] = useState(false); const [isEnable, setIsEnable] = useState(true); const [isMediaEnable, setIsMediaEnable] = useState(false); const [selectedMediaFile, setSelectedMediaFile] = useState([]); // const [showCommentModal, setShowCommentModal] = useState(false); const [selectedPostId, setSelectedPostId] = useState(0); const [activeIndex, setActiveIndex] = useState(0); const [isPosted, setIsPosted] = useState(false); //RepostModal const [reposts, setReposts] = useState([]); const [repostsPage, setRepostsPage] = useState(0); const [repostsCount, setRepostsCount] = useState(0); const [currentRepostPost, setCurrentRepostPost] = useState(null); // Profile data const userRoleWiseId = getSingle('role') === '2' ? getSingle('currentBrandId') : getSingle('retailerCompanyId'); console.log({ userRoleWiseId }); //comment const handleCloseCommentModal = () => dispatch(showModal({ modalStatus: false, modalType: 'comment' })); const handleShowCommentModal = async (postId) => { await setSelectedPostId(postId); await dispatch(showModal({ modalStatus: true, modalType: 'comment' })); }; const fetchMoreReposts = () => { setRepostsPage(repostsPage + 1); }; useEffect(() => { return () => dispatch(resetActivities()); }, [dispatch]); const { createCommentStatus, postId, postCommentCount } = useSelector( (state) => state.comment ); useEffect(() => { if (createCommentStatus === 'succeeded') { dispatch(handleOnComment({ postId, postCommentCount })); } }, [dispatch, createCommentStatus]); useEffect(() => { const getRepostsBy = async () => { let repostRes = await Rest.axiosRequest( API.posts + '/' + currentRepostPost + `/reposts?limit=10&page=${repostsPage}`, {}, 'GET' ); repostRes = repostRes.data; if (repostRes.status) { const { count, rows } = repostRes.data; setRepostsCount(count); if (rows.length > 0) { setReposts([...reposts, ...rows]); } } }; if (currentRepostPost != null) { getRepostsBy(); } }, [currentRepostPost, repostsPage]); const resetRepostModal = () => { setCurrentRepostPost(null); setReposts([]); setRepostsPage(0); setRepostsCount(0); }; const [showRepostModal, setShowRepostModal] = useState(false); const repostsModalClose = () => { setShowRepostModal(false); resetRepostModal(); }; const repostsModalShow = () => setShowRepostModal(true); const repostsClickhandler = (e, postUniqueId) => { setCurrentRepostPost(postUniqueId); repostsModalShow(); }; //LikeModal const [likes, setLikes] = useState([]); const [likesPage, setLikesPage] = useState(0); const [likesCount, setLikesCount] = useState(0); const [currenLikePost, setCurrentLikePost] = useState(null); const fetchMoreLikes = () => { setLikesPage(likesPage + 1); }; useEffect(() => { const getLikesBy = async () => { let likeRes = await Rest.axiosRequest( API.posts + '/' + currenLikePost + `/likes?limit=10&page=${likesPage}`, {}, 'GET' ); likeRes = likeRes.data; if (likeRes.status) { const { count, rows } = likeRes.data; setLikesCount(count); if (rows.length > 0) { setLikes([...likes, ...rows]); } } }; if (currenLikePost != null) { getLikesBy(); } }, [currenLikePost, likesPage]); const resetLikesModal = () => { setCurrentLikePost(null); setLikes([]); setLikesPage(0); setLikesCount(0); }; const [showLikeModal, setShowLikeModal] = useState(false); const likesModalClose = () => { setShowLikeModal(false); resetLikesModal(); }; const likesModalShow = () => setShowLikeModal(true); const likesClickHandler = (e, postUniqueId) => { setCurrentLikePost(postUniqueId); likesModalShow(); }; const handleClose = () => setShow(false); const handleShow = (value, index, id) => { setActiveIndex(index); setShow(true); let singleActivity = activities.find((data) => data.id === id); let mainPost = singleActivity.type == '2' ? singleActivity.parentPost : singleActivity; setIndividualPostAttachments(mainPost.attachments); }; const downloadLicense = () => { saveAs( REACT_APP_API_BASE_URL + '/get/file' + businessDetails.certificatePath ); }; const fetchMoreData = () => { setPage(page + 1); if (productQuality.length >= count) { return; } else { getReviews(); } }; const getReviews = async () => { setIsLoading(true); const review = await Rest.axiosRequest( API.reviews + `?slug=${slug}&page=${page}&limit=${5}`, {}, 'GET' ); if (review.status === 200) { const response = review.data; setCount(response.data[1].count); if (response.data[1].reviews.length) { setProductQuality([...productQuality, ...response.data[1].reviews]); setDeliveryTime([...deliveryTime, ...response.data[2].reviews]); setGeneral([...general, ...response.data[3].reviews]); // setHasMore(true) //setTimeout(() => { setIsLoading(false); //}, 200) } else { setIsLoading(false); // setHasMore(false) return; } } else { setIsLoading(false); noti.notify(review.data.message, 'danger'); } }; const handleMessage = () => { // if(!businessDetails.canMessage){ // noti.notify('You can message seller who is in your state only', "danger"); // } else { router.push(`/messages/${slug}`); // } }; const handleFollow = async () => { setIsFollowClicked(true); let formData = { slug: businessDetails.userSlug, }; let response = await Rest.axiosRequest(API.follow, formData); response = response.data; if (response.status) { const follow = response.data.follow; setFollowStatus(follow ? 'Following' : 'Follow'); setFollowersCount(follow ? ++followersCount : --followersCount); } else { noti.notify(response.message, 'danger'); } setIsFollowClicked(false); }; useEffect(() => { let formData = { page: activityPage, limit: 10, type: 'brand', slug: slug, }; dispatch(fetchActivities(formData)); }, [dispatch, activityPage]); const fetchMoreActivity = () => { setActivityPage(activityPage + 1); }; const formatBytes = (bytes, decimals = 2) => { if (!+bytes) return '0 Bytes'; const k = 1024; const dm = decimals < 0 ? 0 : decimals; const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; const i = Math.floor(Math.log(bytes) / Math.log(k)); return { valueWithSize: `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${ sizes[i] }`, value: parseFloat((bytes / Math.pow(k, i)).toFixed(dm)), size: sizes[i], }; }; const attachmentsHandler = (event) => { let filesCount = selectedMediaFile.length + event.target.files.length; if (filesCount > 10) { noti.notify('Please choose up to 10 media.', 'danger'); return false; } else { if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } if (event.target.files.length > 0) { setIsEnable(false); } else { setIsEnable(true); } const selectedFiles = event.target.files; const selectedFilesArray = Array.from(selectedFiles); const imagesArray = selectedFilesArray.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); // videos and images validation let previousAndSelectedMediaFile = selectedMediaFile.concat(imagesArray); let fileTypeCount = {}; let videoSize = {}; let imageSize = {}; previousAndSelectedMediaFile.map(function (item) { fileTypeCount[item.type] = (fileTypeCount[item.type] || 0) + 1; if (item.type === 'video') { videoSize[item.type] = item.size; } if (item.type === 'image') { imageSize[item.type] = item.size; } }); if (fileTypeCount.video > 1) { noti.notify('You can upload only one video.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'GB' || videoSize?.video?.size === 'TB' || videoSize?.video?.size === 'PB' || videoSize?.video?.size === 'EB' || videoSize?.video?.size === 'ZB' || videoSize?.video?.size === 'YB' ) { noti.notify('Max video file limit is 256 MB.', 'danger'); return false; } else { if ( videoSize?.video?.size === 'MB' && videoSize?.video?.value > 256.05 ) { noti.notify('Max video file limit is 256 MB.', 'danger'); return false; } } } if ( imageSize?.image?.size === 'GB' || imageSize?.image?.size === 'TB' || imageSize?.image?.size === 'PB' || imageSize?.image?.size === 'EB' || imageSize?.image?.size === 'ZB' || imageSize?.image?.size === 'YB' ) { noti.notify('Max image file limit is 5 MB.', 'danger'); return false; } else { if (imageSize?.image?.size === 'MB' && imageSize?.image?.value > 5.05) { noti.notify('Max image file limit is 5 MB.', 'danger'); return false; } } setSelectedMediaFile((previousMediaFile) => previousMediaFile.concat(imagesArray) ); let f = event.target.files; let sf = attachments; for (let i = 0; i < event.target.files.length; i++) { setAttachments((prevfiles) => [...prevfiles, event.target.files[i]]); } } }; function deleteHandler(selectedIndex, selectedFile, selectedId) { setSelectedMediaFile( selectedMediaFile.filter((e, index) => index !== selectedIndex) ); const copiedAttachment = [...attachments]; delete copiedAttachment[selectedId]; const newFiles = []; for (let i = 0; i < copiedAttachment.length; i++) { if (copiedAttachment[i]) { newFiles.push(copiedAttachment[i]); } } setAttachments(newFiles); const imagesArray = newFiles.map((file, index) => { return { previewFile: URL.createObjectURL(file), size: formatBytes(file.size), type: file.type.substring(0, 5) === 'image' ? 'image' : 'video', id: index, }; }); setSelectedMediaFile(imagesArray); if (Object.keys(copiedAttachment).length === 0 && activityComment === '') { setIsEnable(true); } else { setIsEnable(false); } URL.revokeObjectURL(selectedFile); let filesCount = selectedMediaFile.length - 1; if (filesCount >= 10) { setIsMediaEnable(true); } else { setIsMediaEnable(false); } } const postContentHandler = (event, newValue, newPlainTextValue, mentions) => { const { value } = event.target; setActivityComment(newValue); setMentions(mentions); setSearchValue( newPlainTextValue?.substring(newPlainTextValue.lastIndexOf('@') + 1) ); if (value !== '' || Object.keys(selectedMediaFile).length > 0) { setIsEnable(false); } else { setIsEnable(true); } }; const postContentHandlerSelect = (id, display) => { const mentionText = `@${display}`; setActivityComment(mentionText); setMentions([...mentions, { id, display }]); }; const submitPost = async () => { if (activityComment != '' || Object.keys(attachments).length > 0) { setIsEnable(true); setIsPostLoading(true); let formData = new FormData(); formData.append('type', 1); formData.append('post', activityComment?.replace(/\(([^)]+)\)/g, '$1')); formData.append('mentions', JSON.stringify(mentions)); formData.append('attachableType', 'post'); for (const key of Object.keys(attachments)) { formData.append('attachment', attachments[key]); } const response = await Rest.axiosRequest( API.postActivity, formData, 'POST', true ); if (response.status === 201) { setIsPostLoading(false); noti.notify(response.data.message, 'success'); const activity = response.data.data; // console.log([activity, ...activities]) // setActivities([activity, ...activities]); dispatch(addActivity(activity)); resetPostForm(); } else { setIsPostLoading(false); noti.notify('Something went wrong!', 'danger'); } } else { setIsEnable(false); } }; useEffect(() => { getReviews(); }, []); const resetPostForm = () => { // console.log('resetPostForm') setActivityComment(''); setAttachments([]); setSelectedMediaFile([]); setIsEnable(true); }; // Product const cartProducts = useSelector((state) => state?.cart?.data?.cartItems); const productStatus = useSelector((state) => state.cart.status); const currentBrandId = useSelector((state) => state.cart?.data?.brandId); const [isCartLoading, setIsCartLoading] = useState(false); useEffect(() => { if (productStatus === 'idle') { if (isLoggedIn) { dispatch(fetchCartProducts()); } } }, [productStatus, dispatch]); const handleRequestOrder = async (slug) => { if (isLoggedIn) { const quantity = 1; dispatch( addProductToCart({ productSlug: slug, quantity: parseInt(quantity) }) ) .unwrap() .then(() => { noti.notify('Product added to cart', 'success'); }) .catch((rejectedValueOrSerializedError) => { setIsCartLoading(false); noti.notify(rejectedValueOrSerializedError.message, 'danger'); }); } else { router.push('/sign-in'); } }; useEffect(() => { if (deletePostStatus === 'succeeded') { let formData = { page: activityPage, limit: 10, type: 'brand', slug: slug, }; dispatch(fetchActivities(formData)); } }, [dispatch, deletePostStatus]); useEffect(async () => { let formData = { keyword: '', page: 0, limit: 10, }; const response = await Rest.axiosRequest( API.axisPointUsers, formData, 'POST' ); setUsers(response?.data?.data?.rows); }, []); return ( <> <Meta title={ businessDetails.brandName ? businessDetails.brandName + ` | ${APP_NAME}` : '' } keyword={''} description={''} /> <section className='bg-black p-27-0-55'> <Container> <Row> <Col lg={12}> <div className='m-l-r-30'> <div className='box-dark mb-30 overflow-hidden'> <ul className='d-flex justify-start flex-wrap'> <li className='logo-box d-flex justify-content-center align-items-center '> <Figure className='mb-0 figure-circle figure-green-2 figure-120'> <Figure.Image src={ASSETS_URL + businessDetails.brandLogo} className='cover circle' /> </Figure> </li> <li className='seller-detail-wrap'> <ul> <li className='seller-infor seller-infor-main'> <div className='d-flex align-items-center justify-content-between flex-wrap'> <div className='d-flex align-items-center justify-content-lg-between justify-content-center flex-wrap col-md-6 col-12'> <div> <h5 className='fs-24 fw-600 color-22a612 mb-2'> {Helper.niceString( businessDetails.brandName, 90, true )} </h5> <ul className='inline-listing'> {businessDetails.brandWebsite && ( <li> <a href={ businessDetails.brandWebsite ?? '' } target='_blank' className='fs-14 fw-500 color-0598ff text-decoration-none' > { <> <i className='icon-globe'></i> {Helper.niceString( businessDetails.brandWebsite, 20 )} </> }{' '} {!showSkeleton ? ( businessDetails.brandWebsite ? ( <FontAwesomeIcon icon={faExternalLink} /> ) : null ) : null} </a> </li> )} <li> <a onClick={downloadLicense} className='fs-15 fw-600 color-22a612 text-decoration-none' > <i className='icon-pdf-download'></i> <span className='text-decoration-underline'> Operating Licenses </span> </a> </li> </ul> </div> </div> <div className='d-flex align-items-center justify-content-around flex-wrap col-md-6 col-12'> <div> <span className='color-777777 fs-14 fw-500 text-center d-block'> State </span> <p className='fs-18 fw-600 color-white mb-0 text-center'> {businessDetails.state} </p> </div> {businessDetails.year && ( <div> <span className='color-777777 fs-14 fw-500 text-center d-block'> Year Founded </span> <p className='fs-18 fw-600 color-white mb-0 text-center'> {businessDetails.year ?? 'N/A'} </p> </div> )} </div> </div> </li> <li> <ul className='listing-24p list-33'> <li> <div className='d-flex flex-wrap follo-main'> <div className='border-right'> {followersCount > 0 ? ( <Link href={ '/followers/' + businessDetails.userSlug } > <a> <span className='fs-16 fw-500 color-777777 d-block mb-6 text-center'> Followers </span> <p className='fs-16 fw-500 color-white mb-0 text-center'> {followersCount} </p> </a> </Link> ) : ( <div> <span className='fs-16 fw-500 color-777777 d-block mb-6 text-center'> Followers </span> <p className='fs-16 fw-500 color-white mb-0 text-center'> {followersCount} </p> </div> )} </div> <div className='border-right'> {followingsCount > 0 ? ( <Link href={ '/following/' + businessDetails.userSlug } > <a> <span className='fs-16 fw-500 color-777777 d-block mb-6 text-center'> Following </span> <p className='fs-16 fw-500 color-white mb-0 text-center'> {followingsCount} </p> </a> </Link> ) : ( <div> <span className='fs-16 fw-500 color-777777 d-block mb-6 text-center'> Following </span> <p className='fs-16 fw-500 color-white mb-0 text-center'> {followingsCount} </p> </div> )} </div> </div> </li> <li> <div className='d-flex flex-wrap justify-content-center'> {!isLoggedIn ? ( <Link href={`/sign-in`}> <a className='btn-wh-150-46 btn btn-primary br-30 position-static top-0 end-0 me-sm-3 mx-2' style={{ transform: 'none' }} > <span className='fs-20 v-align-middle'> <i className='icon icon-add-friend'></i> </span>{' '} Follow </a> </Link> ) : ( isLoggedIn && +userRoleWiseId !== +businessDetails?.id && ( <a className='btn-wh-150-46 btn btn-primary br-30 position-static top-0 end-0 me-sm-3 mx-2' style={{ transform: 'none' }} onClick={handleFollow} > <span> <i className='icon icon-add-friend'></i> </span>{' '} {followStatus} </a> ) )} {!isLoggedIn ? ( <Link href={`/sign-in`}> <a className='btn-wh-150-46 btn btn-secondary br-30'> <span className='fs-20 v-align-middle'> <FontAwesomeIcon icon={faCommentDots} /> </span>{' '} Message </a> </Link> ) : isLoggedIn && getSingle('role') !== '2' ? ( <a className='btn-wh-150-46 btn btn-secondary br-30 mx-2' onClick={handleMessage} > <span> <FontAwesomeIcon icon={faCommentDots} /> </span>{' '} Message </a> ) : null} </div> </li> <li> <div className='border-left'> <span className='color-777777 fs-14 fw-500 text-center d-block'> Total Orders Completed </span> <p className='fs-18 fw-600 color-white mb-0 text-center'> {businessDetails.totalOrdersCompleted} </p> </div> </li> </ul> </li> </ul> </li> </ul> <ul className='listing-24p rating-listing'> <li className='fs-16 fw-500 color-white d-block mb-6 text-center'> <span className='fs-16 fw-500 color-white d-block mb-6 text-center'> Product Quality </span> <p className='mb-0 text-center'> <span className='color-22a612'> {' '} <FontAwesomeIcon icon={faStar} /> </span> <span className='star-count'> {businessDetails.avgProductRating}/5 </span> <span className='fs-14 fw-300 color-white'> ({businessDetails.reviewsProductCount} Reviews) </span> </p> </li> <li> <span className='fs-16 fw-500 color-white d-block mb-6 text-center'> Delivers on Times </span> <p className='mb-0 text-center'> <span className='color-22a612'> <FontAwesomeIcon icon={faStar} /> </span> <span className='star-count'> {businessDetails.avgDOTRating}/5 </span> <span className='fs-14 fw-300 color-white'> ({businessDetails.reviewsDOTCount} Reviews) </span> </p> </li> <li> <span className='fs-16 fw-500 color-white d-block mb-6 text-center'> Response Time </span> <p className='mb-0 text-center'> <span className='color-22a612'> <FontAwesomeIcon icon={faStar} /> </span> <span className='star-count'> {businessDetails.avgGeneralRating}/5 </span> <span className='fs-14 fw-300 color-white'> ({businessDetails.reviewsGeneralCount} Reviews) </span> </p> </li> <li> <span className='fs-16 fw-500 color-white d-block mb-6 text-center'> Brand Score </span> <p className='mb-0 text-center'> <span className='color-22a612'> <FontAwesomeIcon icon={faStar} /> </span> <span className='fs-20 fw-600 color-22a612 m-l-10'> {businessDetails.avgRating}/15 </span> </p> </li> </ul> </div> {businessDetails?.description && ( <Card className='card-dark border-gray mb-30 overflow-hidden'> <Card.Header className='bg-color-3d3d3d fs-18 fw-600 color-white border-bottom-gray-light p-13-20'> Description </Card.Header> <Card.Body className='bg-color-191919 fs-14 fw-30 color-white o-09 p-20-20-30-20'> {businessDetails.description} </Card.Body> </Card> )} <div className='custom-tabs'> <Tabs defaultActiveKey='product'> <Tab eventKey='product' title='Product'> <div className='table-wrap br-t-l-0 br-t-r-0'> {/* <Table bordered hover variant="dark" id="seller_detail"> */} <ResponsiveTable className='table table-bordered table-hover table-dark' id='seller_detail' > <Thead> { <Tr> <Th width='250px;'>Product</Th> {isLoggedIn && ( <> <Th className='text-center' width='70px;'> Price/Package </Th> </> )} <Th className='text-center' width='120px;'> Unit Weight </Th> <Th className='text-center' width='90px;'> Unit/Package </Th> <Th className='text-center' width='90px;'> THC% </Th> <Th className='text-center' width='500px;'> Action </Th> </Tr> } </Thead> <Tbody> {products.length > 0 ? ( products.map((rowData, keyIndex) => ( <Tr key={keyIndex + 'product'}> <Td> <Link href={'/product/' + rowData.slug}> <a className='color-f3772c d-inline-block'> {Helper.niceString( rowData.title, 20, true )} </a> </Link> <br /> {Helper.niceString( rowData.category?.title, 14, true )} {rowData.subcategory?.title && ( <> <br /> {Helper.niceString( rowData.subcategory?.title, 16, true )} </> )} </Td> {isLoggedIn && ( <> <Td className='text-center'> {!commaSeparatedStringWithIncludes( rowData?.user?.brand ?.blockedRetailers, getSingle('userId') ) ? ( <> {rowData.productPrice} {rowData.isShowStock && ( <> <br /> {rowData.packagesInStock} Left </> )} </> ) : ( '-' )} </Td> </> )} <Td className='text-center'> {rowData?.unitWeight} </Td> <Td className='text-center'> {rowData?.unitPerPackage} </Td> <Td className='text-center'> {rowData?.thc}% </Td> <Td className='text-center'> <Link href={'/product/' + rowData.slug}> <a className='action-btn color-white text-decoration-none'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={ <Tooltip>View Product</Tooltip> } > <FontAwesomeIcon icon={faEye} /> </OverlayTrigger> </a> </Link> {getSingle('role') !== '2' ? ( <> {isLoggedIn ? ( <FavouriteBtn isFavourite={ rowData.productFavourites.length } productSlug={rowData.slug} /> ) : ( <Link href={'/sign-in'}> <a> <FavouriteBtn isFavourite={false} productSlug={rowData.slug} /> </a> </Link> )} {isLoggedIn ? ( <Link href={`/messages/${rowData.user?.brand?.slug}`} > <a className='action-btn color-f3772c'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={ <Tooltip>Message</Tooltip> } > <FontAwesomeIcon icon={faCommentDots} /> </OverlayTrigger> </a> </Link> ) : ( <Link href={`/sign-in`}> <a className='action-btn color-f3772c'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={ <Tooltip>Message</Tooltip> } > <FontAwesomeIcon icon={faCommentDots} /> </OverlayTrigger> </a> </Link> )} </> ) : null} <Link href={ '/brand/' + rowData.user?.brand?.slug } > <a className='action-btn color-white text-decoration-none'> <OverlayTrigger placement='top' delay={{ show: 250, hide: 400 }} overlay={ <Tooltip>View Brand</Tooltip> } > <i className='icon-user-view'></i> </OverlayTrigger> </a> </Link> {!commaSeparatedStringWithIncludes( rowData?.user?.brand?.blockedRetailers, getSingle('userId') ) && getSingle('role') !== '2' && ( <> <Button varient='primary' onClick={() => { handleRequestOrder(rowData?.slug); }} className='btn btn-wh-110-28 br-6 ' > <span className='fs-14 me-2'> <i className='far fa-shopping-cart'></i> </span>{' '} {isCartLoading ? ( <Spinner animation='border' /> ) : ( 'Add to cart' )} </Button> </> )} </Td> </Tr> )) ) : ( <Tr> <Td className='text-center' colSpan={10}> No records found! </Td> </Tr> )} </Tbody> </ResponsiveTable> </div> </Tab> <Tab eventKey='activity' title='Activity'> <Card className='p-0 bg-transparent bs-none border-0'> <Card.Body className='p-0'> <Row> <Col lg={11} className='mx-auto'> {userRoleWiseId === businessDetails.id ? ( <ActivityPost activityComment={activityComment} searchValue={searchValue} attachments={attachments} attachmentsHandler={attachmentsHandler} deleteHandler={deleteHandler} postContentHandler={postContentHandler} postContentHandlerSelect={ postContentHandlerSelect } submitPost={submitPost} userImage={userImage} isEnable={isEnable} isMediaEnable={isMediaEnable} selectedMediaFile={selectedMediaFile} isPostLoading={isPostLoading} users={users} /> ) : null} </Col> </Row> <Row> <Col lg={11} className='mx-auto'> <ActivityList activities={activities} totalActivities={totalActivities} fetchMoreActivity={fetchMoreActivity} handleShow={handleShow} handleShowCommentModal={handleShowCommentModal} likesClickHandler={likesClickHandler} repostsClickhandler={repostsClickhandler} /> </Col> </Row> </Card.Body> </Card> </Tab> <Tab eventKey='review' title='Review'> <div className='box-dark mb-30 overflow-hidden'> <ul className='listing-33p rating-listing'> <li className='ps-xl-5'> <span className='fs-16 fw-500 color-777777 d-block mb-6'> Product Quality </span> <p className='mb-0'> <span className='color-22a612'> {' '} <FontAwesomeIcon icon={faStar} /> </span> <span className='star-count'> {businessDetails.avgProductRating}/5 </span> <span className='fs-14 fw-300 color-white'> ({businessDetails.reviewsProductCount} Reviews) </span> </p> </li> <li className='ps-xl-5'> <span className='fs-16 fw-500 color-777777 d-block mb-6'> Delivers on Times </span> <p className='mb-0'> <span className='color-22a612'> <FontAwesomeIcon icon={faStar} /> </span> <span className='star-count'> {businessDetails.avgDOTRating}/5 </span> <span className='fs-14 fw-300 color-white'> ({businessDetails.reviewsDOTCount} Reviews) </span> </p> </li> <li className='ps-xl-5'> <span className='fs-16 fw-500 color-777777 d-block mb-6'> Response Time </span> <p className='mb-0'> <span className='color-22a612'> <FontAwesomeIcon icon={faStar} /> </span> <span className='star-count'> {businessDetails.avgGeneralRating}/5 </span> <span className='fs-14 fw-300 color-white'> ({businessDetails.reviewsGeneralCount} Reviews) </span> </p> </li> </ul> </div> <div className='custom-tabs'> <Tabs defaultActiveKey='product' id='uncontrolled-tab'> <Tab eventKey='product' title='Product Quality'> <ul className='comment-listing'> {isLoading ? ( [...Array(5)].map((d, index) => { return ( <li className='comment-wrap' key={index}> <Figure className='mb-0 w-60 h-60 br-50p'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={60} height={60} /> </SkeletonTheme> </Figure> <div className='comment-detail'> <h5 className='fs-16 fw-600 color-white mb-0'> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} /> </SkeletonTheme> ) : ( <> 'Tina Lee'{' '} <date className='fs-13 fw-500 color-8c8c8c f-style-italic p-l-10'> <FontAwesomeIcon icon={faCalendarAlt} />{' '} 11 Jan'22 </date> </> )} </h5> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} className='product-rating' /> </SkeletonTheme> ) : ( <p className='product-rating'> Product Quality{' '} <span> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> </span> </p> )} <p className='fs-14 fw-300 color-white o-08 mt-6'> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton count={5} /> </SkeletonTheme> ) : ( 'dummy text' )} </p> </div> </li> ); }) ) : ( <> <InfiniteScroll dataLength={productQuality.length} next={fetchMoreData} hasMore={hasMore} loader={ isLoading ? [...Array(3)].map( (elementInArray, index) => ( <Card key={index}> <Card.Header> <Row> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> </Row> </Card.Header> </Card> ) ) : null } > <> {productQuality.length > 0 ? ( productQuality.map( (rowData, keyIndex) => ( <li key={keyIndex + 'rview'} className='comment-wrap' > <Figure className='mb-0 w-60 h-60 br-50p border-white-2'> <Figure.Image src={ ASSETS_URL + (rowData.retailer .profilePath ?? '/profile/no-profile-image.jpg') } className='cover circle' /> </Figure> <div className='comment-detail'> <h5 className='fs-16 fw-600 color-white mb-0'> {rowData.retailer.fullName}{' '} <date className='fs-13 fw-500 color-8c8c8c f-style-italic p-l-10'> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {moment( rowData.createdAt ).format(customFormat)} </date> </h5> <p className='product-rating'> Product Quality <span> <ReactStars count={5} size={13} value={rowData.ratings} isHalf={true} emptyIcon={ <div style={{ color: '#8c8c8c', }} > {' '} <i className='fas fa-star' /> </div> } halfIcon={ <i className='fa fa-star-half-alt' /> } filledIcon={ <i className='fa fa-star' /> } activeColor='#22a612' edit={false} /> </span> </p> <p className='fs-14 fw-300 color-white o-08 mt-6'> {rowData.description} </p> </div> </li> ) ) ) : ( <div className='text-center'> {' '} No records found!{' '} </div> )} </> </InfiniteScroll> </> )} </ul> </Tab> <Tab eventKey='deliveryTime' title='Delivery On Time'> <ul className='comment-listing'> {isLoading ? ( [...Array(5)].map((d, index) => { return ( <li className='comment-wrap' key={index + 'dot'} > <Figure className='mb-0 w-60 h-60 br-50p'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={60} height={60} /> </SkeletonTheme> </Figure> <div className='comment-detail'> <h5 className='fs-16 fw-600 color-white mb-0'> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} /> </SkeletonTheme> ) : ( <> 'Tina Lee'{' '} <date className='fs-13 fw-500 color-8c8c8c f-style-italic p-l-10'> <FontAwesomeIcon icon={faCalendarAlt} />{' '} 11 Jan'22 </date> </> )} </h5> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} className='product-rating' /> </SkeletonTheme> ) : ( <p className='product-rating'> Product Quality{' '} <span> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> </span> </p> )} <p className='fs-14 fw-300 color-white o-08 mt-6'> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton count={5} /> </SkeletonTheme> ) : ( 'dummy text' )} </p> </div> </li> ); }) ) : ( <> <InfiniteScroll dataLength={deliveryTime.length} next={fetchMoreData} hasMore={hasMore} loader={ isLoading ? [...Array(3)].map( (elementInArray, index) => ( <Card key={index + 'infiniteScroll'} > <Card.Header> <Row> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> </Row> </Card.Header> </Card> ) ) : null } > <> {deliveryTime.length > 0 ? ( deliveryTime.map( (rowData, keyIndex) => ( <li key={keyIndex + 'delivery'} className='comment-wrap' > <Figure className='mb-0 w-60 h-60 br-50p border-white-2'> <Figure.Image src={ ASSETS_URL + (rowData.retailer .profilePath ?? '/profile/no-profile-image.jpg') } className='cover circle' /> </Figure> <div className='comment-detail'> <h5 className='fs-16 fw-600 color-white mb-0'> {rowData.retailer.fullName}{' '} <date className='fs-13 fw-500 color-8c8c8c f-style-italic p-l-10'> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {moment( rowData.createdAt ).format(customFormat)} </date> </h5> <p className='product-rating'> Delivery on Time{' '} <span> <ReactStars count={5} size={13} value={rowData.ratings} isHalf={true} emptyIcon={ <div style={{ color: '#8c8c8c', }} > {' '} <i className='fas fa-star' /> </div> } halfIcon={ <i className='fa fa-star-half-alt' /> } filledIcon={ <i className='fa fa-star' /> } activeColor='#22a612' edit={false} /> </span> </p> <p className='fs-14 fw-300 color-white o-08 mt-6'> {rowData.description} </p> </div> </li> ) ) ) : ( <div className='text-center'> {' '} No records found!{' '} </div> )} </> </InfiniteScroll> </> )} </ul> </Tab> <Tab eventKey='general' title='Response Time'> <ul className='comment-listing'> {isLoading ? ( [...Array(5)].map((d, index) => { return ( <li key={index + 'list'} className='comment-wrap' > <Figure className='mb-0 w-60 h-60 br-50p'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={60} height={60} /> </SkeletonTheme> </Figure> <div className='comment-detail'> <h5 className='fs-16 fw-600 color-white mb-0'> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} /> </SkeletonTheme> ) : ( <> 'Tina Lee'{' '} <date className='fs-13 fw-500 color-8c8c8c f-style-italic p-l-10'> <FontAwesomeIcon icon={faCalendarAlt} />{' '} 11 Jan'22 </date> </> )} </h5> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton width={250} className='product-rating' /> </SkeletonTheme> ) : ( <p className='product-rating'> Product Quality{' '} <span> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> <FontAwesomeIcon icon={faStar} /> </span> </p> )} <p className='fs-14 fw-300 color-white o-08 mt-6'> {isLoading ? ( <SkeletonTheme baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton count={5} /> </SkeletonTheme> ) : ( 'dummy text' )} </p> </div> </li> ); }) ) : ( <> <InfiniteScroll dataLength={general.length} next={fetchMoreData} hasMore={hasMore} loader={ isLoading ? [...Array(3)].map( (elementInArray, index) => ( <Card key={index + 'infi'}> <Card.Header> <Row> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> <Col> <SkeletonTheme height={25} width={200} baseColor={ SkeletonOptions.baseColor } highlightColor={ SkeletonOptions.highlightColor } > <Skeleton /> </SkeletonTheme> </Col> </Row> </Card.Header> </Card> ) ) : null } > <> {general.length > 0 ? ( general.map((rowData, keyIndex) => ( <li className='comment-wrap' key={keyIndex + 'gen'} > <Figure className='mb-0 w-60 h-60 br-50p border-white-2'> <Figure.Image src={ ASSETS_URL + (rowData.retailer .profilePath ?? '/profile/no-profile-image.jpg') } className='cover circle' /> </Figure> <div className='comment-detail'> <h5 className='fs-16 fw-600 color-white mb-0'> {rowData.retailer.fullName}{' '} <date className='fs-13 fw-500 color-8c8c8c f-style-italic p-l-10'> <FontAwesomeIcon icon={faCalendarAlt} />{' '} {moment( rowData.createdAt ).format(customFormat)} </date> </h5> <p className='product-rating'> Professionalism{' '} <span> <ReactStars count={5} size={13} value={rowData.ratings} isHalf={true} emptyIcon={ <div style={{ color: '#8c8c8c', }} > {' '} <i className='fas fa-star' /> </div> } halfIcon={ <i className='fa fa-star-half-alt' /> } filledIcon={ <i className='fa fa-star' /> } activeColor='#22a612' edit={false} /> </span> </p> <p className='fs-14 fw-300 color-white o-08 mt-6'> {rowData.description} </p> </div> </li> )) ) : ( <div className='text-center'> {' '} No records found!{' '} </div> )} </> </InfiniteScroll> </> )} </ul> </Tab> </Tabs> </div> </Tab> </Tabs> </div> </div> </Col> </Row> </Container> </section> <LightboxModal sliderIndex={activeIndex} images={individualPostAttachments} show={show} handleClose={handleClose} /> <CommentModal showCommentModal={isCommentModal} handleCloseCommentModal={handleCloseCommentModal} postId={selectedPostId} userImage={userImage} /> <RepostModal show={showRepostModal} hide={repostsModalClose} reposts={reposts} repostsCount={repostsCount} fetchMoreReposts={fetchMoreReposts} /> <LikeModal show={showLikeModal} hide={likesModalClose} likes={likes} likesCount={likesCount} fetchMoreLikes={fetchMoreLikes} /> </> ); } export default SellerDetails; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); try { const { slug } = context.params; let businessDetails = {}; let products = []; const token = contextCookie(context, 'token'); const userImage = contextCookie(context, 'userImage'); const response = await Rest.axiosRequest( API.brandDetails + `/${slug}`, {}, 'GET', false, token ); if (response.status === 200) { const result = response?.data?.data; // const medRecId = contextCookie(context, 'medRecId'); // if ( // isLoggedIn && // medRecId !== result?.brandData?.brandCompany?.medRecId // ) { // return { notFound: true }; // } businessDetails = { brandName: result?.brandData?.brandName ?? '', brandWebsite: result?.brandData?.website ?? '', brandLogo: result?.brandData?.profilePath ?? 'uploads/profile/seller-default.png', state: result?.brandData?.brandCompany?.state?.name ?? '', year: result?.brandData?.brand?.year ?? '', totalOrdersCompleted: result?.brandData.totalOrdersCompleted ?? 0, avgProductRating: result?.brandData.avgProductRating ?? 0, avgDOTRating: result?.brandData.avgDOTRating ?? 0, avgGeneralRating: result?.brandData.avgGeneralRating ?? 0, avgRating: result?.brandData.avgRating ?? 0, description: result?.brandData?.brand?.description ?? '', // reviewsCount: result?.brandData.reviewsCount ?? 0, reviewsDOTCount: result?.brandData.reviewsDOTCount ?? 0, reviewsGeneralCount: result?.brandData.reviewsGeneralCount ?? 0, reviewsProductCount: result?.brandData.reviewsProductCount ?? 0, certificatePath: result?.brandData?.brandCompany?.certificatePath ?? '', canMessage: result?.brandData.canMessage ?? '', userSlug: result?.brandData?.slug ?? '', id: result?.brandData?.id ?? '', userId: result?.brandData?.userId ?? '', userFollowed: isLoggedIn ? result?.brandData.userFollowed ?? false : false, // followersCount: result?.brandData?.followers?.length ?? 0, // followingsCount: result?.brandData?.followings?.length ?? 0, followersCount: result?.brandData?.followersCount ?? 0, followingsCount: result?.brandData?.followingsCount ?? 0, }; products = result?.products ?? []; } else { return { notFound: true, }; } return { props: { isLoggedIn, businessDetails, products, userImage, }, }; } catch (e) { console.log(e.message); return { redirect: { destination: '/500' }, }; } }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/following/[slug].js
import React, { useEffect, useState } from 'react'; import { Container, Row, Col, Tabs, Tab, Button, Figure, ListGroup, Card } from "react-bootstrap"; import ReactPaginate from 'react-paginate'; import { useRouter } from 'next/router'; import Rest from '../../config/rest.config'; import API from '../../config/endpoints.config'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { contextCookie, getSingle } from '../../services/Auth'; import FollowingListItem from '../../components/FollowingListItem'; import FollowerListItem from '../../components/FollowerListItem'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faArrowLeft, } from '@fortawesome/free-solid-svg-icons'; const baseColor = "#202020"; const highlightColor = "#444"; function Following({ slug }) { const router = useRouter(); const [showSkeleton, setShowSkeleton] = useState(true); const [followings, setFollowings] = useState([]); const [totalPages, setTotalPages] = useState(1); const [limit, setLimit] = useState(10); const handleSelect = (eventKey) => { switch (eventKey) { case 'followers': return router.push({ pathname: '/followers/[slug]', query: { slug: slug }, }) break; case 'following': return router.push({ pathname: '/following/[slug]', query: { slug: slug }, }) break; default: return router.reload(); } } const handlePageChange = (event) => { router.push('?offset=' + event.selected, undefined, { shallow: true }); }; const deleteFollowing = (followingId) => { const data = followings.filter(i => i.id !== followingId); setFollowings(data); } useEffect(() => { const getFollowings = async () => { setShowSkeleton(true); let response = await Rest.axiosRequest(`${API.followings}/${slug}` + `?` + new URLSearchParams({ limit: limit, offset: '0', ...router.query }).toString(), {}, "GET", false, getSingle('token')); response = response.data; if (response.status) { setFollowings(response.data.followings); setTotalPages(response.data.totalPages); } setShowSkeleton(false); } getFollowings(); }, [limit, router.query]); return ( <> <section className="bg-black p-27-0-55"> <Container> <Row> <Col lg={10} className="mx-auto"> <Card className="card-dark card-post card-axis-point border-gray-1"> <Card.Header> <div className="d-flex align-items-center"> <a className="d-flex align-items-center" onClick={() => router.back()}> <span className="text-white fs-20 me-3" > <FontAwesomeIcon icon={faArrowLeft} /> </span> </a> <h3 className="text-white fs-18 mb-0">{getSingle('fullName')}</h3> </div> </Card.Header> <Card.Body> <div className="custom-tabs theme-dark"> <Tabs defaultActiveKey="following" onSelect={handleSelect}> <Tab eventKey="followers" title="Followers"> </Tab> <Tab eventKey="following" title="Following"> <ListGroup variant="flush" className="list-black"> {showSkeleton ? [...Array(10)].map((arrayData, index) => { return ( <div key={index + "skeleton"} className="d-flex justify-content-between align-items-center px-5 list-group-item"> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor}> <div className="d-flex align-items-center"> <Skeleton circle={true} height={40} width={40} className="mb-0 me-3" /> <Skeleton width={200} height={20} /> </div> <Skeleton width={100} height={30} className="me-2" /> </SkeletonTheme> </div> ) }) : followings.length > 0 ? followings.map((following, index) => <ListGroup.Item key={index}> <FollowingListItem key={index} following={following} /> </ListGroup.Item> ) : <div className="d-flex justify-content-center align-items-center fs-16 fw-500 p-2"> No records found! </div>} </ListGroup> </Tab> </Tabs> <div className='mt-5 d-flex justify-content-center'> { totalPages > 1 && <ReactPaginate previousLabel={<i className="fas fa-long-arrow-alt-left"></i>} nextLabel={<i className="fas fa-long-arrow-alt-right"></i>} pageClassName="page-item" pageLinkClassName="page-link" previousClassName="page-item prev-item" previousLinkClassName="page-link" nextClassName="page-item next-item" nextLinkClassName="page-link" breakLabel="..." breakClassName="page-item" breakLinkClassName="page-link" pageCount={totalPages} //marginPagesDisplayed={1} pageRangeDisplayed={5} onPageChange={handlePageChange} containerClassName="pagination" activeClassName="active" forcePage={parseInt(router.query.offset ?? 0)} /> } </div> </div> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ) } export default Following export async function getServerSideProps(context) { const { slug } = context.params return { props: { slug }, } }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/account/delete.js
import Link from "next/link"; import { useRouter } from 'next/router' import { Container, Row, Col, Card, Button, Form } from "react-bootstrap"; import Swal from 'sweetalert2'; import Rest from '../../config/rest.config'; import API from '../../config/endpoints.config'; import { logout } from "../../services/Auth"; import Notifier from "../../components/Notifier"; export default function Delete(){ const router = useRouter(); const noti = new Notifier(); const handleDelete = () => { Swal.fire({ title: 'Are you sure?', text: "", icon: 'warning', showCancelButton: true, confirmButtonColor: '#22a612', cancelButtonColor: '#d93737', confirmButtonText: 'Yes, delete it!', background: '#191919', customClass: { popup: 'swal2-dark', } }).then(async (result) => { if (result.isConfirmed) { const response = await Rest.axiosRequest(API.deletAccount, {}); if(response.data.status){ noti.notify(response.data.message, "success"); logout(); router.replace('/sign-in') } else{ noti.notify(response.data.message, "danger"); } } }) } return ( <section className="bg-black p-30-0-60"> <Container> <Row> <Col lg={12} className="mx-auto"> <Card className="card-dark border-gray p-15-20-20 br-10 mh-275"> <Card.Header className="border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-13"> <Card.Title className="fs-18 fw-700 color-dcdcdc mb-0">Delete Account</Card.Title> </Card.Header> <Card.Body className="p-0"> <Row> <Col lg={12}> <Form.Group className="mb-3"> <Form.Label className="color-dcdcdc">Are you sure you want to delete the account?</Form.Label> </Form.Group> <Form.Group className="mb-3"> <Button variant="primary" className="btn-wh-184-51 btn-rounded" onClick={handleDelete}>Delete</Button> </Form.Group> </Col> </Row> </Card.Body> </Card> </Col> </Row> </Container> </section> ) }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/account/index.js
import React, { useContext, useEffect, useRef, useState } from 'react'; import { Container, Row, Col, Card, Form, Button, Spinner, OverlayTrigger, Tooltip, } from 'react-bootstrap'; import Link from 'next/link'; import { useRouter } from 'next/router'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faEdit, faLocation, faQuestionCircle, } from '@fortawesome/free-solid-svg-icons'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { saveAs } from 'file-saver'; import Select from 'react-select'; import { DropdownIndicator, react_select_lg_Styles, } from '../../components/DropDown'; // import Datetime from "react-datetime"; import moment from 'moment'; import 'react-datetime/css/react-datetime.css'; import FormValidator from '../../components/FormValidator'; import Notifier from '../../components/Notifier'; import { contextCookie, updateSingle } from '../../services/Auth'; import { Helper } from '../../services/Helper'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { SkeletonOptions } from '../../services/SkeletonOptions'; import { APP_NAME, ASSETS_URL, REACT_APP_API_BASE_URL, } from '../../config/server.config'; import Meta from '../../components/Meta'; import CustomDatePicker from '../../components/CustomDatePicker'; function MyAccount() { const noti = new Notifier(); const locationRef = useRef(null); const router = useRouter(); const validator = new FormValidator([ { field: 'name', method: 'isEmpty', validWhen: false, message: 'Please enter name.', }, { field: 'companyName', method: 'isEmpty', validWhen: false, message: 'Please enter company name.', }, // { // field: 'phoneNumber', // method: 'isEmpty', // validWhen: false, // message: 'Please select store phone number.', // }, // { // field: 'stateId', // method: 'isEmpty', // validWhen: false, // message: 'Please select state.', // }, // { // field: 'zipCode', // method: 'isEmpty', // validWhen: false, // message: 'Please enter zip code.', // }, // { // field: 'zipCode', // method: 'isLength', // args: [5, 5], // validWhen: true, // message: 'Zipcode should be 5 characters long.', // }, // { // field: 'licenseNumber', // method: 'isEmpty', // validWhen: false, // message: 'Please enter license number.', // }, { field: 'medRecId', method: 'isEmpty', validWhen: false, message: 'Please select license type.', }, // { // field: 'licenseExpirationDate', // method: 'isEmpty', // validWhen: false, // message: 'Please enter expiration date.', // }, // { // field: 'address', // method: 'isEmpty', // validWhen: false, // message: 'Please enter address.', // }, // { // field: "licenseDocument", // method: checkFileType, // validWhen: false, // message: "Please upload valid license document.", // } ]); const passwordMatch = (confirmation, state) => { if ( changePasswordState.newPassword !== '' && changePasswordState.confirmNewPassword !== '' && changePasswordState.newPassword === changePasswordState.confirmNewPassword ) { return false; } else { return true; } }; const changePasswordValidator = new FormValidator([ { field: 'currentPassword', method: 'isEmpty', validWhen: false, message: 'Please enter current password.', }, { field: 'currentPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'Current password should be minimum 6 and maximum 20 characters.', }, { field: 'newPassword', method: 'isEmpty', validWhen: false, message: 'Please enter new password.', }, { field: 'newPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'New password should be minimum 6 and maximum 20 characters.', }, { field: 'confirmNewPassword', method: 'isEmpty', validWhen: false, message: 'Please enter confirm new password.', }, { field: 'confirmNewPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'Confirm new password should be minimum 6 and maximum 20 characters.', }, { field: 'confirmNewPassword', method: passwordMatch, validWhen: false, message: 'Please enter same as new password.', }, ]); const [profileData, setProfileData] = useState({ profilePath: '/profile/no-profile-image.jpg', //profileDocument: '', name: '', companyName: '', contactNumber: null, contactEmail: null, //phoneNumber: '', website: null, // stateId: '', // zipCode: '', // licenseNumber: '', medRecId: '', // licenseExpirationDate: '', // medRecCertificatePath: '', // address: '', }); const [showSkeleton, setShowSkeleton] = useState(true); const [showLoading, setShowLoading] = useState(false); // const [states, setStates] = useState([]); const [medRecs, setMedRecs] = useState([]); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const [showChangePassLoading, setChangePassShowLoading] = useState(false); const [changePasswordState, setChangePasswordState] = useState({ currentPassword: '', newPassword: '', confirmNewPassword: '', }); const [changePasswordValidation, setChangePasswordValidation] = useState( changePasswordValidator.valid() ); const [changePasswordsubmitted, setChangePasswordSubmitted] = useState(false); useEffect(async () => { const response = await Rest.axiosRequest(API.userProfile, {}, 'GET'); if (response.status === 200) { response.data.data.companyName = response?.data?.data?.retailerCompany?.companyName ?? ''; response.data.data.contactNumber = response?.data?.data?.retailerCompany?.contactNumber ?? ''; response.data.data.contactEmail = response?.data?.data?.retailerCompany?.contactEmail ?? ''; response.data.data.profilePath = response?.data?.data?.retailerCompany.profilePath !== null ? response?.data?.data?.retailerCompany.profilePath : profileData.profilePath; response.data.data.website = response?.data?.data?.retailerCompany?.website ?? ''; // response.data.data.stateId = // response?.data?.data?.retailerCompany?.stateId ?? ''; // response.data.data.zipCode = // response?.data?.data?.retailerCompany?.zipCode ?? ''; // response.data.data.licenseNumber = // response?.data?.data?.retailerCompany?.licenseNumber ?? ''; response.data.data.medRecId = response?.data?.data?.retailerCompany?.medRecId ?? ''; // response.data.data.licenseExpirationDate = // response?.data?.data?.retailerCompany?.licenseExpirationDate ?? ''; // response?.data?.data?.retailerCompany.medRecCertificatePath = // response?.data?.data?.retailerCompany.medRecCertificatePath !== null // ? response?.data?.data?.retailerCompany.medRecCertificatePath // : ''; // response.data.data.address = response?.data?.data?.business.address ?? ''; // locationRef.current.value = response?.data?.data?.business?.address ?? ''; setProfileData(response.data.data); setShowSkeleton(false); } else { noti.notify(response.data.message, 'danger'); } // const statesData = await Rest.axiosRequest(API.getStates, {}, 'GET'); // if (statesData.status === 200) { // const states = []; // statesData.data.data.map((state) => { // states.push({ // id: state.id, // value: state.id, // name: state.name, // label: state.name, // }); // }); // setStates(states); // } else { // noti.notify(statesData.data.message, 'danger'); // } const medRecData = await Rest.axiosRequest(API.getMedrec, {}, 'GET'); if (medRecData && medRecData.status === 200) { const medRecs = []; medRecData.data.data.map((medRec) => { medRecs.push({ id: medRec.id, value: medRec.id, name: medRec.title, label: medRec.title, }); }); setMedRecs(medRecs); } else { noti.notify(medRecData.data.message, 'danger'); } // const autoCompleteAddress = new google.maps.places.Autocomplete( // document.getElementById('address'), // { componentRestrictions: { country: ['US'] } } // ); // google.maps.event.addListener( // autoCompleteAddress, // 'place_changed', // function () { // setProfileData((prevState) => ({ // ...prevState, // address: locationRef.current.value, // })); // } // ); }, []); const downloadFile = (filePath) => { saveAs(REACT_APP_API_BASE_URL + '/get/file' + filePath); }; const onChangeHandler = async (event) => { const { name, value } = event.target; if (name === 'zipCode' && value < 1) { return; } setProfileData((prevState) => ({ ...prevState, [name]: value })); }; // const handleChangeSelectState = (val) => { // if (val) { // setProfileData((prevState) => ({ ...prevState, stateId: val.value })); // } else { // setProfileData((prevState) => ({ ...prevState, stateId: '' })); // } // }; const handleChangeSelectLicenseType = (val) => { if (val) { setProfileData((prevState) => ({ ...prevState, medRecId: val.value })); } else { setProfileData((prevState) => ({ ...prevState, medRecId: '' })); } }; const documentHandler = (event) => { let selectedFile = event.target.files[0]; if (selectedFile) { let fileType = selectedFile.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); const { name, files } = event.target; if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setProfileData((prevState) => ({ ...prevState, [name]: files[0] })); if (name == 'profileDocument' && fileCheck && fileCheck.length > 0) { var file = event.target.files[0]; var reader = new FileReader(); var url = reader.readAsDataURL(file); reader.onloadend = function (e) { document.getElementById('preview_image').src = reader.result; }.bind(this); } } else { event.target.value = null; setProfileData((prevState) => ({ ...prevState, [name]: '' })); noti.notify( name == 'profileDocument' ? 'Please upload Image file only.' : 'Please upload Image or PDF file only.', 'danger' ); } } }; const handleChangeDate = (date) => { setProfileData((prevState) => ({ ...prevState, licenseExpirationDate: date.format('YYYY-MM-DD'), })); }; const updateUserDetails = async (e) => { e.preventDefault(); const validation = validator.validate(profileData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); let formData = new FormData(); for (let key in profileData) { formData.append(key, profileData[key]); } const response = await Rest.axiosRequest( API.userProfile, formData, 'PUT', true ); setShowLoading(false); if (response.status === 200) { updateSingle('userImage', response?.data?.data?.profilePath); updateSingle('userName', response?.data?.data?.companyName); const updatedData = { profilePath: response.data.data.profilePath, //profileDocument: response.data.data.profileDocument, name: response.data.data.name, companyName: response?.data?.data?.companyName, contactNumber: response?.data?.data?.contactNumber ?? '', contactEmail: response?.data?.data?.contactEmail ?? '', //phoneNumber: response.data.data.phoneNumber, website: response?.data?.data?.website ?? '', // stateId: response.data.data.stateId, // zipCode: response.data.data.zipCode, // address: response.data.data.address, // licenseNumber: response.data.data.licenseNumber, medRecId: response.data.data.medRecId, //licenseExpirationDate: response.data.data.licenseExpirationDate, //licenseDocument: response.data.data.licenseDocument, //medRecCertificatePath: response.data.data.medRecCertificatePath, }; setProfileData(updatedData); noti.notify(response.data.message, 'success'); setSubmitted(false); router.replace('/account'); } else { noti.notify(response.data.message, 'danger'); } } }; let inputProps = { placeholder: 'Select Expiration Date', readOnly: true, }; const changePassOnChangeHandler = (event) => { const { name, value } = event.target; setChangePasswordState((prevState) => ({ ...prevState, [name]: value.trim(), })); }; const handleChangePasswordSubmit = async (e) => { e.preventDefault(); const validation = changePasswordValidator.validate(changePasswordState); setChangePasswordValidation(validation); setChangePasswordSubmitted(true); if (validation.isValid) { setChangePassShowLoading(true); const response = await Rest.axiosRequest( API.changePassword, changePasswordState ); setChangePassShowLoading(false); if (response.data.status) { noti.notify(response.data.message, 'success'); setChangePasswordState({ currentPassword: '', newPassword: '', confirmNewPassword: '', }); setChangePasswordSubmitted(false); } else { if (response.data.message instanceof Array) { for (let msg in response.data.message) { noti.notify(response.data.message[msg], 'danger'); } } else { noti.notify(response.data.message, 'danger'); } } } }; const handleAddressKeyUp = (e) => { setProfileData((prevState) => ({ ...prevState, address: e.target.value })); }; let checkValidation = submitted ? validator.validate(profileData) : validation; let checkChangePasswordValidation = changePasswordsubmitted ? changePasswordValidator.validate(changePasswordState) : changePasswordValidation; return ( <> <Meta title={`My Account | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-20 br-10'> <Card.Header className='border-btm-gray mb-20 d-flex align-items-center'> <Card.Title className='fs-18 fw-600 color-dcdcdc mb-0'> My Account </Card.Title> <div className='ms-auto'> <Link href='/account/delete'> <a className='btn btn-primary br-6'>Delete Account</a> </Link> </div> </Card.Header> <Card.Body className='p-0'> <Row> <Col lg={3} md={4} sm={4}> <Form.Group className='mb-4 profile-box br-10 bg-color-333 border-gray'> <Form.Label>Profile Picture</Form.Label> <div className='userimg-wrap'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={96} circle={true} className='cover circle d-inline-block' /> </SkeletonTheme> ) : ( <> <img src={ASSETS_URL + profileData.profilePath} id='preview_image' className='cover circle' /> <div className='form-control upload_file br-50p w-28 h-28 bg-color-22a612' placeholder='' > <Form.Label htmlFor='document_upload' className=' profile-edit-btn' > <span> <FontAwesomeIcon icon={faEdit} /> </span> </Form.Label> <Form.Control type='file' id='document_upload' name='profileDocument' onChange={(e) => documentHandler(e)} accept='image/*' /> </div> </> )} </div> </Form.Group> </Col> <Col lg={9} md={8} sm={8}> <Row> {/*<Col lg={12}> <Form.Group className="mb-4 form-dark"> {showSkeleton ? <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor}> <Skeleton height={50}/> </SkeletonTheme> : <> <Form.Label>First Name</Form.Label> <Form.Control type="text" name="firstName" placeholder="Enter First Name" value={profileData.firstName} onChange={onChangeHandler}/> <div className={ checkValidation.firstName.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.firstName.message} </div> </div> </> } </Form.Group> </Col> <Col lg={12}> <Form.Group className="mb-4 form-dark"> {showSkeleton ? <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor}> <Skeleton height={50}/> </SkeletonTheme> : <> <Form.Label>Last Name</Form.Label> <Form.Control type="text" name="lastName" placeholder="Enter Last Name" value={profileData.lastName} onChange={onChangeHandler}/> <div className={ checkValidation.lastName.isInvalid ? 'animated fadeIn' : '' } > <div className="error"> {checkValidation.lastName.message} </div> </div> </> } </Form.Group> </Col>*/} <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Name</Form.Label> <Form.Control type='text' name='name' placeholder='Enter Name' value={profileData.name} onChange={onChangeHandler} /> <div className={ checkValidation.name.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.name.message} </div> </div> </> )} </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Email</Form.Label> <Form.Control type='email' name='email' placeholder='Enter Email' value={profileData.email} disabled /> </> )} </Form.Group> </Col> {/* <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Store Phone</Form.Label> <Form.Control type='number' name='phoneNumber' placeholder='Enter Phone Number' value={profileData.phoneNumber} onChange={onChangeHandler} min='0' /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.phoneNumber.message} </div> </div> </> )} </Form.Group> </Col> */} </Row> </Col> <Col lg={12}> <h4 className='fs-16 fw-600 color-dcdcdc mb-20 p-b-10 border-btm-gray'> Retailer Details </h4> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Company Name</Form.Label> <Form.Control type='text' name='companyName' placeholder='Enter Company Name' value={profileData.companyName} onChange={onChangeHandler} /> <div className={ checkValidation.companyName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.companyName.message} </div> </div> </> )} </Form.Group> </Col> {showSkeleton ? ( <Col lg={6}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label> Website<span>(optional)</span> </Form.Label> <Form.Control type='text' name='website' placeholder='Enter Website' value={profileData.website} onChange={onChangeHandler} /> </Form.Group> </Col> </> )} {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label> Company Contact Number <OverlayTrigger overlay={ <Tooltip id='tooltip-disabled'> This will be visible to other users on platform </Tooltip> } > <span className='d-inline-block'> <FontAwesomeIcon icon={faQuestionCircle} /> </span> </OverlayTrigger> </Form.Label> <Form.Control type='number' name='contactNumber' value={profileData.contactNumber} onChange={onChangeHandler} placeholder='Enter Company Contact Number' min='0' /> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label> Company Contact Email <OverlayTrigger overlay={ <Tooltip id='tooltip-disabled'> This will be visible to other users on platform </Tooltip> } > <span className='d-inline-block'> <FontAwesomeIcon icon={faQuestionCircle} /> </span> </OverlayTrigger> </Form.Label> <Form.Control type='email' name='contactEmail' value={profileData.contactEmail} onChange={onChangeHandler} placeholder='Enter Company Contact Email' /> </Form.Group> </Col> </> )} {showSkeleton ? ( <Col lg={6}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6} md={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Type</Form.Label> {/* {profileData.medRecCertificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.medRecCertificatePath ) } > (Download Certificate File) </a> )} */} <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} isDisabled={true} value={medRecs.filter( (item) => item.id == profileData.medRecId )} options={medRecs.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectLicenseType(val) } placeholder='Select License Type' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='medRecId' isClearable={true} /> <div className={ checkValidation.medRecId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecId.message} </div> </div> </Form.Group> </Col> {/* <Col lg={6} md={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>State</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={states.filter( (item) => item.id == profileData.stateId )} options={states.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectState(val)} placeholder='Select State' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='stateId' isClearable={true} /> <div className={ checkValidation.stateId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.stateId.message} </div> </div> </Form.Group> </Col> <Col lg={6} md={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>Zip Code</Form.Label> <Form.Control type='number' name='zipCode' placeholder='Enter Phone Number' value={profileData.zipCode} onChange={onChangeHandler} min='1' /> <div className={ checkValidation.zipCode.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.zipCode.message} </div> </div> </Form.Group> </Col> */} </> )} {/* {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6} md={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Number</Form.Label> <Form.Control type='text' name='licenseNumber' placeholder='Enter License Number' value={profileData.licenseNumber} onChange={onChangeHandler} /> <div className={ checkValidation.licenseNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseNumber.message} </div> </div> </Form.Group> </Col> <Col lg={6} md={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Type</Form.Label> {profileData.medRecCertificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.medRecCertificatePath ) } > (Download Certificate File) </a> )} <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} isDisabled={true} value={medRecs.filter( (item) => item.id == profileData.medRecId )} options={medRecs.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectLicenseType(val) } placeholder='Select License Type' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='medRecId' isClearable={true} /> <div className={ checkValidation.medRecId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecId.message} </div> </div> </Form.Group> </Col> </> )} {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6} md={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>Expiration Date</Form.Label> <CustomDatePicker responsive={true} selectedDate={ profileData.licenseExpirationDate ? moment( profileData.licenseExpirationDate ).format('DD MMM, YYYY') : '' } handleOnChange={(date) => handleChangeDate(date)} disableFutureDates={false} disablePastDates={true} /> <div className={ checkValidation.licenseExpirationDate.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseExpirationDate.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Document</Form.Label> {profileData.medRecCertificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.medRecCertificatePath ) } > (Download File) </a> )} <div className='form-control upload_file' placeholder='Choose File' > <Form.Label htmlFor='document_upload' className='btn btn-primary bs-none' > Choose File </Form.Label> <Form.Control type='file' accept='image/*,application/pdf' id='document_upload' name='licenseDocument' onChange={(e) => documentHandler(e)} /> <div className='my-3'> {profileData.licenseDocument ? profileData.licenseDocument.name : null} </div> </div> </Form.Group> </Col> </> )} <Col lg={12}> <Form.Group className='mb-4 form-dark'> <Form.Label>Address</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type='text' name='address' placeholder='Enter Address' ref={locationRef} onChange={handleAddressKeyUp} id='address' /> <span className='icon'> <FontAwesomeIcon icon={faLocation} /> </span> </div> <div className={ checkValidation.address.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.address.message} </div> </div> </Form.Group> </Col> */} <Col lg={12}> <div className='text-center m-25-0-35'> {showSkeleton ? ( <SkeletonTheme baseColor={SkeletonOptions.baseColor} highlightColor={SkeletonOptions.highlightColor} > <Skeleton height={50} width={200} /> </SkeletonTheme> ) : ( <Button variant='primary' type='submit' className='btn-wh-184-51 btn-rounded' onClick={!showLoading ? updateUserDetails : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Update' )} </Button> )} </div> </Col> </Row> </Card.Body> <Card.Header className='border-btm-gray mb-20 p-l-0 p-r-0 p-t-0 p-b-19'> <Card.Title className='fs-18 fw-600 color-dcdcdc mb-0'> Change Password </Card.Title> </Card.Header> <Card.Body className='bg-color-1f1f1f br-15 p-10-15 change-psw-form'> <Row> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>Current Password</Form.Label> <Form.Control type='password' name='currentPassword' placeholder='Enter Current Password' value={changePasswordState.currentPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.currentPassword .isInvalid ? 'animated fadeIn' : '' } > <div className='error'> { checkChangePasswordValidation.currentPassword .message } </div> </div> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>New Password</Form.Label> <Form.Control type='password' name='newPassword' placeholder='Enter New Password' value={changePasswordState.newPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.newPassword.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkChangePasswordValidation.newPassword.message} </div> </div> </Form.Group> </Col> <Col lg={6}> <Form.Group className='form-dark'> <Form.Label>Confirm New Password</Form.Label> <Form.Control type='password' name='confirmNewPassword' placeholder='Enter New Password' value={changePasswordState.confirmNewPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.confirmNewPassword .isInvalid ? 'animated fadeIn' : '' } > <div className='error'> { checkChangePasswordValidation.confirmNewPassword .message } </div> </div> </Form.Group> </Col> <Col lg={6} className='d-flex align-items-end justify-content-lg-start justify-content-center' > <Button variant='primary' type='submit' className='btn-wh-184-51 btn-rounded' onClick={ !showChangePassLoading ? handleChangePasswordSubmit : null } disabled={showChangePassLoading} > {showChangePassLoading ? ( <Spinner animation='border' /> ) : ( 'Change' )} </Button> </Col> </Row> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default MyAccount; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/account/company.js
import { useEffect, useRef, useState } from 'react'; import InputMask from 'react-input-mask'; import { useRouter } from 'next/router'; import Link from 'next/link'; /* global google */ import { Container, Row, Col, Card, Form, Button, Spinner, OverlayTrigger, Tooltip, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faEdit, faLocation, faQuestionCircle, } from '@fortawesome/free-solid-svg-icons'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { saveAs } from 'file-saver'; import Select from 'react-select'; import { DropdownIndicator, react_select_lg_Styles, } from '../../components/DropDown'; import CustomDatePicker from '../../components/CustomDatePicker'; import moment from 'moment'; import 'react-datetime/css/react-datetime.css'; import FormValidator from '../../components/FormValidator'; import Notifier from '../../components/Notifier'; import { contextCookie, updateSingle } from '../../services/Auth'; import { Helper } from '../../services/Helper'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { APP_NAME, ASSETS_URL, REACT_APP_API_BASE_URL, } from '../../config/server.config'; import Meta from '../../components/Meta'; const baseColor = '#202020'; const highlightColor = '#444'; function MyAccountCompany() { const noti = new Notifier(); const locationRef = useRef(null); const router = useRouter(); const validator = new FormValidator([ { field: 'companyName', method: 'isEmpty', validWhen: false, message: 'Please enter company name.', }, { field: 'medRecId', method: 'isEmpty', validWhen: false, message: 'Please select license type.', }, { field: 'licenseNumber', method: 'isEmpty', validWhen: false, message: 'Please enter license number.', }, { field: 'licenseExpirationDate', method: 'isEmpty', validWhen: false, message: 'Please enter expiration date.', }, { field: 'address', method: 'isEmpty', validWhen: false, message: 'Please enter address.', }, { field: 'stateId', method: 'isEmpty', validWhen: false, message: 'Please select state.', }, { field: 'zipCode', method: 'isEmpty', validWhen: false, message: 'Please enter zip code.', }, { field: 'phoneNumber', method: 'isEmpty', validWhen: false, message: 'Please enter phone number.', }, { field: 'phoneNumber', method: 'isLength', args: [10, 10], validWhen: true, message: 'Phone number should comprise ten digits.', }, { field: 'zipCode', method: 'isLength', args: [5, 5], validWhen: true, message: 'Zipcode should be 5 characters long.', }, ]); const [profileData, setProfileData] = useState({ companyName: '', medRecId: '', certificatePath: '', medCertificatePath: '', recCertificatePath: '', licenseNumber: '', licenseExpirationDate: '', contactNumber: '', contactEmail: '', address: '', stateId: '', zipCode: '', phoneNumber: '', }); const [showSkeleton, setShowSkeleton] = useState(true); const [showLoading, setShowLoading] = useState(false); const [states, setStates] = useState([]); const [medRecs, setMedRecs] = useState([]); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); useEffect(async () => { const response = await Rest.axiosRequest(API.companyProfile, {}, 'GET'); if (response && response.status === 200) { const result = response?.data?.data; const data = { companyName: result?.companyName ?? '', medRecId: result?.medRecId, certificatePath: result?.certificatePath !== null ? result?.certificatePath : '', resaleLicensePath: result?.resaleLicensePath !== null ? result?.resaleLicensePath : '', recCertificatePath: result?.recCertificatePath !== null ? result?.recCertificatePath : '', licenseNumber: result?.licenseNumber, licenseExpirationDate: result?.licenseExpirationDate, contactNumber: result?.contactNumber ?? '', contactEmail: result?.contactEmail ?? '', address: result?.address, stateId: result?.stateId, zipCode: result?.zipCode, phoneNumber: result?.phoneNumber, }; locationRef.current.value = result?.address; setProfileData(data); setShowSkeleton(false); } else { noti.notify(response.data.message, 'danger'); } const statesData = await Rest.axiosRequest(API.getStates, {}, 'GET'); if (statesData.status === 200) { const states = []; statesData.data.data.map((state) => { states.push({ id: state.id, value: state.id, name: state.name, label: state.name, }); }); setStates(states); } else { noti.notify(statesData.data.message, 'danger'); } const medRecData = await Rest.axiosRequest(API.getMedrec, {}, 'GET'); if (medRecData && medRecData.status === 200) { const medRecs = []; medRecData.data.data.map((medRec) => { medRecs.push({ id: medRec.id, value: medRec.id, name: medRec.title, label: medRec.title, }); }); setMedRecs(medRecs); } else { noti.notify(medRecData.data.message, 'danger'); } const autoCompleteAddress = new google.maps.places.Autocomplete( document.getElementById('address'), { componentRestrictions: { country: ['US'] } } ); google.maps.event.addListener( autoCompleteAddress, 'place_changed', function () { setProfileData((prevState) => ({ ...prevState, address: locationRef.current.value, })); } ); }, []); const downloadFile = (filePath) => { saveAs(REACT_APP_API_BASE_URL + '/get/file' + filePath); }; const onChangeHandler = async (event) => { const { name, value } = event.target; if (name === 'zipCode' && value < 1) { return; } setProfileData((prevState) => ({ ...prevState, [name]: value })); }; const handleChangeSelectState = (val) => { if (val) { setProfileData((prevState) => ({ ...prevState, stateId: val.value })); } else { setProfileData((prevState) => ({ ...prevState, stateId: '' })); } }; const handleChangeSelectLicenseType = (val) => { if (val) { setProfileData((prevState) => ({ ...prevState, medRecId: val.value })); } else { setProfileData((prevState) => ({ ...prevState, medRecId: '' })); } }; const handleChangeDate = (date) => { setProfileData((prevState) => ({ ...prevState, licenseExpirationDate: date.format('YYYY-MM-DD'), })); }; const updateProfileDetails = async (e) => { e.preventDefault(); const validation = validator.validate(profileData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); const response = await Rest.axiosRequest( API.companyProfile, profileData, 'PUT' ); setShowLoading(false); if (response.status === 200) { const result = response?.data?.data; const updatedData = { companyName: result.companyName ?? '', medRecId: result?.medRecId, certificatePath: result?.certificatePath, resaleLicensePath: result?.resaleLicensePath, licenseNumber: result?.licenseNumber, licenseExpirationDate: result?.licenseExpirationDate, contactNumber: result.contactNumber ?? '', contactEmail: result.contactEmail ?? '', address: result?.address, stateId: result?.stateId, zipCode: result?.zipCode, }; setProfileData(updatedData); noti.notify(response.data.message, 'success'); setSubmitted(false); router.replace('/account/company'); } else { noti.notify(response.data.message, 'danger'); } } }; const handleAddressKeyUp = (e) => { setProfileData((prevState) => ({ ...prevState, address: e.target.value })); }; let checkValidation = submitted ? validator.validate(profileData) : validation; return ( <> <Meta title={`My Company | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-20 br-10'> <Card.Header className='border-btm-gray mb-20 d-flex align-items-center'> <Card.Title className='fs-18 fw-600 color-dcdcdc mb-0'> My Company </Card.Title> </Card.Header> <Card.Body className='p-0'> <Row> {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Company Name</Form.Label> <Form.Control type='text' name='companyName' placeholder='Enter Company Name' value={profileData.companyName} onChange={onChangeHandler} /> <div className={ checkValidation.companyName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.companyName.message} </div> </div> </> )} </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Type</Form.Label> {' |'} {(profileData.medRecId == 1 || profileData.medRecId == 2) && ( <> {profileData.certificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile(profileData.certificatePath) } > (License Certificate File) </a> )} {' |'} {profileData.resaleLicensePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.resaleLicensePath ) } > (Resale Certificate File) </a> )} </> )} {profileData.medRecId == 3 && ( <> {profileData.medCertificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.medCertificatePath ) } > (Medical Certificate) </a> )} {profileData.recCertificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.recCertificatePath ) } > (Recreational Certificate) </a> )} </> )} <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} isDisabled={true} value={medRecs.filter( (item) => item.id == profileData.medRecId )} options={medRecs.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectLicenseType(val) } placeholder='Select License Type' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='medRecId' isClearable={true} /> <div className={ checkValidation.medRecId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecId.message} </div> </div> </Form.Group> </Col> </> )} {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Number</Form.Label> <Form.Control type='text' name='licenseNumber' placeholder='Enter License Number' value={profileData.licenseNumber} onChange={onChangeHandler} /> <div className={ checkValidation.licenseNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseNumber.message} </div> </div> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Expire Date</Form.Label> <CustomDatePicker responsive={true} selectedDate={ profileData.licenseExpirationDate ? moment( profileData.licenseExpirationDate ).format('DD MMM, YYYY') : '' } handleOnChange={(date) => handleChangeDate(date)} disableFutureDates={false} disablePastDates={true} /> <div className={ checkValidation.licenseExpirationDate.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseExpirationDate.message} </div> </div> </Form.Group> </Col> </> )} {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label> Company Contact Number <OverlayTrigger overlay={ <Tooltip id='tooltip-disabled'> This will be visible to other users on platform </Tooltip> } > <span className='d-inline-block'> <FontAwesomeIcon icon={faQuestionCircle} /> </span> </OverlayTrigger> </Form.Label> <Form.Control type='number' name='contactNumber' value={profileData.contactNumber} onChange={onChangeHandler} placeholder='Enter Company Contact Number' min='0' /> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label> Company Contact Email <OverlayTrigger overlay={ <Tooltip id='tooltip-disabled'> This will be visible to other users on platform </Tooltip> } > <span className='d-inline-block'> <FontAwesomeIcon icon={faQuestionCircle} /> </span> </OverlayTrigger> </Form.Label> <Form.Control type='email' name='contactEmail' value={profileData.contactEmail} onChange={onChangeHandler} placeholder='Enter Company Contact Email' /> </Form.Group> </Col> </> )} <Col lg={12}> <Form.Group className='mb-4 form-dark'> <Form.Label>Address</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type='text' name='address' placeholder='Enter Address' ref={locationRef} onChange={handleAddressKeyUp} id='address' /> <span className='icon'> <FontAwesomeIcon icon={faLocation} /> </span> </div> <div className={ checkValidation.address.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.address.message} </div> </div> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>State</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={states.filter( (item) => item.id == profileData.stateId )} options={states.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectState(val)} placeholder='Select State' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='state_id' isClearable={true} /> <div className={ checkValidation.stateId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.stateId.message} </div> </div> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>Zip Code</Form.Label> <Form.Control type='number' name='zipCode' placeholder='Enter Zip Code' value={profileData.zipCode} onChange={onChangeHandler} min='1' /> <div className={ checkValidation.zipCode.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.zipCode.message} </div> </div> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>Phone Number</Form.Label> <InputMask name='phoneNumber' placeholder='Enter Phone Number' onChange={onChangeHandler} onBlur={onChangeHandler} value={profileData.phoneNumber} maskChar={null} className='form-control' mask='9999999999' /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.phoneNumber.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <div className='text-center m-0-0-45'> <Button variant='primary' type='submit' className='btn-wh-184-51 btn-rounded' onClick={!showLoading ? updateProfileDetails : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Update' )} </Button> </div> </Col> </Row> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default MyAccountCompany; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/account/brand.js
import { useRouter } from 'next/router'; import { useEffect, useRef, useState } from 'react'; /* global google */ import { faEdit, faLocation } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { saveAs } from 'file-saver'; import { Button, Card, Col, Container, Form, Row, Spinner, } from 'react-bootstrap'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; // import Datetime from "react-datetime"; import 'react-datetime/css/react-datetime.css'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import FormValidator from '../../components/FormValidator'; import Meta from '../../components/Meta'; import Notifier from '../../components/Notifier'; import { APP_NAME, ASSETS_URL, REACT_APP_API_BASE_URL, } from '../../config/server.config'; import { contextCookie, updateSingle } from '../../services/Auth'; const baseColor = '#202020'; const highlightColor = '#444'; function MyAccountSeller() { const noti = new Notifier(); const locationRef = useRef(null); const router = useRouter(); const validator = new FormValidator([ { field: 'brandName', method: 'isEmpty', validWhen: false, message: 'Please enter brand name.', }, ]); const [profileData, setProfileData] = useState({ profilePath: 'uploads/profile/seller-default.png', brandName: '', year: '', website: '', profileDocument: '', description: '', }); const [showSkeleton, setShowSkeleton] = useState(true); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const onChangeHandler = async (event) => { const { name, value } = event.target; if (name === 'zipCode' && value < 1) { return; } setProfileData((prevState) => ({ ...prevState, [name]: value })); }; const documentHandler = (event) => { let selectedFile = event.target.files[0]; if (selectedFile) { let fileType = selectedFile.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); const { name, files } = event.target; if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setProfileData((prevState) => ({ ...prevState, [name]: files[0] })); if (name == 'profileDocument' && fileCheck && fileCheck.length > 0) { var file = event.target.files[0]; var reader = new FileReader(); var url = reader.readAsDataURL(file); reader.onloadend = function (e) { document.getElementById('preview_image').src = reader.result; }.bind(this); } } else { event.target.value = null; setProfileData((prevState) => ({ ...prevState, [name]: '' })); noti.notify( name == 'profileDocument' ? 'Please upload Image file only.' : 'Please upload Image or PDF file only.', 'danger' ); } } }; const updateProfileDetails = async (e) => { e.preventDefault(); const validation = validator.validate(profileData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); let formData = new FormData(); for (let key in profileData) { formData.append(key, profileData[key]); } const response = await Rest.axiosRequest( API.barndrProfile, formData, 'PUT', true ); setShowLoading(false); if (response.status === 200) { const result = response?.data?.data; updateSingle('userImage', result?.profilePath); updateSingle('userName', result?.brandName); const updatedData = { profilePath: result?.profilePath, profileDocument: result?.profileDocument, brandName: result?.brandName, year: result?.year, website: result?.website ?? '', description: result?.description, }; setProfileData(updatedData); noti.notify(response.data.message, 'success'); setSubmitted(false); router.replace('/account/brand'); } else { noti.notify(response.data.message, 'danger'); } } }; useEffect(async () => { const response = await Rest.axiosRequest(API.barndrProfile, {}, 'GET'); if (response && response.status === 200) { const result = response?.data?.data; const data = { profilePath: result?.profilePath !== null ? result.profilePath : profileData.profilePath, brandName: result?.brandName, year: result?.year, website: result?.website ?? '', description: result?.description, }; setProfileData(data); setShowSkeleton(false); } else { noti.notify(response.data.message, 'danger'); } }, []); let checkValidation = submitted ? validator.validate(profileData) : validation; return ( <> <Meta title={`My Account | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-20 br-10'> <Card.Header className='border-btm-gray mb-20 d-flex align-items-center'> <Card.Title className='fs-18 fw-600 color-dcdcdc mb-0'> My Account </Card.Title> </Card.Header> <Card.Body className='p-0'> <Row> <Col lg={3}> <Form.Group className='mb-4 profile-box br-10 bg-color-333 border-gray'> <Form.Label>Logo</Form.Label> <div className='userimg-wrap'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={96} circle={true} className='cover circle d-inline-block' /> </SkeletonTheme> ) : ( <> <img src={ASSETS_URL + profileData.profilePath} id='preview_image' className='cover circle' /> <div className='form-control upload_file br-50p w-28 h-28 bg-color-22a612' placeholder='' > <Form.Label htmlFor='logo' className=' profile-edit-btn' > <span> <FontAwesomeIcon icon={faEdit} /> </span> </Form.Label> <Form.Control type='file' id='logo' name='profileDocument' onChange={(e) => documentHandler(e)} accept='image/*' /> </div> </> )} </div> </Form.Group> </Col> <Col lg={9}> <Row> <Col lg={12}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Brand Name</Form.Label> <Form.Control type='text' name='brandName' placeholder='Enter Brand Name' value={profileData.brandName} onChange={onChangeHandler} /> <div className={ checkValidation.brandName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.brandName.message} </div> </div> </> )} </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label> Brand Establish Year<span>(optional)</span> </Form.Label> <Form.Control type='number' name='year' placeholder='Enter Brand Establish Year' min='0' value={profileData.year} onChange={onChangeHandler} /> </> )} </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label> Website<span>(optional)</span> </Form.Label> <Form.Control type='text' name='website' placeholder='Enter Website' value={profileData.website} onChange={onChangeHandler} /> </> )} </Form.Group> </Col> </Row> </Col> <Col lg={12}> <Form.Group className='mb-4 form-dark'> <Form.Label>Description</Form.Label> <Form.Control as='textarea' name='description' placeholder='Enter Description' onChange={onChangeHandler} style={{ height: '100px' }} value={profileData.description} /> </Form.Group> </Col> <Col lg={12}> <div className='text-center m-0-0-45'> <Button variant='primary' type='submit' className='btn-wh-184-51 btn-rounded' onClick={!showLoading ? updateProfileDetails : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Update' )} </Button> </div> </Col> </Row> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default MyAccountSeller; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/account/seller.js
import { useEffect, useRef, useState } from 'react'; import { useRouter } from 'next/router'; import Link from 'next/link'; /* global google */ import { Container, Row, Col, Card, Form, Button, Spinner, OverlayTrigger, Tooltip, } from 'react-bootstrap'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faEdit, faLocation, faQuestionCircle, } from '@fortawesome/free-solid-svg-icons'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { saveAs } from 'file-saver'; import Select from 'react-select'; import { DropdownIndicator, react_select_lg_Styles, } from '../../components/DropDown'; // import Datetime from "react-datetime"; import CustomDatePicker from '../../components/CustomDatePicker'; import moment from 'moment'; import 'react-datetime/css/react-datetime.css'; import FormValidator from '../../components/FormValidator'; import Notifier from '../../components/Notifier'; import { contextCookie, updateSingle } from '../../services/Auth'; import { Helper } from '../../services/Helper'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import { APP_NAME, ASSETS_URL, REACT_APP_API_BASE_URL, } from '../../config/server.config'; import Meta from '../../components/Meta'; const baseColor = '#202020'; const highlightColor = '#444'; function MyAccountSeller() { const noti = new Notifier(); const locationRef = useRef(null); const router = useRouter(); const validator = new FormValidator([ { field: 'name', method: 'isEmpty', validWhen: false, message: 'Please enter name.', }, { field: 'phoneNumber', method: 'isEmpty', validWhen: false, message: 'Please select phone number.', }, { field: 'companyName', method: 'isEmpty', validWhen: false, message: 'Please enter company name.', }, // { // field: "website", // method: "isEmpty", // validWhen: false, // message: "Please enter website url.", // } { field: 'year', method: 'isEmpty', validWhen: false, message: 'Please enter business establish year.', }, { field: 'licenseNumber', method: 'isEmpty', validWhen: false, message: 'Please enter license number.', }, { field: 'medRecId', method: 'isEmpty', validWhen: false, message: 'Please select license type.', }, { field: 'licenseExpirationDate', method: 'isEmpty', validWhen: false, message: 'Please enter expiration date.', }, { field: 'stateId', method: 'isEmpty', validWhen: false, message: 'Please select state.', }, { field: 'zipCode', method: 'isEmpty', validWhen: false, message: 'Please enter zip code.', }, { field: 'zipCode', method: 'isLength', args: [5, 5], validWhen: true, message: 'Zipcode should be 5 characters long.', }, { field: 'address', method: 'isEmpty', validWhen: false, message: 'Please enter address.', }, { field: 'description', method: 'isEmpty', validWhen: false, message: 'Please enter description.', }, ]); const passwordMatch = (confirmation, state) => { if ( changePasswordState.newPassword !== '' && changePasswordState.confirmNewPassword !== '' && changePasswordState.newPassword === changePasswordState.confirmNewPassword ) { return false; } else { return true; } }; const changePasswordValidator = new FormValidator([ { field: 'currentPassword', method: 'isEmpty', validWhen: false, message: 'Please enter current password.', }, { field: 'currentPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'Current password should be minimum 6 and maximum 20 characters.', }, { field: 'newPassword', method: 'isEmpty', validWhen: false, message: 'Please enter new password.', }, { field: 'newPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'New password should be minimum 6 and maximum 20 characters.', }, { field: 'confirmNewPassword', method: 'isEmpty', validWhen: false, message: 'Please enter confirm new password.', }, { field: 'confirmNewPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'Confirm new password should be minimum 6 and maximum 20 characters.', }, { field: 'confirmNewPassword', method: passwordMatch, validWhen: false, message: 'Please enter same as new password.', }, ]); const [profileData, setProfileData] = useState({ profilePath: 'uploads/profile/seller-default.png', profileDocument: '', name: '', phoneNumber: '', companyName: '', contactNumber: '', contactEmail: '', website: null, year: '', licenseNumber: '', medRecId: '', licenseExpirationDate: '', licenseDocument: '', certificatePath: '', medCertificatePath: '', recCertificatePath: '', stateId: '', zipCode: '', address: '', description: '', }); const [showSkeleton, setShowSkeleton] = useState(true); const [showLoading, setShowLoading] = useState(false); const [states, setStates] = useState([]); const [medRecs, setMedRecs] = useState([]); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const [showChangePassLoading, setChangePassShowLoading] = useState(false); const [changePasswordState, setChangePasswordState] = useState({ currentPassword: '', newPassword: '', confirmNewPassword: '', }); const [changePasswordValidation, setChangePasswordValidation] = useState( changePasswordValidator.valid() ); const [changePasswordsubmitted, setChangePasswordSubmitted] = useState(false); useEffect(async () => { const response = await Rest.axiosRequest(API.sellerProfile, {}, 'GET'); if (response && response.status === 200) { const result = response?.data?.data; const data = { profilePath: result?.profilePath !== null ? result?.brand?.profilePath : profileData.profilePath, name: result?.name, email: result?.email, phoneNumber: result?.brandCompany?.phoneNumber, companyName: result?.brandCompany?.companyName ?? '', contactNumber: result?.brandCompany?.contactNumber ?? '', contactEmail: result?.brandCompany?.contactEmail ?? '', website: result?.brand?.website ?? '', year: result?.brand.year, licenseNumber: result?.brandCompany?.licenseNumber, medRecId: result?.brandCompany?.medRecId, licenseExpirationDate: result?.brandCompany?.licenseExpirationDate, licenseDocument: result?.brandCompany?.licenseDocument, certificatePath: result?.brandCompany?.certificatePath !== null ? result?.brandCompany?.certificatePath : '', resaleLicensePath: result?.brandCompany?.resaleLicensePath !== null ? result?.brandCompany?.resaleLicensePath : '', recCertificatePath: result?.brandCompany?.recCertificatePath !== null ? result?.brandCompany?.recCertificatePath : '', stateId: result?.brandCompany?.stateId, zipCode: result?.brandCompany?.zipCode, address: result?.brand?.address, description: result?.brand.description, }; locationRef.current.value = result?.brand?.address; setProfileData(data); setShowSkeleton(false); } else { noti.notify(response.data.message, 'danger'); } const statesData = await Rest.axiosRequest(API.getStates, {}, 'GET'); if (statesData.status === 200) { const states = []; statesData.data.data.map((state) => { states.push({ id: state.id, value: state.id, name: state.name, label: state.name, }); }); setStates(states); } else { noti.notify(statesData.data.message, 'danger'); } const medRecData = await Rest.axiosRequest(API.getMedrec, {}, 'GET'); if (medRecData && medRecData.status === 200) { const medRecs = []; medRecData.data.data.map((medRec) => { medRecs.push({ id: medRec.id, value: medRec.id, name: medRec.title, label: medRec.title, }); }); setMedRecs(medRecs); } else { noti.notify(medRecData.data.message, 'danger'); } const autoCompleteAddress = new google.maps.places.Autocomplete( document.getElementById('address'), { componentRestrictions: { country: ['US'] } } ); google.maps.event.addListener( autoCompleteAddress, 'place_changed', function () { setProfileData((prevState) => ({ ...prevState, address: locationRef.current.value, })); } ); }, []); const downloadFile = (filePath) => { saveAs(REACT_APP_API_BASE_URL + '/get/file' + filePath); }; const onChangeHandler = async (event) => { const { name, value } = event.target; if (name === 'zipCode' && value < 1) { return; } setProfileData((prevState) => ({ ...prevState, [name]: value })); }; const handleChangeSelectState = (val) => { if (val) { setProfileData((prevState) => ({ ...prevState, stateId: val.value })); } else { setProfileData((prevState) => ({ ...prevState, stateId: '' })); } }; const handleChangeSelectLicenseType = (val) => { if (val) { setProfileData((prevState) => ({ ...prevState, medRecId: val.value })); } else { setProfileData((prevState) => ({ ...prevState, medRecId: '' })); } }; const documentHandler = (event) => { let selectedFile = event.target.files[0]; if (selectedFile) { let fileType = selectedFile.type; let fileCheck = fileType.match(/image\/[A-Za-z]*/g); const { name, files } = event.target; if ( fileType === 'application/pdf' || (fileCheck && fileCheck.length > 0) ) { setProfileData((prevState) => ({ ...prevState, [name]: files[0] })); if (name == 'profileDocument' && fileCheck && fileCheck.length > 0) { var file = event.target.files[0]; var reader = new FileReader(); var url = reader.readAsDataURL(file); reader.onloadend = function (e) { document.getElementById('preview_image').src = reader.result; }.bind(this); } } else { event.target.value = null; setProfileData((prevState) => ({ ...prevState, [name]: '' })); noti.notify( name == 'profileDocument' ? 'Please upload Image file only.' : 'Please upload Image or PDF file only.', 'danger' ); } } }; const handleChangeDate = (date) => { setProfileData((prevState) => ({ ...prevState, licenseExpirationDate: date.format('YYYY-MM-DD'), })); }; const updateProfileDetails = async (e) => { e.preventDefault(); const validation = validator.validate(profileData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); let formData = new FormData(); for (let key in profileData) { formData.append(key, profileData[key]); } const response = await Rest.axiosRequest( API.sellerProfile, formData, 'PUT', true ); setShowLoading(false); if (response.status === 200) { const result = response?.data?.data; updateSingle('userImage', result?.profilePath); updateSingle('userName', result?.companyName); const updatedData = { profilePath: result?.profilePath, profileDocument: result?.profileDocument, name: result?.name, phoneNumber: result?.phoneNumber, companyName: result.companyName ?? '', contactNumber: result.contactNumber ?? '', contactEmail: result.contactEmail ?? '', website: result?.website ?? '', year: result?.year, licenseNumber: result?.licenseNumber, medRecId: result?.medRecId, licenseExpirationDate: result?.licenseExpirationDate, licenseDocument: result?.licenseDocument, certificatePath: result?.certificatePath, resaleLicensePath: result?.resaleLicensePath, recCertificatePath: result?.recCertificatePath, stateId: result?.stateId, zipCode: result?.zipCode, address: result?.address, description: result?.description, }; setProfileData(updatedData); noti.notify(response.data.message, 'success'); setSubmitted(false); router.replace('/account/seller'); } else { noti.notify(response.data.message, 'danger'); } } }; let inputProps = { placeholder: 'Select Expiration Date', readOnly: true, }; const changePassOnChangeHandler = (event) => { const { name, value } = event.target; setChangePasswordState((prevState) => ({ ...prevState, [name]: value.trim(), })); }; const handleChangePasswordSubmit = async (e) => { e.preventDefault(); const validation = changePasswordValidator.validate(changePasswordState); setChangePasswordValidation(validation); setChangePasswordSubmitted(true); if (validation.isValid) { setChangePassShowLoading(true); const response = await Rest.axiosRequest( API.changePassword, changePasswordState ); setChangePassShowLoading(false); if (response.data.status) { noti.notify(response.data.message, 'success'); setChangePasswordState({ currentPassword: '', newPassword: '', confirmNewPassword: '', }); setChangePasswordSubmitted(false); } else { noti.notify( response.data.message instanceof Array ? response.data.message[0] : response.data.message, 'danger' ); } } }; const handleAddressKeyUp = (e) => { setProfileData((prevState) => ({ ...prevState, address: e.target.value })); }; let checkValidation = submitted ? validator.validate(profileData) : validation; let checkChangePasswordValidation = changePasswordsubmitted ? changePasswordValidator.validate(changePasswordState) : changePasswordValidation; return ( <> <Meta title={`My Account | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-20 br-10'> <Card.Header className='border-btm-gray mb-20 d-flex align-items-center'> <Card.Title className='fs-18 fw-600 color-dcdcdc mb-0'> My Account </Card.Title> <div className='ms-auto'> <Link href='/account/delete'> <a className='btn btn-primary br-6'>Delete Account</a> </Link> </div> </Card.Header> <Card.Body className='p-0'> <Row> <Col lg={3}> <Form.Group className='mb-4 profile-box br-10 bg-color-333 border-gray'> <Form.Label>Logo</Form.Label> <div className='userimg-wrap'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={96} circle={true} className='cover circle d-inline-block' /> </SkeletonTheme> ) : ( <> <img src={ASSETS_URL + profileData.profilePath} id='preview_image' className='cover circle' /> <div className='form-control upload_file br-50p w-28 h-28 bg-color-22a612' placeholder='' > <Form.Label htmlFor='logo' className=' profile-edit-btn' > <span> <FontAwesomeIcon icon={faEdit} /> </span> </Form.Label> <Form.Control type='file' id='logo' name='profileDocument' onChange={(e) => documentHandler(e)} accept='image/*' /> </div> </> )} </div> </Form.Group> </Col> <Col lg={9}> <Row> <Col lg={12}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Name</Form.Label> <Form.Control type='text' name='name' placeholder='Enter Name' value={profileData.name} onChange={onChangeHandler} /> <div className={ checkValidation.name.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.name.message} </div> </div> </> )} </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Email</Form.Label> <Form.Control type='email' name='email' placeholder='Enter Email' value={profileData.email} disabled /> </> )} </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Phone Number</Form.Label> <Form.Control type='number' name='phoneNumber' placeholder='Enter Phone Number' value={profileData.phoneNumber} onChange={onChangeHandler} min='0' /> <div className={ checkValidation.phoneNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.phoneNumber.message} </div> </div> </> )} </Form.Group> </Col> </Row> </Col> <Col lg={12}> <h4 className='fs-16 fw-600 color-dcdcdc mb-20 p-b-10 border-btm-gray'> Brand Details </h4> </Col> <Col lg={12}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Company Name</Form.Label> <Form.Control type='text' name='companyName' placeholder='Enter Company Name' value={profileData.companyName} onChange={onChangeHandler} /> <div className={ checkValidation.companyName.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.companyName.message} </div> </div> </> )} </Form.Group> </Col> {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label> Company Contact Number <OverlayTrigger overlay={ <Tooltip id='tooltip-disabled'> This will be visible to other users on platform </Tooltip> } > <span className='d-inline-block'> <FontAwesomeIcon icon={faQuestionCircle} /> </span> </OverlayTrigger> </Form.Label> <Form.Control type='number' name='contactNumber' value={profileData.contactNumber} onChange={onChangeHandler} placeholder='Enter Company Contact Number' min='0' /> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label> Company Contact Email <OverlayTrigger overlay={ <Tooltip id='tooltip-disabled'> This will be visible to other users on platform </Tooltip> } > <span className='d-inline-block'> <FontAwesomeIcon icon={faQuestionCircle} /> </span> </OverlayTrigger> </Form.Label> <Form.Control type='email' name='contactEmail' value={profileData.contactEmail} onChange={onChangeHandler} placeholder='Enter Company Contact Email' /> </Form.Group> </Col> </> )} {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label> Website<span>(optional)</span> </Form.Label> <Form.Control type='text' name='website' placeholder='Enter Website' value={profileData.website} onChange={onChangeHandler} /> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>Business Establish Year</Form.Label> <Form.Control type='number' name='year' placeholder='Enter Business Establish Year' value={profileData.year} onChange={onChangeHandler} /> <div className={ checkValidation.year.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.year.message} </div> </div> </Form.Group> </Col> </> )} {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Number</Form.Label> <Form.Control type='text' name='licenseNumber' placeholder='Enter License Number' value={profileData.licenseNumber} onChange={onChangeHandler} /> <div className={ checkValidation.licenseNumber.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseNumber.message} </div> </div> </Form.Group> </Col> </> )} {showSkeleton ? ( <Col lg={12}> <Form.Group className='mb-4 form-dark'> <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> </Form.Group> </Col> ) : ( <> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Type</Form.Label> {' |'} {(profileData.medRecId == 1 || profileData.medRecId == 2) && ( <> {profileData.certificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile(profileData.certificatePath) } > (License Certificate File) </a> )} {' |'} {profileData.resaleLicensePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.resaleLicensePath ) } > (Resale Certificate File) </a> )} </> )} {profileData.medRecId == 3 && ( <> {profileData.medCertificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.medCertificatePath ) } > (Medical Certificate) </a> )} {profileData.recCertificatePath && ( <a className='color-f3772c curser-pointer ms-2' onClick={() => downloadFile( profileData.recCertificatePath ) } > (Recreational Certificate) </a> )} </> )} <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} isDisabled={true} value={medRecs.filter( (item) => item.id == profileData.medRecId )} options={medRecs.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectLicenseType(val) } placeholder='Select License Type' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='medRecId' isClearable={true} /> <div className={ checkValidation.medRecId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.medRecId.message} </div> </div> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>License Expire Date</Form.Label> {/* <Datetime dateFormat="DD MMM, YYYY" timeFormat={false} closeOnSelect={true} inputProps={inputProps} isValidDate={Helper.valid} value={profileData.licenseExpirationDate ? moment(profileData.licenseExpirationDate).format( "DD MMM, YYYY" ) : ''} onChange={(date) => handleChangeDate(date)} closeOnTab={true} utc={true} className="date_picker" /> */} <CustomDatePicker responsive={true} selectedDate={ profileData.licenseExpirationDate ? moment( profileData.licenseExpirationDate ).format('DD MMM, YYYY') : '' } handleOnChange={(date) => handleChangeDate(date)} disableFutureDates={false} disablePastDates={true} /> <div className={ checkValidation.licenseExpirationDate.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.licenseExpirationDate.message} </div> </div> </Form.Group> </Col> </> )} <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>State</Form.Label> <Select classNamePrefix='react-select' className='react-select-lg' styles={react_select_lg_Styles} value={states.filter( (item) => item.id == profileData.stateId )} options={states.map(({ id, name }) => ({ value: id, label: name, }))} onChange={(val) => handleChangeSelectState(val)} placeholder='Select State' components={{ DropdownIndicator, IndicatorSeparator: () => null, }} name='state_id' isClearable={true} /> <div className={ checkValidation.stateId.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.stateId.message} </div> </div> </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> <Form.Label>Zip Code</Form.Label> <Form.Control type='number' name='zipCode' placeholder='Enter Zip Code' value={profileData.zipCode} onChange={onChangeHandler} min='1' /> <div className={ checkValidation.zipCode.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.zipCode.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <Form.Group className='mb-4 form-dark'> <Form.Label>Address</Form.Label> <div className='form-icon form-icon-right'> <Form.Control type='text' name='address' placeholder='Enter Address' ref={locationRef} onChange={handleAddressKeyUp} id='address' /> <span className='icon'> <FontAwesomeIcon icon={faLocation} /> </span> </div> <div className={ checkValidation.address.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.address.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <Form.Group className='mb-4 form-dark'> <Form.Label>Description</Form.Label> <Form.Control as='textarea' name='description' placeholder='Enter Description' onChange={onChangeHandler} style={{ height: '100px' }} value={profileData.description} /> <div className={ checkValidation.description.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.description.message} </div> </div> </Form.Group> </Col> <Col lg={12}> <div className='text-center m-0-0-45'> <Button variant='primary' type='submit' className='btn-wh-184-51 btn-rounded' onClick={!showLoading ? updateProfileDetails : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Update' )} </Button> </div> </Col> <Col lg={12}> <h4 className='fs-16 fw-600 color-dcdcdc mb-45 p-b-10 border-btm-gray'> Change Password </h4> </Col> <Col lg={4}> <Form.Group className='mb-4 form-dark'> <Form.Label>Current Password</Form.Label> <Form.Control type='password' name='currentPassword' placeholder='Enter Current Password' value={changePasswordState.currentPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.currentPassword .isInvalid ? 'animated fadeIn' : '' } > <div className='error'> { checkChangePasswordValidation.currentPassword .message } </div> </div> </Form.Group> </Col> <Col lg={4}> <Form.Group className='mb-4 form-dark'> <Form.Label>New Password</Form.Label> <Form.Control type='password' name='newPassword' placeholder='Enter New Password' value={changePasswordState.newPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.newPassword.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkChangePasswordValidation.newPassword.message} </div> </div> </Form.Group> </Col> <Col lg={4}> <Form.Group className='mb-4 form-dark'> <Form.Label>Confirm New Password</Form.Label> <Form.Control type='password' name='confirmNewPassword' placeholder='Enter New Password' value={changePasswordState.confirmNewPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.confirmNewPassword .isInvalid ? 'animated fadeIn' : '' } > <div className='error'> { checkChangePasswordValidation.confirmNewPassword .message } </div> </div> </Form.Group> </Col> <Col lg={12}> <div className='text-center m-4-0-25'> <Button variant='primary' type='submit' className='btn-wh-184-51 btn-rounded' onClick={ !showChangePassLoading ? handleChangePasswordSubmit : null } disabled={showChangePassLoading} > {showChangePassLoading ? ( <Spinner animation='border' /> ) : ( 'Change' )} </Button> </div> </Col> </Row> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default MyAccountSeller; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/account/credentials.js
import { useRouter } from 'next/router'; import { useEffect, useState } from 'react'; import { Button, Card, Col, Container, Form, Row, Spinner, } from 'react-bootstrap'; import 'react-datetime/css/react-datetime.css'; import Skeleton, { SkeletonTheme } from 'react-loading-skeleton'; import FormValidator from '../../components/FormValidator'; import Meta from '../../components/Meta'; import Notifier from '../../components/Notifier'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { APP_NAME } from '../../config/server.config'; import { contextCookie } from '../../services/Auth'; import Link from 'next/link'; const baseColor = '#202020'; const highlightColor = '#444'; function MyAccountCredentials() { const noti = new Notifier(); const router = useRouter(); const validator = new FormValidator([ { field: 'name', method: 'isEmpty', validWhen: false, message: 'Please enter name.', }, ]); const passwordMatch = (confirmation, state) => { if ( changePasswordState.newPassword !== '' && changePasswordState.confirmNewPassword !== '' && changePasswordState.newPassword === changePasswordState.confirmNewPassword ) { return false; } else { return true; } }; const changePasswordValidator = new FormValidator([ { field: 'currentPassword', method: 'isEmpty', validWhen: false, message: 'Please enter current password.', }, { field: 'currentPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'Current password should be minimum 6 and maximum 20 characters.', }, { field: 'newPassword', method: 'isEmpty', validWhen: false, message: 'Please enter new password.', }, { field: 'newPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'New password should be minimum 6 and maximum 20 characters.', }, { field: 'confirmNewPassword', method: 'isEmpty', validWhen: false, message: 'Please enter confirm new password.', }, { field: 'confirmNewPassword', method: 'isLength', args: [6, 20], validWhen: true, message: 'Confirm new password should be minimum 6 and maximum 20 characters.', }, { field: 'confirmNewPassword', method: passwordMatch, validWhen: false, message: 'Please enter same as new password.', }, ]); const [profileData, setProfileData] = useState({ name: '', }); const [showSkeleton, setShowSkeleton] = useState(true); const [showLoading, setShowLoading] = useState(false); const [validation, setValidation] = useState(validator.valid()); const [submitted, setSubmitted] = useState(false); const [showChangePassLoading, setChangePassShowLoading] = useState(false); const [changePasswordState, setChangePasswordState] = useState({ currentPassword: '', newPassword: '', confirmNewPassword: '', }); const [changePasswordValidation, setChangePasswordValidation] = useState( changePasswordValidator.valid() ); const [changePasswordsubmitted, setChangePasswordSubmitted] = useState(false); const onChangeHandler = async (event) => { const { name, value } = event.target; setProfileData((prevState) => ({ ...prevState, [name]: value })); }; const updateProfileDetails = async (e) => { e.preventDefault(); const validation = validator.validate(profileData); setValidation(validation); setSubmitted(true); if (validation.isValid) { setShowLoading(true); const response = await Rest.axiosRequest( API.personalProfile, profileData, 'PUT' ); setShowLoading(false); if (response.status === 200) { const result = response?.data?.data; const updatedData = { name: result?.name, }; setProfileData(updatedData); noti.notify(response.data.message, 'success'); setSubmitted(false); router.replace('/account/credentials'); } else { noti.notify(response.data.message, 'danger'); } } }; const changePassOnChangeHandler = (event) => { const { name, value } = event.target; setChangePasswordState((prevState) => ({ ...prevState, [name]: value.trim(), })); }; const handleChangePasswordSubmit = async (e) => { e.preventDefault(); const validation = changePasswordValidator.validate(changePasswordState); setChangePasswordValidation(validation); setChangePasswordSubmitted(true); if (validation.isValid) { setChangePassShowLoading(true); const response = await Rest.axiosRequest( API.changePassword, changePasswordState ); setChangePassShowLoading(false); if (response.data.status) { noti.notify(response.data.message, 'success'); setChangePasswordState({ currentPassword: '', newPassword: '', confirmNewPassword: '', }); setChangePasswordSubmitted(false); } else { noti.notify( response.data.message instanceof Array ? response.data.message[0] : response.data.message, 'danger' ); } } }; useEffect(async () => { const response = await Rest.axiosRequest(API.personalProfile, {}, 'GET'); if (response && response.status === 200) { const result = response?.data?.data; const data = { name: result?.name, email: result?.email, }; setProfileData(data); setShowSkeleton(false); } else { noti.notify(response.data.message, 'danger'); } }, []); let checkValidation = submitted ? validator.validate(profileData) : validation; let checkChangePasswordValidation = changePasswordsubmitted ? changePasswordValidator.validate(changePasswordState) : changePasswordValidation; return ( <> <Meta title={`My Credentials | ${APP_NAME}`} keywords={''} description={''} /> <section className='bg-black p-30-0-60'> <Container> <Row> <Col lg={12} className='mx-auto'> <Card className='card-dark border-gray p-15-20-20 br-10'> <Card.Header className='border-btm-gray mb-20 d-flex align-items-center'> <Card.Title className='fs-18 fw-600 color-dcdcdc mb-0'> My Credentials </Card.Title> <div className='ms-auto'> <Link href='/account/delete'> <a className='btn btn-primary br-6'>Delete Account</a> </Link> </div> </Card.Header> <Card.Body className='p-0'> <Row> <Col lg={12}> <h4 className='fs-16 fw-600 color-dcdcdc mb-20 p-b-10 border-btm-gray'> Personal Details </h4> </Col> <Col lg={12}> <Row> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Name</Form.Label> <Form.Control type='text' name='name' placeholder='Enter Name' value={profileData.name} onChange={onChangeHandler} /> <div className={ checkValidation.name.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkValidation.name.message} </div> </div> </> )} </Form.Group> </Col> <Col lg={6}> <Form.Group className='mb-4 form-dark'> {showSkeleton ? ( <SkeletonTheme baseColor={baseColor} highlightColor={highlightColor} > <Skeleton height={50} /> </SkeletonTheme> ) : ( <> <Form.Label>Email</Form.Label> <Form.Control type='email' name='email' placeholder='Enter Email' value={profileData.email} disabled /> </> )} </Form.Group> </Col> </Row> </Col> <Col lg={12}> <div className='text-center m-0-0-45'> <Button variant='primary' type='submit' className='btn-wh-184-51 btn-rounded' onClick={!showLoading ? updateProfileDetails : null} disabled={showLoading} > {showLoading ? ( <Spinner animation='border' /> ) : ( 'Update' )} </Button> </div> </Col> <Col lg={12}> <h4 className='fs-16 fw-600 color-dcdcdc mb-45 p-b-10 border-btm-gray'> Change Password </h4> </Col> <Col lg={4}> <Form.Group className='mb-4 form-dark'> <Form.Label>Current Password</Form.Label> <Form.Control type='password' name='currentPassword' placeholder='Enter Current Password' value={changePasswordState.currentPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.currentPassword .isInvalid ? 'animated fadeIn' : '' } > <div className='error'> { checkChangePasswordValidation.currentPassword .message } </div> </div> </Form.Group> </Col> <Col lg={4}> <Form.Group className='mb-4 form-dark'> <Form.Label>New Password</Form.Label> <Form.Control type='password' name='newPassword' placeholder='Enter New Password' value={changePasswordState.newPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.newPassword.isInvalid ? 'animated fadeIn' : '' } > <div className='error'> {checkChangePasswordValidation.newPassword.message} </div> </div> </Form.Group> </Col> <Col lg={4}> <Form.Group className='mb-4 form-dark'> <Form.Label>Confirm New Password</Form.Label> <Form.Control type='password' name='confirmNewPassword' placeholder='Enter New Password' value={changePasswordState.confirmNewPassword} onChange={changePassOnChangeHandler} /> <div className={ checkChangePasswordValidation.confirmNewPassword .isInvalid ? 'animated fadeIn' : '' } > <div className='error'> { checkChangePasswordValidation.confirmNewPassword .message } </div> </div> </Form.Group> </Col> <Col lg={12}> <div className='text-center m-4-0-25'> <Button variant='primary' type='submit' className='btn-wh-184-51 btn-rounded' onClick={ !showChangePassLoading ? handleChangePasswordSubmit : null } disabled={showChangePassLoading} > {showChangePassLoading ? ( <Spinner animation='border' /> ) : ( 'Change' )} </Button> </div> </Col> </Row> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default MyAccountCredentials; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (!isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }
0
/content/gmx-projects/gmx-admin/frontend/pages
/content/gmx-projects/gmx-admin/frontend/pages/seller/sign-up.js
import React, { useEffect, useState } from 'react'; import { Card, Col, Container, Row, Button, Nav } from 'react-bootstrap'; import Link from 'next/link'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import API from '../../config/endpoints.config'; import Rest from '../../config/rest.config'; import { faAngleRight, faCrown, faStar, } from '@fortawesome/free-solid-svg-icons'; import Skeleton from 'react-loading-skeleton'; import Meta from '../../components/Meta'; import { APP_NAME } from '../../config/server.config'; import { contextCookie } from '../../services/Auth'; function SellerSignStep1() { const [plans, setPlans] = useState([]); const [isLoading, setIsLoading] = useState(false); useEffect(async () => { setIsLoading(true); const plansData = await Rest.axiosRequest(API.getPlans, {}, 'GET'); const response = plansData.data; if (response.status) { setIsLoading(false); } else { setIsLoading(false); } setPlans(response.data); }, []); return ( <> <Meta title={`Sign Up | ${APP_NAME}`} keyword={`Sign Up | ${APP_NAME}`} description={`Sign Up | ${APP_NAME}`} /> <section className="bg-black"> <Container> <Row> <Col lg={8} md={10} className="mx-auto"> <Card className="card-post border-gray bs-none"> <Card.Body className="p-md-5 py-md-4 p-3"> <Card.Title className="text-center fs-26 fw-700 color-dcdcdc mb-12"> Sign Up </Card.Title> <p className="text-center fs-15 fw-500 color-dcdcdc mb-2"> Already have an account?{' '} <Link href="/sign-in"> <a className="color-22a612 fw-500">Sign in</a> </Link> </p> <Nav variant="tabs" defaultActiveKey="/seller/sign-up" className="custom_tabs mb-4" > <Link href="/sign-up"> <Nav.Item> <Nav.Link href="/sign-up">Retailers</Nav.Link> </Nav.Item> </Link> <Link href="/seller/sign-up"> <Nav.Item> <Nav.Link href="/seller/sign-up" className="active"> Brands </Nav.Link> </Nav.Item> </Link> </Nav> <h3 className="fs-18 fw-700 color-dcdcdc mb-17"> Select Plan </h3> {isLoading ? ( <Skeleton height={400} /> ) : plans.length > 0 ? ( plans.map((planData, keyIndex) => ( <div key={keyIndex + 'plan'} className="border-white-2 bg-color-282828 p-20-20-20-39 br-15 mb-4" > <span className="fs-30 color-22a612 mb-10 d-block"> {planData.price > 0 ? ( <FontAwesomeIcon icon={faCrown} /> ) : ( <FontAwesomeIcon icon={faStar} /> )} </span> <p className="mb-0 price fs-28 fw-700 color-dcdcdc"> {planData.price > 0 ? `$ ${planData.price}` : 'FREE'} <span className="fs-13 color-929292 fw-400"> {planData.price > 0 ? '/Month' : ''} </span> </p> <p className="plan-type fs-16 fw-500 color-dcdcdc border-bottom-light p-b-13 mb-20"> {planData.title} </p> <ul className="listing-true-false"> <li className="true fs-14 fw-400 color-dcdcdc"> List and showcase product offerings </li> <li className="true fs-14 fw-400 color-dcdcdc"> Receive order requests </li> <li className="true fs-14 fw-400 color-dcdcdc"> Build Brand credibility and reputation </li> </ul> <div className="text-center mt-22"> <Button variant="primary" className="btn btn-wh-150-46 btn-rounded btn-right-icons" > <Link href={'/seller/sign-up/' + btoa(planData.id)}> <div> Select <span className="color-22a612"> <FontAwesomeIcon icon={faAngleRight} /> </span> </div> </Link> </Button> </div> </div> )) ) : ( <div>No record found</div> )} <div className={'brand-sign-up text-center'}> <Link href="/subscription-policy">Subscription Policy</Link> </div> </Card.Body> </Card> </Col> </Row> </Container> </section> </> ); } export default SellerSignStep1; export async function getServerSideProps(context) { const isLoggedIn = contextCookie(context, 'isLogin'); if (isLoggedIn) { return { redirect: { destination: '/' }, }; } return { props: {}, }; }