1
0
mirror of https://github.com/oceanprotocol/market.git synced 2024-12-02 05:57:29 +01:00

Reduce duplication

This commit is contained in:
KY Lau 2021-06-11 15:21:57 +08:00
parent d9f86edbd5
commit e3bf6b4a2a

View File

@ -41,6 +41,10 @@ const contentQuery = graphql`
} }
` `
function Separator() {
return <span className={styles.separator}>|</span>
}
export default function AssetContent(props: AssetContentProps): ReactElement { export default function AssetContent(props: AssetContentProps): ReactElement {
const data = useStaticQuery(contentQuery) const data = useStaticQuery(contentQuery)
const content = data.purgatory.edges[0].node.childContentJson.asset const content = data.purgatory.edges[0].node.childContentJson.asset
@ -117,7 +121,7 @@ export default function AssetContent(props: AssetContentProps): ReactElement {
</Button> </Button>
{appConfig.allowAdvancedSettings === 'true' && ( {appConfig.allowAdvancedSettings === 'true' && (
<> <>
<span className={styles.separator}>|</span> <Separator />
<Button <Button
style="text" style="text"
size="small" size="small"
@ -129,7 +133,7 @@ export default function AssetContent(props: AssetContentProps): ReactElement {
)} )}
{ddo.findServiceByType('compute') && type === 'dataset' && ( {ddo.findServiceByType('compute') && type === 'dataset' && (
<> <>
<span className={styles.separator}>|</span> <Separator />
<Button <Button
style="text" style="text"
size="small" size="small"