department-of-veterans-affairs / va.gov-team

Public resources for building on and in support of VA.gov. Visit complete Knowledge Hub:
https://depo-platform-documentation.scrollhelp.site/index.html
283 stars 204 forks source link

Refactor VA facility link in search result components #23629

Open mpelzsherman opened 3 years ago

mpelzsherman commented 3 years ago

The VaFacilityResult and Covid19Result components have the following duplicated code:

          {isVADomain(website) ? (
            <h3 className="vads-u-font-size--h5 no-marg-top">
              <a href={website}>{name}</a>
            </h3>
          ) : (
            <h3 className="vads-u-font-size--h5 no-marg-top">
              <Link to={`facility/${location.id}`}>{name}</Link>
            </h3>
          )}

This code also lives in LocationInfoBlock.jsx.

Let's put this code into a common component and re-use that instead.

jilladams commented 1 year ago

@maxx1128 to help check if this is still legit in the code or not

maxx1128 commented 1 year ago

Confirmed this is still an issue in the code. There's also a near-identical other instance of this in LocationInfoBlock.jsx that could be included as well.