Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update external link icon placement and size #700

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
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
12 changes: 6 additions & 6 deletions src/components/__tests__/__snapshots__/data-section.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -210,12 +210,17 @@ exports[`Data Section matches snapshot 1`] = `
CAMP2Ex P-3 Remotely Sensed Aerosol Data
</label>
<a
className="sc-eqUAAy gqBnyJ"
className="sc-eqUAAy jxHsRt"
data-cy="doi-link"
href="http://dx.doi.org/10.5067/Airborne/CAMP2Ex_Aerosol_AircraftRemoteSensing_P3_Data_1"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
10.5067/Airborne/CAMP2Ex_Aerosol_AircraftRemoteSensing_P3_Data_1
</span>
<svg
height="16"
role="img"
Expand All @@ -237,11 +242,6 @@ exports[`Data Section matches snapshot 1`] = `
fill="#aac9ff"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
10.5067/Airborne/CAMP2Ex_Aerosol_AircraftRemoteSensing_P3_Data_1
</span>
</a>
</div>
<div
Expand Down
48 changes: 24 additions & 24 deletions src/components/__tests__/__snapshots__/footer.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,17 @@ exports[`Footer renders correctly 1`] = `
</li>
<li>
<a
className="sc-aXZVg egnkfv"
className="sc-aXZVg gGyAQD"
data-cy="api documentation-link"
href="https://nasa-impact.github.io/admg-backend/documentation/api_doc.html"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
API Documentation
</span>
<svg
height="16"
role="img"
Expand All @@ -143,11 +148,6 @@ exports[`Footer renders correctly 1`] = `
fill="#aac9ff"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
API Documentation
</span>
</a>
</li>
</ul>
Expand All @@ -165,12 +165,17 @@ exports[`Footer renders correctly 1`] = `
>
<li>
<a
className="sc-aXZVg egnkfv"
className="sc-aXZVg gGyAQD"
data-cy="admg-website-link"
href="https://earthdata.nasa.gov/esds/impact/admg"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
ADMG Website
</span>
<svg
height="16"
role="img"
Expand All @@ -192,21 +197,21 @@ exports[`Footer renders correctly 1`] = `
fill="#aac9ff"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
ADMG Website
</span>
</a>
</li>
<li>
<a
className="sc-aXZVg egnkfv"
className="sc-aXZVg gGyAQD"
data-cy="impact-website-link"
href="https://earthdata.nasa.gov/esds/impact"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
IMPACT Website
</span>
<svg
height="16"
role="img"
Expand All @@ -228,11 +233,6 @@ exports[`Footer renders correctly 1`] = `
fill="#aac9ff"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
IMPACT Website
</span>
</a>
</li>
</ul>
Expand Down Expand Up @@ -514,12 +514,17 @@ exports[`Footer renders correctly 1`] = `
, Built by

<a
className="sc-aXZVg egnkfv"
className="sc-aXZVg gGyAQD"
data-cy="devseed-website-link"
href="https://www.developmentseed.org"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
Development Seed
</span>
<svg
height="16"
role="img"
Expand All @@ -541,11 +546,6 @@ exports[`Footer renders correctly 1`] = `
fill="#aac9ff"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
Development Seed
</span>
</a>
.
</div>
Expand Down
25 changes: 15 additions & 10 deletions src/components/explore/products-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,14 @@ export function ProductsTable({ dois }) {
css={`
background: rgba(255, 255, 255, 0.06);
border-spacing: 30px;
th:first-child {
padding-left: 1.25rem;
}
`}
>
<thead>
<tr>
<th
css={`
padding-left: 20px;
`}
>
DATA PRODUCT
</th>
<th>DATA PRODUCT</th>
<th>PLATFORMS</th>
<th>INSTRUMENTS</th>
</tr>
Expand All @@ -46,16 +43,24 @@ export function ProductsTable({ dois }) {
href={`http://dx.doi.org/${doi.doi}`}
css={`
color: ${colors[NEGATIVE].linkText};
display: block;
display: inline-flex;
flex-flow: row nowrap;
gap: 0.25rem;
align-items: center;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
padding-left: 30px;
padding-left: 1.5rem;
svg {
width: 12px;
height: 12px;
flex-shrink: 0;
}
`}
data-cy={`doi-link`}
>
<ExternalLinkIcon color={colors[NEGATIVE].linkText} />{" "}
<span>{doi.shortname}</span>
<ExternalLinkIcon color={colors[NEGATIVE].linkText} />{" "}
</a>
</td>
<td>
Expand Down
12 changes: 7 additions & 5 deletions src/components/external-link.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from "prop-types"

