Updates result components, adds card docs

This commit is contained in:
Alicia Sykes
2023-07-22 00:06:06 +01:00
parent 463e5d7154
commit f9437ea964
7 changed files with 53 additions and 8 deletions

View File

@ -12,6 +12,8 @@ export const StyledCard = styled.section<{ styles?: string}>`
padding: 1rem;
position: relative;
margin 0.5rem;
max-height: 64rem;
overflow: auto;
${props => props.styles}
`;

View File

@ -19,7 +19,7 @@ const DnsServerCard = (props: {data: any, title: string, actionButtons: any }):
<Card heading={props.title} actionButtons={props.actionButtons} styles={cardStyles}>
{dnsSecurity.dns.map((dns: any, index: number) => {
return (<>
<Heading as="h4" size="small" color={colors.primary}>DNS Server #{index+1}</Heading>
{ dnsSecurity.dns.length > 1 && <Heading as="h4" size="small" color={colors.primary}>DNS Server #{index+1}</Heading> }
<Row lbl="IP Address" val={dns.address} />
<Row lbl="Hostname" val={dns.hostname} />
<Row lbl="DoH Support" val={dns.dohDirectSupports ? '✅ Yes*' : '❌ No*'} />

View File

@ -19,7 +19,6 @@ const cardStyles = `
`;
const SitemapCard = (props: {data: any, title: string, actionButtons: any }): JSX.Element => {
console.log(props.data);
const normalSiteMap = props.data.url || props.data.urlset?.url || null;
const siteMapIndex = props.data.sitemapindex?.sitemap || null;
@ -32,8 +31,12 @@ const SitemapCard = (props: {data: any, title: string, actionButtons: any }): JS
};
const getPathFromUrl = (url: string) => {
const urlObj = new URL(url);
return urlObj.pathname;
try {
const urlObj = new URL(url);
return urlObj.pathname;
} catch (e) {
return url;
}
};
return (

View File

@ -62,8 +62,9 @@ h4 {
}
}
.tech-icon {
width: 2.5rem;
min-width: 2.5rem;
border-radius: 4px;
margin: 0.5rem 0;
}
&:not(:last-child) {
border-bottom: 1px solid ${colors.primary};

View File

@ -5,6 +5,7 @@ import Row from 'components/Form/Row';
const cardStyles = `
grid-column: span 2;
span.val { max-width: 32rem !important; }
span { overflow: hidden; }
`;
const TxtRecordCard = (props: {data: any, title: string, actionButtons: any }): JSX.Element => {

View File

@ -187,12 +187,11 @@ const jobNames = [
'domain',
'dns',
'dns-server',
'domain-lookup',
'tech-stack',
'hosts',
'quality',
'cookies',
'server-info',
// 'server-info',
'redirects',
'robots-txt',
'dnssec',