diff --git a/components/unit-cards/battlegroup-card.tsx b/components/unit-cards/battlegroup-card.tsx index 7192b2b6..7c03211b 100644 --- a/components/unit-cards/battlegroup-card.tsx +++ b/components/unit-cards/battlegroup-card.tsx @@ -192,6 +192,9 @@ const BattlegroupBranchMapping = ( upg.ui.briefText?.replace(spaceRegex, "\n")?.replace(specialRegex, "") || briefTextFormatter?.replace(spaceRegex, "\n")?.replace(specialRegex, ""); + const extraTextFormatter = ability.ui.extraTextFormatter || upg.ui.extraTextFormatter; + const extraText = extraTextFormatter.replace(spaceRegex, "\n")?.replace(specialRegex, ""); + return ( - - {briefText} - + + + {briefText} + + + {extraText} + + {hasCost(costs) ? UnitCostCard(costs) : <>} diff --git a/components/unit-cards/building-description-card.tsx b/components/unit-cards/building-description-card.tsx index 4fd6c536..15a9a38e 100644 --- a/components/unit-cards/building-description-card.tsx +++ b/components/unit-cards/building-description-card.tsx @@ -78,12 +78,12 @@ const BuildingCardHeader = ( withPlaceholder /> - + <Title order={3} transform="capitalize" lineClamp={1}> {desc.screen_name} - + {desc.extra_text} - </Text> + {desc.brief_text} @@ -99,13 +99,6 @@ const BuildingCardHeader = ( - {/* Health */} Hitpoints {health.hitpoints} @@ -182,22 +175,28 @@ const BuildingUnitMapper = (units: BuildingSchema["units"], faction: raceType) = })} > - - - {UnitCostCard(time_cost)} - - - {reqCards} + + + + {hasCost(time_cost) ? UnitCostCard(time_cost) : <>} + + {playerReq.length ? ( + + {reqCards} + + ) : ( + <> + )} diff --git a/components/unit-cards/requirement-card.tsx b/components/unit-cards/requirement-card.tsx index f7ef8355..ce4bce3e 100644 --- a/components/unit-cards/requirement-card.tsx +++ b/components/unit-cards/requirement-card.tsx @@ -3,6 +3,11 @@ import ImageWithFallback, { iconPlaceholder } from "../placeholders"; import { UpgradesType } from "../../src/unitStats"; export const RequirementCard = ({ ui }: UpgradesType) => { + const spaceRegex = /\\r?\\n|\\r|\\n/g; + const specialRegex = /\*/g; + + const briefText = ui.briefText?.replace(spaceRegex, "\n")?.replace(specialRegex, ""); + return ( @@ -17,15 +22,17 @@ export const RequirementCard = ({ ui }: UpgradesType) => { - + {ui.screenName} - + {ui.extraText} + + + {briefText} - {ui.briefText} - {ui.helpText} + {/* {ui.helpText} */} diff --git a/components/unit-cards/unit-description-card.tsx b/components/unit-cards/unit-description-card.tsx index 3927297b..013c6457 100644 --- a/components/unit-cards/unit-description-card.tsx +++ b/components/unit-cards/unit-description-card.tsx @@ -38,6 +38,11 @@ export const UnitDescriptionCard = ({ }) => { const factionBackgroundSrc = BattlegroupBackgrounds[faction]; + const spaceRegex = /\\r?\\n|\\r|\\n/g; + const specialRegex = /\*/g; + + const briefText = desc.brief_text?.replace(spaceRegex, "\n")?.replace(specialRegex, ""); + return ( <> @@ -67,9 +72,9 @@ export const UnitDescriptionCard = ({ fallbackSrc={symbolPlaceholder} /> - - - {desc.brief_text} + + + {briefText}