forked from spicetify/marketplace
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: ririxi <[email protected]>
- Loading branch information
1 parent
15900b9
commit 5032c0c
Showing
10 changed files
with
139 additions
and
115 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 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
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 |
---|---|---|
@@ -1,35 +1,35 @@ | ||
# Spicetify Marketplace | ||
|
||
<p> | ||
<a href="https://github.com/spicetify/spicetify-marketplace/releases/latest"> | ||
<img src="https://img.shields.io/github/v/release/spicetify/spicetify-marketplace?include_prereleases"> | ||
<a href="https://github.com/spicetify/marketplace/releases/latest"> | ||
<img src="https://img.shields.io/github/v/release/spicetify/marketplace?include_prereleases"> | ||
</a> | ||
<a href="https://github.com/spicetify/spicetify-marketplace/releases"> | ||
<img src="https://img.shields.io/github/downloads/spicetify/spicetify-marketplace/total.svg"> | ||
<a href="https://github.com/spicetify/marketplace/releases"> | ||
<img src="https://img.shields.io/github/downloads/spicetify/marketplace/total.svg"> | ||
</a> | ||
<a href="https://github.com/spicetify/spicetify-marketplace/issues?q=is%3Aissue+is%3Aclosed"> | ||
<img src="https://img.shields.io/github/issues-closed/spicetify/spicetify-marketplace"> | ||
<a href="https://github.com/spicetify/marketplace/issues?q=is%3Aissue+is%3Aclosed"> | ||
<img src="https://img.shields.io/github/issues-closed/spicetify/marketplace"> | ||
</a> | ||
<a href="https://github.com/spicetify/spicetify-marketplace/commits/main"> | ||
<img src="https://img.shields.io/github/commit-activity/m/spicetify/spicetify-marketplace"> | ||
<a href="https://github.com/spicetify/marketplace/commits/main"> | ||
<img src="https://img.shields.io/github/commit-activity/m/spicetify/marketplace"> | ||
</a> | ||
</p> | ||
|
||
Customize your Spotify client directly from within [Spicetify](https://github.com/spicetify/spicetify-cli)! | ||
Customize your Spotify client directly from within [Spicetify](https://github.com/spicetify/cli)! | ||
|
||
Marketplace allows you to **browse, download, and install** extensions, themes, and CSS snippets with ease. You can also browse custom apps, but will need to do some manual installation to get them working. | ||
|
||
Made with [Spicetify Creator](https://github.com/spicetify/spicetify-creator) | ||
|
||
Head to the [wiki](https://github.com/spicetify/spicetify-marketplace/wiki) to get started! | ||
Head to the [wiki](https://github.com/spicetify/marketplace/wiki) to get started! | ||
|
||
--- | ||
|
||
## Links | ||
- [Overview](https://github.com/spicetify/spicetify-marketplace/wiki) | ||
- [Installation](https://github.com/spicetify/spicetify-marketplace/wiki/Installation) | ||
- [Publishing to Marketplace](https://github.com/spicetify/spicetify-marketplace/wiki/Publishing-to-Marketplace) | ||
- [Contributions](https://github.com/spicetify/spicetify-marketplace/wiki/Contributions) | ||
- [Development](https://github.com/spicetify/spicetify-marketplace/wiki/Development) | ||
- [Translating/Localizing Marketplace](https://github.com/spicetify/spicetify-marketplace/wiki/Localizing-Marketplace) | ||
- [Overview](https://github.com/spicetify/marketplace/wiki) | ||
- [Installation](https://github.com/spicetify/marketplace/wiki/Installation) | ||
- [Publishing to Marketplace](https://github.com/spicetify/marketplace/wiki/Publishing-to-Marketplace) | ||
- [Contributions](https://github.com/spicetify/marketplace/wiki/Contributions) | ||
- [Development](https://github.com/spicetify/marketplace/wiki/Development) | ||
- [Translating/Localizing Marketplace](https://github.com/spicetify/marketplace/wiki/Localizing-Marketplace) | ||
|
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 |
---|---|---|
@@ -1,10 +1,10 @@ | ||
{ | ||
"name": "spicetify-marketplace", | ||
"name": "marketplace", | ||
"version": "1.0.2", | ||
"homepage": "https://github.com/spicetify/spicetify-marketplace", | ||
"repository": "github:spicetify/spicetify-marketplace", | ||
"homepage": "https://github.com/spicetify/marketplace", | ||
"repository": "github:spicetify/marketplace", | ||
"bugs": { | ||
"url": "https://github.com/spicetify/spicetify-marketplace/issues" | ||
"url": "https://github.com/spicetify/marketplace/issues" | ||
}, | ||
"packageManager": "[email protected]", | ||
"scripts": { | ||
|
@@ -17,7 +17,7 @@ | |
"type-check": "tsc --noEmit", | ||
"watch": "spicetify-creator --watch", | ||
"prepare": "husky install", | ||
"update-types": "curl -s -o src/types/spicetify.d.ts https://raw.githubusercontent.com/spicetify/spicetify-cli/master/globals.d.ts" | ||
"update-types": "curl -s -o src/types/spicetify.d.ts https://raw.githubusercontent.com/spicetify/cli/main/globals.d.ts" | ||
}, | ||
"engines": { | ||
"yarn": "please-use-pnpm", | ||
|
@@ -47,4 +47,4 @@ | |
"semver": "^7.6.0" | ||
}, | ||
"private": true | ||
} | ||
} |
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
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 |
---|---|---|
@@ -1,61 +1,81 @@ | ||
import { t } from "i18next"; | ||
import React from "react"; | ||
|
||
import { LATEST_RELEASE_URL, MARKETPLACE_VERSION, RELEASES_URL } from "../../../constants"; | ||
import { | ||
LATEST_RELEASE_URL, | ||
MARKETPLACE_VERSION, | ||
RELEASES_URL, | ||
} from "../../../constants"; | ||
import { getMarkdownHTML } from "../../../logic/Utils"; | ||
|
||
async function fetchLatestReleaseInfo(): Promise<{ | ||
version: string; | ||
changelog: string | null; | ||
version: string; | ||
changelog: string | null; | ||
} | null> { | ||
try { | ||
const result = await fetch(LATEST_RELEASE_URL); | ||
const resultJson = await result.json(); | ||
const { body, tag_name, message } = resultJson; | ||
return body && tag_name && !message | ||
? { | ||
version: tag_name.replace("v", ""), | ||
changelog: await getMarkdownHTML(body.match(/## What's Changed([\s\S]*?)(\r\n\r|\n\n##)/)[1], "spicetify", "spicetify-marketplace") | ||
} | ||
: null; | ||
} catch (error) { | ||
console.error(error); | ||
return null; | ||
} | ||
try { | ||
const result = await fetch(LATEST_RELEASE_URL); | ||
const resultJson = await result.json(); | ||
const { body, tag_name, message } = resultJson; | ||
return body && tag_name && !message | ||
? { | ||
version: tag_name.replace("v", ""), | ||
changelog: await getMarkdownHTML( | ||
body.match(/## What's Changed([\s\S]*?)(\r\n\r|\n\n##)/)[1], | ||
"spicetify", | ||
"marketplace", | ||
), | ||
} | ||
: null; | ||
} catch (error) { | ||
console.error(error); | ||
return null; | ||
} | ||
} | ||
|
||
function UpdateModal(): React.ReactElement { | ||
const [releaseInfo, setReleaseInfo] = React.useState<{ | ||
version: string; | ||
changelog: string | null; | ||
} | null>(null); | ||
const [releaseInfo, setReleaseInfo] = React.useState<{ | ||
version: string; | ||
changelog: string | null; | ||
} | null>(null); | ||
|
||
React.useEffect(() => { | ||
fetchLatestReleaseInfo().then((releaseInfo) => setReleaseInfo(releaseInfo)); | ||
}, []); | ||
React.useEffect(() => { | ||
fetchLatestReleaseInfo().then((releaseInfo) => setReleaseInfo(releaseInfo)); | ||
}, []); | ||
|
||
return ( | ||
<div id="marketplace-update-container"> | ||
<div id="marketplace-update-description"> | ||
<h4>{t("updateModal.description")}</h4> | ||
<a href={`${RELEASES_URL}/tag/v${MARKETPLACE_VERSION}`}>{t("updateModal.currentVersion", { version: MARKETPLACE_VERSION })}</a> | ||
<a href={`${RELEASES_URL}/tag/v${releaseInfo?.version}`}>{t("updateModal.latestVersion", { version: releaseInfo?.version })}</a> | ||
</div> | ||
<hr /> | ||
<div id="marketplace-update-whats-changed"> | ||
<h3 className="marketplace-update-header">{t("updateModal.whatsChanged")}</h3> | ||
<details> | ||
<summary>{t("updateModal.seeChangelog")}</summary> | ||
<ul dangerouslySetInnerHTML={{ __html: releaseInfo?.changelog ?? "" }} /> | ||
</details> | ||
</div> | ||
<hr /> | ||
<div id="marketplace-update-guide"> | ||
<h3 className="marketplace-update-header">{t("updateModal.howToUpgrade")}</h3> | ||
<a href="https://github.com/spicetify/spicetify-marketplace/wiki/Installation">{t("updateModal.viewGuide")}</a> | ||
</div> | ||
</div> | ||
); | ||
return ( | ||
<div id="marketplace-update-container"> | ||
<div id="marketplace-update-description"> | ||
<h4>{t("updateModal.description")}</h4> | ||
<a href={`${RELEASES_URL}/tag/v${MARKETPLACE_VERSION}`}> | ||
{t("updateModal.currentVersion", { version: MARKETPLACE_VERSION })} | ||
</a> | ||
<a href={`${RELEASES_URL}/tag/v${releaseInfo?.version}`}> | ||
{t("updateModal.latestVersion", { version: releaseInfo?.version })} | ||
</a> | ||
</div> | ||
<hr /> | ||
<div id="marketplace-update-whats-changed"> | ||
<h3 className="marketplace-update-header"> | ||
{t("updateModal.whatsChanged")} | ||
</h3> | ||
<details> | ||
<summary>{t("updateModal.seeChangelog")}</summary> | ||
<ul | ||
dangerouslySetInnerHTML={{ __html: releaseInfo?.changelog ?? "" }} | ||
/> | ||
</details> | ||
</div> | ||
<hr /> | ||
<div id="marketplace-update-guide"> | ||
<h3 className="marketplace-update-header"> | ||
{t("updateModal.howToUpgrade")} | ||
</h3> | ||
<a href="https://github.com/spicetify/marketplace/wiki/Installation"> | ||
{t("updateModal.viewGuide")} | ||
</a> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default UpdateModal; |
Oops, something went wrong.