Skip to content

Commit

Permalink
third party adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght committed Apr 12, 2024
1 parent 82ca49b commit 7227137
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
7 changes: 3 additions & 4 deletions src/lib/map/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -737,8 +737,7 @@ export const generateMarker = (
element.tags &&
(element.tags['payment:onchain'] ||
element.tags['payment:lightning'] ||
element.tags['payment:lightning_contactless'] ||
thirdParty);
element.tags['payment:lightning_contactless']);

const popupContainer = L.DomUtil.create('div');

Expand Down Expand Up @@ -948,13 +947,13 @@ export const generateMarker = (
<div class='flex space-x-4'>
${
paymentMethod
paymentMethod || thirdParty
? `<div>
<span class='block text-mapLabel text-xs'>Payment Methods</span>
<div class='w-full flex space-x-2 mt-0.5'>
${
thirdParty
!paymentMethod
? `<a href=${element.tags?.['payment:lightning:companion_app_url']} target="_blank" rel="noreferrer">
<i class="fa-solid fa-mobile-screen-button w-6 h-6 !text-primary dark:!text-white hover:!text-link dark:hover:!text-link transition-colors" title="Third party app required"></i>
</a>`
Expand Down
19 changes: 13 additions & 6 deletions src/routes/map/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,13 @@
if (
elementOSM.tags &&
elementOSM.tags['payment:lightning:requires_companion_app'] === 'yes'
elementOSM.tags['payment:lightning:requires_companion_app'] === 'yes' &&
elementOSM.tags['payment:lightning:companion_app_url'] &&
!(
elementOSM.tags['payment:onchain'] ||
elementOSM.tags['payment:lightning'] ||
elementOSM.tags['payment:lightning_contactless']
)
) {
thirdPartyLayer.addLayer(marker);
}
Expand Down Expand Up @@ -231,18 +237,19 @@
'Third Party App': thirdPartyLayer
};
map.addLayer(upToDateLayer);
map.addLayer(outdatedLayer);
map.addLayer(legacyLayer);
map.addLayer(thirdPartyLayer);
Object.keys(categories)
.sort()
.map((category) => {
.forEach((category) => {
overlayMaps[
category === 'atm'
? category.toUpperCase()
: category.charAt(0).toUpperCase() + category.slice(1)
] = categories[category];
map.addLayer(upToDateLayer);
map.addLayer(outdatedLayer);
map.addLayer(legacyLayer);
map.addLayer(thirdPartyLayer);
map.addLayer(categories[category]);
});
Expand Down
7 changes: 3 additions & 4 deletions src/routes/merchant/[id]/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@
merchant.osm_json.tags &&
(merchant.osm_json.tags['payment:onchain'] ||
merchant.osm_json.tags['payment:lightning'] ||
merchant.osm_json.tags['payment:lightning_contactless'] ||
thirdParty);
merchant.osm_json.tags['payment:lightning_contactless']);
lat = latCalc(merchant['osm_json']);
long = longCalc(merchant['osm_json']);
Expand Down Expand Up @@ -576,11 +575,11 @@
{/if}
</div>

{#if paymentMethod && merchant}
{#if (paymentMethod || thirdParty) && merchant}
<div>
<h4 class="uppercase text-primary dark:text-white">Accepted Payments</h4>
<div class="mt-1 flex items-center justify-center space-x-2">
{#if thirdParty}
{#if !paymentMethod}
<a
bind:this={thirdPartyTooltip}
href={merchant.osm_json.tags?.['payment:lightning:companion_app_url']}
Expand Down

0 comments on commit 7227137

Please sign in to comment.