Skip to content

Commit 3cb44f6

Browse files
committed
Returnerer tomt element ved manglende descriptor, slik at CS parts-velgeren vises. Reverter EditorHelp
1 parent 8b71d57 commit 3cb44f6

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

src/components/_editor-only/editor-help/EditorHelp.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,12 @@ type Props = {
2929
text: string;
3030
globalWarningText?: string;
3131
type?: 'info' | 'error' | 'help' | 'arrowUp' | 'arrowDown';
32-
} & React.HTMLAttributes<HTMLDivElement>;
32+
};
3333

3434
export const EditorHelp = ({
3535
text,
3636
globalWarningText,
3737
type = 'help',
38-
...rest
3938
}: Props) => {
4039
const { pageConfig } = usePageConfig();
4140
const { editorView } = pageConfig;
@@ -53,7 +52,7 @@ export const EditorHelp = ({
5352
}
5453

5554
return (
56-
<div className={style.editorHelp} id={id} {...rest}>
55+
<div className={style.editorHelp} id={id}>
5756
<StaticImage
5857
imageData={imagePath[type]}
5958
alt={''}

src/components/parts/PartsMapper.tsx

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -154,17 +154,7 @@ export const PartsMapper = ({ pageProps, partProps }: Props) => {
154154
const isEditView = pageProps.editorView === 'edit';
155155
const editorProps = isEditView ? buildEditorProps(path) : undefined;
156156

157-
if (!descriptor) {
158-
return (
159-
<EditorHelp
160-
text={'Velg en part-komponent'}
161-
type={'info'}
162-
{...editorProps}
163-
/>
164-
);
165-
}
166-
167-
if (partsDeprecated.has(descriptor)) {
157+
if (!descriptor || partsDeprecated.has(descriptor)) {
168158
return isEditView ? <div {...editorProps} /> : null;
169159
}
170160

0 commit comments

Comments
 (0)