-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Labels
ODHack 14ODODUI/WebIssue targets the UI and the frontendIssue targets the UI and the frontendgood first issueGood for newcomersGood for newcomers
Description
Description
Interactive team composition interface with real-time Cairo contract validation.
Acceptance Criteria:
- Drag-and-drop players into formation slots (4-3-3 default)
- Salary cap counter (€100M budget)
- Real-time validation against
TeamValidation.cairorules:- Player positions
- Team nationality quotas
- Captain selection
- Error toast notifications
- IPFS metadata preview before submission
Technical Details:
// components/TeamBuilder.tsx
import { DragDropContext, Droppable, Draggable } from '@hello-pangea/dnd';
interface PlayerSlot {
position: 'GK' | 'DEF' | 'MID' | 'FWD';
player?: Player;
}
export default function TeamBuilder() {
const [formation, setFormation] = useState<PlayerSlot[]>(/*...*/);
const validateTeam = useCallback(
debounce(async (players: string[]) => {
const { isValid } = await callContract('TeamValidation', 'validate_team', [players]);
setIsValid(isValid);
}, 300),
[]
);
return (
<DragDropContext onDragEnd={handleDragEnd}>
<div className={css.formationGrid}>
{formation.map((slot, index) => (
<Droppable droppableId={`slot-${index}`}>
{/* ... */}
</Droppable>
))}
</div>
</DragDropContext>
);
}Notes:
- Implement custom position validators
- Show player stats tooltips on hover
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ODHack 14ODODUI/WebIssue targets the UI and the frontendIssue targets the UI and the frontendgood first issueGood for newcomersGood for newcomers