-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4471830
commit f58ae6d
Showing
8 changed files
with
103 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.LeaderboardWrapper { | ||
padding-top: 6rem; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
interface Props { | ||
headings: string[] | ||
} | ||
|
||
const Heading = ({ headings }: Props) => { | ||
return ( | ||
<thead className='text-xs text-gray-700 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400'> | ||
<tr> | ||
{headings.map(heading => { | ||
return ( | ||
<th scope='col' className='px-6 py-3'> | ||
{heading} | ||
</th> | ||
) | ||
})} | ||
</tr> | ||
</thead> | ||
) | ||
} | ||
|
||
export default Heading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { it } from 'node:test' | ||
|
||
interface Props { | ||
data_items: string[] | ||
index_row: number | ||
} | ||
|
||
const IndividualCol = ({ index_row, data_items }: Props) => { | ||
return ( | ||
<tr | ||
className='border-b dark:bg-gray-800 dark:border-gray-700 odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700' | ||
key={index_row} | ||
> | ||
{data_items.map((item, index) => { | ||
if (index === 0) { | ||
return ( | ||
<th | ||
scope='row' | ||
className='px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap' | ||
> | ||
{item} | ||
</th> | ||
) | ||
} | ||
if (index === data_items.length - 1) { | ||
return <td className='px-6 py-4 text-right'>{item}</td> | ||
} | ||
return <td className='px-6 py-4'>{item}</td> | ||
})} | ||
</tr> | ||
) | ||
} | ||
|
||
export default IndividualCol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import Heading from './Heading' | ||
import IndividualCol from './IndividualCol' | ||
|
||
interface Props {} | ||
|
||
const InfoTable = ({}: Props) => { | ||
const heading_cf: string[] = [ | ||
'RollNumber', | ||
'User Handle', | ||
'Rating', | ||
'Contests', | ||
] | ||
const data_reg1: string[] = ['210020047', 'shubhagarwal539', '1100', '1816'] | ||
const data_reg2: string[] = ['2100200048', 'RoopikaKaPreemi', '1169', '1812'] | ||
return ( | ||
<> | ||
<div className='flex justify-center'> | ||
<div className='relative overflow-x-auto shadow-md px-4 sm:px-8 md:px-12 lg:px-36 xl:px-56'> | ||
<table className='w-full text-sm text-left text-gray-500 dark:text-gray-400'></table> | ||
<Heading headings={heading_cf} /> | ||
<tbody> | ||
<IndividualCol data_items={data_reg1} index_row={0} /> | ||
<IndividualCol data_items={data_reg2} index_row={1} /> | ||
</tbody> | ||
</div> | ||
</div> | ||
</> | ||
) | ||
} | ||
|
||
export default InfoTable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters