Skip to content

Commit 1eaae36

Browse files
Fix styling for JSON copy buttons (#878)
Fix styling for JSON copy buttons to have a transparent background
1 parent bf5d49c commit 1eaae36

File tree

6 files changed

+53
-6
lines changed

6 files changed

+53
-6
lines changed

src/views/workflow-history/workflow-history-event-details-json/workflow-history-event-details-json.styles.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { type ButtonOverrides } from 'baseui/button';
2+
13
import type {
24
StyletronCSSObject,
35
StyletronCSSObjectOf,
@@ -25,3 +27,13 @@ const cssStylesObj = {
2527

2628
export const cssStyles: StyletronCSSObjectOf<typeof cssStylesObj> =
2729
cssStylesObj;
30+
31+
export const overrides = {
32+
copyButton: {
33+
BaseButton: {
34+
style: {
35+
backgroundColor: 'rgba(0, 0, 0, 0)',
36+
},
37+
},
38+
} satisfies ButtonOverrides,
39+
};

src/views/workflow-history/workflow-history-event-details-json/workflow-history-event-details-json.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ import PrettyJson from '@/components/pretty-json/pretty-json';
66
import useStyletronClasses from '@/hooks/use-styletron-classes';
77
import losslessJsonStringify from '@/utils/lossless-json-stringify';
88

9-
import { cssStyles } from './workflow-history-event-details-json.styles';
9+
import {
10+
cssStyles,
11+
overrides,
12+
} from './workflow-history-event-details-json.styles';
1013
import type { Props } from './workflow-history-event-details-json.types';
1114

1215
export default function WorkflowHistoryEventDetailsJson({ entryValue }: Props) {
@@ -19,7 +22,10 @@ export default function WorkflowHistoryEventDetailsJson({ entryValue }: Props) {
1922
<div className={cls.jsonViewWrapper}>
2023
<div className={cls.jsonViewContainer}>
2124
<div className={cls.jsonViewHeader}>
22-
<CopyTextButton textToCopy={textToCopy} />
25+
<CopyTextButton
26+
textToCopy={textToCopy}
27+
overrides={overrides.copyButton}
28+
/>
2329
</div>
2430
<PrettyJson json={entryValue} />
2531
</div>

src/views/workflow-queries/workflow-queries-result-json/workflow-queries-result-json.styles.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { styled as createStyled } from 'baseui';
2+
import { type ButtonOverrides } from 'baseui/button';
23

34
export const styled = {
45
ViewContainer: createStyled<'div', { $isError: boolean }>(
@@ -24,3 +25,13 @@ export const styled = {
2425
})
2526
),
2627
};
28+
29+
export const overrides = {
30+
copyButton: {
31+
BaseButton: {
32+
style: {
33+
backgroundColor: 'rgba(0, 0, 0, 0)',
34+
},
35+
},
36+
} satisfies ButtonOverrides,
37+
};

src/views/workflow-queries/workflow-queries-result-json/workflow-queries-result-json.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PrettyJson from '@/components/pretty-json/pretty-json';
66
import losslessJsonStringify from '@/utils/lossless-json-stringify';
77

88
import getQueryJsonContent from './helpers/get-query-json-content';
9-
import { styled } from './workflow-queries-result-json.styles';
9+
import { overrides, styled } from './workflow-queries-result-json.styles';
1010
import { type Props } from './workflow-queries-result-json.types';
1111

1212
export default function WorkflowQueriesResultJson(props: Props) {
@@ -24,7 +24,10 @@ export default function WorkflowQueriesResultJson(props: Props) {
2424
{content !== undefined && (
2525
<>
2626
<PrettyJson json={content} />
27-
<CopyTextButton textToCopy={textToCopy} />
27+
<CopyTextButton
28+
textToCopy={textToCopy}
29+
overrides={overrides.copyButton}
30+
/>
2831
</>
2932
)}
3033
</styled.ViewContainer>

src/views/workflow-summary-tab/workflow-summary-tab-json-view/workflow-summary-tab-json-view.styles.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { type ButtonOverrides } from 'baseui/button';
2+
13
import type {
24
StyletronCSSObject,
35
StyletronCSSObjectOf,
@@ -19,3 +21,13 @@ const cssStylesObj = {
1921

2022
export const cssStyles: StyletronCSSObjectOf<typeof cssStylesObj> =
2123
cssStylesObj;
24+
25+
export const overrides = {
26+
copyButton: {
27+
BaseButton: {
28+
style: {
29+
backgroundColor: 'rgba(0, 0, 0, 0)',
30+
},
31+
},
32+
} satisfies ButtonOverrides,
33+
};

src/views/workflow-summary-tab/workflow-summary-tab-json-view/workflow-summary-tab-json-view.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import useStyletronClasses from '@/hooks/use-styletron-classes';
1010
import losslessJsonStringify from '@/utils/lossless-json-stringify';
1111

1212
import { jsonViewTabsOptions } from './workflow-summary-tab-json-view.constants';
13-
import { cssStyles } from './workflow-summary-tab-json-view.styles';
13+
import { cssStyles, overrides } from './workflow-summary-tab-json-view.styles';
1414
import type { Props } from './workflow-summary-tab-json-view.types';
1515

1616
export default function WorkflowSummaryTabJsonView({
@@ -42,7 +42,10 @@ export default function WorkflowSummaryTabJsonView({
4242
options={jsonViewTabsOptions}
4343
onChange={({ activeKey }) => setActiveTab(activeKey.toString())}
4444
/>
45-
<CopyTextButton textToCopy={textToCopy} />
45+
<CopyTextButton
46+
textToCopy={textToCopy}
47+
overrides={overrides.copyButton}
48+
/>
4649
</div>
4750
{activeTab === 'result' && isWorkflowRunning ? (
4851
<PrettyJsonSkeleton width="200px" />

0 commit comments

Comments
 (0)