Skip to content

Commit 19eedda

Browse files
committed
wrap TOMLPanel in Typography; conditional ENV headers
1 parent 2320932 commit 19eedda

File tree

2 files changed

+16
-12
lines changed

2 files changed

+16
-12
lines changed

src/screens/Configuration/ConfigurationCard/ConfigurationCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import React from 'react'
33
import { gql, useQuery } from '@apollo/client'
44

55
import { KeyValueListCard } from 'src/components/Cards/KeyValueListCard'
6+
import {isNil} from "lodash";
67

78
export const CONFIG__ITEMS_FIELDS = gql`
89
fragment Config_ItemsFields on ConfigItem {
@@ -48,7 +49,7 @@ export const ConfigurationCard = () => {
4849
error={error?.message}
4950
loading={loading}
5051
entries={entries}
51-
showHead
52+
showHead={isNil(error?.message)}
5253
/>
5354
)
5455
}

src/screens/Configuration/ConfigurationV2Card/ConfigurationV2Card.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import ExpansionPanelDetails from '@material-ui/core/ExpansionPanelDetails'
1414
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter'
1515
import { prism } from 'react-syntax-highlighter/dist/esm/styles/prism'
1616
import ExpandMoreIcon from '@material-ui/icons/ExpandMore'
17+
import Typography from '@material-ui/core/Typography'
1718

1819
export const CONFIG_V2_QUERY = gql`
1920
query FetchConfigV2 {
@@ -38,7 +39,7 @@ export const ConfigurationV2Card = () => {
3839
<Card>
3940
<CardHeader title="TOML Configuration" />
4041
<TOMLPanel
41-
title="v2 config dump"
42+
title="V2 config dump:"
4243
error={error?.message}
4344
loading={loading}
4445
toml={data?.configv2.user}
@@ -113,15 +114,17 @@ const TOMLPanel = ({ loading, toml, error = '', title, expanded }: Props) => {
113114
const styles = { display: 'block' }
114115

115116
return (
116-
<ExpansionPanel defaultExpanded={expanded}>
117-
<ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
118-
{title}
119-
</ExpansionPanelSummary>
120-
<ExpansionPanelDetails style={styles}>
121-
<SyntaxHighlighter language="toml" style={prism}>
122-
{toml}
123-
</SyntaxHighlighter>
124-
</ExpansionPanelDetails>
125-
</ExpansionPanel>
117+
<Typography>
118+
<ExpansionPanel defaultExpanded={expanded}>
119+
<ExpansionPanelSummary expandIcon={<ExpandMoreIcon />}>
120+
{title}
121+
</ExpansionPanelSummary>
122+
<ExpansionPanelDetails style={styles}>
123+
<SyntaxHighlighter language="toml" style={prism}>
124+
{toml}
125+
</SyntaxHighlighter>
126+
</ExpansionPanelDetails>
127+
</ExpansionPanel>
128+
</Typography>
126129
)
127130
}

0 commit comments

Comments
 (0)