Skip to content
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Deploy PR Preview
on:
pull_request:
types: [opened, synchronize, closed]

jobs:
preview:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "22"
- name: Enable Corepack
run: corepack enable
- name: Use Yarn 4.7.0
run: corepack prepare [email protected] --activate
- run: yarn
- run: yarn build:web
- uses: rossjrw/[email protected]
with:
source-dir: ./packages/raga-web-app/dist
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
],
"scripts": {
"build": "nx run-many -t build",
"build:web": "yarn workspace @adahiya/raga-lib build && yarn workspace @adahiya/raga-web-app build",
"check-format": "prettier --check \"./**/*.{js,json,md,scss,ts,tsx,yaml,yml}\"",
"check-lint": "nx run-many -t check-lint",
"check-types": "nx run-many -t check-types",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import { useTaskEffect } from "../../hooks";
import { appStore } from "../../store/appStore";
import EmptyState from "../common/emptyState";
import styles from "./libraryLoader.module.scss";
import LoadLibraryForm from "./loadLibraryForm";
import LoadLibraryForm, { LoadMockLibraryForm } from "./loadLibraryForm";

export default function LibraryLoader(props: { children: React.ReactNode }) {
const libraryInputFilepath = appStore.use.libraryInputFilepath();
const libraryState = appStore.use.libraryLoadingState();
const loadLibrary = appStore.use.loadSwinsianLibrary();
const useMockData = appStore.use.useMockData();

useTaskEffect(
function* () {
Expand All @@ -29,7 +30,7 @@ export default function LibraryLoader(props: { children: React.ReactNode }) {
title="Select a Swinsian library"
icon={<IoMusicalNotes size={48} />}
>
<LoadLibraryForm />
{useMockData ? <LoadMockLibraryForm /> : <LoadLibraryForm />}
</EmptyState>
) : libraryState === "loading" ? (
<EmptyState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,17 @@ function MaybeRecentlyUsedLibrariesSection({ formWidth }: { formWidth: number })
</>
);
}

export function LoadMockLibraryForm() {
const setLibraryInputFilepath = appStore.use.setLibraryInputFilepath();

const handleClick = useCallback(() => {
setLibraryInputFilepath("/mock/library.xml");
}, [setLibraryInputFilepath]);

return (
<Stack gap="xs">
<Button onClick={handleClick}>Load Mock Library</Button>
</Stack>
);
}
Loading