-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
300 unlock 6 shopify customer #301
Conversation
…ustomer data - Introduced `Text` component for dynamic title rendering in headers across the app for better flexibility and internationalization support. - Refactored `OffKeyHeaderConnected` to dynamically display customer information, improving user experience by personalizing the header based on the customer's data. - Implemented dynamic imports for `OffKeyHeaderConnected` to optimize loading times and resource usage, aligning with modern web performance best practices. - Updated storybook examples and tests to reflect changes and ensure components behave as expected with the new dynamic content. - Adjusted imports and exports to accommodate the new structure and usage of components, ensuring the codebase remains organized and maintainable. ✨ (examples.tsx, context.tsx, hooks.ts, types.ts, en.json): Enhance iframe integration with customer data support - Added customer data handling in iframe context to improve user experience by personalizing content. - Updated localization strings to include dynamic customer names, enhancing the personalization of welcome messages. - Introduced mock functionality for iframe API in storybook examples to facilitate testing and development with mocked customer data.
✨ (shopifyCustomer.yaml): Grant 'anonymous' role select permissions on shopifyCustomer table ✨ (OffKeyAuth.tsx): Introduce organizerId prop to OffKeyAuth component for enhanced Shopify customer handling ♻️ (examples.tsx): Replace OffKeyHeader with OffKeyHeaderNotConnected for better state representation when not connected ✨ (OffKeyHeaderNotConnected.*): Add OffKeyHeaderNotConnected component and stories for unconnected state display ✨ (useShopifyCustomer.spec.tsx, useShopifyCustomer.tsx, types.ts, shopifyCustomer.query.gql, en.json, hooks.ts): add Shopify customer hook with tests and types for Shopify integration 📝 (en.json): update localization files to support new Shopify integration features 💡 (hooks.ts): add comments to clarify the use of iframe readiness in Shopify customer hook
🔧 (.swcrc, project.json): update SWC and project config to include jest tests ✅ (i18n): add unit tests for string interpolation functionality ♻️ (i18n): refactor string interpolation to use intl-messageformat
…components for better flexibility and customization - Adjust default button and skeleton button heights for consistency - Allow dynamic padding for buttons - Include `className` prop in `EmojiAvatar` for additional styling - Introduce `auto` size option for avatars to support full container adaptation - Remove top margin from paragraphs by default for more consistent text layout ⬆️ (package.json): Add `intl-messageformat` dependency to support internationalization
… auth flow - Introduce story states for loading, not connected, new account, existing account with new customer, and existing several accounts with new customer scenarios. - Implement ShopifyCustomerStatus to manage different states of customer authentication. - Refactor mock setup to include shopifyCustomerMocks and walletConnectedProps for a more streamlined and realistic testing environment. - Remove unused imports and refactor code for clarity and better readability. ✨ (OffKeyAuth.tsx, OffKeyAuthSignIn.tsx): Enhance Shopify auth with dynamic text and state management - Introduced dynamic localization support for authentication texts. - Added state management for account matching errors. - Refactored to use `useState` for local state management. - Removed unused imports and refactored for cleaner, more maintainable code. - Enhanced UI to handle multiple wallet addresses and account recovery scenarios. ✨ Introduce dynamic text rendering based on customer status ♻️ Refactor imports and usage of wallet and customer hooks for clarity 📝 Add examples and storybook stories for component documentation and testing ✨ (examples.tsx, useShopifyCustomer.spec.tsx, useShopifyCustomer.tsx, types.ts, index.ts, useWalletAuth.tsx): Introduce new examples, update status enums, and enhance wallet connection logic - Added examples for OffKeyHeaderNotConnected component to demonstrate usage and provide mock setups for storybook integration. - Updated ShopifyCustomerStatus enums to more accurately reflect customer states, improving clarity and consistency across the codebase. - Enhanced useShopifyCustomer hook to include walletInStorage in return objects, supporting more nuanced wallet management. - Refined wallet connection logic in useWalletAuth hook to validate the wallet address against a specified address, enhancing security and accuracy in wallet connections. - Streamlined Shopify webhook and API handler by removing outdated comments and improving request verification logic, ensuring more reliable and secure Shopify integration.
…, Button.tsx): Enhance UI components for better flexibility and consistency - Add styles for `.off-btn` with `.off-profile-avatar` and `.off-btn-icon-only` for improved layout handling. - Refactor `OffKeyAuthSignIn` and `OffKeyProfile` components to use `.off-profile-avatar` class for consistent avatar sizing. - Simplify `OffKeyProfile` component by removing `AutoAnimate` and `Spinner`, using `isLoading` prop for loading state. - Adjust `Button` component to correctly handle `isIconOnly` prop for consistent button styling across the app. - Update examples to demonstrate new layout and component adjustments.
- Remove `Auth`, `WalletConnect` components, and related stories to streamline the auth feature. - Consolidate auth functionality, improving maintainability and reducing complexity. ♻️ refactor(shopify): streamline Shopify feature exports and remove unused components - Removed exports for `ShopifyAuth`, `ShopifyCard`, `ShopifyCardHeader`, and related components to simplify the module's public API. - Deleted `Card`, `CardConnected`, `CardHeader`, and their associated story and example files to focus on core functionality and reduce maintenance overhead. 🔥 Remove CardNotConnected component and related stories, examples in shopify feature ♻️ Update import path for authMocks in OffKeyGate examples to reflect new structure
…yHeaderConnected.tsx, OffKeyHeaderConnected.stories.tsx): introduce `AuthMocksParams` type for cleaner code and add localization support with dynamic text for `OffKeyHeaderConnected` component. Refactor stories to use new props and improve readability. ✨ (OffKeyProfile.stories.tsx, OffKeyProfile.tsx): Enhance Shopify integration with customer matching and dynamic text - **Why?** To better integrate Shopify customer data with the application, ensuring a more personalized and seamless user experience. This update allows for dynamic text based on customer information and improves the handling of user authentication and wallet connections specific to Shopify customers. ✨ (examples.tsx, useShopifyCustomer.tsx, hooks.ts): Enhance Shopify integration with offKeyState and dynamic message signing - Refactor imports and remove unused ones to streamline the codebase. - Introduce new props and mocks for `OffKeyProfile` to support enhanced Shopify customer matching and authentication flows. - Update `useShopifyCustomer` hook to include `offKeyState` in its return value, enabling better state management and integration with Shopify. - Modify `signWithEthereum` function to accept a dynamic message, allowing for more flexible and secure message signing within iframe environments.
…r data and dynamic text interpolation for OffKeyGate components - **Why**: To enhance the OffKeyGate component's functionality by incorporating Shopify customer data, allowing for a more personalized user experience. The dynamic text interpolation based on the customer's state and locale provides tailored content, improving the overall user interaction with the gate feature. This update supports a broader range of scenarios, including unlocking, used, and locked states, by dynamically adjusting the displayed messages and information according to the user's current status and language preferences. ♻️ (OffKeyGate/examples.tsx, OffKeyInfo.tsx): refactor to simplify and enhance state management - Simplified import statements and removed unused mocks to streamline the codebase. - Introduced `offKeyGateProps` to centralize and clarify the configuration of OffKeyGate states and texts, improving readability and maintainability. - Enhanced `OffKeyInfo` component by directly passing `offKeyStatusText`, removing the dependency on `useTranslations` for a more straightforward and efficient implementation.
…tent styling across components ♻️ (OffKeyInfo.tsx): Refactor OffKeyLogo size to `size-auto` for better flexibility ♻️ (OffKeyInfo.tsx): Adjust skeleton loader width from `w-24` to `w-32` for improved visual consistency
…onents ♻️ (shopify feature): refactor export statements for consistency 📝 (Auth.tsx, ProfileNav.tsx): mark components as deprecated 💡 (OffKeyAuth.stories.tsx): update user interaction steps in stories for clarity
…eters ✨ (Hasura metadata): update remote_schemas with ShopifyCampaignTemplate type ✨ (GraphQL queries): add new queries for Shopify campaign parameters and customer data
…nd layout components to enhance code splitting and improve loading times ♻️ Refactor Shopify components to fetch campaign parameters dynamically and handle not found cases with `notFound()` for better user experience and error handling 🌐 Update localization implementation by removing deprecated imports and using new methods for internationalization support ✨ (page.tsx): refactor Gate component to async for fetching campaign data ✨ (page.tsx): add dynamic text based on campaign state 🚀 (shopify-api): add new library for Shopify API integration 📝 (shopify-api): add README, eslint, swc, and jest configs for shopify-api lib 🔧 (shopify-api): configure package.json and project.json for shopify-api lib ✨ (shopify-api): implement getShopifyCampaignParameters for connected and not connected states ✨ Add TypeScript config for Shopify API feature and refactor Shopify exports 📝 Add examples and implementation for OffKeyGateNotConnected component ♻️ refactor(shopify): remove OffKeyGateSignIn component and related examples ♻️ refactor(stories): rename story in OffKeyHeaderConnected for clarity ✨ feat(nx): add new tasks for TypeScript and SWC with caching ✨ feat(tsconfig): add path alias for shopify-api feature
…sections ♻️ Refactor Shopify API functions to streamline data handling 🔧 Update TypeScript config to include "next" types for Shopify API feature 🚚 Move `OffKeyAuthSkeleton` definition to its own file for better modularity ✨ (OffKeyAuthSkelton.tsx, OffKeyGateSkeleton.tsx, OffKeyGateNotConnectedSkeleton.tsx, OffKeyHeaderNotConnectedSkeleton.tsx, OffKeyInfoSkeleton.tsx): Add skeleton components for loading states ♻️ (OffKeyGate.tsx, OffKeyGateNotConnected.tsx, OffKeyHeaderNotConnected.tsx, OffKeyInfo.tsx): Refactor to use new skeleton components for consistent loading states 🐛 (ProfileNav.tsx): Fix connectToDappMutation to include 'Offline' parameter for correct offline handling ✅ (useShopifyCustomer.spec.tsx): Update tests to reflect new logic and improve coverage on error handling and address mismatch scenarios ✨ (useShopifyCustomer.tsx): handle error state in addition to isLoading for customer data ⬆️ (tsconfig.json): enable resolveJsonModule to import JSON files in TypeScript ♻️ (index.ts): refactor StringMap and FormatXMLElementFn types for clarity and efficiency ♻️ (hooks.ts): type annotate messageToSign parameter and fix message value in signWithEthereum 🔧 (.swcrc): update SWC configuration by removing exclusions for spec and test files
…T requests ✨ (index.ts): introduce CreateShopifyCustomer and GetShopifyCustomer handling logic ✅ (index.spec.ts): update tests to reflect new authorization logic and error handling ♻️ (index.ts): refactor error handling to use ForbiddenError for address mismatches 🔧 (index.ts): add CreateShopifyCustomerOptions and GetShopifyCustomerOptions types ✨ (validators.ts): Add CreateShopifyCustomerParams and GetShopifyCustomerParams for Shopify integration ♻️ (apiErrorHandlers.ts): Refactor NotAuthorizedError to use 401 status code and introduce ForbiddenError with 403 status ✅ (index.spec.ts): Update tests to reflect new error handling logic and test ForbiddenError handling
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
PR Description updated to latest commit (f630df8) |
PR Review
✨ Review tool usage guide:Overview: The tool can be triggered automatically every time a new PR is opened, or can be invoked manually by commenting on any PR.
See the review usage page for a comprehensive guide on using this tool. |
PR Code Suggestions
✨ Improve tool usage guide:Overview:
See the improve usage page for a comprehensive guide on using this tool. |
…nt interactions ♻️ (OffKeyInfo.stories.tsx): separate OffKeyInfoSkeleton import for clarity 🔥 (test-utils/functions): remove unused test-utils library to clean up project ✨ (.storybook/main.ts): enable SWC for Storybook to improve build performance ♻️ (Button.stories.tsx): replace delayData with sleep for consistency in utils usage ♻️ (button/examples.tsx): replace `delayData` with `sleep` for consistency 🔧 (tsconfig.base.json): remove `@test-utils/functions` path to clean up unused dependencies
…List component - Simplify Default story by removing commented code and adding new text checks for "6 x" and "General Admission" - Remove Opened story variant and integrate its setup into Default story for streamlined testing - Add Remove story with specific parameters to disable snapshots, ensuring focused testing on dynamic interactions
…thRetry WHY: Simplify retry logic by handling specific error messages directly in the catch block, making the code easier to understand and maintain.
… and consistency
Type
enhancement
Description
OffKeyAuth
component to handle different customer statuses using the newuseShopifyCustomer
hook.useShopifyCustomer
hook to manage and fetch customer data, improving the component's responsiveness to state changes.OffKeyProfile
component to integrate with theuseShopifyCustomer
hook for dynamic UI updates based on customer status.OffKeyHeaderConnected
component to support dynamic text and localization, improving user experience based on customer context.Changes walkthrough
OffKeyAuth.stories.tsx
Add Storybook Stories for OffKeyAuth Component
libs/features/unlock/shopify/src/lib/OffKeyAuth/OffKeyAuth.stories.tsx
OffKeyAuth
component to demonstrate variousstates and interactions.
authMocks
to simulate different authentication states andcustomer data.
OffKeyAuth.tsx
Refactor OffKeyAuth Component for Enhanced State Management
libs/features/unlock/shopify/src/lib/OffKeyAuth/OffKeyAuth.tsx
ShopifyCustomerStatus
for better state management.UI elements.
OffKeyProfile.tsx
Integrate useShopifyCustomer Hook in OffKeyProfile Component
libs/features/unlock/shopify/src/lib/OffKeyProfile/OffKeyProfile.tsx
useShopifyCustomer
hook to manage customer data and state.useShopifyCustomer.tsx
Implement useShopifyCustomer Hook for Customer Data Management
libs/features/unlock/shopify/src/lib/hooks/useShopifyCustomer.tsx
useShopifyCustomer
to fetch and manage customerdata from Shopify.
components.
OffKeyHeaderConnected.tsx
Enhance OffKeyHeaderConnected for Dynamic Text and Localization
libs/features/unlock/shopify/src/lib/OffKeyHeaderConnected/OffKeyHeaderConnected.tsx
customer data.