.
This commit is contained in:
1 parent
ec2315cc3d
commit
dfcfe9e4ad
3 files changed
+116
-3
No files matched your search
@@ -26,6 +26,7 @@ function formatPoints(value: number) {
|
||||
return value.toLocaleString();
|
||||
}
|
||||
|
||||
const AUCTION_MAX_TEAM_SIZE = 5;
|
||||
const LANE_ROWS: Position[] = ['TOP', 'JGL', 'MID', 'ADC', 'SUP'];
|
||||
const POSITION_TO_RIOT_LANE = {
|
||||
TOP: 'TOP',
|
||||
@@ -194,6 +195,8 @@ function TeamPanel({
|
||||
const accentBar = team.side === 'blue' ? 'bg-blue-500' : 'bg-red-500';
|
||||
const sideColor = team.side === 'blue' ? 'text-blue-400' : 'text-red-400';
|
||||
const headerBg = team.side === 'blue' ? 'bg-blue-500/8' : 'bg-red-500/8';
|
||||
const teamSize = team.members.length + 1;
|
||||
const isFull = teamSize >= AUCTION_MAX_TEAM_SIZE;
|
||||
|
||||
return (
|
||||
<div
|
||||
@@ -216,6 +219,12 @@ function TeamPanel({
|
||||
{formatPoints(team.points)}P
|
||||
</span>
|
||||
</div>
|
||||
<div className="mt-1 flex items-center justify-between text-[10px]">
|
||||
<span className="text-base-content/25">
|
||||
팀장 포함 {teamSize}/{AUCTION_MAX_TEAM_SIZE}
|
||||
</span>
|
||||
{isFull && <span className="font-bold text-amber-400">정원 완료</span>}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="divide-y divide-base-content/5">
|
||||
@@ -247,7 +256,9 @@ function TeamPanel({
|
||||
))
|
||||
)}
|
||||
|
||||
{Array.from({ length: Math.max(0, 4 - team.members.length) }).map((_, index) => (
|
||||
{Array.from({
|
||||
length: Math.max(0, AUCTION_MAX_TEAM_SIZE - 1 - team.members.length),
|
||||
}).map((_, index) => (
|
||||
<div
|
||||
key={`empty-${team.side}-${index}`}
|
||||
className="px-3 py-1.5 h-[34px] flex items-center"
|
||||
@@ -396,6 +407,8 @@ function BidControls({
|
||||
: captainSide === 'red'
|
||||
? state.teams[1]
|
||||
: null;
|
||||
const activeTeamSize = activeTeam ? activeTeam.members.length + 1 : 0;
|
||||
const isActiveTeamFull = activeTeamSize >= AUCTION_MAX_TEAM_SIZE;
|
||||
|
||||
useEffect(() => {
|
||||
setBidAmount(Math.max(minBid, Math.ceil(minBid / 10) * 10));
|
||||
@@ -420,6 +433,7 @@ function BidControls({
|
||||
<button
|
||||
key={preset}
|
||||
onClick={() => setBidAmount(Math.max(minBid, preset))}
|
||||
disabled={isActiveTeamFull}
|
||||
className={`text-[11px] px-2.5 py-1 border transition-colors ${
|
||||
bidAmount === preset
|
||||
? 'border-primary/40 bg-primary/10 text-primary'
|
||||
@@ -436,19 +450,26 @@ function BidControls({
|
||||
setBidAmount(Math.max(minBid, Number(event.target.value)))
|
||||
}
|
||||
min={minBid}
|
||||
disabled={isActiveTeamFull}
|
||||
className="w-24 text-xs px-2 py-1 border border-base-content/10 bg-transparent text-base-content tabular-nums text-right focus:outline-none focus:border-primary/30"
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => onBid(activeTeam.side, bidAmount)}
|
||||
disabled={bidAmount > activeTeam.points || bidAmount <= state.currentBid}
|
||||
disabled={
|
||||
isActiveTeamFull ||
|
||||
bidAmount > activeTeam.points ||
|
||||
bidAmount <= state.currentBid
|
||||
}
|
||||
className={`w-full py-2 text-xs font-bold uppercase tracking-wide border transition-colors disabled:opacity-30 disabled:cursor-not-allowed ${
|
||||
activeTeam.side === 'blue'
|
||||
? 'border-blue-500/30 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20'
|
||||
: 'border-red-500/30 bg-red-500/10 text-red-400 hover:bg-red-500/20'
|
||||
}`}
|
||||
>
|
||||
{activeTeam.side === 'blue' ? '블루팀' : '레드팀'} 입찰 ({formatPoints(bidAmount)}P)
|
||||
{isActiveTeamFull
|
||||
? `${activeTeam.side === 'blue' ? '블루팀' : '레드팀'} 정원 완료 (${activeTeamSize}/${AUCTION_MAX_TEAM_SIZE})`
|
||||
: `${activeTeam.side === 'blue' ? '블루팀' : '레드팀'} 입찰 (${formatPoints(bidAmount)}P)`}
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user