ReqoreTier: currency symbol is dropped when price is a string
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 72/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Inizia in src/components/Tier/index.tsx dalla condizione relativa alla valuta mostrata nell’issue, quindi controlla come vengono gestiti price e salePrice. Verifica che le stringhe numeriche mostrino il simbolo della valuta, mentre le etichette non numeriche come «Custom» no, ed esegui i test Tier pertinenti; il payload non indica un file di test.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
What happens
ReqoreTier drops the currency symbol whenever price is a string:
// src/components/Tier/index.tsx
currency && currencyPosition === 'before' && isNumber(price) ? currency : undefined
IReqoreTierProps declares price: string | number and currency: string, so
<ReqoreTier price="50" currency="$" /> is a perfectly legal call — it just renders
50 with no $, silently. Nothing warns, and the missing symbol is easy to miss in
review because the number itself is right.
Why it bites
Prices almost always arrive as strings: JSON payloads, CMS fields, Intl-formatted
amounts, anything with a decimal that must not be re-rounded. On the Qorus marketing
site both sources are strings — the pricing CMS global and the live Qorus SaaS
product catalogue (qorus_saas_product_prices.price) — so every plan card had lost
its currency symbol.
What the landing page does meanwhile
Coerces the value before handing it over, which is exactly the workaround this issue
asks to make unnecessary:
const priceOf = (price: string): string | number =>
/^\d+(\.\d+)?$/.test(price) ? Number(price) : price;
Suggested fix
In ReqoreTier, gate the currency on "the price is an amount", not on the JS type —
e.g. isNumber(price) || /^\d/.test(String(price)), applied to price and
salePrice alike. A non-numeric price (Custom, Contact us) should keep today's
behaviour of showing no symbol.
If the type-based gate is deliberate, then price should be typed number for the
currency path and the prop doc should say the symbol is numeric-only — right now the
types promise something the render does not deliver.
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 0
- Merge medio
- 16h 28m
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di qoretechnologies/reqore
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
qoretechnologies/reqore#725 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
qoretechnologies/reqore#711 ·
I maintainer di solito rispondono entro 1 giorno
-
Checkbox: a long description pushes the control out of its container — the label column cannot shrinkForse già presa @Foxhoundn l’ha presa 49 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
qoretechnologies/reqore#662 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 64/100
qoretechnologies/reqore#745 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 73/100
qoretechnologies/reqore#738 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di qoretechnologies/reqore
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
genfeedai/genfeed.ai#11828 ·
I maintainer di solito rispondono entro 1 giorno
-
bug security
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
IbrahimHafez1/loadwise#251 ·
I maintainer di solito rispondono entro 1 giorno
-
bug good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
erkamyaman/unslop-anything#415 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
Yeachan-Heo/oh-my-codex#4278 ·
I maintainer di solito rispondono entro 1 giorno
-
admin
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno