Skip to content

Commit fc04ec4

Browse files
fix: forward realm to live event jump-in so world events deep-link to the world (#629)
1 parent 065c8b6 commit fc04ec4

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

src/components/whats-on/EventDetailModal/EventDetailModalHero.spec.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,24 @@ describe('EventDetailModalHero', () => {
223223

224224
expect(screen.getByTestId('jump-in-button')).toHaveAttribute('data-position', '10,20')
225225
})
226+
227+
describe('and the event is hosted in a world', () => {
228+
it('should pass the realm to the jump in button so the launcher deep-links into the world instead of Genesis City', () => {
229+
render(<EventDetailModalHero data={createMockData({ live: true, isWorld: true, realm: 'kenz0.dcl.eth' })} onClose={mockOnClose} />)
230+
231+
const jumpInButton = screen.getByTestId('jump-in-button')
232+
expect(jumpInButton).toHaveAttribute('data-position', '10,20')
233+
expect(jumpInButton).toHaveAttribute('data-realm', 'kenz0.dcl.eth')
234+
})
235+
})
236+
237+
describe('and the event is hosted in Genesis City', () => {
238+
it('should not pass a realm so the launcher uses the coordinates', () => {
239+
render(<EventDetailModalHero data={createMockData({ live: true, isWorld: false })} onClose={mockOnClose} />)
240+
241+
expect(screen.getByTestId('jump-in-button')).not.toHaveAttribute('data-realm')
242+
})
243+
})
226244
})
227245

228246
describe('when the event has no image', () => {

src/components/whats-on/EventDetailModal/EventDetailModalHero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function EventDetailModalHero({ data, onClose, onEdit }: { data: ModalEventData;
173173
</CreatorLocationRow>
174174
<ActionsRow>
175175
{data.live && (
176-
<JumpInButton position={`${data.x},${data.y}`} size="medium">
176+
<JumpInButton position={`${data.x},${data.y}`} realm={data.realm} size="medium">
177177
{t('event_detail.jump_in')}
178178
</JumpInButton>
179179
)}

0 commit comments

Comments
 (0)