|
1 | 1 | import { useEffect, useRef, useState } from 'react'; |
2 | 2 | import { StopFill } from 'react-bootstrap-icons'; |
3 | 3 | import { useNavigate } from 'react-router-dom'; |
4 | | -import { Sheet, SheetClose, SheetContent, SheetTitle } from '@/components/ui/sheet'; |
| 4 | +import { Sheet, SheetContent, SheetTitle } from '@/components/ui/sheet'; |
5 | 5 | import { api } from '@/lib/api/client'; |
6 | 6 | import { notice } from '@/lib/message'; |
7 | 7 | import { getCurrentUser } from '@/lib/user'; |
@@ -153,7 +153,6 @@ export function ChuniV2SongScoreRanking({ |
153 | 153 |
|
154 | 154 | function selectDifficulty(level: number) { |
155 | 155 | setCurrentLevel(level); |
156 | | - setRanking([]); |
157 | 156 | void api |
158 | 157 | .get('api/game/chuni/v2/musicScoreRanking', { musicId: music!.musicId, level }) |
159 | 158 | .then((response) => setRanking((response ?? []) as ChuniV2SongRankingRow[])) |
@@ -189,34 +188,37 @@ export function ChuniV2SongScoreRanking({ |
189 | 188 | className="chuni-v2-song-score-ranking-panel chuni-v2-song-score-ranking-sheet w-[400px] max-w-full p-0 text-sm outline-none sm:max-w-[400px]" |
190 | 189 | onOpenAutoFocus={(event) => event.preventDefault()} |
191 | 190 | > |
192 | | - <div className="offcanvas-header position-absolute end-0 z-3"> |
193 | | - <SheetClose asChild> |
194 | | - <button type="button" className="btn-close" aria-label="Close" /> |
195 | | - </SheetClose> |
196 | | - </div> |
197 | 191 | <SheetTitle className="visually-hidden">{music.name}</SheetTitle> |
198 | | - <div className="offcanvas-body pt-0 px-0"> |
| 192 | + <div |
| 193 | + className="offcanvas-body" |
| 194 | + style={{ maxHeight: '100vh', overflowY: 'scroll', boxSizing: 'border-box', margin: 0, padding: 0 }} |
| 195 | + > |
| 196 | + <button |
| 197 | + type="button" |
| 198 | + className="btn-close" |
| 199 | + aria-label="Close" |
| 200 | + style={{ position: 'fixed', top: '1rem', right: '1rem', zIndex: 1000 }} |
| 201 | + onClick={requestClose} |
| 202 | + /> |
199 | 203 | <div |
200 | | - className="music-info-container row pb-3 pt-3 gap-3 px-3 m-0" |
201 | | - style={ |
202 | | - { |
203 | | - '--jacket-img': `url(${assetsHost}assets/chuni/jacket/CHU_UI_Jacket_${padDigits(music.musicId, 4)}.webp)`, |
204 | | - } as React.CSSProperties |
205 | | - } |
| 204 | + className="music-info-container position-relative" |
| 205 | + style={{ |
| 206 | + '--jacket-img': `url(${assetsHost}assets/chuni/jacket/CHU_UI_Jacket_${padDigits(music.musicId, 4)}.webp)`, |
| 207 | + } as React.CSSProperties} |
206 | 208 | > |
207 | | - <div className="col-12 p-0"> |
208 | | - {enableImages && ( |
209 | | - <img |
210 | | - className="music-img" |
211 | | - src={`${assetsHost}assets/chuni/jacket/CHU_UI_Jacket_${padDigits(music.musicId, 4)}.webp`} |
212 | | - alt="" |
213 | | - /> |
214 | | - )} |
215 | | - </div> |
216 | | - <div className="col-12 music-info"> |
217 | | - <h4 className="music-title">「{music.name}」</h4> |
218 | | - <div className="mb-1">{music.artistName}</div> |
219 | | - <div className="text-secondary">{music.genre}</div> |
| 209 | + {enableImages && ( |
| 210 | + <img |
| 211 | + className="card-img mb-3 music-img sm ms-4 mt-4 rounded" |
| 212 | + src={`${assetsHost}assets/chuni/jacket/CHU_UI_Jacket_${padDigits(music.musicId, 4)}.webp`} |
| 213 | + alt="" |
| 214 | + /> |
| 215 | + )} |
| 216 | + <div className="position-relative"> |
| 217 | + <h5 className="card-title mb-1 fw-bold ms-4">{music.name}</h5> |
| 218 | + <span className="card-subtitle music-artistName ms-4" style={{ fontSize: 12 }}> |
| 219 | + {music.artistName} |
| 220 | + </span> |
| 221 | + <hr className="mb-0" /> |
220 | 222 | </div> |
221 | 223 | </div> |
222 | 224 |
|
|
0 commit comments