Skip to content

Commit

Permalink
refactor(resizable-layout-website): add aria role and label
Browse files Browse the repository at this point in the history
  • Loading branch information
jerensl committed Jul 12, 2024
1 parent 512cb34 commit 31151ec
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 26 deletions.
2 changes: 2 additions & 0 deletions modelina-website/src/components/MonacoEditorWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export default function MonacoEditorWrapper({

return (
<Editor
role='figure'
ariaLabel='Code Editor'
onMount={handleEditorDidMount}
language={language}
theme={theme}
Expand Down
56 changes: 30 additions & 26 deletions modelina-website/src/components/playground/Content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,32 +68,36 @@ export const Content: FunctionComponent<ContentProps> = ({ setNewConfig, setNewQ
})}
>
<Resizable
leftComponent={<div className={clsx('h-full rounded-b bg-code-editor-dark font-bold text-white shadow-lg', {
'hidden md:block': showInputEditor && !showOptions
})}>
<MonacoEditorWrapper
value={input}
onChange={(_, change) => {
setInput(change);
generateNewCode(change);
}}
editorDidMount={() => {
setLoaded({ ...loaded, editorLoaded: true });
}}
language='json'
/>
</div>}
rightComponent={<div className={clsx('size-full', {
'hidden md:block': !showInputEditor && !showOptions
})}>
{error ? (
<CustomError statusCode={statusCode} errorMessage={errorMessage} />
) : (
<PlaygroundGeneratedContext.Provider value={PlaygroundGeneratedContextValue}>
<GeneratedModelsComponent setNewQuery={setNewQuery} />
</PlaygroundGeneratedContext.Provider>
)}
</div>} />
leftComponent={
<div className={clsx('h-full rounded-b bg-code-editor-dark font-bold text-white shadow-lg', {
'hidden md:block': showInputEditor && !showOptions
})}>
<MonacoEditorWrapper
value={input}
onChange={(_, change) => {
setInput(change);
generateNewCode(change);
}}
editorDidMount={() => {
setLoaded({ ...loaded, editorLoaded: true });
}}
language='json'
/>
</div>
}
rightComponent={
<div className={clsx('size-full', {
'hidden md:block': !showInputEditor && !showOptions
})}>
{error ? (
<CustomError statusCode={statusCode} errorMessage={errorMessage} />
) : (
<PlaygroundGeneratedContext.Provider value={PlaygroundGeneratedContextValue}>
<GeneratedModelsComponent setNewQuery={setNewQuery} />
</PlaygroundGeneratedContext.Provider>
)}
</div>
} />

</div>
</div>
Expand Down

0 comments on commit 31151ec

Please sign in to comment.