refactor: use shared constants for MIN/MAX_ADVANCE_DAYS
- Import constants from shared/constants.json in exchange page - Remove hardcoded values for minAdvanceDays and maxAdvanceDays
This commit is contained in:
parent
110e5ec07f
commit
27896ed136
1 changed files with 3 additions and 3 deletions
|
|
@ -12,15 +12,15 @@ import { components } from "../generated/api";
|
|||
import { formatDate, formatTime, getDateRange } from "../utils/date";
|
||||
import { formatEur } from "../utils/exchange";
|
||||
import { layoutStyles, typographyStyles, bannerStyles, buttonStyles } from "../styles/shared";
|
||||
import constants from "../../../shared/constants.json";
|
||||
|
||||
type ExchangePriceResponse = components["schemas"]["ExchangePriceResponse"];
|
||||
type ExchangeResponse = components["schemas"]["ExchangeResponse"];
|
||||
type BookableSlot = components["schemas"]["BookableSlot"];
|
||||
type AvailableSlotsResponse = components["schemas"]["AvailableSlotsResponse"];
|
||||
|
||||
// Constants from shared config (will be fetched from API)
|
||||
const MIN_ADVANCE_DAYS = 1;
|
||||
const MAX_ADVANCE_DAYS = 30;
|
||||
// Constants from shared config
|
||||
const { minAdvanceDays: MIN_ADVANCE_DAYS, maxAdvanceDays: MAX_ADVANCE_DAYS } = constants.exchange;
|
||||
|
||||
type Direction = "buy" | "sell";
|
||||
type WizardStep = "details" | "booking";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue