Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"TypeError: Cannot read properties of undefined (reading 'spaceXLarge')" when setting "content" on ItinerarySegmentDetail #3775

Open
statsgod opened this issue Mar 23, 2023 · 0 comments

Comments

@statsgod
Copy link

Expected Behavior

On setting "content" attribute on "ItinerarySegmentDetail", component should become expandable and show details like as illustrated in the demo here:

https://kiwicom.github.io/orbit/?path=/story/itinerary--detail&globals=backgrounds.grid:false&knob-Description=This%20is%20description%20of%20the%20card&knob-SectionDescription=Section%20Description&knob-SectionTitle=Section%20Title&knob-Title=Card%20with%20title&knob-dataTest=test&knob-description=Select%20your%20hotel,%20hostel,%20apartment,%20or%20B&knob-expanded=true&knob-illustration=BoardingPass&knob-initialExpended=true&knob-title=Rooms%20in%20Warsaw&knob-titleAs=h1

Current Behavior

Rest of demo runs fine until you pass "content attribute", which results in:
"TypeError: Cannot read properties of undefined (reading 'spaceXLarge')"

Possible Solution

Seems to be a problem with defaultTheme getting set here: https://github.com/kiwicom/orbit/blob/ff36265399a9f5207143a18f0d53ee7d34e3010a/packages/orbit-components/src/Itinerary/ItinerarySegment/ItinerarySegmentDetail/index.tsx

or maybe an out of syncness with legacy code? not seeing a reference to "content" attribute here:
https://github.com/kiwicom/orbit/blob/ff36265399a9f5207143a18f0d53ee7d34e3010a/packages/orbit-components/src/Itinerary/README.md

Steps to Reproduce

  1. copy the exact component code from here: https://kiwicom.github.io/orbit/?path=/story/itinerary--detail&globals=backgrounds.grid:false&knob-Description=This%20is%20description%20of%20the%20card&knob-SectionDescription=Section%20Description&knob-SectionTitle=Section%20Title&knob-Title=Card%20with%20title&knob-dataTest=test&knob-description=Select%20your%20hotel,%20hostel,%20apartment,%20or%20B&knob-expanded=true&knob-illustration=BoardingPass&knob-initialExpended=true&knob-title=Rooms%20in%20Warsaw&knob-titleAs=h12.
  2. Comment out references to BadgeGroup, which is not documented well...
  3. Add the following imports:
    import Itinerary, {
    ItinerarySegment,
    ItineraryStatus,
    ItineraryBadgeList,
    ItinerarySegmentStop,
    ItinerarySegmentDetail,
    } from "@kiwicom/orbit-components/lib/Itinerary";

Context (Environment)

Blocking full implementation of Itinerary components

Environment:
macOS 12.6.1
Latest chrome (111.0.5563.64)

packages (via npm list --depth=0)
[email protected] /Users/statsgod/react-poc
├── @babel/[email protected]
├── @babel/[email protected]
├── @kiwicom/[email protected]
├── @types/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant