-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* graphql setup and clean up old stuff * added basic pagination * display a minimal list of services * added support group information to the services * cleanup * added router and new tabs * avoid fetching twice when setting the offset in the pagination * reset package lock * npm install in workspace
- Loading branch information
Showing
63 changed files
with
660 additions
and
221 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from "react" | ||
// import useUrlState from "../hooks/useUrlState" | ||
import useQueryClientFn from "../hooks/useQueryClientFn" | ||
|
||
const AsyncWorker = () => { | ||
// useUrlState() | ||
useQueryClientFn() | ||
return null | ||
} | ||
|
||
export default AsyncWorker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React, { createContext, useContext } from "react" | ||
import { useStore as create } from "zustand" | ||
import createStore from "../lib/store" | ||
|
||
const StoreContext = createContext() | ||
const StoreProvider = ({ children }) => ( | ||
<StoreContext.Provider value={createStore()}> | ||
{children} | ||
</StoreContext.Provider> | ||
) | ||
|
||
const useStore = (selector) => create(useContext(StoreContext), selector) | ||
|
||
export const useEndpoint = () => useStore((s) => s.endpoint) | ||
export const useQueryClientFnReady = () => useStore((s) => s.queryClientFnReady) | ||
export const useActions = () => useStore((s) => s.actions) | ||
|
||
export default StoreProvider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import React, { useMemo } from "react" | ||
import { Container, TabNavigation, TabNavigationItem } from "juno-ui-components" | ||
import { useRouter } from "url-state-router" | ||
import { Messages } from "messages-provider" | ||
|
||
const TabsContainer = ({ tabsConfig, component, children }) => { | ||
const { navigateTo, currentPath } = useRouter() | ||
|
||
const tabIndex = useMemo(() => { | ||
if (!currentPath) return 0 | ||
return tabsConfig.findIndex((tab) => currentPath.startsWith(tab.path)) | ||
}, [currentPath]) | ||
|
||
const onActiveItemChange = (label) => { | ||
const i = tabsConfig.findIndex((tab) => label === tab.label) | ||
navigateTo(tabsConfig[i].path) | ||
} | ||
|
||
return ( | ||
<> | ||
<TabNavigation | ||
activeItem={tabsConfig[tabIndex]?.label} | ||
onActiveItemChange={onActiveItemChange} | ||
> | ||
{tabsConfig.map((tab, index) => ( | ||
<TabNavigationItem key={index} icon={tab.icon} label={tab.label} /> | ||
))} | ||
</TabNavigation> | ||
|
||
<Container py> | ||
<Messages /> | ||
{component || children} | ||
</Container> | ||
</> | ||
) | ||
} | ||
|
||
export default TabsContainer |
File renamed without changes.
Oops, something went wrong.