diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/Button/RawInfoButton.tsx b/packages/sdk/packages/payload/packages/raw-info/src/components/Button/RawInfoButton.tsx index 2d9505be37..556178ce49 100644 --- a/packages/sdk/packages/payload/packages/raw-info/src/components/Button/RawInfoButton.tsx +++ b/packages/sdk/packages/payload/packages/raw-info/src/components/Button/RawInfoButton.tsx @@ -3,8 +3,8 @@ import { Payload, WithSchema } from '@xyo-network/payload-model' import { MouseEventHandler, ReactNode, useState } from 'react' import { ExpansionProps } from '../../lib' -import { RawInfoDialog } from '../Dialog' import { xyoColorLogo } from '../img' +import { RawInfoDialog } from '../shared' import { IconSize, presetIconSizeValue } from './lib' export interface RawInfoButtonProps extends ButtonExProps, ExpansionProps { diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/Button/RawInfoIconButton.tsx b/packages/sdk/packages/payload/packages/raw-info/src/components/Button/RawInfoIconButton.tsx index 2d23972f4c..4a107cc6b4 100644 --- a/packages/sdk/packages/payload/packages/raw-info/src/components/Button/RawInfoIconButton.tsx +++ b/packages/sdk/packages/payload/packages/raw-info/src/components/Button/RawInfoIconButton.tsx @@ -3,8 +3,8 @@ import { Payload } from '@xyo-network/payload-model' import { forwardRef, MouseEventHandler, ReactNode, useState } from 'react' import { ExpansionProps } from '../../lib' -import { RawInfoDialog } from '../Dialog' import { xyoColorLogo } from '../img' +import { RawInfoDialog } from '../shared' import { IconSize, presetIconSizeValue } from './lib' export interface RawInfoIconProps extends IconButtonProps, ExpansionProps { diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/Dialog/index.ts b/packages/sdk/packages/payload/packages/raw-info/src/components/Dialog/index.ts deleted file mode 100644 index a9674e6d27..0000000000 --- a/packages/sdk/packages/payload/packages/raw-info/src/components/Dialog/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './RawInfoDialog' diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/index.ts b/packages/sdk/packages/payload/packages/raw-info/src/components/index.ts index 38e33a27b9..c0b0ff3dd4 100644 --- a/packages/sdk/packages/payload/packages/raw-info/src/components/index.ts +++ b/packages/sdk/packages/payload/packages/raw-info/src/components/index.ts @@ -1,4 +1,3 @@ export * from './Button' -export * from './Dialog' export * from './shared' export * from './styled' diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/shared/PayloadCollapse.tsx b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/PayloadCollapse.tsx similarity index 86% rename from packages/sdk/packages/payload/packages/raw-info/src/components/shared/PayloadCollapse.tsx rename to packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/PayloadCollapse.tsx index 131336e28a..1ec9bb6973 100644 --- a/packages/sdk/packages/payload/packages/raw-info/src/components/shared/PayloadCollapse.tsx +++ b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/PayloadCollapse.tsx @@ -5,9 +5,9 @@ import { PayloadBuilder } from '@xyo-network/payload-builder' import { Payload } from '@xyo-network/payload-model' import { useDataState } from '@xyo-network/react-shared' -import { ExpansionProps } from '../../lib' -import { StyledChipLabel } from '../styled' -import { JsonViewerEx } from './JsonViewerEx' +import { ExpansionProps } from '../../../lib' +import { StyledChipLabel } from '../../styled' +import { JsonViewerEx } from '../JsonViewerEx' export interface RawInfoPayloadCollapse extends CollapseProps, ExpansionProps { payload?: Payload | null @@ -16,6 +16,7 @@ export interface RawInfoPayloadCollapse extends CollapseProps, ExpansionProps { export const RawInfoPayloadCollapse: React.FC = ({ defaultExpandedJson, payload, updateExpandedJson, ...props }) => { const [expandedJson, setExpandedJson] = useDataState(defaultExpandedJson) const [hash] = usePromise(async () => (payload ? await PayloadBuilder.dataHash(payload) : undefined), [payload]) + const actionText = expandedJson ? 'Hide JSON' : 'Show JSON' const handleExpansion = () => { updateExpandedJson?.(!expandedJson) @@ -27,7 +28,7 @@ export const RawInfoPayloadCollapse: React.FC = ({ defau {payload ? : null} diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/Dialog/RawInfoDialog.stories.tsx b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/RawInfoDialog.stories.tsx similarity index 100% rename from packages/sdk/packages/payload/packages/raw-info/src/components/Dialog/RawInfoDialog.stories.tsx rename to packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/RawInfoDialog.stories.tsx diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/Dialog/RawInfoDialog.tsx b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/RawInfoDialog.tsx similarity index 93% rename from packages/sdk/packages/payload/packages/raw-info/src/components/Dialog/RawInfoDialog.tsx rename to packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/RawInfoDialog.tsx index 68044c21b7..3500a39cbf 100644 --- a/packages/sdk/packages/payload/packages/raw-info/src/components/Dialog/RawInfoDialog.tsx +++ b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/RawInfoDialog.tsx @@ -2,8 +2,8 @@ import { Button, Dialog, DialogActions, DialogContent, DialogProps, DialogTitle import { Payload } from '@xyo-network/payload-model' import { MouseEventHandler, ReactNode } from 'react' -import { ExpansionProps } from '../../lib' -import { RawInfoPayloadCollapse } from '../shared' +import { ExpansionProps } from '../../../lib' +import { RawInfoPayloadCollapse } from './PayloadCollapse' export interface RawInfoDialogProps extends DialogProps, ExpansionProps { dialogContent?: ReactNode diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/index.ts b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/index.ts new file mode 100644 index 0000000000..1adc0d6b78 --- /dev/null +++ b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/Dialog/index.ts @@ -0,0 +1,2 @@ +export * from './PayloadCollapse' +export * from './RawInfoDialog' diff --git a/packages/sdk/packages/payload/packages/raw-info/src/components/shared/index.ts b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/index.ts index 34b4013ea5..49c8e3686e 100644 --- a/packages/sdk/packages/payload/packages/raw-info/src/components/shared/index.ts +++ b/packages/sdk/packages/payload/packages/raw-info/src/components/shared/index.ts @@ -1,2 +1,2 @@ +export * from './Dialog' export * from './JsonViewerEx' -export * from './PayloadCollapse'