Closed Tejp98 closed 3 years ago
@Tejp98 Hello buddy, You can update to latest version (4.6) which changes renderSeed to a new shape You still can make seed as custom as you want
import { ..., RenderSeedProps } from 'react-brackets';
const RenderSeed = ({ breakpoint, seed, roundIndex, seedIndex }: RenderSeedProps) => {}
Or you can use the current one and you can pass any additional data to the seed object and customize it as you like,
import { Bracket, Seed, SeedItem, SeedTeam, SeedTime } from 'react-brackets';
// You can reshape seed in rounds array and access the object here,
// you can pass index for example in seeds and access it here
const RenderSeed = (seed: any, breakpoint: number) => {
return (
<Seed mobileBreakpoint={breakpoint}>
<SeedItem style={{ width: '100%' }}>
<div>
<SeedTeam>{seed.teams?.[0].name || '-----------'}</SeedTeam>
<div style={{ height: 1, backgroundColor: '#707070' }}></div>
<SeedTeam>{seed.teams?.[1]?.name || '-----------'}</SeedTeam>
</div>
</SeedItem>
<SeedTime mobileBreakpoint={breakpoint} style={{ fontSize: 9 }}>
{seed.date}
</SeedTime>
</Seed>
);
};
<Bracket
rounds={rounds}
renderSeedComponent={RenderSeed}
/>
Can you please provide an approach on how to handle seeds with odd numbers or not in the power of 2? Please refer to the image.