Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions client/src/seo-field/components/DOMContext/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Loader from 'Components/Loader';

export const DOMContext = React.createContext(null);

const DOMContextProvider = (props) => {
function DOMContextProvider(props) {
const { link, children } = props;
const [body, setBody] = useState(null);
const [isLoading, setIsLoading] = useState(true);
Expand Down Expand Up @@ -36,7 +36,7 @@ const DOMContextProvider = (props) => {
{children}
</DOMContext.Provider>
);
};
}

DOMContextProvider.defaultProps = {
children: null,
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/HighlightedText.jsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import React from 'react';
import PropTypes from 'prop-types';

const HighlightedText = (props) => {
function HighlightedText(props) {
const { content, keyword } = props;
let highlighted = content;
if (keyword && keyword !== '') {
const re = new RegExp(keyword, 'gi');
highlighted = highlighted.replace(re, '<b><span style="background-color: #fffe79;">$&</span></b>');
}
return (<span dangerouslySetInnerHTML={{ __html: highlighted }} />); // eslint-disable-line react/no-danger,max-len
};
}

HighlightedText.defaultProps = {
keyword: null,
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/Loader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
import { Spinner } from 'reactstrap';

const Loader = (props) => {
function Loader(props) {
const { color, cover } = props;
const loader = (
<div className="d-flex justify-content-center align-items-center h-100">
Expand All @@ -28,7 +28,7 @@ const Loader = (props) => {
);
}
return loader;
};
}

Loader.defaultProps = {
color: 'dark',
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/SEOAnalysisField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import classnames from 'classnames';
import '../i18n';
import { useTranslation } from 'react-i18next';

const SEOAnalysisField = (props) => {
function SEOAnalysisField(props) {
const { link, rootUrl, keyword } = props;
const [openTab, setOpenTab] = useState('1');
const { t } = useTranslation();
Expand Down Expand Up @@ -46,7 +46,7 @@ const SEOAnalysisField = (props) => {
</DOMContextProvider>
</div>
);
};
}

SEOAnalysisField.defaultProps = {
link: '',
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/Tabs/Analysis/Result.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import PropTypes from 'prop-types';
/* eslint-disable react/no-danger */

const Result = (props) => {
function Result(props) {
const {
show, state, message, index,
} = props;
Expand All @@ -29,7 +29,7 @@ const Result = (props) => {
</div>
</>
);
};
}

Result.defaultProps = {
show: true,
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/Tabs/Analysis/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types';
import useAnalysis from 'Hooks/useAnalysis';
import Result from './Result';

const Analysis = (props) => {
function Analysis(props) {
const { rootUrl, link, keyword } = props;
const { results } = useAnalysis(rootUrl, link, keyword);
const order = ['danger', 'warning', 'success', 'secondary'];
Expand All @@ -24,7 +24,7 @@ const Analysis = (props) => {
))}
</div>
);
};
}

Analysis.defaultProps = {
rootUrl: 'localhost',
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/Tabs/SERP/SERPBreadcrumbs.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import HighlightedText from 'Components/HighlightedText';
/**
* Renders the breadcrumb part of the SERP
*/
const SERPBreadcrumbs = (props) => {
function SERPBreadcrumbs(props) {
const { breadcrumbs, keyword } = props;
return (
<div
Expand All @@ -27,7 +27,7 @@ const SERPBreadcrumbs = (props) => {
))}
</div>
);
};
}

SERPBreadcrumbs.defaultProps = {
keyword: '',
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/Tabs/SERP/SERPSnippet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import HighlightedText from 'Components/HighlightedText';
/**
* renders the snippet part of the SERP
*/
const SERPSnippet = (props) => {
function SERPSnippet(props) {
const { snippet, keyword } = props;
return (
<div
Expand All @@ -19,7 +19,7 @@ const SERPSnippet = (props) => {
<HighlightedText content={snippet} keyword={keyword} />
</div>
);
};
}

SERPSnippet.defaultProps = {
keyword: '',
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/Tabs/SERP/SERPTitle.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import HighlightedText from 'Components/HighlightedText';
/**
* The title part of the SERP preview
*/
const SERPTitle = (props) => {
function SERPTitle(props) {
const { title, link, keyword } = props;
return (
<div
Expand All @@ -29,7 +29,7 @@ const SERPTitle = (props) => {
</a>
</div>
);
};
}

SERPTitle.defaultProps = {
keyword: '',
Expand Down
4 changes: 2 additions & 2 deletions client/src/seo-field/components/Tabs/SERP/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import SERPSnippet from './SERPSnippet';
/**
* Renders a SERP preview
*/
const SERP = (props) => {
function SERP(props) {
const { rootUrl, link, keyword } = props;

const { breadcrumbs, title, snippet } = useSERP(rootUrl, link, keyword);
Expand All @@ -27,7 +27,7 @@ const SERP = (props) => {
</div>
</div>
);
};
}

SERP.defaultProps = {
rootUrl: 'localhost',
Expand Down
Loading