tf-checkout-react 1.0.72 → 1.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/index.d.ts +1 -0
- package/dist/components/billing-info-container/index.d.ts +10 -3
- package/dist/components/billing-info-container/utils.d.ts +1 -0
- package/dist/components/confirmationContainer/index.d.ts +2 -1
- package/dist/components/paymentContainer/index.d.ts +8 -3
- package/dist/components/stripePayment/index.d.ts +2 -1
- package/dist/components/ticketsContainer/PromoCodeSection.d.ts +12 -0
- package/dist/components/ticketsContainer/index.d.ts +3 -1
- package/dist/components/waitingList/index.d.ts +2 -1
- package/dist/images/done.svg +3 -0
- package/dist/tf-checkout-react.cjs.development.js +303 -174
- package/dist/tf-checkout-react.cjs.development.js.map +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js +1 -1
- package/dist/tf-checkout-react.cjs.production.min.js.map +1 -1
- package/dist/tf-checkout-react.esm.js +302 -173
- package/dist/tf-checkout-react.esm.js.map +1 -1
- package/dist/tf-checkout-styles.css +1 -1
- package/dist/utils/createCheckoutDataBodyWithDefaultHolder.d.ts +7 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/setConfigs.d.ts +2 -1
- package/package.json +2 -2
- package/src/api/index.ts +6 -20
- package/src/assets/images/done.svg +3 -0
- package/src/components/billing-info-container/index.tsx +58 -45
- package/src/components/billing-info-container/utils.ts +2 -1
- package/src/components/common/CheckboxField.tsx +15 -8
- package/src/components/common/CustomField.tsx +7 -0
- package/src/components/common/FormikPhoneNumberField.tsx +9 -0
- package/src/components/common/SelectField.tsx +5 -1
- package/src/components/confirmationContainer/index.tsx +59 -43
- package/src/components/paymentContainer/index.tsx +28 -20
- package/src/components/stripePayment/index.tsx +24 -16
- package/src/components/ticketsContainer/PromoCodeSection.tsx +82 -0
- package/src/components/ticketsContainer/index.tsx +100 -83
- package/src/components/ticketsContainer/style.css +6 -4
- package/src/components/waitingList/index.tsx +7 -4
- package/src/utils/createCheckoutDataBodyWithDefaultHolder.ts +51 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/setConfigs.ts +7 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
.button-container{display:flex;justify-content:center;padding:20px}.billing-info-container{margin:0 auto;max-width:800px}.billing-info-container .is-half{width:49%}.billing-info-container p{color:#000}.billing-info-container .main-header{font-size:2rem;font-weight:600}.billing-info-container__twoFields{display:flex;justify-content:space-between;margin-top:15px}.billing-info-container__singleField{margin-top:15px}.account-actions-block{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.login-register-button,.MuiButtonBase-root.MuiButton-root,.MuiButtonBase-root.MuiButton-root:hover{background-color:#212529;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:26px;font-weight:700;line-height:1.15;margin-top:10px;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.logo-image-container{margin-top:5px;text-align:center;width:49%}.logo-image-container img{height:30px}.login-block{align-items:center;display:flex;flex-direction:column}.login-register-button:hover{background-color:#505050!important;border-color:#505050!important}.login-register-block{display:flex;justify-content:space-between}@media only screen and (max-width:820px){.billing-info-container{width:90%}.billing-info-container .main-header{font-size:1.5rem}}.email-checking{margin-bottom:15px}.modal-title{align-items:center;background-color:#fff;display:flex;font-family:Inter;font-size:18px;font-weight:700;height:49px;line-height:22px;padding-left:25px;position:relative}.login-modal-body{padding:15px 25px}.login-modal-body input{background:#fff!important}.login-modal-body__email,.login-modal-body__password{margin-bottom:20px}.login-action-button button{background-color:#212529;border:none;border-radius:0;color:#fff;cursor:pointer;font-size:26px;font-weight:600;height:45px;line-height:18px;margin:10px 0;outline:none;padding:10px;width:100%}.login-action-button button:hover{background-color:#505050;border-color:#505050}.server_auth__error{color:red;font-family:Inter;font-size:12px;font-style:normal;padding-left:25px;padding-top:15px}.info-text-for-login{font-size:14px;margin-bottom:4px;padding-left:10px}.register-container{margin:0 auto;max-width:800px}.register-container .is-half{width:49%}.register-container__twoFields{display:flex;justify-content:space-between;margin-top:15px}.register-container__singleField{margin-top:15px}button{margin-top:10px}.payment_page{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.payment_page .order_info_section{padding:15px 0}.payment_page .order_info_section .order_info_block{padding-bottom:15px;padding-top:15px}.payment_page .order_info_section .order_info_block .field-underline{border-bottom:1px solid #000;padding-bottom:15px}.payment_page .order_info_section .order_info_block .order_info_title{font-size:14px;font-weight:700;padding-bottom:3px}.payment_page .order_info_section .order_info_block .order_info_text{font-size:16px;line-height:1.15;outline:none}.payment_page .MuiBox-root{margin-left:auto;margin-right:auto;padding:20px;text-align:center}.payment_page .payment_info_label{padding:20px 0;text-align:center}.payment_page .payment_form{color:#fff;padding:20px}.payment_page .payment_form input,.payment_page .payment_form label{color:#fff}.payment_page .payment_button{padding-top:20px;text-align:center}.card_form_inner{background:#232323;border-radius:8px;margin:0 auto 20px;min-width:325px;padding:15px;width:50%}.card_form_inner .card_label_text{color:#fff}.card_form_inner .StripeElement{margin:5px 0 10px}.card_label_text{color:#fff}.payment_button{padding-top:15px;text-align:center}.payment_button button{background-color:#212529;border-radius:8px;color:#fff;cursor:pointer;font-size:26px;padding:15px 30px;transition:opacity .5s;width:200px}.payment_button button:hover{opacity:.7}.disabled-payment-button button{opacity:.3;pointer-events:none;user-select:none}.checkout_error_block{color:#e53935;font-weight:600;padding:15px 0}.zip_element p{margin-bottom:0}.zip_element input{background-color:#000;border:none;color:#fff;font-size:18px;margin-top:5px;outline:none;width:100%}.confirmation-page{margin:0 auto;max-width:1024px}.confirmation-page button{margin-top:inherit}.confirmation-page .strong-text{font-weight:700}.confirmation-page .title{color:#333;font-size:24px;font-weight:600}.confirmation-page .share-message-section{background:#dff0d8;border:1px solid #d6e9c6;border-radius:5px;color:#2c7221;display:flex;flex-direction:column;margin:20px 0;padding:15px}.confirmation-page .main{font-size:15px;font-weight:700}.confirmation-page .helper,.confirmation-page .main{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.confirmation-page .helper{font-size:14px;margin-top:5px}.confirmation-page .referral_text_image_section{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.confirmation-page .referral_text_section{margin:10px}.confirmation-page .referral_title_text{color:#f08057;font-size:28px;padding-bottom:10px}.confirmation-page .referral_text{font-size:18px}.confirmation-page .referral_text_image_section img{margin:10px;max-width:200px}.confirmation-page .share_wrapper{column-gap:5rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin:10px}.confirmation-page .invitation_title{font-size:22px;padding-bottom:12px;padding-top:12px}.confirmation-page .share_section{display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 -10px}.confirmation-page .invitation_section{flex:1 1;padding:0 5px}.confirmation-page .share_buttons{display:grid;flex-wrap:wrap;margin:0 -7px}.confirmation-page .convenient_buttons{margin-top:10px}.confirmation-page .social-media-btns{grid-gap:5px;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.confirmation-page .sharing-btn{background-color:#000;flex:1 1;min-width:130px}.confirmation-page .sharing-btn a{text-decoration:none}.confirmation-page .share-by-link{background:#000;color:#fff;padding:10px}.confirmation-page .share-by-link.label{margin:0;padding:0;text-align:left}.confirmation-page .share-btn-inner{align-items:center;background-color:#000;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-flex;padding:0;text-align:left;width:100%}.confirmation-page .share-input{background-color:#fff;border:none;outline:none;padding:5px;text-align:left;width:300px}.confirmation-page .share-text{display:block;font-size:13px;font-weight:600;padding-top:8px;width:100%}.confirmation-page .pricing-section_wrapper{background:#e3e3e3;border:1px solid #dcdcdc;display:grid;grid-template-columns:1fr 1fr;margin:10px 0;padding:15px}.confirmation-page .pricing-section_label{font-weight:600}.confirmation-page .pricing-section_sublabel{font-size:14px;font-weight:100}.confirmation-page .pricing-section_price{font-weight:600;text-align:right}.confirmation-page .share-by-link-copy-icon{align-items:center;background-color:#32325d;border-radius:4px;color:#fff;cursor:pointer;display:flex;justify-content:center;margin-left:8px;padding:10px;transition:all .15s ease}.confirmation-page .share-by-link-copy-icon:hover{background-color:#505050}.confirmation-page .share-by-link-copy-icon img{width:14px}.confirmation-page .social-media-sharing{background-color:#000;color:#fff;cursor:pointer;padding:10px;text-align:center}.confirmation-page .share-icon{border-radius:4px;display:inline-flex}@media only screen and (max-width:1050px){.confirmation-page .share_wrapper{column-gap:0;display:grid;grid-template-columns:unset;margin:15px}}@media only screen and (max-width:480px){.confirmation-page .social-media-btns{grid-template-columns:unset}.confirmation-page .share-input{width:250px}}body{margin:0;padding:0}.get-tickets-page{width:100%}.event-detail__tier{background-color:#fff;padding:17px 35px 20px}.event-detail__tier-name{color:#000;font-family:Inter-Bold;font-family:Bebas Neue;font-size:.85rem;font-weight:700;letter-spacing:.2em;line-height:1.3;margin-bottom:8px;margin-top:16px;padding-right:20%;text-transform:uppercase}.event-detail__tier-status{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;margin-top:8px;width:100%}.event-detail__tier-status.ticket-button{background-color:#212529;border:3px solid #000;border-radius:0;color:#fff;cursor:pointer;font-weight:700;letter-spacing:.2em;line-height:1.5;margin-bottom:10px;width:200px}.event-tickets-container{align-items:center;display:flex;justify-content:space-between}.event-detail__tier-status.ticket-button.true{background-color:#c1c3c6;border-color:#afb0b1}.event-detail__tier-price{color:#000;font-family:Inter-Bold;font-size:1.5rem;font-weight:700;line-height:1;text-align:center}.event-detail__tier-price p{margin:0}.event-detail__tier-price .fees{font-size:14px;font-weight:400;margin-top:4px;text-align:left}.event-detail__tier-price .old-price{color:red;font-size:1.3rem;margin-bottom:5px;text-decoration:line-through}.alert-info{background-color:#d9edf7;border:1px solid #bce8f1;border-radius:4px;color:#3a87ad;font-size:1em;margin:0 35px;padding:8px 15px;text-align:center;text-shadow:0 1px 0 hsla(0,0%,100%,.5)}.event-detail__tier-state{color:#30bc9d;font-family:Inter-Bold;font-size:.75rem;font-weight:300;line-height:1;text-align:right;text-transform:uppercase}.promo-code-block input{font-size:14px;padding:1px 8px}.book-button{background-color:#212529;border:3px solid #000;border-radius:0;color:#fff;cursor:pointer;display:block;font-size:26px;font-weight:700;height:50px;letter-spacing:.2em;line-height:1.5;margin:25px auto 10px;text-align:center;width:100%}.book-button:hover{background-color:#505050;border-color:#505050}.loader-container{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.get-tickets-paper::-webkit-scrollbar{width:5px}.get-tickets-paper::-webkit-scrollbar-track{background:#f1f1f1}.get-tickets-paper::-webkit-scrollbar-thumb{background:#888}.get-tickets-paper::-webkit-scrollbar-thumb:hover{background:#555}.get-tickets .get-tickets__selectbox{width:100%}.disabled{pointer-events:none;user-select:none}.hidden{display:none}.waiting-list{padding:17px 35px 20px}.waiting-list .field-item{margin-bottom:30px}.waiting-list .waiting-list-button{width:100%!important}.waiting-list .waiting-list-button:hover{background-color:#505050}.waiting-list .success-message h3{margin:10px 0}.waiting-list .success-message p{margin:0}.waiting-list .no-tickets-text{font-weight:700;text-align:center}.waiting-list .added-success-message{font-size:22px}.my-ticket{padding:30px}.my-ticket-table{margin-top:30px}.my-ticket .loading{background-color:rgba(0,0,0,.4);height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100%}.my-ticket .event-info,.my-ticket .loading{align-items:center;display:flex}.my-ticket thead th{font-weight:700}.my-ticket .event-info img{margin-right:10px;width:50px}.my-ticket .order-details-button{background-color:#32325d;border:none;border-radius:4px;color:#fff;cursor:pointer;padding:10px 14px;transition:all .15s ease}.my-ticket .order-details-button:hover{background-color:#505050}.order-details{margin:0 auto;max-width:940px}.order-details .loading{align-items:center;background-color:rgba(0,0,0,.4);display:flex;height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100%}.order-details .layout-title{font-size:24px;font-weight:400}.order-details .sub-title{font-size:18px;font-weight:400;margin:10px 0}.order-details .order-summary-box{margin-top:30px}.order-details .total-row td,.order-details th{color:#fff;font-weight:700}.order-details .tickets-box{margin-top:30px}.order-details .ticket-add-on-table{background-color:#fcf8e3}.order-details .download-button{background-color:#212529;border:1px solid #fff;border-radius:0;color:#fff;cursor:pointer;display:block;font-family:Bebas Neue;font-size:16px;font-weight:400;line-height:normal;margin-bottom:20px;margin-top:20px;min-height:auto;outline:none;overflow:hidden;padding:12px 0;position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:uppercase;width:100%}.order-details .download-button:hover{background-color:#505050}.order-details .personal-link{padding:20px 0}
|
|
1
|
+
.button-container{display:flex;justify-content:center;padding:20px}.billing-info-container{margin:0 auto;max-width:800px}.billing-info-container .is-half{width:49%}.billing-info-container p{color:#000}.billing-info-container .main-header{font-size:2rem;font-weight:600}.billing-info-container__twoFields{display:flex;justify-content:space-between;margin-top:15px}.billing-info-container__singleField{margin-top:15px}.account-actions-block{color:#182026;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif;margin-top:10px}.login-register-button,.MuiButtonBase-root.MuiButton-root,.MuiButtonBase-root.MuiButton-root:hover{background-color:#212529;border:#f28051;border-radius:5px;color:#fff;cursor:pointer;display:block;font-family:Inter-Bold;font-size:26px;font-weight:700;line-height:1.15;margin-top:10px;min-height:46px;outline:none;overflow:hidden;padding:14px 12px 12px;position:relative;text-align:center;text-overflow:ellipsis;text-transform:uppercase;width:49%}.logo-image-container{margin-top:5px;text-align:center;width:49%}.logo-image-container img{height:30px}.login-block{align-items:center;display:flex;flex-direction:column}.login-register-button:hover{background-color:#505050!important;border-color:#505050!important}.login-register-block{display:flex;justify-content:space-between}@media only screen and (max-width:820px){.billing-info-container{width:90%}.billing-info-container .main-header{font-size:1.5rem}}.email-checking{margin-bottom:15px}.modal-title{align-items:center;background-color:#fff;display:flex;font-family:Inter;font-size:18px;font-weight:700;height:49px;line-height:22px;padding-left:25px;position:relative}.login-modal-body{padding:15px 25px}.login-modal-body input{background:#fff!important}.login-modal-body__email,.login-modal-body__password{margin-bottom:20px}.login-action-button button{background-color:#212529;border:none;border-radius:0;color:#fff;cursor:pointer;font-size:26px;font-weight:600;height:45px;line-height:18px;margin:10px 0;outline:none;padding:10px;width:100%}.login-action-button button:hover{background-color:#505050;border-color:#505050}.server_auth__error{color:red;font-family:Inter;font-size:12px;font-style:normal;padding-left:25px;padding-top:15px}.info-text-for-login{font-size:14px;margin-bottom:4px;padding-left:10px}.register-container{margin:0 auto;max-width:800px}.register-container .is-half{width:49%}.register-container__twoFields{display:flex;justify-content:space-between;margin-top:15px}.register-container__singleField{margin-top:15px}button{margin-top:10px}.payment_page{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.payment_page .order_info_section{padding:15px 0}.payment_page .order_info_section .order_info_block{padding-bottom:15px;padding-top:15px}.payment_page .order_info_section .order_info_block .field-underline{border-bottom:1px solid #000;padding-bottom:15px}.payment_page .order_info_section .order_info_block .order_info_title{font-size:14px;font-weight:700;padding-bottom:3px}.payment_page .order_info_section .order_info_block .order_info_text{font-size:16px;line-height:1.15;outline:none}.payment_page .MuiBox-root{margin-left:auto;margin-right:auto;padding:20px;text-align:center}.payment_page .payment_info_label{padding:20px 0;text-align:center}.payment_page .payment_form{color:#fff;padding:20px}.payment_page .payment_form input,.payment_page .payment_form label{color:#fff}.payment_page .payment_button{padding-top:20px;text-align:center}.card_form_inner{background:#232323;border-radius:8px;margin:0 auto 20px;min-width:325px;padding:15px;width:50%}.card_form_inner .card_label_text{color:#fff}.card_form_inner .StripeElement{margin:5px 0 10px}.card_label_text{color:#fff}.payment_button{padding-top:15px;text-align:center}.payment_button button{background-color:#212529;border-radius:8px;color:#fff;cursor:pointer;font-size:26px;padding:15px 30px;transition:opacity .5s;width:200px}.payment_button button:hover{opacity:.7}.disabled-payment-button button{opacity:.3;pointer-events:none;user-select:none}.checkout_error_block{color:#e53935;font-weight:600;padding:15px 0}.zip_element p{margin-bottom:0}.zip_element input{background-color:#000;border:none;color:#fff;font-size:18px;margin-top:5px;outline:none;width:100%}.confirmation-page{margin:0 auto;max-width:1024px}.confirmation-page button{margin-top:inherit}.confirmation-page .strong-text{font-weight:700}.confirmation-page .title{color:#333;font-size:24px;font-weight:600}.confirmation-page .share-message-section{background:#dff0d8;border:1px solid #d6e9c6;border-radius:5px;color:#2c7221;display:flex;flex-direction:column;margin:20px 0;padding:15px}.confirmation-page .main{font-size:15px;font-weight:700}.confirmation-page .helper,.confirmation-page .main{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Open Sans,Helvetica Neue,Icons16,sans-serif}.confirmation-page .helper{font-size:14px;margin-top:5px}.confirmation-page .referral_text_image_section{align-items:center;display:flex;flex-wrap:wrap;justify-content:space-between;margin:20px 0}.confirmation-page .referral_text_section{margin:10px}.confirmation-page .referral_title_text{color:#f08057;font-size:28px;padding-bottom:10px}.confirmation-page .referral_text{font-size:18px}.confirmation-page .referral_text_image_section img{margin:10px;max-width:200px}.confirmation-page .share_wrapper{column-gap:5rem;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));margin:10px}.confirmation-page .invitation_title{font-size:22px;padding-bottom:12px;padding-top:12px}.confirmation-page .share_section{display:flex;flex-wrap:wrap;justify-content:space-between;margin:0 -10px}.confirmation-page .invitation_section{flex:1 1;padding:0 5px}.confirmation-page .share_buttons{display:grid;flex-wrap:wrap;margin:0 -7px}.confirmation-page .convenient_buttons{margin-top:10px}.confirmation-page .social-media-btns{grid-gap:5px;display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr))}.confirmation-page .sharing-btn{background-color:#000;flex:1 1;min-width:130px}.confirmation-page .sharing-btn a{text-decoration:none}.confirmation-page .share-by-link{background:#000;color:#fff;padding:10px}.confirmation-page .share-by-link.label{margin:0;padding:0;text-align:left}.confirmation-page .share-btn-inner{align-items:center;background-color:#000;box-sizing:border-box;color:#fff;cursor:pointer;display:inline-flex;padding:0;text-align:left;width:100%}.confirmation-page .share-input{background-color:#fff;border:none;outline:none;padding:5px;text-align:left;width:300px}.confirmation-page .share-text{display:block;font-size:13px;font-weight:600;padding-top:8px;width:100%}.confirmation-page .pricing-section_wrapper{background:#e3e3e3;border:1px solid #dcdcdc;display:grid;grid-template-columns:1fr 1fr;margin:10px 0;padding:15px}.confirmation-page .pricing-section_label{font-weight:600}.confirmation-page .pricing-section_sublabel{font-size:14px;font-weight:100}.confirmation-page .pricing-section_price{font-weight:600;text-align:right}.confirmation-page .share-by-link-copy-icon{align-items:center;background-color:#32325d;border-radius:4px;color:#fff;cursor:pointer;display:flex;justify-content:center;margin-left:8px;padding:10px;transition:all .15s ease}.confirmation-page .share-by-link-copy-icon:hover{background-color:#505050}.confirmation-page .share-by-link-copy-icon img{width:14px}.confirmation-page .social-media-sharing{background-color:#000;color:#fff;cursor:pointer;padding:10px;text-align:center}.confirmation-page .share-icon{border-radius:4px;display:inline-flex}@media only screen and (max-width:1050px){.confirmation-page .share_wrapper{column-gap:0;display:grid;grid-template-columns:unset;margin:15px}}@media only screen and (max-width:480px){.confirmation-page .social-media-btns{grid-template-columns:unset}.confirmation-page .share-input{width:250px}}body{margin:0;padding:0}.get-tickets-page{width:100%}.event-detail__tier{background-color:#fff;padding:17px 35px 20px}.event-detail__tier-name{color:#000;font-family:Inter-Bold;font-family:Bebas Neue;font-size:.85rem;font-weight:700;letter-spacing:.2em;line-height:1.3;margin-bottom:8px;margin-top:16px;padding-right:20%;text-transform:uppercase}.event-detail__tier-status{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;justify-content:space-between;margin-top:8px;width:100%}.event-detail__tier-status.ticket-button{background-color:#212529;border:3px solid #000;border-radius:0;color:#fff;cursor:pointer;font-weight:700;letter-spacing:.2em;line-height:1.5;margin-bottom:10px;width:200px}.event-tickets-container{align-items:center;display:flex;justify-content:space-between}.event-detail__tier-status.ticket-button.true{background-color:#c1c3c6;border-color:#afb0b1}.event-detail__tier-price{color:#000;font-family:Inter-Bold;font-size:1.5rem;line-height:1;text-align:center}.event-detail__tier-price p{margin:0}.event-detail__tier-price .fees{font-size:14px;margin-top:4px;text-align:left}.event-detail__tier-price .old-price{color:red;font-size:1.3rem;margin-bottom:5px;text-decoration:line-through}.alert-info{align-items:center;background-color:#d9edf7;border:1px solid #bce8f1;border-radius:4px;color:#3a87ad;display:flex;font-size:1em;justify-content:center;margin:0 35px;padding:8px 15px;text-shadow:0 1px 0 hsla(0,0%,100%,.5)}.alert-info svg{margin-right:4px}.event-detail__tier-state{color:#30bc9d;font-family:Inter-Bold;font-size:.75rem;font-weight:300;line-height:1;text-align:right;text-transform:uppercase}.promo-code-block input{font-size:14px;padding:1px 8px}.book-button{background-color:#212529;border:3px solid #000;border-radius:0;color:#fff;cursor:pointer;display:block;font-size:26px;font-weight:700;height:50px;letter-spacing:.2em;line-height:1.5;margin:25px auto 10px;text-align:center;width:100%}.book-button:hover{background-color:#505050;border-color:#505050}.loader-container{align-items:center;display:flex;height:100%;justify-content:center;width:100%}.get-tickets-paper::-webkit-scrollbar{width:5px}.get-tickets-paper::-webkit-scrollbar-track{background:#f1f1f1}.get-tickets-paper::-webkit-scrollbar-thumb{background:#888}.get-tickets-paper::-webkit-scrollbar-thumb:hover{background:#555}.get-tickets .get-tickets__selectbox{width:100%}.disabled{pointer-events:none;user-select:none}.hidden{display:none}.waiting-list{padding:17px 35px 20px}.waiting-list .field-item{margin-bottom:30px}.waiting-list .waiting-list-button{width:100%!important}.waiting-list .waiting-list-button:hover{background-color:#505050}.waiting-list .success-message h3{margin:10px 0}.waiting-list .success-message p{margin:0}.waiting-list .no-tickets-text{font-weight:700;text-align:center}.waiting-list .added-success-message{font-size:22px}.my-ticket{padding:30px}.my-ticket-table{margin-top:30px}.my-ticket .loading{background-color:rgba(0,0,0,.4);height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100%}.my-ticket .event-info,.my-ticket .loading{align-items:center;display:flex}.my-ticket thead th{font-weight:700}.my-ticket .event-info img{margin-right:10px;width:50px}.my-ticket .order-details-button{background-color:#32325d;border:none;border-radius:4px;color:#fff;cursor:pointer;padding:10px 14px;transition:all .15s ease}.my-ticket .order-details-button:hover{background-color:#505050}.order-details{margin:0 auto;max-width:940px}.order-details .loading{align-items:center;background-color:rgba(0,0,0,.4);display:flex;height:100vh;justify-content:center;left:0;position:fixed;top:0;width:100%}.order-details .layout-title{font-size:24px;font-weight:400}.order-details .sub-title{font-size:18px;font-weight:400;margin:10px 0}.order-details .order-summary-box{margin-top:30px}.order-details .total-row td,.order-details th{color:#fff;font-weight:700}.order-details .tickets-box{margin-top:30px}.order-details .ticket-add-on-table{background-color:#fcf8e3}.order-details .download-button{background-color:#212529;border:1px solid #fff;border-radius:0;color:#fff;cursor:pointer;display:block;font-family:Bebas Neue;font-size:16px;font-weight:400;line-height:normal;margin-bottom:20px;margin-top:20px;min-height:auto;outline:none;overflow:hidden;padding:12px 0;position:relative;text-align:center;text-decoration:none;text-overflow:ellipsis;text-transform:uppercase;width:100%}.order-details .download-button:hover{background-color:#505050}.order-details .personal-link{padding:20px 0}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ interface IConfigs {
|
|
|
3
3
|
CLIENT_ID: string;
|
|
4
4
|
CLIENT_SECRET: string;
|
|
5
5
|
STRIPE_PUBLISHABLE_KEY: string;
|
|
6
|
-
|
|
6
|
+
X_SOURCE_ORIGIN: string;
|
|
7
|
+
[key: string]: string | number;
|
|
7
8
|
}
|
|
8
9
|
export declare const CONFIGS: IConfigs;
|
|
9
10
|
export declare const setConfigs: (configs: IConfigs) => void;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.0.
|
|
2
|
+
"version": "1.0.76",
|
|
3
3
|
"license": "MIT",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"typings": "dist/index.d.ts",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/lodash": "^4.14.176",
|
|
52
52
|
"@types/react": "^17.0.34",
|
|
53
53
|
"@types/react-dom": "^17.0.11",
|
|
54
|
-
"@typescript-eslint/parser": "
|
|
54
|
+
"@typescript-eslint/parser": "5.4.0",
|
|
55
55
|
"husky": "^7.0.4",
|
|
56
56
|
"react": "^17.0.2",
|
|
57
57
|
"react-dom": "^17.0.2",
|
package/src/api/index.ts
CHANGED
|
@@ -4,15 +4,6 @@ import _get from 'lodash/get'
|
|
|
4
4
|
import { CONFIGS } from '../utils'
|
|
5
5
|
|
|
6
6
|
const isWindowDefined = typeof window !== 'undefined'
|
|
7
|
-
const discardedOrigins = [
|
|
8
|
-
'http://localhost',
|
|
9
|
-
'gtsb.io',
|
|
10
|
-
'gatsbyjs.io',
|
|
11
|
-
'https://www.houseofx.nyc',
|
|
12
|
-
'https://tickets-staging.houseofx.nyc',
|
|
13
|
-
]
|
|
14
|
-
|
|
15
|
-
const origin = isWindowDefined && window.location.origin
|
|
16
7
|
|
|
17
8
|
const ttfHeaders: { [key: string]: any } = {
|
|
18
9
|
Accept: 'application/vnd.api+json',
|
|
@@ -22,12 +13,6 @@ const ttfHeaders: { [key: string]: any } = {
|
|
|
22
13
|
if (isWindowDefined && localStorage.getItem('auth_guest_token')) {
|
|
23
14
|
ttfHeaders['Authorization-Guest'] = localStorage.getItem('auth_guest_token')
|
|
24
15
|
}
|
|
25
|
-
if (
|
|
26
|
-
isWindowDefined &&
|
|
27
|
-
!discardedOrigins.some(el => origin && origin.includes(el))
|
|
28
|
-
) {
|
|
29
|
-
ttfHeaders['X-Source-Origin'] = 'houseofx.nyc'
|
|
30
|
-
}
|
|
31
16
|
|
|
32
17
|
interface IPublicRequest extends AxiosInstance {
|
|
33
18
|
setGuestToken: (token: string) => void;
|
|
@@ -82,13 +67,10 @@ publicRequest.interceptors.request.use((config: AxiosRequestConfig) => {
|
|
|
82
67
|
config.headers = updatedHeaders
|
|
83
68
|
}
|
|
84
69
|
|
|
85
|
-
if (
|
|
86
|
-
isWindowDefined &&
|
|
87
|
-
!discardedOrigins.some(el => origin && origin.includes(el))
|
|
88
|
-
) {
|
|
70
|
+
if (CONFIGS.X_SOURCE_ORIGIN) {
|
|
89
71
|
const updatedHeaders = {
|
|
90
72
|
...config.headers,
|
|
91
|
-
'X-Source-Origin':
|
|
73
|
+
'X-Source-Origin': CONFIGS.X_SOURCE_ORIGIN,
|
|
92
74
|
}
|
|
93
75
|
config.headers = updatedHeaders
|
|
94
76
|
}
|
|
@@ -109,6 +91,10 @@ publicRequest.setBaseUrl = (baseUrl: string) =>
|
|
|
109
91
|
publicRequest.setAccessToken = token =>
|
|
110
92
|
(publicRequest.defaults.headers.common.Authorization = token)
|
|
111
93
|
|
|
94
|
+
export const setXSourceOrigin = (sourceOrigin: string) => {
|
|
95
|
+
ttfHeaders['X-Source-Origin'] = sourceOrigin
|
|
96
|
+
}
|
|
97
|
+
|
|
112
98
|
export const setCustomHeader = (response: any) => {
|
|
113
99
|
const guestHeaderResponseValue = _get(
|
|
114
100
|
response,
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
<svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path fill-rule="evenodd" clip-rule="evenodd" d="M10 20C15.5228 20 20 15.5228 20 10C20 4.47717 15.5228 0 10 0C4.47717 0 0 4.47717 0 10C0 15.5228 4.47717 20 10 20ZM8.14661 15.8678L16.8782 6.39722C16.9561 6.31335 17 6.19922 17 6.08008C17 5.96094 16.9561 5.8468 16.8782 5.76282L16.3016 5.12854C16.1386 4.95715 15.8796 4.95715 15.7167 5.12854L7.85004 13.661L4.28326 9.79236C4.20593 9.70776 4.10071 9.66016 3.99084 9.66016C3.9353 9.66016 3.88086 9.67236 3.83069 9.69531C3.78168 9.71777 3.73663 9.75061 3.69843 9.79236L3.12183 10.4177C3.07635 10.4667 3.04248 10.5259 3.02216 10.5905C3.00763 10.6365 3 10.6853 3 10.735C3 10.8541 3.04388 10.9683 3.12183 11.0521L7.56177 15.8678C7.6391 15.9524 7.74438 16 7.85419 16C7.96399 16 8.06927 15.9524 8.14661 15.8678Z" fill="#569F44"/>
|
|
3
|
+
</svg>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { FC, useEffect, useState, useCallback } from 'react'
|
|
1
|
+
import React, { FC, useEffect, useState, useCallback, useRef } from 'react'
|
|
2
2
|
import { AxiosError } from 'axios'
|
|
3
3
|
import {
|
|
4
4
|
Field,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
FormikProps,
|
|
9
9
|
FormikValues,
|
|
10
10
|
} from 'formik'
|
|
11
|
-
import
|
|
11
|
+
import Button from '@mui/material/Button'
|
|
12
12
|
import _identity from 'lodash/identity'
|
|
13
13
|
import _map from 'lodash/map'
|
|
14
14
|
import _get from 'lodash/get'
|
|
@@ -40,16 +40,14 @@ import {
|
|
|
40
40
|
import { CustomField } from '../common/CustomField'
|
|
41
41
|
import axios from 'axios'
|
|
42
42
|
import { CheckboxField } from '../common/CheckboxField'
|
|
43
|
-
import { CircularProgress } from '@mui/material'
|
|
43
|
+
import { CircularProgress, ThemeOptions } from '@mui/material'
|
|
44
44
|
import { nanoid } from 'nanoid'
|
|
45
45
|
import { getQueryVariable } from '../../utils/getQueryVariable'
|
|
46
46
|
import { SelectField } from '../common/SelectField'
|
|
47
47
|
import { ErrorFocus } from '../../utils/formikErrorFocus'
|
|
48
48
|
import { FormikPhoneNumberField } from '../common/FormikPhoneNumberField'
|
|
49
|
-
import { getImage } from '../../utils/getImage'
|
|
50
49
|
import { ThemeProvider, createTheme } from '@mui/material/styles'
|
|
51
|
-
|
|
52
|
-
const TTFLOGO = getImage('logo-ttf.png')
|
|
50
|
+
import { CSSProperties } from '@mui/styled-engine'
|
|
53
51
|
|
|
54
52
|
export interface IBillingInfoPage {
|
|
55
53
|
data?: IBillingInfoData[];
|
|
@@ -66,7 +64,7 @@ export interface IBillingInfoPage {
|
|
|
66
64
|
refreshToken: string;
|
|
67
65
|
}) => void;
|
|
68
66
|
|
|
69
|
-
onRegisterError?: (e: AxiosError) => void;
|
|
67
|
+
onRegisterError?: (e: AxiosError, email: string) => void;
|
|
70
68
|
|
|
71
69
|
onSubmitError?: (e: AxiosError) => void;
|
|
72
70
|
|
|
@@ -97,7 +95,9 @@ export interface IBillingInfoPage {
|
|
|
97
95
|
buttonName?: string;
|
|
98
96
|
theme?: 'light' | 'dark';
|
|
99
97
|
isLoggedIn?: boolean;
|
|
100
|
-
|
|
98
|
+
accountInfoTitle?: string | JSX.Element;
|
|
99
|
+
hideLogo?: boolean;
|
|
100
|
+
themeOptions?: ThemeOptions & { input?: CSSProperties; checkbox?: CSSProperties }
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
const LogicRunner: FC<{
|
|
@@ -117,6 +117,7 @@ const LogicRunner: FC<{
|
|
|
117
117
|
onGetStatesSuccess,
|
|
118
118
|
onGetStatesError,
|
|
119
119
|
}) => {
|
|
120
|
+
const prevCountry = useRef(values.country)
|
|
120
121
|
useEffect(() => {
|
|
121
122
|
const fetchStates = async () => {
|
|
122
123
|
try {
|
|
@@ -126,7 +127,10 @@ const LogicRunner: FC<{
|
|
|
126
127
|
value: key,
|
|
127
128
|
}))
|
|
128
129
|
setStates(mappedStates)
|
|
129
|
-
|
|
130
|
+
if (prevCountry.current !== values.country) {
|
|
131
|
+
setFieldValue('state', mappedStates[0]?.value ?? '')
|
|
132
|
+
prevCountry.current = values.country
|
|
133
|
+
}
|
|
130
134
|
onGetStatesSuccess(res.data)
|
|
131
135
|
} catch (e) {
|
|
132
136
|
if (axios.isAxiosError(e)) {
|
|
@@ -149,13 +153,13 @@ const LogicRunner: FC<{
|
|
|
149
153
|
const parsedData = JSON.parse(userDataEncoded)
|
|
150
154
|
const mappedValues = {
|
|
151
155
|
firstName: parsedData?.first_name || '',
|
|
152
|
-
lastName: parsedData?.last_name,
|
|
156
|
+
lastName: parsedData?.last_name || '',
|
|
153
157
|
email: parsedData?.email || '',
|
|
154
158
|
phone: parsedData?.phone || '',
|
|
155
159
|
confirmEmail: parsedData?.email || '',
|
|
156
160
|
state: parsedData?.state || '',
|
|
157
161
|
street_address: parsedData?.street_address || '',
|
|
158
|
-
country: parsedData?.country || 1,
|
|
162
|
+
country: parsedData?.country || "1",
|
|
159
163
|
zip: parsedData?.zip || '',
|
|
160
164
|
brand_opt_in: parsedData?.brand_opt_in || '',
|
|
161
165
|
city: parsedData?.city || '',
|
|
@@ -200,18 +204,14 @@ export const BillingInfoContainer = ({
|
|
|
200
204
|
onGetProfileDataError = () => {},
|
|
201
205
|
onAuthorizeSuccess = () => {},
|
|
202
206
|
onAuthorizeError = () => {},
|
|
203
|
-
onLogin
|
|
207
|
+
onLogin,
|
|
204
208
|
onLoginSuccess = () => {},
|
|
205
209
|
isLoggedIn: pIsLoggedIn = false,
|
|
206
|
-
|
|
210
|
+
accountInfoTitle = '',
|
|
211
|
+
hideLogo,
|
|
212
|
+
themeOptions
|
|
207
213
|
}: IBillingInfoPage) => {
|
|
208
|
-
const themeMui = createTheme(
|
|
209
|
-
typography: {
|
|
210
|
-
allVariants: {
|
|
211
|
-
fontFamily
|
|
212
|
-
},
|
|
213
|
-
},
|
|
214
|
-
})
|
|
214
|
+
const themeMui = createTheme(themeOptions)
|
|
215
215
|
const isWindowDefined = typeof window !== 'undefined'
|
|
216
216
|
const userData =
|
|
217
217
|
isWindowDefined && window.localStorage.getItem('user_data')
|
|
@@ -279,9 +279,11 @@ export const BillingInfoContainer = ({
|
|
|
279
279
|
}, [])
|
|
280
280
|
|
|
281
281
|
useEffect(() => {
|
|
282
|
-
isWindowDefined &&
|
|
282
|
+
isWindowDefined &&
|
|
283
|
+
window.document.addEventListener('auth_error', handleAuthErrors)
|
|
283
284
|
return () => {
|
|
284
|
-
isWindowDefined &&
|
|
285
|
+
isWindowDefined &&
|
|
286
|
+
window.document.removeEventListener('auth_error', handleAuthErrors)
|
|
285
287
|
}
|
|
286
288
|
}, [handleAuthErrors])
|
|
287
289
|
|
|
@@ -301,7 +303,7 @@ export const BillingInfoContainer = ({
|
|
|
301
303
|
setCountries(
|
|
302
304
|
_map(_get(res, 'data.data'), (item, key) => ({
|
|
303
305
|
label: item,
|
|
304
|
-
value:
|
|
306
|
+
value: key,
|
|
305
307
|
}))
|
|
306
308
|
)
|
|
307
309
|
onGetCountriesSuccess(res.data)
|
|
@@ -341,7 +343,7 @@ export const BillingInfoContainer = ({
|
|
|
341
343
|
const userDataResponse = await getProfileData(token)
|
|
342
344
|
const profileSpecifiedData = _get(userDataResponse, 'data.data')
|
|
343
345
|
const profileDataObj = setLoggedUserData(profileSpecifiedData)
|
|
344
|
-
setUserValues(profileDataObj)
|
|
346
|
+
setUserValues({ ...profileDataObj, firstName: profileDataObj.first_name, lastName: profileDataObj.last_name })
|
|
345
347
|
window.localStorage.setItem(
|
|
346
348
|
'user_data',
|
|
347
349
|
JSON.stringify(profileDataObj)
|
|
@@ -366,9 +368,8 @@ export const BillingInfoContainer = ({
|
|
|
366
368
|
dataWithUniqueIds,
|
|
367
369
|
{
|
|
368
370
|
...initialValues,
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
country: 1,
|
|
371
|
+
country: _get(userData, 'country', '') || "1",
|
|
372
|
+
state: _get(userData, 'state', '') || "1",
|
|
372
373
|
brand_opt_in: optedInFieldValue,
|
|
373
374
|
},
|
|
374
375
|
userValues
|
|
@@ -449,11 +450,12 @@ export const BillingInfoContainer = ({
|
|
|
449
450
|
)
|
|
450
451
|
}
|
|
451
452
|
|
|
452
|
-
if (error?.email) {
|
|
453
|
+
if (error?.email && !onLogin) {
|
|
454
|
+
// False will stand for outside controll
|
|
453
455
|
setAlreadyHasUser(true)
|
|
454
456
|
setShowModalLogin(true)
|
|
455
457
|
}
|
|
456
|
-
onRegisterError(e)
|
|
458
|
+
onRegisterError(e, values.email)
|
|
457
459
|
}
|
|
458
460
|
return
|
|
459
461
|
}
|
|
@@ -514,24 +516,35 @@ export const BillingInfoContainer = ({
|
|
|
514
516
|
<div className={`billing-info-container ${theme}`}>
|
|
515
517
|
{!isLoggedIn && (
|
|
516
518
|
<div className="account-actions-block">
|
|
517
|
-
<div>
|
|
518
|
-
Got a <strong>TICKET</strong>FAIRY account?
|
|
519
|
-
</div>
|
|
519
|
+
<div>{accountInfoTitle}</div>
|
|
520
520
|
<div>Login & skip ahead:</div>
|
|
521
521
|
<div className="login-block">
|
|
522
522
|
<button
|
|
523
523
|
className="login-register-button"
|
|
524
524
|
type="button"
|
|
525
525
|
onClick={() => {
|
|
526
|
-
|
|
527
|
-
|
|
526
|
+
// If outside login needed to skip package login functionallity
|
|
527
|
+
if (onLogin) {
|
|
528
|
+
onLogin()
|
|
529
|
+
} else {
|
|
530
|
+
setShowModalLogin(true)
|
|
531
|
+
}
|
|
528
532
|
}}
|
|
529
533
|
>
|
|
530
534
|
Login
|
|
531
535
|
</button>
|
|
532
|
-
|
|
533
|
-
<
|
|
534
|
-
|
|
536
|
+
{!hideLogo && (
|
|
537
|
+
<div className="logo-image-container">
|
|
538
|
+
<img
|
|
539
|
+
src={
|
|
540
|
+
theme === 'dark'
|
|
541
|
+
? 'https://www.ticketfairy.com/resources/images/logo-ttf.svg'
|
|
542
|
+
: 'https://www.ticketfairy.com/resources/images/logo-ttf-black.svg'
|
|
543
|
+
}
|
|
544
|
+
alt="nodata"
|
|
545
|
+
/>
|
|
546
|
+
</div>
|
|
547
|
+
)}
|
|
535
548
|
</div>
|
|
536
549
|
</div>
|
|
537
550
|
)}
|
|
@@ -582,7 +595,7 @@ export const BillingInfoContainer = ({
|
|
|
582
595
|
? CheckboxField
|
|
583
596
|
: element.type === 'select'
|
|
584
597
|
? SelectField
|
|
585
|
-
: element.type === 'phone'
|
|
598
|
+
: element.type === 'phone'
|
|
586
599
|
? FormikPhoneNumberField
|
|
587
600
|
: CustomField
|
|
588
601
|
}
|
|
@@ -651,18 +664,18 @@ export const BillingInfoContainer = ({
|
|
|
651
664
|
))}
|
|
652
665
|
</div>
|
|
653
666
|
<div className="button-container">
|
|
654
|
-
<
|
|
667
|
+
<Button
|
|
655
668
|
type="submit"
|
|
656
669
|
variant="contained"
|
|
657
670
|
className="login-register-button"
|
|
658
|
-
loadingIndicator={
|
|
659
|
-
<CircularProgress color="inherit" size={26} />
|
|
660
|
-
}
|
|
661
|
-
loading={props.isSubmitting}
|
|
662
671
|
disabled={props.isSubmitting}
|
|
663
672
|
>
|
|
664
|
-
{
|
|
665
|
-
|
|
673
|
+
{props.isSubmitting ? (
|
|
674
|
+
<CircularProgress size={26} />
|
|
675
|
+
) : (
|
|
676
|
+
buttonName
|
|
677
|
+
)}
|
|
678
|
+
</Button>
|
|
666
679
|
</div>
|
|
667
680
|
</div>
|
|
668
681
|
</Form>
|
|
@@ -88,6 +88,7 @@ interface IUserData {
|
|
|
88
88
|
state?: string;
|
|
89
89
|
zip?: string;
|
|
90
90
|
zipCode?: string;
|
|
91
|
+
stateId?: string;
|
|
91
92
|
}
|
|
92
93
|
|
|
93
94
|
interface IticketHolder {
|
|
@@ -107,7 +108,7 @@ export const setLoggedUserData = (data: IUserData) => ({
|
|
|
107
108
|
country: data?.country || '',
|
|
108
109
|
phone: data?.phone || '',
|
|
109
110
|
street_address: data?.streetAddress || '',
|
|
110
|
-
state: data?.
|
|
111
|
+
state: data?.stateId || '',
|
|
111
112
|
zip: data?.zip || data?.zipCode || '',
|
|
112
113
|
})
|
|
113
114
|
|
|
@@ -3,6 +3,7 @@ import FormGroup from '@mui/material/FormGroup'
|
|
|
3
3
|
import FormControlLabel from '@mui/material/FormControlLabel'
|
|
4
4
|
import Checkbox from '@mui/material/Checkbox'
|
|
5
5
|
import { FieldInputProps } from 'formik'
|
|
6
|
+
import { useTheme } from '@mui/styles'
|
|
6
7
|
|
|
7
8
|
export interface ICheckboxField {
|
|
8
9
|
label: string | number | JSX.Element;
|
|
@@ -20,11 +21,17 @@ export const CheckboxField = ({
|
|
|
20
21
|
theme,
|
|
21
22
|
setFieldValue,
|
|
22
23
|
...rest
|
|
23
|
-
}: ICheckboxField & IOtherProps) =>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
24
|
+
}: ICheckboxField & IOtherProps) => {
|
|
25
|
+
const customTheme: any = useTheme()
|
|
26
|
+
return (
|
|
27
|
+
<FormGroup>
|
|
28
|
+
<FormControlLabel
|
|
29
|
+
control={<Checkbox {...field} {...rest} />}
|
|
30
|
+
label={label}
|
|
31
|
+
componentsProps={{
|
|
32
|
+
typography: customTheme.checkbox
|
|
33
|
+
}}
|
|
34
|
+
/>
|
|
35
|
+
</FormGroup>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
@@ -5,6 +5,7 @@ import _get from 'lodash/get'
|
|
|
5
5
|
import _includes from 'lodash/includes'
|
|
6
6
|
|
|
7
7
|
import { FieldInputProps, FormikProps } from 'formik'
|
|
8
|
+
import { useTheme } from '@mui/styles'
|
|
8
9
|
|
|
9
10
|
export interface ISelectOption {
|
|
10
11
|
label: string | number;
|
|
@@ -42,6 +43,8 @@ export const CustomField = ({
|
|
|
42
43
|
Boolean(_get(touched, field.name)) ||
|
|
43
44
|
(_includes(field.name, 'holder') && !!error && !!submitCount)
|
|
44
45
|
|
|
46
|
+
const customTheme: any = useTheme()
|
|
47
|
+
|
|
45
48
|
return (
|
|
46
49
|
<TextField
|
|
47
50
|
id={field.name}
|
|
@@ -56,6 +59,10 @@ export const CustomField = ({
|
|
|
56
59
|
className: theme,
|
|
57
60
|
MenuProps: { className: theme },
|
|
58
61
|
}}
|
|
62
|
+
InputLabelProps={{ sx: customTheme.input }}
|
|
63
|
+
inputProps={{
|
|
64
|
+
sx: customTheme.input
|
|
65
|
+
}}
|
|
59
66
|
{...field}
|
|
60
67
|
>
|
|
61
68
|
{isSelectField
|
|
@@ -3,6 +3,7 @@ import { FieldInputProps } from 'formik'
|
|
|
3
3
|
import MuiPhoneNumber from 'material-ui-phone-number'
|
|
4
4
|
import _get from 'lodash/get'
|
|
5
5
|
import { removePlusSign } from '../../normalizers'
|
|
6
|
+
import { useTheme } from '@mui/styles'
|
|
6
7
|
|
|
7
8
|
export interface INumberInField {
|
|
8
9
|
label: string | number | JSX.Element;
|
|
@@ -24,6 +25,8 @@ export const FormikPhoneNumberField = ({
|
|
|
24
25
|
const error = _get(errors, field.name)
|
|
25
26
|
const isTouched = Boolean(_get(touched, field.name))
|
|
26
27
|
|
|
28
|
+
const customTheme: any = useTheme()
|
|
29
|
+
|
|
27
30
|
return (
|
|
28
31
|
<MuiPhoneNumber
|
|
29
32
|
name='phone'
|
|
@@ -35,6 +38,12 @@ export const FormikPhoneNumberField = ({
|
|
|
35
38
|
error={!!error && isTouched}
|
|
36
39
|
helperText={isTouched && error}
|
|
37
40
|
fullWidth
|
|
41
|
+
InputLabelProps={{
|
|
42
|
+
sx: customTheme.input
|
|
43
|
+
}}
|
|
44
|
+
InputProps={{
|
|
45
|
+
sx: customTheme.input
|
|
46
|
+
}}
|
|
38
47
|
autoFormat={false}
|
|
39
48
|
{...rest}
|
|
40
49
|
/>
|
|
@@ -5,6 +5,7 @@ import _get from 'lodash/get'
|
|
|
5
5
|
|
|
6
6
|
import { FieldInputProps, FormikProps } from 'formik'
|
|
7
7
|
import { FormControl, InputLabel, FormHelperText } from '@mui/material'
|
|
8
|
+
import { useTheme } from '@mui/styles'
|
|
8
9
|
|
|
9
10
|
export interface ISelectOption {
|
|
10
11
|
label: string | number;
|
|
@@ -39,9 +40,11 @@ export const SelectField = ({
|
|
|
39
40
|
const isTouched = Boolean(_get(touched, field.name))
|
|
40
41
|
const error = _get(errors, field.name)
|
|
41
42
|
|
|
43
|
+
const customTheme: any = useTheme()
|
|
44
|
+
|
|
42
45
|
return (
|
|
43
46
|
<FormControl fullWidth={true}>
|
|
44
|
-
<InputLabel htmlFor={field.name} error={!!error && isTouched} shrink={true}>
|
|
47
|
+
<InputLabel style={customTheme.input} htmlFor={field.name} error={!!error && isTouched} shrink={true}>
|
|
45
48
|
{label}
|
|
46
49
|
</InputLabel>
|
|
47
50
|
<Select
|
|
@@ -57,6 +60,7 @@ export const SelectField = ({
|
|
|
57
60
|
className={theme}
|
|
58
61
|
MenuProps={{ className: theme }}
|
|
59
62
|
{...field}
|
|
63
|
+
style={customTheme.input}
|
|
60
64
|
>
|
|
61
65
|
{_map(selectOptions, option => (
|
|
62
66
|
<option
|