Skip to content

Instantly share code, notes, and snippets.

@p-jackson
p-jackson / userid.patch
Created January 24, 2022 02:56
Add `user_id` to signup dependencies
diff --git a/client/lib/signup/step-actions/index.js b/client/lib/signup/step-actions/index.js
index 92f0017eed..62c0680aec 100644
--- a/client/lib/signup/step-actions/index.js
+++ b/client/lib/signup/step-actions/index.js
@@ -153,7 +153,7 @@ function getNewSiteParams( {
const siteSegment = getSiteTypePropertyValue( 'slug', siteType, 'id' );
const siteTypeTheme = getSiteTypePropertyValue( 'slug', siteType, 'theme' );
const selectedDesign = get( signupDependencies, 'selectedDesign', false );
- const userId = getCurrentUserId( state );
+ const userId = signupDependencies.user_id || getCurrentUserId( state );
diff --git a/client/landing/gutenboarding/onboarding-block/style-preview/font-select.tsx b/client/landing/gutenboarding/onboarding-block/style-preview/font-select.tsx
index 090a9eab53..8284ad01c6 100644
--- a/client/landing/gutenboarding/onboarding-block/style-preview/font-select.tsx
+++ b/client/landing/gutenboarding/onboarding-block/style-preview/font-select.tsx
@@ -141,9 +141,13 @@ const FontSelect: React.FunctionComponent = () => {
return (
<Button
- className={ classnames( 'style-preview__font-option', {
- 'is-selected': isSelected,
@p-jackson
p-jackson / testing-block.js
Created February 4, 2020 08:55
Testing block with notice in placeholder
/**
* WordPress dependencies
*/
import { Placeholder, withNotices } from '@wordpress/components';
import { useEffect } from '@wordpress/element';
import { __ } from '@wordpress/i18n';
import { resizeCornerNE as icon } from '@wordpress/icons';
const Edit = withNotices( ( { noticeOperations, noticeUI } ) => {
useEffect( () => {
@p-jackson
p-jackson / classes-as-action-creators.ts
Created January 20, 2020 09:55
Using classes as action creators
// Action Creators
class IncrementCounter {
readonly type = 'INCREMENT_COUNTER';
}
class SetCounter {
readonly type = 'SET_COUNTER';
constructor( public newValue: number ) {}
}
@p-jackson
p-jackson / export-from-sass-dir.patch
Created January 10, 2020 02:30
Export SASS styles from a public folder by referencing the internal files
diff --git a/client/assets/stylesheets/shared/_typography.scss b/client/assets/stylesheets/shared/_typography.scss
index 4a59103c03..34e69045bb 100644
--- a/client/assets/stylesheets/shared/_typography.scss
+++ b/client/assets/stylesheets/shared/_typography.scss
@@ -1,4 +1,4 @@
-@import '~@automattic/components/src/styles/_typography.scss';
+@import '~@automattic/components/sass/_typography.scss';
// Typeface Variables
diff --git a/client/my-sites/checkout/checkout/checkout-container.jsx b/client/my-sites/checkout/checkout/checkout-container.jsx
index 3f03dbf5ca..c5a68b0101 100644
--- a/client/my-sites/checkout/checkout/checkout-container.jsx
+++ b/client/my-sites/checkout/checkout/checkout-container.jsx
@@ -35,13 +35,10 @@ function isSiteCreatedDateNew( createdAt, creationWindowInMinutes = 5 ) {
class CheckoutContainer extends React.Component {
state = {
headerText: '',
- shouldDisplaySiteCreatedNotice:
- this.props.isComingFromSignup &&
diff --git a/client/my-sites/checkout/checkout/secure-payment-form.jsx b/client/my-sites/checkout/checkout/secure-payment-form.jsx
index f30dafbf33..ff83ebadd1 100644
--- a/client/my-sites/checkout/checkout/secure-payment-form.jsx
+++ b/client/my-sites/checkout/checkout/secure-payment-form.jsx
@@ -193,7 +193,7 @@ export class SecurePaymentForm extends Component {
} );
};
- submitTransaction( event ) {
+ async submitTransaction( event ) {
@p-jackson
p-jackson / import-flow-back-button.patch
Created July 26, 2019 04:47
Tweaks import url step so it doesn't override existing steps
diff --git a/client/lib/signup/step-actions.js b/client/lib/signup/step-actions.js
index 973d8a89ad..40eb0967ff 100644
--- a/client/lib/signup/step-actions.js
+++ b/client/lib/signup/step-actions.js
@@ -637,15 +637,18 @@ export function isPlanFulfilled( stepName, defaultDependencies, nextProps ) {
}
export function isSiteTypeFulfilled( stepName, defaultDependencies, nextProps ) {
- let siteType, siteTypeValue;
-
@p-jackson
p-jackson / hooks.js
Created April 11, 2019 10:44
What updated in React component
function useTraceUpdate(props) {
const prev = useRef(props);
useEffect(() => {
const changedProps = Object.entries(props).reduce((ps, [k, v]) => {
if (prev.current[k] !== v) {
ps[k] = [prev.current[k], v];
}
return ps;
}, {});
if (Object.keys(changedProps).length > 0) {
@p-jackson
p-jackson / Cargo.toml
Created July 14, 2016 11:34
Https with hyper on Windows without using OpenSSL
[dependencies]
schannel = "0.0.2"
[dependencies.hyper]
version = "0.7"
default-features = false