Skip to content

Commit

Permalink
refactor(progress): ♻️ update stories & component
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Oct 19, 2020
1 parent 56d0cb3 commit 5bd038f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions src/progress/Progress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
* We improved the Progress Component [Progress](https://github.com/chakra-ui/chakra-ui/tree/develop/packages/progress)
* to work with Reakit System
*/
import { isFunction } from "@chakra-ui/utils";
import { BoxHTMLProps, BoxOptions, useBox } from "reakit";
import { createHook, createComponent } from "reakit-system";

import { dataAttr } from "../utils";
import { PROGRESS_KEYS } from "./__keys";
import { ProgressStateReturn } from "./ProgressState";
import { dataAttr } from "../utils";

export type ProgressOptions = BoxOptions &
Pick<
Expand Down Expand Up @@ -39,8 +38,8 @@ export const useProgress = createHook<ProgressOptions, ProgressHTMLProps>({

const getAriaValueText = () => {
if (value == null) return;
return isFunction(options.getAriaValueText)
? options.getAriaValueText(value, percent)
return options.getAriaValueText
? options.getAriaValueText?.(value, percent)
: ariaValueText ?? `${value}`;
};

Expand Down
2 changes: 1 addition & 1 deletion src/progress/stories/LinearProgress.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Meta } from "@storybook/react";

import { StyledProgress } from "./Progress";
import { StyledProgress } from "./ProgressComponent";

export default {
title: "Progress/Linear",
Expand Down
File renamed without changes.

0 comments on commit 5bd038f

Please sign in to comment.