Skip to content

Commit

Permalink
Merge pull request #891 from gisce/70005/indicadors-styles-card
Browse files Browse the repository at this point in the history
Indicator: allow use prop card to show as card indicator
  • Loading branch information
ecarreras authored Feb 14, 2025
2 parents 3778b5c + 7b72ac9 commit c5ddfeb
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/widgets/custom/Indicator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const GraphIndicatorInput = (props: IndicatorInputProps) => {
action={treeShortcut}
openAction={openShortcut as any}
tooltip={description}
card={ooui.card}
>
{loading && <CenteredSpinner />}
{!loading && (
Expand Down
26 changes: 22 additions & 4 deletions src/widgets/views/Graph/GraphCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,15 @@ const { useToken } = theme;
const { Text } = Typography;

export const GraphCard = (props: GraphCardProps) => {
const { title, children, action, openAction, parms, tooltip } = props;
const {
title,
children,
action,
openAction,
parms,
tooltip,
card = false,
} = props;
const { token } = useToken();

const hasDragAndDrop = Object.keys(parms).length > 0;
Expand All @@ -28,8 +36,8 @@ export const GraphCard = (props: GraphCardProps) => {
<Row
align="middle"
style={{
borderBottom: "1px solid #ddd",
backgroundColor: token.colorPrimaryBg,
borderBottom: card ? "none" : "1px solid #ddd",
backgroundColor: card ? token.colorBgBase : token.colorPrimaryBg,
}}
wrap={false}
>
Expand All @@ -51,7 +59,17 @@ export const GraphCard = (props: GraphCardProps) => {
<Text ellipsis={true}>{title}</Text>
</>
) : (
<Text ellipsis={true}>{title}</Text>
<Text
ellipsis={true}
style={{
color: card
? token.colorTextDescription
: token.colorTextHeading,
fontWeight: card ? "normal" : "bold",
}}
>
{title}
</Text>
)}
</Col>
{action && (
Expand Down
1 change: 1 addition & 0 deletions src/widgets/views/Graph/GraphCard.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ export type GraphCardProps = {
action?: ShortcutApi;
openAction?: (shortcutApi?: ShortcutApi) => void;
tooltip?: string;
card?: boolean;
};

0 comments on commit c5ddfeb

Please sign in to comment.