From d765b00120681a0897ca30fcbc89e8899b238f10 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 16 Jun 2023 18:49:55 -0700 Subject: [PATCH] Redesigned team navigation (#310) * Add ellipsis icon * Reduce size of tokens * Move UpdateToast to toasts folder * Update variables.scss * Add reps for grid objects These reps act like the existing PartyRep except for Characters and Summons, as well as a new component just for Weapons. They only render the grid of objects and nothing else. Eventually PartyRep will use WeaponRep * Added RepSegment This is a Character, Weapon or Summon rep wrapped with an input and label for use in a SegmentedControl * Modify PartySegmentedControl to use RepSegments This will not work on mobile yet, where it should gracefully degrade to a normal SegmentedControl with only text * Extract URL copied and Remixed toasts into files * Extract delete team alert into a file Also, to support this: * Added `Destructive` class to Button * Added `primaryActionClassName` prop to Alert * Added an alert for when remixing teams * Began refactoring PartyDetails into several files * PartyHeader will live at the top, above the new segmented control * PartyDetails stays below, only showing remixed teams and the description * PartyDropdown handles the new ... menu * Remove duplicated code This is description and remix code that is still in `PartyDetails` * Small fixes for weapon grid * Add placeholder image for guidebooks * Add localizations * Add Guidebook type and update other types * Update gitignore Don't commit guidebook images * Indicate if a dialog is scrollable We had broken paging in the infinite scroll component. Turning off "scrolling" at the dialog levels fixes it without adding scrollbars in environments that persistently show them * Add ExtraContainer This is the purple container that will contain additional weapons and sephira guidebooks * Move ExtraWeapons to ExtraWeaponsGrid And put it in ExtraContainer * Added GuidebooksGrid and GuidebookUnit These are the display components for Guidebooks in the WeaponGrid * Visual adjustments to summon grid * Add Empty class to weapons when unit is unfilled * Implement GuidebooksGrid in WeaponGrid * Remove extra switch * Remove old dependencies and props * Implement searching for/adding guidebooks to party * Update styles * Fix dependency * Properly determine when extra container should display * Change to 1-indexing for guidebooks * Add support for removing guidebooks * Display guidebook validation error * Move read only buttons to PartyHeader Also broke up tokens and made them easier to render * Add guidebooks to DetailsObject * Remove preview when on mobile sizes --- components/Header/index.tsx | 42 -- components/Layout/index.tsx | 2 +- components/common/Alert/index.scss | 1 + components/common/Alert/index.tsx | 7 +- components/common/Button/index.scss | 9 + components/common/DialogContent/index.scss | 8 +- components/common/DialogContent/index.tsx | 15 +- .../common/DropdownMenuContent/index.scss | 13 +- components/common/SegmentedControl/index.scss | 12 +- components/common/Token/index.scss | 6 +- components/dialogs/DeleteTeamAlert/index.tsx | 35 + components/dialogs/RemixTeamAlert/index.tsx | 57 ++ components/extra/ExtraContainer/index.scss | 50 ++ components/extra/ExtraContainer/index.tsx | 11 + components/extra/ExtraWeaponsGrid/index.scss | 47 ++ components/extra/ExtraWeaponsGrid/index.tsx | 95 +++ components/extra/GuidebookResult/index.scss | 37 + components/extra/GuidebookResult/index.tsx | 32 + components/extra/GuidebookUnit/index.scss | 109 +++ components/extra/GuidebookUnit/index.tsx | 201 +++++ components/extra/GuidebooksGrid/index.scss | 45 ++ components/extra/GuidebooksGrid/index.tsx | 95 +++ components/party/Party/index.scss | 8 + components/party/Party/index.tsx | 107 ++- components/party/PartyDetails/index.tsx | 573 +-------------- components/party/PartyDropdown/index.scss | 0 components/party/PartyDropdown/index.tsx | 197 +++++ components/party/PartyHeader/index.scss | 394 ++++++++++ components/party/PartyHeader/index.tsx | 693 ++++++++++++++++++ .../party/PartySegmentedControl/index.scss | 6 + .../party/PartySegmentedControl/index.tsx | 104 +-- components/reps/CharacterRep/index.scss | 75 ++ components/reps/CharacterRep/index.tsx | 132 ++++ components/reps/RepSegment/index.scss | 73 ++ components/reps/RepSegment/index.tsx | 34 + components/reps/SummonRep/index.scss | 45 ++ components/reps/SummonRep/index.tsx | 172 +++++ components/reps/WeaponRep/index.scss | 45 ++ components/reps/WeaponRep/index.tsx | 106 +++ components/search/SearchModal/index.scss | 5 + components/search/SearchModal/index.tsx | 43 +- components/summon/SummonGrid/index.scss | 2 +- components/summon/SummonGrid/index.tsx | 2 +- components/toasts/RemixedToast/index.tsx | 49 ++ .../{about => toasts}/UpdateToast/index.scss | 0 .../{about => toasts}/UpdateToast/index.tsx | 0 components/toasts/UrlCopiedToast/index.tsx | 39 + components/weapon/ExtraWeapons/index.scss | 59 -- components/weapon/ExtraWeapons/index.tsx | 48 -- components/weapon/WeaponGrid/index.scss | 4 +- components/weapon/WeaponGrid/index.tsx | 64 +- components/weapon/WeaponUnit/index.scss | 2 + public/icons/Ellipsis.svg | 5 + .../placeholders/placeholder-guidebook.png | Bin 0 -> 361 bytes public/locales/en/common.json | 23 +- public/locales/ja/common.json | 23 +- styles/variables.scss | 8 +- types/Guidebook.d.ts | 14 + types/Party.d.ts | 12 +- types/index.d.ts | 10 +- utils/appState.tsx | 6 + 61 files changed, 3317 insertions(+), 794 deletions(-) create mode 100644 components/dialogs/DeleteTeamAlert/index.tsx create mode 100644 components/dialogs/RemixTeamAlert/index.tsx create mode 100644 components/extra/ExtraContainer/index.scss create mode 100644 components/extra/ExtraContainer/index.tsx create mode 100644 components/extra/ExtraWeaponsGrid/index.scss create mode 100644 components/extra/ExtraWeaponsGrid/index.tsx create mode 100644 components/extra/GuidebookResult/index.scss create mode 100644 components/extra/GuidebookResult/index.tsx create mode 100644 components/extra/GuidebookUnit/index.scss create mode 100644 components/extra/GuidebookUnit/index.tsx create mode 100644 components/extra/GuidebooksGrid/index.scss create mode 100644 components/extra/GuidebooksGrid/index.tsx create mode 100644 components/party/PartyDropdown/index.scss create mode 100644 components/party/PartyDropdown/index.tsx create mode 100644 components/party/PartyHeader/index.scss create mode 100644 components/party/PartyHeader/index.tsx create mode 100644 components/reps/CharacterRep/index.scss create mode 100644 components/reps/CharacterRep/index.tsx create mode 100644 components/reps/RepSegment/index.scss create mode 100644 components/reps/RepSegment/index.tsx create mode 100644 components/reps/SummonRep/index.scss create mode 100644 components/reps/SummonRep/index.tsx create mode 100644 components/reps/WeaponRep/index.scss create mode 100644 components/reps/WeaponRep/index.tsx create mode 100644 components/toasts/RemixedToast/index.tsx rename components/{about => toasts}/UpdateToast/index.scss (100%) rename components/{about => toasts}/UpdateToast/index.tsx (100%) create mode 100644 components/toasts/UrlCopiedToast/index.tsx delete mode 100644 components/weapon/ExtraWeapons/index.scss delete mode 100644 components/weapon/ExtraWeapons/index.tsx create mode 100644 public/icons/Ellipsis.svg create mode 100644 public/images/placeholders/placeholder-guidebook.png create mode 100644 types/Guidebook.d.ts diff --git a/components/Header/index.tsx b/components/Header/index.tsx index 4fac2dea..b40746d6 100644 --- a/components/Header/index.tsx +++ b/components/Header/index.tsx @@ -296,25 +296,6 @@ const Header = () => { } // Rendering: Buttons - const saveButton = () => { - return ( - -