From b1b12f23b9fa07f37eba3cf9046b4d837c8f49f2 Mon Sep 17 00:00:00 2001 From: GregTCLTK Date: Mon, 25 Nov 2024 18:37:08 +0100 Subject: [PATCH] wip newdrop --- pages/music/data.ts | 4 +- pages/music/main.ts | 7 +- pages/music/newDrop.ts | 277 ++++++++++++++++++------------------- pages/music/views/table.ts | 163 ++++++++++++---------- pages/user/signin.ts | 8 +- serve.ts | 4 +- 6 files changed, 234 insertions(+), 229 deletions(-) diff --git a/pages/music/data.ts b/pages/music/data.ts index de6b6c9..5a9fdc9 100644 --- a/pages/music/data.ts +++ b/pages/music/data.ts @@ -1,6 +1,6 @@ import { delay } from "@std/async"; import { API, StreamingUploadHandler, stupidErrorAlert } from "shared/mod.ts"; -import { Reference } from "webgen/mod.ts"; +import { Reference, WriteSignal } from "webgen/mod.ts"; import { ArtistRef, Song } from "../../spec/music.ts"; export function uploadSongToDrop(songs: Reference, artists: ArtistRef[], language: string, primaryGenre: string, secondaryGenre: string, uploadingSongs: Reference<{ [key: string]: number }[]>, file: File) { @@ -63,7 +63,7 @@ export function uploadSongToDrop(songs: Reference, artists: ArtistRef[], }, file); } -export function uploadArtwork(id: string, file: File, artworkClientData: Reference, artwork: Reference) { +export function uploadArtwork(id: string, file: File, artworkClientData: WriteSignal, artwork: WriteSignal) { const blobUrl = URL.createObjectURL(file); artworkClientData.setValue({ type: "uploading", filename: file.name, blobUrl, percentage: 0 }); diff --git a/pages/music/main.ts b/pages/music/main.ts index a9a0778..d8e1c20 100644 --- a/pages/music/main.ts +++ b/pages/music/main.ts @@ -4,8 +4,6 @@ import "./pages/payouts.ts"; import "./pages/publishedDrops.ts"; import "./pages/unpublishedDrops.ts"; -/// - import { RegisterAuthRefresh, sheetStack } from "shared/helper.ts"; import { Navigation } from "shared/navigation.ts"; import { API, stupidErrorAlert } from "shared/restSpec.ts"; @@ -51,10 +49,7 @@ appendBody( .map((isArtistsRoute) => isArtistsRoute ? PrimaryButton("Create new Artist") - .onClick(() => { - sheetStack.addSheet(createArtistSheet()); - // createArtistSheet().then(async () => menuState.artists = await API.music.artists.list().then(stupidErrorAlert)); - }) + .onClick(() => sheetStack.addSheet(createArtistSheet())) : PrimaryButton("Create new Drop") .onPromiseClick(async () => { const { id } = await API.music.drops.create().then(stupidErrorAlert); diff --git a/pages/music/newDrop.ts b/pages/music/newDrop.ts index 809a7d7..9f2781f 100644 --- a/pages/music/newDrop.ts +++ b/pages/music/newDrop.ts @@ -1,16 +1,17 @@ -import { allowedAudioFormats, allowedImageFormats, CenterAndRight, ExistingSongDialog, getSecondary, RegisterAuthRefresh, sheetStack } from "shared/helper.ts"; +import { allowedImageFormats, getSecondary, RegisterAuthRefresh, sheetStack } from "shared/helper.ts"; import { API, stupidErrorAlert } from "shared/mod.ts"; -import { appendBody, asRef, asRefRecord, Box, Content, createFilePicker, DialogContainer, DropDown, Empty, Grid, Image, Label, PrimaryButton, SecondaryButton, SheetHeader, Spinner, TextInput, WebGenTheme } from "webgen/mod.ts"; +import { appendBody, asRefRecord, Box, Color, Content, createFilePicker, DateInput, DialogContainer, DropDown, Empty, FullWidthSection, Grid, Image, Label, PrimaryButton, SecondaryButton, SheetHeader, Spinner, TextInput, WebGenTheme } from "webgen/mod.ts"; +import { ZodError } from "zod/mod.ts"; import "../../assets/css/main.css"; import { DynaNavigation } from "../../components/nav.ts"; import genres from "../../data/genres.json" with { type: "json" }; import language from "../../data/language.json" with { type: "json" }; -import { ArtistRef, ArtistTypes, DropType, pages, Song } from "../../spec/music.ts"; -import { uploadArtwork, uploadSongToDrop } from "./data.ts"; -import { EditArtistsDialog, ManageSongs } from "./views/table.ts"; +import { ArtistRef, ArtistTypes, Song } from "../../spec/music.ts"; // Do no move this import +import { uploadArtwork } from "./data.ts"; import "./newDrop.css"; +import { EditArtistsDialog } from "./views/table.ts"; await RegisterAuthRefresh(); @@ -26,8 +27,8 @@ if (!params.has("id")) { const dropId = params.get("id")!; export const creationState = asRefRecord({ - loaded: false, - _id: undefined, + // loaded: false, + _id: dropId, gtin: undefined, title: undefined, release: undefined, @@ -38,73 +39,53 @@ export const creationState = asRefRecord({ compositionCopyright: undefined, soundRecordingCopyright: undefined, artwork: undefined, - artworkClientData: undefined, + artworkClientData: undefined, uploadingSongs: []> [], songs: [], comments: undefined, page: 0, - validationState: undefined, + validationState: undefined, }); API.music.id(dropId).get().then(stupidErrorAlert) .then((drop) => { - creationState._id = dropId; - creationState.gtin = drop.gtin; - creationState.title = drop.title; - creationState.release = drop.release; - creationState.language = drop.language; - creationState.artists = drop.artists ?? [{ type: ArtistTypes.Primary, _id: null! }]; - creationState.primaryGenre = drop.primaryGenre; - creationState.secondaryGenre = drop.secondaryGenre; - creationState.compositionCopyright = drop.compositionCopyright ?? "BBN Music (via bbn.one)"; - creationState.soundRecordingCopyright = drop.soundRecordingCopyright ?? "BBN Music (via bbn.one)"; - creationState.artwork = drop.artwork; - creationState.artworkClientData = (drop.artwork ? { type: "direct", source: () => API.music.id(dropId).artwork().then(stupidErrorAlert) } : undefined); - creationState.songs = drop.songs ?? []; - creationState.comments = drop.comments; + creationState.gtin.setValue(drop.gtin); + creationState.title.setValue(drop.title); + creationState.release.setValue(drop.release); + creationState.language.setValue(drop.language); + creationState.artists.setValue(drop.artists ?? [{ type: ArtistTypes.Primary, _id: null! }]); + creationState.primaryGenre.setValue(drop.primaryGenre); + creationState.secondaryGenre.setValue(drop.secondaryGenre); + creationState.compositionCopyright.setValue(drop.compositionCopyright ?? "BBN Music (via bbn.one)"); + creationState.soundRecordingCopyright.setValue(drop.soundRecordingCopyright ?? "BBN Music (via bbn.one)"); + creationState.artwork.setValue(drop.artwork); + creationState.artworkClientData.setValue( (drop.artwork ? { type: "direct", source: () => API.music.id(dropId).artwork().then(stupidErrorAlert) } : undefined)); + creationState.songs.setValue(drop.songs ?? []); + creationState.comments.setValue(drop.comments); }) - .then(() => creationState.loaded = true); + .then(() => creationState.page.setValue(1)); const additionalDropInformation = Grid( SheetHeader("Additional Information", sheetStack), - Grid( - Grid( - TextInput(creationState.gtin, "UPC/EAN"), - TextInput(creationState.compositionCopyright, "Composition Copyright"), - TextInput(creationState.soundRecordingCopyright, "Sound Recording Copyright"), - ) - .setGap() - .setEvenColumns(1) - .addClass("grid-area"), - PrimaryButton("Save").onClick(() => sheetStack.removeOne()), - ).setGap(), -); - -appendBody( - WebGenTheme( - DialogContainer(sheetStack.visible(), sheetStack), - Content( - DynaNavigation("Music"), - Box(creationState.loaded.map((loaded) => loaded ? wizard : Spinner())), - ), - ).addClass("fullscreen"), -); - -Custom(document.body).setAttribute("data-theme", undefined); + TextInput(creationState.gtin, "UPC/EAN"), + TextInput(creationState.compositionCopyright, "Composition Copyright"), + TextInput(creationState.soundRecordingCopyright, "Sound Recording Copyright"), + PrimaryButton("Save").onClick(() => sheetStack.removeOne()), +).setGap(); const validator = (page: number) => async () => { - const { error, validate } = Validate(creationState, pages[page]); + // const { error, validate } = Validate(creationState, pages[page]); - const data = validate(); - if (error.getValue()) return creationState.validationState = error.getValue(); - if (data) await API.music.id(dropId).update(data); - creationState.page++; - creationState.validationState = undefined; + // const data = validate(); + // if (error.getValue()) return creationState.validationState = error.getValue(); + // if (data) await API.music.id(dropId).update(data); + creationState.page.setValue(page + 1); + creationState.validationState.setValue(undefined); }; const footer = (page: number) => Grid( - page == 0 ? SecondaryButton("Cancel").setJustifyContent("center").onClick(() => location.href = "/c/music") : SecondaryButton("Back").setJustifyContent("center").onClick(() => creationState.page--), + page == 0 ? SecondaryButton("Cancel").setJustifyContent("center").onClick(() => location.href = "/c/music") : SecondaryButton("Back").setJustifyContent("center").onClick(() => creationState.page.setValue(page - 1)), Box( creationState.validationState.map((error) => error @@ -117,108 +98,124 @@ const footer = (page: number) => ), ), PrimaryButton("Next").setJustifyContent("center").onClick(validator(page)), - ).addClass("footer"); + ) + .setGap() + .setTemplateColumns("1fr auto 1fr"); const wizard = creationState.page.map((page) => { if (page == 0) { + return Spinner(); + } else if (page == 1) { return Grid( - MediaQuery("(max-width: 450px)", (small) => + Grid( + Label("Enter your Album details.").setFontWeight("bold").setTextSize("xl").setJustifySelf("center"), + TextInput(creationState.title, "Title"), Grid( - Label("Enter your Album details.").addClass("title"), - TextInput(creationState.title, "Title"), - Grid( - TextInput(creationState.release, "Release Date"), - DropDown(Object.keys(language), creationState.language, "Language") - .setValueRender((key) => language[ key]), - ) - .setEvenColumns(small ? 1 : 2) - .setGap(), - PrimaryButton("Artists") - .onClick(() => EditArtistsDialog(creationState.artists).open()), - Label("Set your target Audience").addClass("title"), - Grid( - DropDown(Object.keys(genres), creationState.primaryGenre, "Primary Genre"), - // .onChange(() => creationState.secondaryGenre.setValue(undefined)), //move to listen - Box(creationState.primaryGenre.map((primaryGenre) => - DropDown(getSecondary(genres, primaryGenre) ?? [], creationState.secondaryGenre, "Secondary Genre") - .setColor(getSecondary(genres, primaryGenre) ? Color.Grayscaled : Color.Disabled) - )), - ) - .setGap() - .setEvenColumns(small ? 1 : 2), - PrimaryButton("Additional Information") - .onClick(() => sheetStack.addSheet(additionalDropInformation)), + DateInput(creationState.release, "Release Date"), + DropDown(Object.keys(language), creationState.language, "Language") + .setValueRender((key) => language[ key]), + ) + .setEvenColumns(2) + // .setEvenColumns(small ? 1 : 2) + .setGap(), + PrimaryButton("Artists") + .onClick(() => sheetStack.addSheet(EditArtistsDialog(creationState.artists))), + Label("Set your target Audience").setFontWeight("bold").setTextSize("xl").setJustifySelf("center"), + Grid( + DropDown(Object.keys(genres), creationState.primaryGenre, "Primary Genre"), + // .onChange(() => creationState.secondaryGenre.setValue(undefined)), //move to listen + Box(creationState.primaryGenre.map((primaryGenre) => DropDown(getSecondary(genres, primaryGenre) ?? [], creationState.secondaryGenre, "Secondary Genre") // .setColor(getSecondary(genres, primaryGenre) ? Color.Grayscaled : Color.Disabled) + )), ) .setGap() - .setEvenColumns(1) - .addClass("grid-area")), + .setEvenColumns(2), + PrimaryButton("Additional Information") + .onClick(() => sheetStack.addSheet(additionalDropInformation)), + ) + .setGap() + .setEvenColumns(1) + .addClass("grid-area"), footer(page), - ).addClass("wwizard"); - } else if (page == 1) { + ).setGap(); + } else if (page == 2) { return Grid( creationState.artworkClientData.map((data) => Grid( - CenterAndRight( - Label("Upload your Cover").addClass("title"), + Grid( + Label("Upload your Cover").setFontWeight("bold").setTextSize("xl").setJustifySelf("center"), PrimaryButton("Manual Upload") .onClick(() => createFilePicker(allowedImageFormats.join(",")).then((file) => uploadArtwork(dropId, file, creationState.artworkClientData, creationState.artwork))), ), - DropAreaInput( - CenterV(data ? Image(data, "A Music Album Artwork.") : Label("Drop your Artwork here.").setTextSize("xl").setFontWeight("semibold")), - allowedImageFormats, - ([{ file }]) => uploadArtwork(dropId, file, creationState.artworkClientData, creationState.artwork), + Grid( + Grid(data ? Image(data, "A Music Album Artwork.") : Label("Drop your Artwork here.").setTextSize("xl").setFontWeight("semibold")), + // allowedImageFormats, + // ([{ file }]) => uploadArtwork(dropId, file, creationState.artworkClientData, creationState.artwork), ).addClass("drop-area"), ).setGap() ), footer(page), - ).addClass("wwizard"); - } else if (page == 2) { - creationState.songs.listen((songs, oldVal) => { - if (oldVal != undefined) { - creationState.songs.setValue(songs); - } - }); - const songs = asRef( undefined); - const existingSongDialog = ExistingSongDialog(creationState.songs, songs); - return Grid( - Grid( - Grid( - CenterAndRight( - Label("Manage your Music").addClass("title"), - Box( - PrimaryButton("Manual Upload") - .onClick(() => createFilePicker(allowedAudioFormats.join(",")).then((file) => uploadSongToDrop(creationState.songs, creationState.artists, creationState.language, creationState.primaryGenre, creationState.secondaryGenre, creationState.uploadingSongs, file))).setMargin("0 1rem 0 0"), - PrimaryButton("Add an existing Song") - .onPromiseClick(async () => { - songs.setValue((await API.music.songs.list().then(stupidErrorAlert)).filter((song) => creationState.songs.value.some((dropsong) => dropsong._id !== song._id))); - existingSongDialog.open(); - }), - ), - ), - ManageSongs(creationState.songs, creationState.uploadingSongs, creationState.primaryGenre!), - ).setGap(), - ), - footer(page), - ).addClass("wwizard"); - } else if (page == 3) { - return Grid( - Grid( - Label("Thanks! That's everything we need.").setBalanced().addClass("ending-title"), - ), - Grid( - TextInput(creationState.comments, "Comments for Review Team"), - ), - Grid( - SecondaryButton("Back").setJustifyContent("center").onClick(() => creationState.page--), - PrimaryButton("Submit").onPromiseClick(async () => { - creationState.loaded = false; - await API.music.id(dropId).update(creationState); - - await API.music.id(dropId).type.post(DropType.UnderReview); - location.href = "/c/music"; - }).setJustifyContent("center"), - ).addClass("footer"), - ).addClass("wwizard"); + ).setGap(); } - return Spinner(); + // else if (page == 2) { + // creationState.songs.listen((songs, oldVal) => { + // if (oldVal != undefined) { + // creationState.songs.setValue(songs); + // } + // }); + // const songs = asRef( undefined); + // const existingSongDialog = ExistingSongDialog(creationState.songs, songs); + // return Grid( + // Grid( + // Grid( + // CenterAndRight( + // Label("Manage your Music").addClass("title"), + // Box( + // PrimaryButton("Manual Upload") + // .onClick(() => createFilePicker(allowedAudioFormats.join(",")).then((file) => uploadSongToDrop(creationState.songs, creationState.artists, creationState.language, creationState.primaryGenre, creationState.secondaryGenre, creationState.uploadingSongs, file))).setMargin("0 1rem 0 0"), + // PrimaryButton("Add an existing Song") + // .onPromiseClick(async () => { + // songs.setValue((await API.music.songs.list().then(stupidErrorAlert)).filter((song) => creationState.songs.value.some((dropsong) => dropsong._id !== song._id))); + // existingSongDialog.open(); + // }), + // ), + // ), + // ManageSongs(creationState.songs, creationState.uploadingSongs, creationState.primaryGenre!), + // ).setGap(), + // ), + // footer(page), + // ).addClass("wwizard"); + // } else if (page == 3) { + // return Grid( + // Grid( + // Label("Thanks! That's everything we need.").setBalanced().addClass("ending-title"), + // ), + // Grid( + // TextInput(creationState.comments, "Comments for Review Team"), + // ), + // Grid( + // SecondaryButton("Back").setJustifyContent("center").onClick(() => creationState.page--), + // PrimaryButton("Submit").onPromiseClick(async () => { + // creationState.loaded = false; + // await API.music.id(dropId).update(creationState); + + // await API.music.id(dropId).type.post(DropType.UnderReview); + // location.href = "/c/music"; + // }).setJustifyContent("center"), + // ).addClass("footer"), + // ).addClass("wwizard"); + // } + return Empty(); }); + +appendBody( + WebGenTheme( + DialogContainer(sheetStack.visible(), sheetStack), + Content( + FullWidthSection( + DynaNavigation("Music"), + ), + Box(wizard), + ) + .setContentMaxWidth("50%"), + ).setPrimaryColor(new Color("white")), +); diff --git a/pages/music/views/table.ts b/pages/music/views/table.ts index edc103e..5c0ffa0 100644 --- a/pages/music/views/table.ts +++ b/pages/music/views/table.ts @@ -1,6 +1,6 @@ import { sheetStack } from "shared/helper.ts"; import { API, stupidErrorAlert } from "shared/mod.ts"; -import { asRef, asRefRecord, Grid, PrimaryButton, Reference, SheetHeader, TextInput } from "webgen/mod.ts"; +import { asRef, asRefRecord, Box, DropDown, Grid, PrimaryButton, SheetHeader, Table, TextInput, WriteSignal } from "webgen/mod.ts"; import { Artist, ArtistRef, ArtistTypes } from "../../../spec/music.ts"; import "./table.css"; @@ -68,25 +68,23 @@ export const createArtistSheet = (name?: string) => { }); return Grid( SheetHeader("Create Artist", sheetStack), - Grid( - TextInput(state.name, "Artist Name"), - TextInput(state.spotify, "Spotify URL"), - TextInput(state.apple, "Apple Music URL"), - PrimaryButton("Create") - .onPromiseClick(async () => { - await API.music.artists.create(Object.fromEntries(Object.entries(state).map(([key, state]) => [key, state.value])) as any); - }) - .setJustifySelf("start"), - // .setColor(state.$name.map((x) => x ? Color.Grayscaled : Color.Disabled)), - ) - .setGap() - .setAlignContent("start") - .setWidth("400px") - .setHeight("420px"), - ); + TextInput(state.name, "Artist Name"), + TextInput(state.spotify, "Spotify URL"), + TextInput(state.apple, "Apple Music URL"), + PrimaryButton("Create") + .onPromiseClick(async () => { + await API.music.artists.create(Object.fromEntries(Object.entries(state).map(([key, state]) => [key, state.value])) as any).then(stupidErrorAlert); + sheetStack.removeOne(); + location.reload(); + }) + .setDisabled(state.name.map((x) => !x)) + .setJustifySelf("start"), + ) + .setGap() + .setWidth("25rem"); }; -export const EditArtistsDialog = (artists: Reference, provided?: Artist[]) => { +export const EditArtistsDialog = (artists: WriteSignal, provided?: Artist[]) => { const artistList = provided ? asRef(provided) : asRef( []); if (!provided) { @@ -94,65 +92,82 @@ export const EditArtistsDialog = (artists: Reference, provided?: Ar .then((x) => artistList.setValue(x)); } - const dialog = SheetDialog( - sheetStack, - "Manage your Artists", - artistList.map((list) => - new Table2(artists) - .addClass("artist-table") - .setColumnTemplate("10rem 12rem min-content") - .addColumn("Type", (artist) => { - const data = asRef(artist.type); - data.listen((type, oldVal) => { - if (oldVal != undefined) { - if (type == ArtistTypes.Primary || type == ArtistTypes.Featuring) { - artists.updateItem(artist, { type, _id: null! } as ArtistRef); - } else { - artists.updateItem(artist, { type, name: "" } as ArtistRef); - } - } - }); - return DropDownInput("Type", Object.values(ArtistTypes)) - .ref(data); - }) - .addColumn("Name", (artist) => { - if ([ArtistTypes.Primary, ArtistTypes.Featuring].includes(artist.type)) { - const data = asRef(artist._id as string); - data.listen((_id, oldVal) => (oldVal !== undefined) && artists.updateItem(artist, { ...artist, _id })); - return DropDownInput("Select Artist", list.map((y) => y._id)) - .setRender((data) => { - const artist = list.find((y) => y._id === data); - return artist ? artist.name : ""; - }) - .ref(data) - .addAction(MIcon("add"), "Create Artist", () => { - sheetStack.addSheet(createArtistSheet()); - createArtistSheet().then(() => { - API.music.artists.list().then(stupidErrorAlert) - .then((x) => { - artistList.setValue(x); - }); - }); + return Grid( + SheetHeader("Edit Artists", sheetStack), + Box(artistList.map((list) => + Table( + artists, + asRef({ + type: { + cellRenderer: (x) => { + const data = asRef(x); + data.listen((type, oldVal) => { + if (oldVal != undefined) { + if (type == ArtistTypes.Primary || type == ArtistTypes.Featuring) { + artists.updateItem(x, { type, _id: null! } as ArtistRef); + } else { + artists.updateItem(x, { type, name: "" } as ArtistRef); + } + } }); - } - const data = asRef(artist.name as string); - data.listen((name, oldVal) => (oldVal != undefined) && artists.updateItem(artist, { ...artist, name } as ArtistRef)); - return TextInput("text", "Name", "blur") - .ref(data); - }) - .addColumn("", (data) => IconButton(MIcon("delete"), "Delete").onClick(() => artists.setValue(artists.getValue().filter((_, i) => i != artists.getValue().indexOf(data))))) - ).asRefComponent(), - Horizontal( - Spacer(), - Button("Add Artist") + return DropDown(Object.values(ArtistTypes), data); + }, + }, + }), + ) // + // new Table2(artists) + // .addClass("artist-table") + // .setColumnTemplate("10rem 12rem min-content") + // .addColumn("Type", (artist) => { + // const data = asRef(artist.type); + // data.listen((type, oldVal) => { + // if (oldVal != undefined) { + // if (type == ArtistTypes.Primary || type == ArtistTypes.Featuring) { + // artists.updateItem(artist, { type, _id: null! } as ArtistRef); + // } else { + // artists.updateItem(artist, { type, name: "" } as ArtistRef); + // } + // } + // }); + // return DropDownInput("Type", Object.values(ArtistTypes)) + // .ref(data); + // }) + // .addColumn("Name", (artist) => { + // if ([ArtistTypes.Primary, ArtistTypes.Featuring].includes(artist.type)) { + // const data = asRef(artist._id as string); + // data.listen((_id, oldVal) => (oldVal !== undefined) && artists.updateItem(artist, { ...artist, _id })); + // return DropDownInput("Select Artist", list.map((y) => y._id)) + // .setRender((data) => { + // const artist = list.find((y) => y._id === data); + // return artist ? artist.name : ""; + // }) + // .ref(data) + // .addAction(MIcon("add"), "Create Artist", () => { + // sheetStack.addSheet(createArtistSheet()); + // createArtistSheet().then(() => { + // API.music.artists.list().then(stupidErrorAlert) + // .then((x) => { + // artistList.setValue(x); + // }); + // }); + // }); + // } + // const data = asRef(artist.name as string); + // data.listen((name, oldVal) => (oldVal != undefined) && artists.updateItem(artist, { ...artist, name } as ArtistRef)); + // return TextInput("text", "Name", "blur") + // .ref(data); + // }) + // .addColumn("", (data) => IconButton(MIcon("delete"), "Delete").onClick(() => artists.setValue(artists.getValue().filter((_, i) => i != artists.getValue().indexOf(data))))) + )), + Grid( + // Spacer(), + PrimaryButton("Add Artist") .onClick(() => artists.addItem({ type: ArtistTypes.Primary, _id: null! } as ArtistRef)), ).setPadding("0 0 3rem 0"), - Horizontal( - Spacer(), - Button("Save") - .onClick(() => dialog.close()), + Grid( + // Spacer(), + PrimaryButton("Save") + .onClick(() => sheetStack.removeOne()), ), ); - - return dialog; }; diff --git a/pages/user/signin.ts b/pages/user/signin.ts index 6916407..64ef45d 100644 --- a/pages/user/signin.ts +++ b/pages/user/signin.ts @@ -82,7 +82,7 @@ appendBody( }) .setId("submit-button") .setJustifyContent("center"), - Label(API.getToken() ? "" : "Error: Link is invalid").addClass("error-message"), + Label(API.getToken() ? "" : "Error: Link is invalid"), ErrorMessage(state.error), )); } @@ -136,7 +136,6 @@ appendBody( // .setJustifyContent("center") // .addPrefix( // Image(discordLogo, "logo") - // .addClass("prefix-logo") // ) .setMargin("0 0 1.3rem"), EmailInput(state.email, "Email"), @@ -171,8 +170,7 @@ appendBody( Grid( Label("Already have an account?"), TextButton("Sign in") - .onClick(() => state.type.setValue("login")) - .addClass("link"), + .onClick(() => state.type.setValue("login")), ).setTemplateColumns("auto auto"), ).setGap(); } @@ -181,7 +179,7 @@ appendBody( Spinner(), Label("Loading..."), ErrorMessage(state.error), - ).setGap().addClass("loading", "loader"); + ).setGap(); })), ), ) diff --git a/serve.ts b/serve.ts index c0cab44..86b69d5 100644 --- a/serve.ts +++ b/serve.ts @@ -58,9 +58,9 @@ serve({ "signin": "./pages/user/signin.ts", // "callback": "./pages/misc/callback.ts", // "oauth": "./pages/user/oauth.ts", - // "music": "./pages/music-landing/main.ts", + "music": "./pages/music-landing/main.ts", "c/music": "./pages/music/main.ts", - // "c/music/new-drop": "./pages/music/newDrop.ts", + "c/music/new-drop": "./pages/music/newDrop.ts", // "c/music/edit": "./pages/music/edit.ts", // "c/music/payout": "./pages/payout/main.ts", // "hosting": "./pages/hosting/main.ts",