Skip to content

Commit

Permalink
do not close opened panels when choosing new template
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu committed Nov 29, 2021
1 parent 15b0ca0 commit af5a976
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
2 changes: 1 addition & 1 deletion config-overrides.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module.exports = function override(config, env) {
module.exports = function override(config) {
config.module.rules.push({
test: /\.yml$/i,
loader: 'raw-loader',
Expand Down
20 changes: 7 additions & 13 deletions src/components/NewFile/index.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import React from 'react';
import examples from '../../examples';
import state from '../../state';

import {
EditorService,
SpecificationService
} from '../../services';
import { EditorService } from '../../services';
import state from '../../state';

const NewFile = () => {
const handleTemplateClick = (template: string) => {
EditorService.updateState({ content: template, updateModel: true });

const panels = state.sidebar.panels;
EditorService.updateState({ content: template });
SpecificationService.parseSpec(template);
panels.set({
editor: true,
navigation: true,
panels.merge({
newFile: false,
view: true,
viewType: 'template'
});
};

Expand Down Expand Up @@ -61,7 +55,7 @@ const NewFile = () => {
key={title}
className="text-left flex flex-col cursor-pointer rounded-lg p-4 pb-6 transform transition duration-200 border-2 border-gray-400 hover:scale-105 hover:border-pink-500 bg-gray-100"
>
<span className="block text-md text-gray-800 font-bold">{title}</span>
<span className="block text-md text-gray-800 font-bold">{title}</span>
<span className="block text-sm text-gray-500 font-light mt-1">
<Description />
</span>
Expand Down
6 changes: 3 additions & 3 deletions src/examples/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ const templateTypes = {
export default [
{
title: 'Simple Example',
description: () => <> A basic example of a service that is in charge of processing user signups. Great place to start learning AsyncAPI.</>,
description: () => <>A basic example of a service that is in charge of processing user signups. Great place to start learning AsyncAPI.</>,
template: simple,
type: templateTypes.protocol
},
{
title: 'Simple Hello World',
description: () => <> A basic example of a service that is in charge of processing user signups. Great place to start learning AsyncAPI.</>,
description: () => <>A basic example of a service that is in charge of processing user signups. Great place to start learning AsyncAPI.</>,
template: simple,
type: templateTypes.protocol
},
{
title: 'Apache Kafka',
description: () => <> A framework implementation of a software bus using stream-processing. Open Source developed by the Apache Software Foundation.</>,
description: () => <>A framework implementation of a software bus using stream-processing. Open Source developed by the Apache Software Foundation.</>,
template: kafka,
type: templateTypes.protocol
},
Expand Down

0 comments on commit af5a976

Please sign in to comment.