fix(ui): hide 'show details' button if there are no additional details (#1254)

pull/1252/head
Danshil Kokil Mungur 4 years ago committed by GitHub
parent 0de2b63903
commit 6210f12e8e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,22 +1,22 @@
import copy from 'copy-to-clipboard';
import { useRouter } from 'next/router';
import React, { useEffect, useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import copy from 'copy-to-clipboard';
import { useToasts } from 'react-toast-notifications';
import useSWR from 'swr';
import {
LogMessage,
LogsResultsResponse,
} from '../../../../server/interfaces/api/settingsInterfaces';
import globalMessages from '../../../i18n/globalMessages';
import Error from '../../../pages/_error';
import Badge from '../../Common/Badge';
import Button from '../../Common/Button';
import LoadingSpinner from '../../Common/LoadingSpinner';
import Modal from '../../Common/Modal';
import PageTitle from '../../Common/PageTitle';
import Table from '../../Common/Table';
import globalMessages from '../../../i18n/globalMessages';
import { useRouter } from 'next/router';
import Modal from '../../Common/Modal';
import Transition from '../../Transition';
import { useToasts } from 'react-toast-notifications';
const messages = defineMessages({
logs: 'Logs',
@ -358,14 +358,16 @@ const SettingsLogs: React.FC = () => {
<Table.TD className="text-gray-300">{row.label}</Table.TD>
<Table.TD className="text-gray-300">{row.message}</Table.TD>
<Table.TD className="flex items-center justify-end">
<Button
buttonType="primary"
buttonSize="sm"
onClick={() => setActiveLog(row)}
className="mr-2"
>
{intl.formatMessage(messages.viewDetails)}
</Button>
{row.data && (
<Button
buttonType="primary"
buttonSize="sm"
onClick={() => setActiveLog(row)}
className="mr-2"
>
{intl.formatMessage(messages.viewDetails)}
</Button>
)}
<Button
buttonType="primary"
buttonSize="sm"

Loading…
Cancel
Save