Skip to content

Commit

Permalink
Merge pull request toggle-corp#759 from toggle-corp/fix/typing-issues
Browse files Browse the repository at this point in the history
Fix typing issues
  • Loading branch information
frozenhelium authored Apr 29, 2021
2 parents c80b42c + 4a890d0 commit 87aa0f0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion components/General/Modalize.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';

// eslint-disable-next-line @typescript-eslint/ban-types
declare function modalize<T extends object>(
component: (props: T) => JSX.Element,
component: React.ReactComponent<T>,
): React.ReactComponent<T & { modal: React.ReactElement; initialShowModal?: boolean }>;

export default modalize;
2 changes: 1 addition & 1 deletion v2/Input/TreeInput/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export function generateRelations<T, K extends string | number | boolean>(
const parentFromAcc = acc[String(parentId)];
const parent: InternalRelation<K> = parentFromAcc
? ({
...acc[String(parentId)],
...parentFromAcc,
children: {
...parentFromAcc.children,
...elem.children,
Expand Down
20 changes: 11 additions & 9 deletions v2/View/CircularProgressBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ interface Props {
arcClassName?: string;
}

const arcGenerator = arc()
.cornerRadius(5);

function CircularProgressBar(props: Props) {
const {
width,
Expand All @@ -31,26 +34,25 @@ function CircularProgressBar(props: Props) {
const innerCircleRadius = arcInnerRadius - imagePadding;
const imageWidth = (innerCircleRadius - (0.1 * imagePadding)) * Math.sqrt(2);

const arcGenerator = arc()
.innerRadius(arcInnerRadius)
.outerRadius(arcOuterRadius)
.startAngle(0)
.cornerRadius(5);

const progressArc = (v: number) => arcGenerator({ endAngle: 2 * Math.PI * v });
const progressArc = (v: number) => arcGenerator({
endAngle: 2 * Math.PI * v,
startAngle: 0,
innerRadius: arcInnerRadius,
outerRadius: arcOuterRadius,
});

return (
<svg className={_cs(styles.progressBar, className)} height={height} width={width}>
<g transform={`translate(${width / 2}, ${height / 2})`}>
<path
className={styles.arcBackground}
d={progressArc(1)}
d={progressArc(1) ?? undefined}
/>
</g>
<g transform={`translate(${width / 2}, ${height / 2})`}>
<path
className={_cs(styles.arc, arcClassName)}
d={progressArc(value / 100)}
d={progressArc(value / 100) ?? undefined}
/>
</g>
<g transform={`translate(${width / 2}, ${height / 2})`}>
Expand Down

0 comments on commit 87aa0f0

Please sign in to comment.