Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shayan/74993/circular progress component ts migration #28

Merged
Show file tree
Hide file tree
Changes from 52 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
613e011
checking circle/ci test
Jul 11, 2022
2dc542b
removed test changes
Jul 11, 2022
3088a3b
Merge branch 'binary-com:master' into master
shayan-deriv Jul 12, 2022
321e537
Merge branch 'binary-com:master' into master
shayan-deriv Jul 13, 2022
38dfce8
Merge branch 'master' of https://github.com/binary-com/deriv-app
Jul 13, 2022
21a7c64
Merge branch 'binary-com:master' into master
shayan-deriv Jul 19, 2022
cbf5de9
Merge branch 'binary-com:master' into master
shayan-deriv Jul 21, 2022
6882b1d
Merge branch 'binary-com:master' into master
shayan-deriv Jul 21, 2022
c800916
Merge branch 'binary-com:master' into master
shayan-deriv Jul 21, 2022
af4c871
Merge branch 'master' of https://github.com/binary-com/deriv-app
Jul 25, 2022
d4fedbe
Merge branch 'master' of github.com:iman-fs/deriv-app
Jul 25, 2022
308df7c
Merge branch 'master' of https://github.com/binary-com/deriv-app
Jul 26, 2022
06d8d2a
Merge branch 'binary-com:master' into master
shayan-deriv Jul 28, 2022
9564888
Merge branch 'binary-com:master' into master
shayan-deriv Jul 28, 2022
d217eb4
Merge branch 'binary-com:master' into master
shayan-deriv Aug 2, 2022
cf021d2
Merge branch 'master' of https://github.com/binary-com/deriv-app
Aug 2, 2022
45c53ac
Merge branch 'master' of github.com:iman-fs/deriv-app
Aug 2, 2022
fcfc904
Merge branch 'binary-com:master' into master
shayan-deriv Aug 3, 2022
77a5aab
Merge branch 'master' of https://github.com/binary-com/deriv-app
Aug 4, 2022
8713764
Merge branch 'binary-com:master' into master
shayan-deriv Aug 4, 2022
8de30bd
Merge branch 'binary-com:master' into master
shayan-deriv Aug 5, 2022
f958136
Merge branch 'master' of github.com:iman-fs/deriv-app
Aug 9, 2022
d8fa7bf
Merge branch 'master' of https://github.com/binary-com/deriv-app
Aug 9, 2022
6887da9
Merge branch 'master' of https://github.com/binary-com/deriv-app
Aug 10, 2022
bf61789
Merge branch 'binary-com:master' into master
shayan-deriv Aug 10, 2022
9d2a8f3
Merge branch 'binary-com:master' into master
shayan-deriv Aug 14, 2022
d1a7e49
Merge branch 'master' of https://github.com/binary-com/deriv-app
Aug 15, 2022
6b38944
Merge branch 'binary-com:master' into master
shayan-deriv Aug 17, 2022
0f24d87
Merge branch 'binary-com:master' into master
shayan-deriv Aug 22, 2022
0a7019d
Merge branch 'binary-com:master' into master
shayan-deriv Aug 22, 2022
064fa80
Merge branch 'master' of github.com:binary-com/deriv-app
Aug 23, 2022
fc06876
Merge branch 'binary-com:master' into master
shayan-deriv Aug 24, 2022
db7672c
Merge branch 'binary-com:master' into master
shayan-deriv Aug 25, 2022
c614ad1
Merge branch 'master' of github.com:binary-com/deriv-app
Aug 31, 2022
0ed207c
Merge branch 'master' of github.com:binary-com/deriv-app
Sep 4, 2022
ec1b58e
Merge branch 'master' of github.com:binary-com/deriv-app
Sep 5, 2022
c9ae429
Merge branch 'binary-com:master' into master
shayan-deriv Sep 6, 2022
2a645d3
Merge branch 'master' of github.com:binary-com/deriv-app
Sep 6, 2022
5ad2d1f
Merge branch 'binary-com:master' into master
shayan-deriv Sep 6, 2022
25c6c61
Merge branch 'binary-com:master' into master
shayan-deriv Sep 8, 2022
a2c4365
Merge branch 'binary-com:master' into master
shayan-deriv Sep 12, 2022
0d13377
Merge branch 'master' of github.com:binary-com/deriv-app
Sep 14, 2022
c2e443e
Merge branch 'master' of github.com:binary-com/deriv-app
Sep 14, 2022
97c2266
refactor: WIP
Sep 15, 2022
3a2930c
chore: default prop values added
Sep 15, 2022
58c14d2
chore: uncommented Icon component
Sep 15, 2022
e5c7f6d
Merge branch 'master' into shayan/74993/circular-progress-component-t…
shayan-deriv Sep 15, 2022
61a57c9
Merge branch 'master' into shayan/74993/circular-progress-component-t…
shayan-deriv Sep 15, 2022
e7c7aab
Merge branch 'master' into shayan/74993/circular-progress-component-t…
shayan-deriv Sep 18, 2022
b0c4fc6
Merge branch 'master' into shayan/74993/circular-progress-component-t…
shayan-deriv Sep 26, 2022
3a4730d
Merge branch 'components-shared-ts-migration-parent' of github.com:ji…
Sep 26, 2022
37e6b81
fix: made types optiona;
Sep 26, 2022
2ab830d
Merge branch 'components-shared-ts-migration-parent' of github.com:ji…
Sep 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,28 @@
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
import Icon from '../icon/icon';

const CircularProgress = ({ className, danger_limit, icon, is_clockwise, progress, radius, stroke, warning_limit }) => {
type TCircularProgressProps = {
className?: string;
danger_limit?: number;
is_clockwise?: boolean;
progress?: number;
radius?: number;
stroke?: number;
warning_limit?: number;
icon?: string;
};

const CircularProgress = ({
className,
danger_limit = 20,
icon = '',
is_clockwise = false,
progress = 0,
radius = 22,
stroke = 3,
warning_limit = 50,
}: TCircularProgressProps) => {
const normalizedRadius = radius - stroke / 2;
const circumference = normalizedRadius * 2 * Math.PI;
const strokeDashoffset = circumference - (progress / 100) * circumference;
Expand All @@ -30,25 +49,4 @@ const CircularProgress = ({ className, danger_limit, icon, is_clockwise, progres
);
};

CircularProgress.defaultProps = {
icon: 'IcClockOutline',
danger_limit: 20,
is_clockwise: false,
progress: 0,
radius: 22,
stroke: 3,
warning_limit: 50,
};

export default CircularProgress;

CircularProgress.propTypes = {
className: PropTypes.string,
danger_limit: PropTypes.number,
is_clockwise: PropTypes.bool,
progress: PropTypes.number,
radius: PropTypes.number,
stroke: PropTypes.number,
warning_limit: PropTypes.number,
icon: PropTypes.string,
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import CircularProgress from './circular-progress.jsx';
import CircularProgress from './circular-progress';
import './circular-progress.scss';

export default CircularProgress;