-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ Quantumcast ] - New Command "Open Packz Manual" (#6621)
* Update quantumcast extension - Contributions/merge 1684352334444420000 (#14) - Release 0.0.4 (#13) - Update CHANGELOG.md (#12) - eslint mod (#11) - V0.0.3 (#10) - V0.0.3 (#9) - Release 0.0.2 (#8) - release 0.0.1 (#5) - Modified CHANGELOG (#4) - Merge initial release 0.0.1 (#3) - Dev (#2) - npm update (#1) - Added logos - Initial project setup - Update README.md - Initial commit * Added missing icon and removed some matadata images * Removed raycast-env.d.ts --------- Co-authored-by: Per Nielsen Tikær <per@raycast.com>
- Loading branch information
1 parent
c305759
commit 8883c26
Showing
10 changed files
with
202 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
"extends": [ | ||
"@raycast" | ||
] | ||
} | ||
} |
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 |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
|
||
# Misc | ||
.DS_Store | ||
raycast-env.d.ts |
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Large diffs are not rendered by default.
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
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,55 @@ | ||
import { List, Action, ActionPanel, getPreferenceValues, open } from '@raycast/api'; | ||
import { useState, useEffect } from 'react'; | ||
import { packz, env } from 'quantumlib'; | ||
|
||
interface PackzInstallation { | ||
folder: string; | ||
url: string; | ||
executable: string; | ||
} | ||
|
||
export default function Command() { | ||
const { packzManualLanguage } = getPreferenceValues(); | ||
const [packzInstallations, setPackzInstallations] = useState<PackzInstallation[]>([]); | ||
|
||
useEffect(() => { | ||
const fetchPackInstallations = async () => { | ||
const data = await packz.listInstallations(env.applicationsFolder); | ||
setPackzInstallations(data); | ||
}; | ||
fetchPackInstallations(); | ||
}, []); | ||
|
||
return ( | ||
<List searchBarPlaceholder="Select a Packz manual release to open in your default browser"> | ||
{packzInstallations.map((installation: PackzInstallation) => ( | ||
<List.Item | ||
id={installation.folder} | ||
key={installation.folder} | ||
title={installation.folder} | ||
icon="../assets/quantumcast.png" | ||
accessories={[{ text: installation.executable }]} | ||
actions={ | ||
<ActionPanel title="Quantumcast - Open Packz Manual"> | ||
<Action | ||
title="Open in Browser" | ||
icon={Icon.Globe} | ||
onAction={async () => | ||
open(packz.getManualURL(`${installation.url}/${installation.executable}`, packzManualLanguage) ?? '') | ||
} | ||
/> | ||
<Action.Open title="Reveal in Finder" target={installation.url} /> | ||
<Action.CopyToClipboard | ||
title="Copy URL to Clipboard" | ||
content={ | ||
packz.getManualURL(`${installation.url}/${installation.executable}`, packzManualLanguage) ?? '' | ||
} | ||
shortcut={{ modifiers: ['cmd', 'shift'], key: 'c' }} | ||
/> | ||
</ActionPanel> | ||
} | ||
/> | ||
))} | ||
</List> | ||
); | ||
} |