Skip to content

Commit

Permalink
Merge pull request #813 from adobecom/MWPW-158423_
Browse files Browse the repository at this point in the history
MWPW-158423
  • Loading branch information
Blainegunn authored Sep 19, 2024
2 parents 01e5662 + e808230 commit 3686b73
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
13 changes: 13 additions & 0 deletions acrobat/blocks/unity/unity.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import LIMITS from '../verb-widget/limits.js';

const localeMap = {
'': 'en-us',
br: 'pt-br',
Expand Down Expand Up @@ -98,12 +100,23 @@ function getUnityLibs(prodLibs = '/unitylibs') {
&& !hostname.includes('localhost')) {
return prodLibs;
}
// eslint-disable-next-line compat/compat
const branch = new URLSearchParams(window.location.search).get('unitylibs') || 'main';
if (branch.indexOf('--') > -1) return `https://${branch}.hlx.live/unitylibs`;
return `https://${branch}--unity--adobecom.hlx.live/unitylibs`;
}

export default async function init(el) {
let mobileApp;
if ((/iPad|iPhone|iPod/.test(window.browser?.ua) && !window.MSStream)
|| /android/i.test(window.browser?.ua)) {
mobileApp = true;
}

const element = el.querySelector('span');
const verb = element.classList[1].replace('icon-', '');
if (mobileApp && LIMITS[verb].mobileApp) return;

const unitylibs = getUnityLibs();
const langFromPath = window.location.pathname.split('/')[1];
const languageCode = localeMap[langFromPath] ? localeMap[langFromPath].split('-')[0] : 'en';
Expand Down
10 changes: 8 additions & 2 deletions acrobat/blocks/verb-widget/verb-widget.css
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,13 @@
margin-left: 15px;
}

.verb-mobile-cta:hover,
.verb-mobile-cta:active {
background-color: #0054b6;
color: #fff;
text-decoration: none;
}

@media screen and (min-width: 768px) {
.verb-container {
align-items: center;
Expand All @@ -246,11 +253,10 @@
}

.verb-mobile-cta {
/* display: none; */
background: #1473e6;
border-radius: 8px;
padding: 11px 27px;
color: white;
color: #fff;
white-space: nowrap;
font-weight: 700;
display: flex;
Expand Down

0 comments on commit 3686b73

Please sign in to comment.