Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: made modals load async #1989

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
command: |
export TWITTER_BEARER="Bearer ${{ secrets.TWITTER_BEARER }}"
echo $TWITTER_BEARER
STAKWORK_TOKEN=daaa3a0894f0658d99781471dfccd3e1 TWITTER_BEARER=$TWITTER_BEARER GITACTION_ENV=gitactionenv docker-compose -f ./stack/alts/navfiber.yml --project-dir ./stack up -d;
STAKWORK_TOKEN=daaa3a0894f0658d99781471dfccd3e1 TWITTER_BEARER=$TWITTER_BEARER GITACTION_ENV=gitactionenv docker compose -f ./stack/alts/navfiber.yml --project-directory ./stack up -d;
sleep 240;
docker ps
docker logs meme.sphinx
Expand Down
32 changes: 15 additions & 17 deletions src/components/App/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export const App = () => {

const setTeachMeAnswer = useTeachStore((s) => s.setTeachMeAnswer)

const { fetchData, setCategoryFilter, setAbortRequests, addNewNode, splashDataLoading } = useDataStore((s) => s)
const { fetchData, setCategoryFilter, setAbortRequests, addNewNode } = useDataStore((s) => s)

const { setAiSummaryAnswer, getKeyExist, aiRefId } = useAiSummaryStore((s) => s)

Expand Down Expand Up @@ -229,22 +229,20 @@ export const App = () => {
<Leva hidden={!isDevelopment} />

<Suspense fallback={<div>Loading...</div>}>
{!splashDataLoading ? (
<Wrapper direction="row">
<FormProvider {...form}>
<LazyMainToolbar />
<LazySideBar />
<LazyUniverse />
<Overlay />
<AppBar />
<Version>v{version}</Version>
<ActionsToolbar />
</FormProvider>

<ModalsContainer />
<Toasts />
</Wrapper>
) : null}
<Wrapper direction="row">
<FormProvider {...form}>
<LazyMainToolbar />
<LazySideBar />
<LazyUniverse />
<Overlay />
<AppBar />
<Version>v{version}</Version>
<ActionsToolbar />
</FormProvider>

<ModalsContainer />
<Toasts />
</Wrapper>
</Suspense>
</>
)
Expand Down
35 changes: 20 additions & 15 deletions src/components/ModalsContainer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { lazy } from 'react'
import { useSomeModalIsOpen } from '~/stores/useModalStore'

const LazySettingsModal = lazy(() =>
import('../SettingsModal').then(({ SettingsModal }) => ({ default: SettingsModal })),
Expand Down Expand Up @@ -42,18 +43,22 @@
import('./UserFeedBackModal').then(({ UserFeedBackModal }) => ({ default: UserFeedBackModal })),
)

export const ModalsContainer = () => (
<>
<LazyAddItemModal />
<LazyAddContentModal />
<LazySettingsModal />
<LazyEditNodeNameModal />
<LazyRemoveNodeModal />
<LazySourcesTableModal />
<LazyAddNodeEdgeModal />
<LazyChangeNodeTypeModal />
<LazyBlueprintModal />
<LazyMergeNodeModal />
<LazyUserFeedBackModal />
</>
)
export const ModalsContainer = () => {
const someModalIsOpen = useSomeModalIsOpen()

return someModalIsOpen || true ? (

Check warning on line 49 in src/components/ModalsContainer/index.tsx

View workflow job for this annotation

GitHub Actions / craco-build-run

Unexpected constant condition

Check warning on line 49 in src/components/ModalsContainer/index.tsx

View workflow job for this annotation

GitHub Actions / eslint-run

Unexpected constant condition

Check warning on line 49 in src/components/ModalsContainer/index.tsx

View workflow job for this annotation

GitHub Actions / cypress-run

Unexpected constant condition
<>
<LazyAddItemModal />
<LazyAddContentModal />
<LazySettingsModal />
<LazyEditNodeNameModal />
<LazyRemoveNodeModal />
<LazySourcesTableModal />
<LazyAddNodeEdgeModal />
<LazyChangeNodeTypeModal />
<LazyBlueprintModal />
<LazyMergeNodeModal />
<LazyUserFeedBackModal />
</>
) : null
}
Loading