-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
11 changed files
with
343 additions
and
17 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,36 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { TraineeList } from '../TraineeList'; | ||
import Sheet from '../Sheet'; | ||
import './styles.css'; | ||
|
||
class Board extends React.Component { | ||
render() { | ||
const { sheets, trainees } = this.props; | ||
|
||
return ( | ||
<div className="board"> | ||
<div className="trainees-section"> | ||
<TraineeList trainees={trainees} /> | ||
</div> | ||
<div className="sheets-section"> | ||
<div className="sheets"> | ||
{sheets.map(({ id, name, problems }, index) => ( | ||
<div className="sheet-collection" key={index}> | ||
<Sheet id={id} name={name} problems={problems} /> | ||
</div> | ||
))} | ||
</div> | ||
<div>Hi</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
Board.propTypes = { | ||
sheets: PropTypes.array.isRequired, | ||
trainees: PropTypes.array.isRequired | ||
}; | ||
|
||
export default Board; |
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 @@ | ||
export { default as Board } from './Board'; |
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,28 @@ | ||
.board { | ||
display: flex; | ||
flex-direction: row; | ||
overflow: auto; | ||
} | ||
|
||
/* trainees */ | ||
.board .trainees-section { | ||
background-color: white; | ||
position: sticky; | ||
left: 0; | ||
} | ||
|
||
/* sheets */ | ||
.board .sheets-section .sheets { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.board .sheets-section .sheets .sheet-collection { | ||
border-top: 1px solid #535353; | ||
border-right: 1px solid #535353; | ||
border-bottom: 1px solid #535353; | ||
} | ||
|
||
.board .sheets-section .sheets .sheet-collection:first-of-type { | ||
border-left: 1px solid #535353; | ||
} |
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,58 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { sheetNameHeight, blockSize, sheetProblemIdHeight } from '../common'; | ||
import './styles.css'; | ||
|
||
class Sheet extends React.Component { | ||
render() { | ||
const { id, name, problems } = this.props; | ||
|
||
return ( | ||
<div className="sheet"> | ||
<a | ||
href={`https://codeforces.com/group/MWSDmqGsZm/contest/${id}`} | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
className="title" | ||
style={{ height: sheetNameHeight }} | ||
> | ||
{name} | ||
</a> | ||
<div className="problems"> | ||
{problems.map((problem, index) => ( | ||
<a | ||
key={index} | ||
href={`https://codeforces.com/group/MWSDmqGsZm/contest/${id}/problem/${problem.id}`} | ||
rel="noopener noreferrer" | ||
target="_blank" | ||
className="problem" | ||
style={{ width: blockSize, height: sheetProblemIdHeight }} | ||
> | ||
<div className="id">{problem.id}</div> | ||
<div className="status">(999/999)</div> | ||
<div | ||
className="details" | ||
style={{ top: sheetProblemIdHeight - 5 }} | ||
> | ||
{problem.name} | ||
</div> | ||
</a> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
Sheet.propTypes = { | ||
id: PropTypes.string.isRequired, | ||
name: PropTypes.string.isRequired, | ||
problems: PropTypes.arrayOf( | ||
PropTypes.shape({ | ||
id: PropTypes.string.isRequired, | ||
name: PropTypes.string.isRequired | ||
}) | ||
).isRequired | ||
}; | ||
|
||
export default Sheet; |
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 @@ | ||
export { default } from './Sheet'; |
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,49 @@ | ||
.sheet .title { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
font-size: 14px; | ||
text-decoration: none; | ||
border-bottom: 1px solid #e1e1e1; | ||
background-color: #e1e1e1; | ||
color: #535353; | ||
} | ||
|
||
.sheet .problems { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.sheet .problems .problem { | ||
position: relative; | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
text-decoration: none; | ||
background-color: #e1e1e1; | ||
} | ||
|
||
.sheet .problems .problem .status { | ||
font-size: 10px; | ||
color: gray; | ||
} | ||
|
||
.sheet .problems .problem .details { | ||
position: absolute; | ||
z-index: 10; | ||
white-space: nowrap; | ||
font-size: 10px; | ||
background-color: lightyellow; | ||
padding: 3px; | ||
border: 1px solid darkgray; | ||
opacity: 0; | ||
transition: all 300ms; | ||
visibility: hidden; | ||
} | ||
|
||
.sheet .problems .problem:hover .details { | ||
opacity: 1; | ||
visibility: visible; | ||
} |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export { default as Trainee } from './Trainee'; | ||
export { default } from './Trainee'; |
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 @@ | ||
export const sheetNameHeight = 25; | ||
export const sheetProblemIdHeight = 35; | ||
export const blockSize = 55; |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
export * from './Trainee'; | ||
export * from './TraineeList'; | ||
export * from './Board'; |