ReqoreTier: no props for the card's internal spacing, and currency is dropped for numeric-string prices

Abierto
#681 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Start by locating the ReqoreTier implementation and its tests or stories; the issue does not name their paths. Check how it composes the header, price-detail block, and feature-list control groups, and how currency rendering handles string prices. Done means consumers can control the described spacing through props and numeric-string prices display currency without adding a symbol to custom text; update or add coverage for both behaviors.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What the landing page needs

ReqoreTier is the pricing-card component on the Qorus marketing site's /pricing
page (5 plans, dark and light, live plans from the Qorus SaaS product catalog with a
CMS snapshot as the fallback). Two things about it can only be reached today by
writing CSS against Reqore's internal DOM, which is exactly what we are asked not to
do in consuming repos.

1. No control over the spacing inside the card

The Tier hard-codes its internal structure:

<ReqoreControlGroup horizontalAlign='center' vertical gapSize='big'>   // name / price / description / action
  …
</ReqoreControlGroup>
<ReqoreVerticalSpacer height={20} />
<ReqoreControlGroup vertical>                                          // the feature list
  {featureList.map(…)}
</ReqoreControlGroup>

The gapSize='big' group puts the same gap under priceDetail ("per month") as it
puts everywhere else, which is too much for a card that also carries a description
and a feature list. With no prop for it, the site patches it from outside:

const TiersGrid = styled(ReqoreColumns)`
  .reqore-spacer + .reqore-control-group > .reqore-control-group:nth-child(2):not(:has(.reqore-icon)) {
    .reqore-paragraph:last-child { padding-bottom: 16px; }
    & + * { margin-top: -16px; }
  }
`;

That selector is a guess about Reqore's DOM, and it has already misfired once: the
feature list is also "a .reqore-spacer followed by a control group", so the rule
matched the second feature row too and pulled the third row 16px up over it — visible
as soon as a feature's text wrapped to two lines. The :not(:has(.reqore-icon)) above
is the workaround. Any change to the Tier's markup breaks it again, silently.

Ask: props for the spacing the Tier composes — e.g. gapSize for the header
group, and featureListProps / priceDetailProps (or IReqoreControlGroupProps
passthroughs) so a consumer can set gapSize/padded on the feature list and the
price block with props instead of selectors.

2. currency is dropped when price is a numeric string

price is typed string | number, but the currency symbol is only rendered when
isNumber(price):

{currency && currencyPosition === 'before' && isNumber(price) ? currency : undefined}
{price}

Prices arriving from an API or a CMS are text ("55", "0"), so
<ReqoreTier price="55" currency="$" /> renders 55 with no symbol, while
price={55} renders $55. The guard is clearly there so price="Custom" gets no
symbol — but it also swallows the common case. The site works around it by parsing
the amount and passing a number:

const amount = /^\d+(\.\d+)?$/.test(tier.price) ? Number(tier.price) : undefined;
<ReqoreTier price={amount ?? tier.price} currency={amount === undefined ? '' : symbol} … />

Ask: render the currency whenever the price is numeric or parses as a number
(!isNaN(Number(price))), so a numeric string behaves like a number; or expose the
decision as a prop. Either way the fix belongs in the Tier, not in every consumer.

What we did meanwhile

Both workarounds are in the landing page (src/pages/PricingPage.tsx), with comments
pointing at the reason, plus a story play test (expectNoVerticalOverlap) that fails
if the spacing selector ever collapses the feature rows again. We will drop both when
the props land.

Filed from the Qorus SaaS landing page; the site may not change Reqore itself.

Lenguaje dominante
TypeScript
Estrellas
4
Forks
0
Merge medio
16 h 28 min
PR fusionados (30 d)
9

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de qoretechnologies/reqore

Todos los issues de qoretechnologies/reqore

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.