Skip to content

Commit

Permalink
Style update to in-progress drop-down (#2986)
Browse files Browse the repository at this point in the history
  • Loading branch information
charisk authored Oct 18, 2023
1 parent 903b272 commit 96fb004
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
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 { InProgressDropdown as InProgressDropdownComponent } from "../../view/model-editor/InProgressDropdown";

export default {
title: "CodeQL Model Editor/In Progress Dropdown",
component: InProgressDropdownComponent,
} as Meta<typeof InProgressDropdownComponent>;

const Template: StoryFn<typeof InProgressDropdownComponent> = (args) => (
<InProgressDropdownComponent />
);

export const InProgressDropdown = Template.bind({});
3 changes: 3 additions & 0 deletions extensions/ql-vscode/src/view/common/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ type Props = {
value: string | undefined;
options: Array<{ value: string; label: string }>;
disabled?: boolean;
className?: string;
disabledPlaceholder?: string;
onChange?: (event: ChangeEvent<HTMLSelectElement>) => void;

Expand All @@ -40,6 +41,7 @@ export function Dropdown({
options,
disabled,
disabledPlaceholder,
className,
onChange,
...props
}: Props) {
Expand All @@ -49,6 +51,7 @@ export function Dropdown({
value={disabled ? disabledValue : value}
disabled={disabled}
onChange={onChange}
className={className}
{...props}
>
{disabled ? (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
import * as React from "react";
import { styled } from "styled-components";
import { Dropdown } from "../common/Dropdown";

const StyledDropdown = styled(Dropdown)`
font-style: italic;
`;

export const InProgressDropdown = () => {
return (
<Dropdown
<StyledDropdown
value="Thinking..."
options={[]}
disabled={true}
Expand Down

0 comments on commit 96fb004

Please sign in to comment.