-
Notifications
You must be signed in to change notification settings - Fork 5
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 #65 from topcoder-platform/dev
[PROD] Release 1.0.2
- Loading branch information
Showing
83 changed files
with
2,669 additions
and
684 deletions.
There are no files selected for viewing
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.
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 |
---|---|---|
|
@@ -4,7 +4,8 @@ | |
padding: 0 10px; | ||
|
||
@include desktop { | ||
flex: 1 1 auto; | ||
flex: 1 1 0; | ||
padding: 0 35px; | ||
min-width: 0; | ||
} | ||
} |
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,61 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import PT from "prop-types"; | ||
import cn from "classnames"; | ||
import Icon from "../../../assets/images/icon-checkmark-circled.svg"; | ||
import styles from "./styles.module.scss"; | ||
|
||
/** | ||
* Displays an animated checkmark inside circle. After the specified timeout | ||
* the checkmark is faded out and after fade transition ends the onTimeout | ||
* is called. | ||
* | ||
* @param {Object} props component properties | ||
* @param {string} [props.className] class name to be added to root element | ||
* @param {() => void} props.onTimeout | ||
* @param {number} props.timeout timeout milliseconds | ||
* @returns {JSX.Element} | ||
*/ | ||
const CheckmarkCircled = ({ className, onTimeout, timeout = 2000 }) => { | ||
const [isAnimated, setIsAnimated] = useState(false); | ||
const [isTimedOut, setIsTimedOut] = useState(false); | ||
|
||
useEffect(() => { | ||
setIsAnimated(true); | ||
}, []); | ||
|
||
useEffect(() => { | ||
setIsTimedOut(false); | ||
let timeoutId = setTimeout(() => { | ||
timeoutId = 0; | ||
setIsTimedOut(true); | ||
}, Math.max(timeout, /* total CSS animation duration */ 1200)); | ||
return () => { | ||
if (timeoutId) { | ||
clearTimeout(timeoutId); | ||
} | ||
}; | ||
}, [timeout]); | ||
|
||
return ( | ||
<span | ||
className={cn( | ||
styles.container, | ||
{ [styles.fadeOut]: isTimedOut }, | ||
className | ||
)} | ||
onTransitionEnd={isTimedOut ? onTimeout : null} | ||
> | ||
<Icon | ||
className={cn(styles.checkmark, { [styles.animated]: isAnimated })} | ||
/> | ||
</span> | ||
); | ||
}; | ||
|
||
CheckmarkCircled.propTypes = { | ||
className: PT.string, | ||
onTimeout: PT.func.isRequired, | ||
timeout: PT.number, | ||
}; | ||
|
||
export default CheckmarkCircled; |
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,79 @@ | ||
@import "styles/variables"; | ||
|
||
.container { | ||
display: inline-block; | ||
width: 30px; | ||
height: 30px; | ||
opacity: 1; | ||
transition: opacity 0.2s ease; | ||
} | ||
|
||
.checkmark { | ||
display: block; | ||
width: auto; | ||
height: 100%; | ||
border-radius: 999px; | ||
stroke-width: 2; | ||
stroke: $primary-color; | ||
stroke-miterlimit: 10; | ||
box-shadow: inset 0px 0px 0px $primary-color; | ||
animation-play-state: paused; | ||
animation: /*checkmark-circled-fill 0.4s ease-in-out 0.4s forwards,*/ checkmark-circled-scale | ||
0.3s ease-in-out 0.9s both; | ||
|
||
:global(.checkmark__circle) { | ||
stroke-dasharray: 166; | ||
stroke-dashoffset: 166; | ||
stroke-width: 2; | ||
stroke-miterlimit: 10; | ||
stroke: $primary-color; | ||
fill: rgba(255, 255, 255, 0); | ||
animation-play-state: paused; | ||
animation: checkmark-circled-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) | ||
forwards; | ||
} | ||
|
||
:global(.checkmark__check) { | ||
transform-origin: 50% 50%; | ||
stroke-dasharray: 48; | ||
stroke-dashoffset: 48; | ||
animation-play-state: paused; | ||
animation: checkmark-circled-stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s | ||
forwards; | ||
} | ||
} | ||
|
||
.animated { | ||
animation-play-state: running; | ||
|
||
:global(.checkmark__circle), | ||
:global(.checkmark__check) { | ||
animation-play-state: running; | ||
} | ||
} | ||
|
||
.fadeOut { | ||
opacity: 0; | ||
} | ||
|
||
@keyframes checkmark-circled-stroke { | ||
100% { | ||
stroke-dashoffset: 0; | ||
} | ||
} | ||
|
||
@keyframes checkmark-circled-scale { | ||
0%, | ||
100% { | ||
transform: none; | ||
} | ||
50% { | ||
transform: scale3d(1.1, 1.1, 1); | ||
} | ||
} | ||
|
||
@keyframes checkmark-circled-fill { | ||
100% { | ||
box-shadow: inset 0px 0px 0px 10px $primary-color; | ||
} | ||
} |
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,20 @@ | ||
import React from "react"; | ||
import PT from "prop-types"; | ||
import cn from "classnames"; | ||
import styles from "./styles.module.scss"; | ||
|
||
/** | ||
* Displays a white exclamation mark inside red circle. | ||
* | ||
* @param {Object} props component properties | ||
* @returns {JSX.Element} | ||
*/ | ||
const ExclamationMarkCircled = (props) => ( | ||
<span {...props} className={cn(styles.icon, props.className)} /> | ||
); | ||
|
||
ExclamationMarkCircled.propTypes = { | ||
className: PT.string, | ||
}; | ||
|
||
export default ExclamationMarkCircled; |
22 changes: 22 additions & 0 deletions
22
src/components/Icons/ExclamationMarkCircled/styles.module.scss
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,22 @@ | ||
@import "styles/mixins"; | ||
@import "styles/variables"; | ||
|
||
.icon { | ||
display: inline-block; | ||
padding: 2px 0 0; | ||
font-size: 12px; | ||
width: 16px; | ||
height: 16px; | ||
border-radius: 8px; | ||
line-height: 14px; | ||
@include roboto-bold; | ||
text-align: center; | ||
background: $error-color; | ||
color: #fff; | ||
cursor: pointer; | ||
|
||
&::before { | ||
content: "!"; | ||
display: inline; | ||
} | ||
} |
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,30 @@ | ||
import React, { memo, useContext, useEffect } from "react"; | ||
import PT from "prop-types"; | ||
import cn from "classnames"; | ||
import { JobNameContext } from "components/JobNameProvider"; | ||
import { JOB_NAME_LOADING } from "constants/workPeriods"; | ||
import styles from "./styles.module.scss"; | ||
|
||
const JobName = ({ className, jobId }) => { | ||
const [getName, fetchName] = useContext(JobNameContext); | ||
const [jobName, error] = getName(jobId); | ||
|
||
useEffect(() => { | ||
fetchName(jobId); | ||
}, [fetchName, jobId]); | ||
|
||
return ( | ||
<span | ||
className={cn(styles.container, { [styles.error]: !!error }, className)} | ||
> | ||
{jobName || JOB_NAME_LOADING} | ||
</span> | ||
); | ||
}; | ||
|
||
JobName.propTypes = { | ||
className: PT.string, | ||
jobId: PT.oneOfType([PT.number, PT.string]).isRequired, | ||
}; | ||
|
||
export default memo(JobName); |
Oops, something went wrong.