forked from 4GeeksAcademy/react-flask-hello
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from 4GeeksAcademy/YuneDev
Merge Yunedev into dev
- Loading branch information
Showing
21 changed files
with
622 additions
and
96 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
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
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,71 @@ | ||
import React, { useState, useEffect } from 'react' | ||
import styled from 'styled-components' | ||
import ProgressBar from 'react-bootstrap/ProgressBar' | ||
import Collapse from 'react-bootstrap/Collapse'; | ||
|
||
const StyledProgresBar = styled(ProgressBar)` | ||
height: 45%; | ||
width: 40%; | ||
margin: 0 auto; | ||
border: 1px solid grey; | ||
` | ||
|
||
|
||
|
||
export const Progress = (value = 5, min = 0, max = 20) => { | ||
let variant = "success" | ||
|
||
if (value < 10) { | ||
variant = "danger" | ||
} else if (value < 15) { | ||
variant = "warning" | ||
} else if (value < 18) { | ||
variant = 'info' | ||
} | ||
|
||
|
||
|
||
return <StyledProgresBar min={min} max={max} now={value} variant={variant} /> | ||
|
||
} | ||
|
||
|
||
|
||
const ShowSubjectTests = ({ name, grade, description, date }) => { | ||
const [isOpen, setIsOpen] = useState(false) | ||
|
||
|
||
|
||
|
||
|
||
return ( | ||
<div className="container-fluid "> | ||
<div className="row mb-2 mt-2"> | ||
<div className="col-4 d-flex justify-content-start align-items-center text-truncate" onClick={() => setIsOpen(!isOpen)}> | ||
<i className={`bi bi-caret-${isOpen ? "up" : "down"}-fill me-1 d-none d-md-block`}></i> {name} | ||
</div> | ||
<div className='col-4 d-flex justify-content-center align-items-center'> | ||
{Progress(grade)} | ||
</div> | ||
<div className='col-4 d-flex justify-content-end align-items-center'> | ||
{grade.toFixed(2)} | ||
</div> | ||
</div> | ||
<Collapse in={isOpen}> | ||
<div className='row'> | ||
<div className='col-8'> | ||
<p className="text-light"> | ||
{description} | ||
</p> | ||
</div> | ||
<div className="col-4 text-end"> | ||
{date.split(" ").slice(0, 4).join(" ")} | ||
</div> | ||
</div> | ||
</Collapse> | ||
|
||
</div> | ||
) | ||
} | ||
|
||
export default ShowSubjectTests |
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
Oops, something went wrong.