Skip to content

Commit 87eb7b6

Browse files
committed
fix: fix to show time at table
1 parent 8f86ca7 commit 87eb7b6

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

components/events/Timetable.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ const Timetable: FC<ComponentProps> = ({
192192
]?.includes(currentAttendee)
193193
}
194194
>
195-
{dayIndex === 0 && <TimeUnit>{hours}:00</TimeUnit>}
196195
{currentAttendeeCount}
197196
</EachRowTime>
198197
);
@@ -212,6 +211,11 @@ const Timetable: FC<ComponentProps> = ({
212211
/>
213212
);
214213
})}
214+
<TimesWrapper height={initialTableArea.h}>
215+
{DAY_TIME_ARRAY[0].map((hour) => (
216+
<TimeUnit key={hour}>{hour}:00</TimeUnit>
217+
))}
218+
</TimesWrapper>
215219
<SelectedAreaBox {...currentSelectedAreaRef.current} />
216220
</Container>
217221
);
@@ -225,6 +229,7 @@ const Container = styled.div`
225229
gap: 0.1rem;
226230
flex: 1;
227231
cursor: pointer;
232+
position: relative;
228233
`;
229234
const SelectedAreaBox = styled.div<TimeProps>`
230235
position: fixed;
@@ -249,16 +254,26 @@ const AvailableDate = styled.div`
249254
const NotAvailableDate = styled.div`
250255
background-color: ${(props) => props.theme.colors.block};
251256
`;
257+
const TimesWrapper = styled.div<{ height: number }>`
258+
border-radius: 0.3rem;
259+
display: grid;
260+
grid-template-rows: repeat(16, 1fr);
261+
gap: 0.2rem;
262+
position: absolute;
263+
top: 0px;
264+
left: 0px;
265+
height: ${(props) => props.height}px;
266+
`;
252267

253268
const TimeUnit = styled.div`
254-
position: absolute;
255269
top: -0rem;
256-
left: -3.3rem;
270+
left: -3.2rem;
257271
font-size: 1rem;
258272
color: #3e3e3e;
259273
width: 2.5rem;
260274
text-align: right;
261275
font-weight: 400;
276+
position: relative;
262277
`;
263278

264279
const EachRowTime = styled.div<EachRowTimeProps>`

0 commit comments

Comments
 (0)