-
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.
Merge pull request #51 from entrylabs/issue/7700_2
Issue/7700 2
- Loading branch information
Showing
13 changed files
with
278 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
|
||
const ProgressBar = (props) => { | ||
const { percent, preset = 'default' } = props; | ||
const [roundPercent, setRoundPercent] = useState(0); | ||
const overHalf = roundPercent > 50; | ||
|
||
useEffect(() => { | ||
if (preset === 'full') { | ||
setRoundPercent(100); | ||
} else if (preset === 'fail') { | ||
setRoundPercent(Math.round(0)); | ||
} else { | ||
setRoundPercent(Math.round(percent)); | ||
} | ||
}, [preset, percent]); | ||
|
||
return ( | ||
<div className={`entry-modal-progressbar-wrapper`}> | ||
<progress className={`entry-modal-progressbar`} value={roundPercent} max="100" /> | ||
<div | ||
className={`entry-modal-progressbar-text ${ | ||
overHalf ? 'entry-modal-text-invert' : '' | ||
}`} | ||
> | ||
{preset === 'fail' ? '!' : `${roundPercent}%`} | ||
</div> | ||
</div> | ||
); | ||
}; | ||
export default ProgressBar; |
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,25 @@ | ||
import React, { useEffect, useState } from 'react'; | ||
import { IMAGE_TYPES } from '../../constants'; | ||
|
||
const ContentImage = (props) => { | ||
const { imageType } = props; | ||
const [currentName, setCurrentName] = useState(undefined); | ||
|
||
useEffect(() => { | ||
if (IMAGE_TYPES.includes(imageType)) { | ||
setCurrentName(imageType); | ||
} else { | ||
console.log('ERROR: not supported imageType.'); | ||
} | ||
}, [imageType]); | ||
|
||
return ( | ||
currentName && ( | ||
<div | ||
className={`entry-modal-contentImage entry-modal-img_${currentName}`} | ||
alt={imageType} | ||
/> | ||
) | ||
); | ||
}; | ||
export default ContentImage; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.