-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Add 'connectToShopify' text support for internationalization
♻️ Refactor to use 'shopifyContext' for consistent context data access ✨ Implement 'connectToShopify' button functionality in OffKeyAuth 📝 Update stories to include 'shopifyContext' and demonstrate new 'connectToShopify' action ✨ (Various files): Introduce dynamic product titles in unlock messages ♻️ (Various files): Refactor to use `shopifyContext` for consistent data handling 💡 (Various files): Update interpolation keys for clarity in user messages ✨ (useShopifyCustomer.spec.tsx, useShopifyCustomer.tsx): add product context to Shopify hook for enhanced feature integration ♻️ (useShopifyCustomer.spec.tsx): refactor mockLinkedCustomer address to use full-length Ethereum addresses for accuracy in tests 📝 (shopifyCampaignParameters.query.gql): update GraphQL query to include connectToShopify text for UI improvements ✨ (context.tsx, hooks.ts, types.ts): introduce product information in iframe context and hook for enriched Shopify integration
- Loading branch information
1 parent
118ce70
commit a7f0276
Showing
30 changed files
with
1,169 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,17 +6,16 @@ import { | |
} from '@test-utils/storybook-decorators'; | ||
import { ShopifyCustomerStatus } from '../types'; | ||
import OffKeyAuth from './OffKeyAuth'; | ||
import { OffKeyAuthDemo, authMocks, offKeyAuthProps } from './examples'; | ||
import { | ||
OffKeyAuthDemo, | ||
authMocks, | ||
customer, | ||
offKeyAuthProps, | ||
shopifyContext, | ||
} from './examples'; | ||
|
||
const address = '0xB98bD7C7f656290071E52D1aA617D9cB4467Fd6D'; | ||
|
||
const customer = { | ||
id: '1', | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
email: '[email protected]', | ||
}; | ||
|
||
const walletConnectedProps = { | ||
walletAuthMocks: { | ||
connect: () => Promise.resolve(), | ||
|
@@ -43,6 +42,7 @@ const meta = { | |
status: null, | ||
customer: null, | ||
walletInStorage: [{ address }, { address: '0x214123135' }], | ||
shopifyContext, | ||
}, | ||
...walletConnectedProps, | ||
}), | ||
|
@@ -65,11 +65,15 @@ export const NotConnected: Story = { | |
status: ShopifyCustomerStatus.NotConnected, | ||
customer: null, | ||
walletInStorage: [{ address }, { address: '0x214123135' }], | ||
shopifyContext, | ||
}, | ||
...walletConnectedProps, | ||
}), | ||
}, | ||
}, | ||
play: async ({ container }) => { | ||
userEvent.click(await screen.findByText(/connect to my account/i)); | ||
}, | ||
}; | ||
|
||
export const NewAccount: Story = { | ||
|
@@ -81,6 +85,7 @@ export const NewAccount: Story = { | |
status: ShopifyCustomerStatus.NewAccount, | ||
customer, | ||
walletInStorage: [], | ||
shopifyContext, | ||
}, | ||
...walletConnectedProps, | ||
}), | ||
|
@@ -101,6 +106,7 @@ export const ExistingAccountNewCustomer: Story = { | |
status: ShopifyCustomerStatus.ExistingAccountNewCustomer, | ||
customer, | ||
walletInStorage: [{ address }], | ||
shopifyContext, | ||
}, | ||
...walletConnectedProps, | ||
}), | ||
|
@@ -123,6 +129,7 @@ export const ExistingSeveralAccountNewCustomer: Story = { | |
status: ShopifyCustomerStatus.ExistingAccountNewCustomer, | ||
customer, | ||
walletInStorage: [{ address }, { address: '0x214123135' }], | ||
shopifyContext, | ||
}, | ||
walletAuthMocks: { | ||
connect: () => Promise.resolve(), | ||
|
@@ -172,6 +179,7 @@ export const NoMatchingAccount: Story = { | |
customer, | ||
walletInStorage: [{ address }, { address: '0x214123135' }], | ||
walletToConnect: '0x123456789', | ||
shopifyContext, | ||
}, | ||
...walletConnectedProps, | ||
}), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ import OffKeyAuth, { OffKeyAuthProps } from './OffKeyAuth'; | |
export const offKeyAuthProps: OffKeyAuthProps = { | ||
organizerId: 'organizerId', | ||
textAuth: { | ||
connectToShopify: 'Connect to my account', | ||
createNewAccount: 'Create new account', | ||
useExistingAccount: 'Use existing account', | ||
useAnotherAccount: 'Use another account', | ||
|
@@ -57,3 +58,18 @@ export function authMocks({ | |
mockWallet.mockReturnValue(walletAuthMocks); | ||
return [shopifyMocks(shopifyCustomerMocks), mockWallet]; | ||
} | ||
|
||
export const customer = { | ||
id: '1', | ||
firstName: 'John', | ||
lastName: 'Doe', | ||
email: '[email protected]', | ||
}; | ||
|
||
export const shopifyContext = { | ||
customerFirstName: customer.firstName, | ||
customerLastName: customer.lastName, | ||
customerEmail: customer.email, | ||
productTitle: 'My Product', | ||
productAvailable: true, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.