-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
due to exhibitionist-digital/ultra#291 bug
- Loading branch information
Showing
8 changed files
with
104 additions
and
18 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,64 @@ | ||
import { usePageFrameLayoutComponent } from '/~/shared/providers/layout/page-frame/index.tsx'; | ||
import { Spinner } from '/~/shared/ui/spinner.tsx'; | ||
import useUrlParamName from '/~/shared/lib/react/routing/useUrlParamName.ts'; | ||
// import { SupabaseAutogeneratedDataGrid } from '/~/widgets/supabase/autogenerated-data-grid/index.tsx'; | ||
import { Suspense } from 'react'; | ||
|
||
// import { publicSchema } from '/~/shared/api/supabase/schemas.ts'; | ||
import { useQueryKeyUniqueSuffix } from '/~/shared/lib/react/query/key.ts'; | ||
import { useRenderOnlyInBrowser } from '/~/shared/lib/react/useRenderOnlyInBrowser.ts'; | ||
|
||
import { | ||
COLUMNS_SHOW_FIRST, | ||
COLUMNS_SHOW_LAST, | ||
} from '/~/shared/api/supabase/const.ts'; | ||
|
||
//@deno-types="@types/lodash" | ||
import { startCase } from 'lodash'; | ||
|
||
const TablePage = () => { | ||
const isBrowser = useRenderOnlyInBrowser(); | ||
|
||
const [qkey, qkeyRegen] = useQueryKeyUniqueSuffix(); | ||
const PageFrameComponent = usePageFrameLayoutComponent(); | ||
// const [loading, setLoading] = useState(false); | ||
// const user = useSupabase(); | ||
const name = useUrlParamName(); | ||
|
||
if (!name) { | ||
return <>Error: can't parse url param "name"</>; | ||
} | ||
|
||
// const tableSchema = publicSchema[name]; | ||
// console.debug('__TEST__: TablePage: table schema:', tableSchema); | ||
|
||
// if (!tableSchema) { | ||
// return <>Error: no schema with dis table</>; | ||
// } | ||
|
||
return ( | ||
<PageFrameComponent> | ||
<h3>{startCase(name)} table</h3> | ||
|
||
{isBrowser | ||
? ( | ||
<Suspense fallback={<Spinner />}> | ||
__TEST__ | ||
{ | ||
/* <SupabaseAutogeneratedDataGrid | ||
columnsNamesFirst={COLUMNS_SHOW_FIRST} | ||
columnsNamesLast={COLUMNS_SHOW_LAST} | ||
onReloadRequired={qkeyRegen} | ||
queryKeyUniqueSuffix={qkey} | ||
tableName={name} | ||
tableSchema={tableSchema} | ||
/> */ | ||
} | ||
</Suspense> | ||
) | ||
: <Spinner />} | ||
</PageFrameComponent> | ||
); | ||
}; | ||
|
||
export default TablePage; |
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,9 @@ | ||
import { StringParam, useQueryParam } from 'use-query-params'; | ||
|
||
export function useQueryParamString(name: string): string | undefined { | ||
const [result] = useQueryParam(name, StringParam); | ||
|
||
return result || undefined; | ||
} | ||
export const useQueryParamName = () => useQueryParamString('name'); | ||
export const useQueryParamRetPath = () => useQueryParamString('retpath'); |
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,10 @@ | ||
import { useParams } from 'react-router-dom'; | ||
|
||
export function useUrlParamString(paramName: string): string | null { | ||
const value = useParams()[paramName]; | ||
return value ? value : null; | ||
} | ||
|
||
export function useUrlParamName(): string | null { | ||
return useUrlParamString('name') || null; | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.