Skip to content

Commit af72539

Browse files
Fix RoomModal image styling (#1272)
* Update RoomModal.scss * Update RoomModal.tsx * Update src/components/templates/PartyMap/components/RoomModal/RoomModal.tsx Co-authored-by: Glenn 'devalias' Grant <[email protected]> * Update RoomModal.scss * Update RoomModal.tsx * Update RoomModal.scss * Update RoomModal.tsx * Apply suggestions from code review Co-authored-by: Glenn 'devalias' Grant <[email protected]> Co-authored-by: Glenn 'devalias' Grant <[email protected]>
1 parent 3bae7eb commit af72539

File tree

2 files changed

+17
-13
lines changed

2 files changed

+17
-13
lines changed

src/components/templates/PartyMap/components/RoomModal/RoomModal.scss

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ $spacing: 20px;
66
.room-modal {
77
padding: $spacing;
88

9-
background-color: #19181a;
9+
background-color: $saturated-black;
1010
background-repeat: no-repeat;
1111
background-size: cover;
1212

@@ -27,13 +27,6 @@ $spacing: 20px;
2727
justify-content: space-around;
2828
align-items: center;
2929

30-
> img {
31-
width: 60%;
32-
height: auto;
33-
34-
border-radius: $border-radius;
35-
}
36-
3730
> * {
3831
flex: 1;
3932
height: fit-content;
@@ -45,6 +38,17 @@ $spacing: 20px;
4538
}
4639
}
4740

41+
&__icon {
42+
flex-shrink: 0;
43+
height: 180px;
44+
width: 180px;
45+
border-radius: $border-radius;
46+
background-color: $black;
47+
background-size: contain;
48+
background-repeat: no-repeat;
49+
background-position: center;
50+
}
51+
4852
.userlist-container {
4953
margin-top: $spacing;
5054
}

src/components/templates/PartyMap/components/RoomModal/RoomModal.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ export const RoomModalContent: React.FC<RoomModalContentProps> = ({
9393

9494
const hasRoomEvents = renderedRoomEvents?.length > 0;
9595

96+
const iconStyles = {
97+
backgroundImage: room.image_url ? `url(${room.image_url})` : undefined,
98+
};
99+
96100
return (
97101
<>
98102
<h2>{room.title}</h2>
@@ -102,11 +106,7 @@ export const RoomModalContent: React.FC<RoomModalContentProps> = ({
102106
)}
103107

104108
<div className="room-modal__main">
105-
{room.image_url ? (
106-
<img src={room.image_url} alt={room.title} />
107-
) : (
108-
<span>{room.title}</span>
109-
)}
109+
<div className="room-modal__icon" style={iconStyles} />
110110

111111
<RoomModalOngoingEvent
112112
roomEvents={roomEvents}

0 commit comments

Comments
 (0)