Skip to content

Commit

Permalink
refactor code base on comments
Browse files Browse the repository at this point in the history
  • Loading branch information
namnguyen20999 committed Jun 4, 2024
1 parent 678fa7f commit cdc0834
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 3 additions & 4 deletions frontend/taipy-gui/src/components/Taipy/Metric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ const Metric = (props: MetricProps) => {
const delta = useDynamicProperty(props.delta, props.defaultDelta, undefined)
const className = useClassNames(props.libClassName, props.dynamicClassName, props.className);
const baseLayout = useDynamicJsonProperty(props.layout, props.defaultLayout || "", emptyLayout);
const baseStyle = useDynamicJsonProperty(props.style, props.defaultStyle || "", defaultStyle);
const hover = useDynamicProperty(props.hoverText, props.defaultHoverText, undefined);

const data = useMemo(() => {
Expand Down Expand Up @@ -110,9 +109,9 @@ const Metric = (props: MetricProps) => {
const style = useMemo(
() =>
height === undefined
? ({...baseStyle, width: width} as CSSProperties)
: ({...baseStyle, width: width, height: height} as CSSProperties),
[baseStyle, height, width]
? ({...defaultStyle, width: width} as CSSProperties)
: ({...defaultStyle, width: width, height: height} as CSSProperties),

Check warning on line 113 in frontend/taipy-gui/src/components/Taipy/Metric.tsx

View workflow job for this annotation

GitHub Actions / Coverage annotations (🧪 jest-coverage-report-action)

🌿 Branch is not covered

Warning! Not covered branch
[height, width]
);

const skelStyle = useMemo(() => ({...style, minHeight: "7em"}), [style]);
Expand Down
1 change: 0 additions & 1 deletion taipy/gui/_renderers/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,6 @@ class _Factory:
("id",),
("active", PropertyType.dynamic_boolean, True),
("layout", PropertyType.dynamic_dict),
("style", PropertyType.dynamic_dict),
("type", PropertyType.string, "circular"),
("min", PropertyType.number, 0),
("max", PropertyType.number, 100),
Expand Down

0 comments on commit cdc0834

Please sign in to comment.