import { POSITIVE, NEGATIVE } from "../utils/constants"
import { PropTypeIsUrl } from "../utils/helpers"
import { colors, breakpoints } from "../theme"
import { colors } from "../theme"
import { ExternalLinkIcon } from "../icons"

export default function ExternalLink({
Expand All @@ -23,21 +23,23 @@ export default function ExternalLink({
display: inline-flex;
flex-flow: row nowrap;
gap: 0.25rem;
align-items: baseline;
@media screen and (min-width: ${breakpoints["sm"]}) {
flex-flow: row wrap;
align-items: center;
svg {
width: 12px;
height: 12px;
flex-shrink: 0;
}
`}
data-cy={`${id}-link`}
>
<ExternalLinkIcon color={colors[mode].linkText} />
<span
css={`
overflow-wrap: anywhere;
`}
>
{label || children}
</span>
<ExternalLinkIcon color={colors[mode].linkText} />
</a>
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,17 @@ exports[`Overview Section displays content 1`] = `
</dt>
<dd>
<a
className="sc-eqUAAy fwapUR"
className="sc-eqUAAy ksibDB"
data-cy="calibration-doi-link"
href="http://dx.doi.org/10.5067/calibration"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
http://dx.doi.org/10.5067/calibration
</span>
<svg
height="16"
role="img"
Expand All @@ -161,11 +166,6 @@ exports[`Overview Section displays content 1`] = `
fill="#15418c"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
http://dx.doi.org/10.5067/calibration
</span>
</a>
</dd>
<dt>
Expand All @@ -183,12 +183,17 @@ exports[`Overview Section displays content 1`] = `
className="overview-section___StyledLi3-sc-1oemh85-0 hwjFCf"
>
<a
className="sc-eqUAAy fwapUR"
className="sc-eqUAAy ksibDB"
data-cy="online-information-link"
href="http://www.example.com"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
http://www.example.com
</span>
<svg
height="16"
role="img"
Expand All @@ -210,11 +215,6 @@ exports[`Overview Section displays content 1`] = `
fill="#15418c"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
http://www.example.com
</span>
</a>
</li>
</ul>
Expand Down Expand Up @@ -291,12 +291,17 @@ exports[`Overview Section displays content 1`] = `
DOI:

<a
className="sc-eqUAAy gqBnyJ"
className="sc-eqUAAy jxHsRt"
data-cy="instrument-doi-link"
href="http://dx.doi.org/10.5067/instrument"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
http://dx.doi.org/10.5067/instrument
</span>
<svg
height="16"
role="img"
Expand All @@ -318,11 +323,6 @@ exports[`Overview Section displays content 1`] = `
fill="#aac9ff"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
http://dx.doi.org/10.5067/instrument
</span>
</a>
</p>
</div>
Expand Down Expand Up @@ -356,12 +356,17 @@ exports[`Overview Section displays content 1`] = `
className="list-link___StyledLi-sc-xxtxki-0 hZlwud"
>
<a
className="sc-eqUAAy fwapUR"
className="sc-eqUAAy ksibDB"
data-cy="test-link"
href="http://www.example.com"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
test
</span>
<svg
height="16"
role="img"
Expand All @@ -383,23 +388,23 @@ exports[`Overview Section displays content 1`] = `
fill="#15418c"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
test
</span>
</a>
</li>
<li
className="list-link___StyledLi-sc-xxtxki-0 hZlwud"
>
<a
className="sc-eqUAAy fwapUR"
className="sc-eqUAAy ksibDB"
data-cy="test2-link"
href="http://www.example.com"
rel="noopener noreferrer"
target="_blank"
>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
test2
</span>
<svg
height="16"
role="img"
Expand All @@ -421,11 +426,6 @@ exports[`Overview Section displays content 1`] = `
fill="#15418c"
/>
</svg>
<span
className="external-link___StyledSpan-sc-3ezy1s-0 LrNqW"
>
test2
</span>
</a>
</li>
</ul>
Expand Down
Loading