Skip to content

Commit

Permalink
Adjust buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
insmac committed Oct 23, 2024
1 parent 784b11a commit 15fa01b
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 15 deletions.
7 changes: 4 additions & 3 deletions packages/react-components/src/components/Button/skin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type ColorShape = {
white: string;
inherit: string;
tooltipBackground: string;
offWhite: string;
};

type Color = keyof ColorShape;
Expand Down Expand Up @@ -125,16 +126,16 @@ const themes: {
normal: {
background: "transparent",
border: "transparent",
color: "foreground",
color: "offWhite",
},
hover: {
background: "comment",
border: "transparent",
color: "foreground",
color: "offWhite",
},
disabled: {
background: "transparent",
border: "gray1",
border: "transparent",
color: "gray1",
},
},
Expand Down
2 changes: 2 additions & 0 deletions packages/react-components/src/theme/color.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export type Color = {
white: string;
inherit: string;
tooltipBackground: string;
offWhite: string;
};

export const color: Color = {
Expand All @@ -48,4 +49,5 @@ export const color: Color = {
white: "#fafafa",
inherit: "inherit",
tooltipBackground: "#6272a4",
offWhite: "#bdbdbd",
};
1 change: 1 addition & 0 deletions packages/web-console/src/scenes/Console/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ const Console = () => {
<Allotment.Pane
preferredSize={editorSplitterBasis}
visible={editorSplitterBasis !== 0 && !sm}
minSize={250}
>
<Schema />
</Allotment.Pane>
Expand Down
13 changes: 8 additions & 5 deletions packages/web-console/src/scenes/Result/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const Result = ({ viewMode }: { viewMode: ResultViewMode }) => {
tooltipText: "Freeze left column",
trigger: (
<Button
skin={gridFreezeLeftState > 0 ? "success" : "secondary"}
skin={gridFreezeLeftState > 0 ? "success" : "transparent"}
onClick={() => {
gridRef?.current?.toggleFreezeLeft()
gridRef?.current?.focus()
Expand All @@ -182,7 +182,7 @@ const Result = ({ viewMode }: { viewMode: ResultViewMode }) => {
tooltipText: "Move selected column to the front",
trigger: (
<Button
skin="secondary"
skin="transparent"
onClick={gridRef?.current?.shuffleFocusedColumnToFront}
>
<HandPointLeft size="18px" />
Expand All @@ -192,7 +192,10 @@ const Result = ({ viewMode }: { viewMode: ResultViewMode }) => {
{
tooltipText: "Reset grid layout",
trigger: (
<Button skin="secondary" onClick={gridRef?.current?.clearCustomLayout}>
<Button
skin="transparent"
onClick={gridRef?.current?.clearCustomLayout}
>
<Reset size="18px" />
</Button>
),
Expand All @@ -201,7 +204,7 @@ const Result = ({ viewMode }: { viewMode: ResultViewMode }) => {
tooltipText: "Refresh",
trigger: (
<Button
skin="secondary"
skin="transparent"
onClick={() => {
const sql = gridRef?.current?.getSQL()
if (sql) {
Expand Down Expand Up @@ -247,7 +250,7 @@ const Result = ({ viewMode }: { viewMode: ResultViewMode }) => {
placement="bottom"
trigger={
<Button
skin="secondary"
skin="transparent"
onClick={() => {
const sql = gridRef?.current?.getSQL()
if (sql) {
Expand Down
10 changes: 3 additions & 7 deletions packages/web-console/src/scenes/Schema/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,7 @@ const ToolbarToggleButton = styled(PrimaryToggleButton)`
&&:not(:disabled) {
width: auto;
padding: 0 1rem;
border: 1px solid ${({ theme }) => theme.color.selection};
height: 3rem;
background: ${({ theme }) => theme.color.selection};
color: ${({ selected, theme }) =>
theme.color[`${selected ? "green" : "foreground"}`]};
}
`

Expand Down Expand Up @@ -376,7 +372,7 @@ const Schema = ({
placement="bottom"
trigger={
<Button
skin="secondary"
skin="transparent"
data-hook="schema-copy-to-clipboard-button"
disabled={selectedTables.length === 0}
onClick={copySchemasToClipboard}
Expand All @@ -395,7 +391,7 @@ const Schema = ({
placement="bottom"
trigger={
<Button
skin="secondary"
skin="transparent"
data-hook="schema-select-all-button"
onClick={() => {
selectedTables.length === tables?.length
Expand Down Expand Up @@ -428,7 +424,7 @@ const Schema = ({
trigger={
<Button
data-hook="schema-cancel-select-button"
skin="secondary"
skin="transparent"
onClick={() => {
setSelectedTables([])
setSelectOpen(false)
Expand Down

0 comments on commit 15fa01b

Please sign in to comment.