From a02a6c70aa00aecfc045427ba126797e3f88f3bc Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sun, 9 Feb 2025 22:54:15 -0800 Subject: [PATCH] Jedmund/image embeds 2 (#424) ## Component Refactors: - Updated `CharacterHovercard` to improve over mastery and awakening section logic. - Refactored `CharacterModal` to streamline state management (rings, awakening, perpetuity) and object preparation. - Adjusted `CharacterUnit` for consistent over mastery handling. - Simplified `AwakeningSelectWithInput` to use awakening slug values and improve error handling. - Updated `RingSelect` to refine ring value syncing and index logic. - Modified `Party` and `PartyHead` to ensure consistent over mastery processing and proper preview URL construction. - Updated `WeaponModal` to align awakening value handling with the new slug-based approach. ## Styling and Configuration: - Improved grid layout and styling in the `WeaponRep` SCSS module. - Updated `next.config.js` rewrite rules to support new preview and character routes. - Added a new API endpoint (`pages/api/preview/[shortcode].tsx`) for fetching party preview images. ## Type Definitions: - Refined types in `types/GridCharacter.d.ts` and `types/index.d.ts` to reflect updated structures for rings, over mastery, and awakening. --- .aidigestignore | 5 + .gitignore | 1 + .../character/CharacterHovercard/index.tsx | 17 ++- components/character/CharacterModal/index.tsx | 106 +++++++------- components/character/CharacterUnit/index.tsx | 12 +- .../AwakeningSelectWithInput/index.tsx | 56 ++++---- components/mastery/RingSelect/index.tsx | 132 +++++++++--------- components/party/Party/index.tsx | 14 +- components/party/PartyHead/index.tsx | 2 +- components/reps/WeaponRep/index.module.scss | 106 ++++++++------ components/weapon/WeaponModal/index.tsx | 7 +- pages/api/preview/[shortcode].tsx | 33 +++++ types/GridCharacter.d.ts | 6 +- types/index.d.ts | 28 ++-- 14 files changed, 293 insertions(+), 232 deletions(-) create mode 100644 .aidigestignore create mode 100644 pages/api/preview/[shortcode].tsx diff --git a/.aidigestignore b/.aidigestignore new file mode 100644 index 00000000..d661954f --- /dev/null +++ b/.aidigestignore @@ -0,0 +1,5 @@ +public/images +public/labels +public/profiles +tsconfig.tsbuildinfo +*.log diff --git a/.gitignore b/.gitignore index c88bf684..d174bcfa 100644 --- a/.gitignore +++ b/.gitignore @@ -86,3 +86,4 @@ typings/ # DS_Store .DS_Store *.tsbuildinfo +codebase.md diff --git a/components/character/CharacterHovercard/index.tsx b/components/character/CharacterHovercard/index.tsx index 3c01c0d3..1a9e6d55 100644 --- a/components/character/CharacterHovercard/index.tsx +++ b/components/character/CharacterHovercard/index.tsx @@ -65,7 +65,7 @@ const CharacterHovercard = (props: Props) => { } const overMasterySection = () => { - if (props.gridCharacter && props.gridCharacter.over_mastery) { + if (props.gridCharacter && props.gridCharacter.over_mastery.length > 0) { return (
@@ -73,14 +73,13 @@ const CharacterHovercard = (props: Props) => {