-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add empty states for modeling panel (#2914)
- Loading branch information
Showing
11 changed files
with
227 additions
and
111 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
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
18 changes: 18 additions & 0 deletions
18
extensions/ql-vscode/src/stories/common/ResponsiveContainer.stories.tsx
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,18 @@ | ||
import * as React from "react"; | ||
|
||
import { Meta, StoryFn } from "@storybook/react"; | ||
|
||
import { ResponsiveContainer as ResponsiveContainerComponent } from "../../view/common/ResponsiveContainer"; | ||
|
||
export default { | ||
title: "Responsive Container", | ||
component: ResponsiveContainerComponent, | ||
} as Meta<typeof ResponsiveContainerComponent>; | ||
|
||
const Template: StoryFn<typeof ResponsiveContainerComponent> = (args) => ( | ||
<ResponsiveContainerComponent> | ||
<span>Hello</span> | ||
</ResponsiveContainerComponent> | ||
); | ||
|
||
export const ResponsiveContainer = Template.bind({}); |
16 changes: 16 additions & 0 deletions
16
extensions/ql-vscode/src/stories/method-modeling/NoMethodSelected.stories.tsx
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,16 @@ | ||
import * as React from "react"; | ||
|
||
import { Meta, StoryFn } from "@storybook/react"; | ||
|
||
import { NoMethodSelected as NoMethodSelectedComponent } from "../../view/method-modeling/NoMethodSelected"; | ||
|
||
export default { | ||
title: "Method Modeling/No Method Selected", | ||
component: NoMethodSelectedComponent, | ||
} as Meta<typeof NoMethodSelectedComponent>; | ||
|
||
const Template: StoryFn<typeof NoMethodSelectedComponent> = () => ( | ||
<NoMethodSelectedComponent /> | ||
); | ||
|
||
export const NoMethodSelected = Template.bind({}); |
16 changes: 16 additions & 0 deletions
16
extensions/ql-vscode/src/stories/method-modeling/NotInModelingMode.stories.tsx
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,16 @@ | ||
import * as React from "react"; | ||
|
||
import { Meta, StoryFn } from "@storybook/react"; | ||
|
||
import { NotInModelingMode as NotInModelingModeComponent } from "../../view/method-modeling/NotInModelingMode"; | ||
|
||
export default { | ||
title: "Method Modeling/Not In Modeling Mode", | ||
component: NotInModelingModeComponent, | ||
} as Meta<typeof NotInModelingModeComponent>; | ||
|
||
const Template: StoryFn<typeof NotInModelingModeComponent> = () => ( | ||
<NotInModelingModeComponent /> | ||
); | ||
|
||
export const NotInModelingMode = Template.bind({}); |
15 changes: 15 additions & 0 deletions
15
extensions/ql-vscode/src/view/common/ResponsiveContainer.tsx
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,15 @@ | ||
import { styled } from "styled-components"; | ||
|
||
export const ResponsiveContainer = styled.div` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
justify-content: flex-start; | ||
height: 100vh; | ||
@media (min-height: 300px) { | ||
align-items: center; | ||
justify-content: center; | ||
text-align: center; | ||
} | ||
`; |
8 changes: 8 additions & 0 deletions
8
extensions/ql-vscode/src/view/method-modeling/NoMethodSelected.tsx
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,8 @@ | ||
import * as React from "react"; | ||
import { ResponsiveContainer } from "../common/ResponsiveContainer"; | ||
|
||
export const NoMethodSelected = () => { | ||
return ( | ||
<ResponsiveContainer>Select an API or method to model</ResponsiveContainer> | ||
); | ||
}; |
25 changes: 25 additions & 0 deletions
25
extensions/ql-vscode/src/view/method-modeling/NotInModelingMode.tsx
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,25 @@ | ||
import * as React from "react"; | ||
import { useCallback } from "react"; | ||
import { vscode } from "../vscode-api"; | ||
import { styled } from "styled-components"; | ||
import TextButton from "../common/TextButton"; | ||
import { ResponsiveContainer } from "../common/ResponsiveContainer"; | ||
|
||
const Button = styled(TextButton)` | ||
margin-top: 0.2rem; | ||
`; | ||
|
||
export const NotInModelingMode = () => { | ||
const handleClick = useCallback(() => { | ||
vscode.postMessage({ | ||
t: "startModeling", | ||
}); | ||
}, []); | ||
|
||
return ( | ||
<ResponsiveContainer> | ||
<span>Not in modeling mode</span> | ||
<Button onClick={handleClick}>Start modeling</Button> | ||
</ResponsiveContainer> | ||
); | ||
}; |