Skip to content

Commit

Permalink
add config.hrefMigrate and config.hrefv1
Browse files Browse the repository at this point in the history
  • Loading branch information
ug.rp committed Apr 21, 2024
1 parent 2c70409 commit 91b7793
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 21 deletions.
7 changes: 4 additions & 3 deletions public/themes/classic.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@ r4-app {
}

r4-app[color-scheme='os'] {
}
r4-app[color-scheme='light'] {
--c-bg: hsl(40, 6%, 90%);
--c-bg2: color-mix(in oklch, var(--c-bg) 100%, white 50%);
}
r4-app[color-scheme='light'] {
}

r4-app[color-scheme='dark'] {
--c-fg: var(--c-light);
Expand Down Expand Up @@ -204,7 +204,8 @@ r4-track-description a {
}

/* search query */
r4-query { }
r4-query {
}
r4-query menu,
r4-query details {
padding: calc(var(--s) / 3);
Expand Down
4 changes: 3 additions & 1 deletion src/components/r4-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ export default class R4App extends LitElement {
const client = this.href?.split('://')[1]
return {
href: this.href,
hrefV1: 'https://v1.radio4000.com',
hrefMigrate: 'https://migrate.radio4000.com',
client,
version: this.version,
singleChannel: this.singleChannel,
Expand Down Expand Up @@ -112,7 +114,7 @@ export default class R4App extends LitElement {
const sameUser = (this.user && this.user.id) === (detail.user && detail.user.id)
if (
detail.eventType === 'INITIAL_SESSION' ||
detail.eventType === 'SIGNED_IN' && !sameUser ||
(detail.eventType === 'SIGNED_IN' && !sameUser) ||
detail.eventType === 'SIGNED_OUT'
) {
this.user = detail.user
Expand Down
2 changes: 1 addition & 1 deletion src/pages/base-channel.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default class BaseChannel extends R4Page {
<p>
This Radio4000 channel is from <a href="https://v1.radio4000.com/${this.params.slug}">version 1</a>. If you
are the channel operator, consider importing it to
<a href="https://migrate.radio4000.com/?slug=${this.params.slug}">version 2</a>.
<a href="${this.config.hrefMigrate}/?slug=${this.params.slug}">version 2</a>.
</p>
<form method="dialog">
<button>Got it!</button>
Expand Down
11 changes: 3 additions & 8 deletions src/pages/r4-page-home.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@ export default class R4PageHome extends R4Page {
${this.store.following?.length ? this.renderFollowingChannels() : null}
`
}
renderIn() {
return html`
<h1>Home</h1>
<p></p>
`
}
renderIn() {}
renderOut() {
return this.renderBetaNote()
}
Expand Down Expand Up @@ -62,11 +57,11 @@ export default class R4PageHome extends R4Page {
<p>Welcome to the new <r4-title></r4-title>, version 2 (<strong>v2</strong>).</p>
<p>
All previous radio channels are still available on the
<a href="https://v1.radio400.com">v1</a> website.
<a href="${this.config.hrefV1}">v1</a> website.
</p>
<p>
To import a radio channel from v1 to v2, see
<a href="https://migrate.radio4000.com">migration</a>.
<a href="${this.config.hrefMigrate}">migration</a>.
</p>
</dialog>
</section>
Expand Down
9 changes: 6 additions & 3 deletions src/pages/r4-page-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ export default class R4PageNew extends R4Page {
}

renderHeader() {
return html` `
return html``
}
renderMain() {
return html`
<h2>Do you already have a radio from the old site?</h2>
<p>1. Create a new account below.<br>
2. Follow the steps on <a href="https://migrate.radio4000.com"><strong>migrate.radio4000</strong></a> &larr; it'll only take a minute (<a href="${this.config.href}/about">about</a>).</p>
<p>
1. Create a new account below.<br />
2. Follow the steps on <a href="${this.config.hrefMigrate}"><strong>migrate.radio4000</strong></a> &larr; it'll
only take a minute (<a href="${this.config.href}/about">about</a>).
</p>
<p>If you are new here, nevermind that notice and welcome!</p>
<h1>Create radio channel</h1>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/r4-page-settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export default class R4PageSettings extends R4Page {
<ul>
<li><a href="${this.config.href}/sign/in">Sign in</a> an existing account</li>
<li><a href="${this.config.href}/sign/up">Sign up</a> to register a new account</li>
<li><a href="https://migrate.radio4000.com">Migrate</a> a channel from v1 to v2</li>
<li><a href="${this.config.hrefMigrate}">Migrate</a> a channel from v1 to v2</li>
</ul>
</section>
`
Expand Down
6 changes: 2 additions & 4 deletions src/pages/r4-page-sign.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export default class R4PageSign extends R4Page {
showConfirmEmail: {type: Boolean, state: true},
}

migrateUrl = 'https://migrate.radio4000.com'

get showConfirm() {
return this.showConfirmEmail && this.params.method === 'up'
}
Expand Down Expand Up @@ -107,8 +105,8 @@ export default class R4PageSign extends R4Page {
if you already have an existing account.
</li>
<li>
Sign up first, to <a href=${this.migrateUrl}>import/migrate</a> an existing radio (from the previous
<a href="https://radio4000.com">site</a>).
Sign up first, to <a href="${this.config.hrefMigrate}">import/migrate</a> an existing radio (from the
previous <a href="https://radio4000.com">site</a>).
</li>
</ul>
</section>
Expand Down

0 comments on commit 91b7793

Please sign in to comment.