-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #314 from tableflip/choo
🚂🚋🚋🚋🚋🚋
- Loading branch information
Showing
13 changed files
with
565 additions
and
398 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
'use strict' | ||
/* eslint-env browser, webextensions */ | ||
|
||
const browser = require('webextension-polyfill') | ||
const html = require('choo/html') | ||
|
||
module.exports = function contextActions ({ | ||
isIpfsContext, | ||
isPinning, | ||
isUnPinning, | ||
isPinned, | ||
isIpfsOnline, | ||
onCopyIpfsAddr, | ||
onCopyPublicGwAddr, | ||
onPin, | ||
onUnPin | ||
}) { | ||
if (!isIpfsContext) return null | ||
|
||
return html` | ||
<div class="panel-section panel-section-list"> | ||
<div class="panel-list-item" onclick=${onCopyIpfsAddr}> | ||
<div class="icon"></div> | ||
<div class="text">${browser.i18n.getMessage('panelCopy_currentIpfsAddress')}</div> | ||
<div class="text-shortcut"></div> | ||
</div> | ||
<div class="panel-list-item" onclick=${onCopyPublicGwAddr}> | ||
<div class="icon"></div> | ||
<div class="text">${browser.i18n.getMessage('panel_copyCurrentPublicGwUrl')}</div> | ||
<div class="text-shortcut"></div> | ||
</div> | ||
${isIpfsOnline && isPinned ? null : html` | ||
<div class="panel-list-item ${isPinning ? 'disabled' : ''}" onclick=${onPin}> | ||
<div class="icon"></div> | ||
<div class="text">${browser.i18n.getMessage('panel_pinCurrentIpfsAddress')}</div> | ||
<div class="text-shortcut"></div> | ||
</div> | ||
`} | ||
${isIpfsOnline && isPinned ? html` | ||
<div class="panel-list-item ${isUnPinning ? 'disabled' : ''}" onclick=${onUnPin}> | ||
<div class="icon"></div> | ||
<div class="text">${browser.i18n.getMessage('panel_unpinCurrentIpfsAddress')}</div> | ||
<div class="text-shortcut"></div> | ||
</div> | ||
` : null} | ||
<div class="panel-section-separator"></div> | ||
</div> | ||
` | ||
} |
Oops, something went wrong.