Skip to content

Commit

Permalink
Allow the use of light text in marketplace banner
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed Sep 30, 2024
1 parent eb43f89 commit 8718b47
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/profiles/marketplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export interface MarketplaceIndex {
banner: Localized<{
backgroundUrl: string,
backgroundAccent?: string,
useLightText?: boolean,
preHeaderText?: string,
headerText: string,

Expand Down
8 changes: 8 additions & 0 deletions src/routes/Marketplace/Marketplace.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
text-transform: uppercase;
}

.lightBannerText > .preHeader {
color: rgba(255, 255, 255, 0.4);
}

.lightBannerText > .header {
color: #FFF;
}

.banner > .buttons {
margin-top: 12px;
display: flex;
Expand Down
9 changes: 7 additions & 2 deletions src/routes/Marketplace/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@ function Marketplace() {

const banner = localizeObject(marketIndex.banner, "en-US");

const bannerStyles = [ styles.banner ];
if (banner.useLightText) {
bannerStyles.push(styles.lightBannerText);
}

return <main className={styles.main}>
<MarketplacePopup marketplaceProfile={selectedProfile} setSelectedProfile={setSelectedProfile} />

<div className={styles.banner}
<div className={bannerStyles.join(" ")}
style={{
"--banner": `url(${processAssetUrl(banner.backgroundUrl)})`,
"--accent": banner.backgroundAccent === undefined ? "transparent" : banner.backgroundAccent
Expand Down Expand Up @@ -71,7 +76,7 @@ function Marketplace() {
</Button>

{banner.previewUrl !== undefined &&
<Button color={ButtonColor.DARK} rounded border
<Button color={banner.useLightText ? ButtonColor.BLUE : ButtonColor.DARK} rounded border
onClick={async () => await askOpenUrl(banner.previewUrl as string)}>

Preview
Expand Down

0 comments on commit 8718b47

Please sign in to comment.