Skip to content

Commit

Permalink
Merge pull request #4 from ambar/dev
Browse files Browse the repository at this point in the history
feat: replace icons
  • Loading branch information
ambar authored Apr 4, 2024
2 parents cfee959 + 8be13e0 commit d574da1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bundle-watch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- uses: actions/setup-node@v4
- uses: preactjs/compressed-size-action@v2
with:
pattern: 'out/**/*.*'
pattern: '{images,out}/**/*.*'
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
run: |
yarn jest --coverage
# - name: report
# uses: coverallsapp/github-action@v1.0.1
# uses: coverallsapp/github-action@v2
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# path-to-lcov: ./coverage/lcov.info
4 changes: 1 addition & 3 deletions images/electron.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 1 addition & 3 deletions images/node.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 7 additions & 7 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,12 @@ function debounce<T extends AnyFunction<void>>(fn: T, wait: number) {
} as T
}

// https://icon-sets.iconify.design/devicon/
const iconMap: Record<Platform, string> = {
browser: 'images/electron.svg',
node: 'images/node.svg',
}

function setPanelTitleAndIcon(
panel: vscode.WebviewPanel,
document: vscode.TextDocument
Expand All @@ -308,15 +314,9 @@ function setPanelTitleAndIcon(
`Preview` +
(document ? ' ' + path.basename(document.uri.fsPath) : '') +
` in ${platformTitleMap[currentPlatform]}`
const iconMap = {
browser: 'electron',
node: 'node',
}
panel.iconPath = vscode.Uri.joinPath(
itsContext!.extensionUri,
`images/${
iconMap[currentPlatform as keyof typeof iconMap] ?? 'electron'
}.svg`
iconMap[currentPlatform]
)
}

Expand Down

0 comments on commit d574da1

Please sign in to comment.