From 33c9f1485215e3c33a9998b3babc023332fa43fa Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Tue, 29 Aug 2023 16:01:08 -0400 Subject: [PATCH] Don't require passing `theme` to `toggleable_icon_button` --- styles/src/component/icon_button.ts | 5 +---- styles/src/style_tree/collab_panel.ts | 2 +- styles/src/style_tree/titlebar.ts | 8 ++++---- styles/src/style_tree/toolbar.ts | 2 +- styles/src/style_tree/workspace.ts | 1 - 5 files changed, 7 insertions(+), 11 deletions(-) diff --git a/styles/src/component/icon_button.ts b/styles/src/component/icon_button.ts index 935909afdb..dda6be83b2 100644 --- a/styles/src/component/icon_button.ts +++ b/styles/src/component/icon_button.ts @@ -77,10 +77,7 @@ export function icon_button({ color, margin, layer, variant, size }: IconButtonO }) } -export function toggleable_icon_button( - theme: Theme, - { color, active_color, margin, variant, size, active_layer }: ToggleableIconButtonOptions -) { +export function toggleable_icon_button({ color, active_color, margin, variant, size, active_layer }: ToggleableIconButtonOptions) { if (!color) color = "base" return toggleable({ diff --git a/styles/src/style_tree/collab_panel.ts b/styles/src/style_tree/collab_panel.ts index 07f367c8af..c4ffee889c 100644 --- a/styles/src/style_tree/collab_panel.ts +++ b/styles/src/style_tree/collab_panel.ts @@ -61,7 +61,7 @@ export default function contacts_panel(): any { width: 14, } - const header_icon_button = toggleable_icon_button(theme, { + const header_icon_button = toggleable_icon_button({ variant: "ghost", size: "sm", active_layer: theme.lowest, diff --git a/styles/src/style_tree/titlebar.ts b/styles/src/style_tree/titlebar.ts index 0a0b69e596..0565982eea 100644 --- a/styles/src/style_tree/titlebar.ts +++ b/styles/src/style_tree/titlebar.ts @@ -34,7 +34,7 @@ function call_controls() { } return { - toggle_microphone_button: toggleable_icon_button(theme, { + toggle_microphone_button: toggleable_icon_button({ margin: { ...margin_y, left: space.group, @@ -43,7 +43,7 @@ function call_controls() { active_color: "negative", }), - toggle_speakers_button: toggleable_icon_button(theme, { + toggle_speakers_button: toggleable_icon_button({ margin: { ...margin_y, left: space.half_item, @@ -51,7 +51,7 @@ function call_controls() { }, }), - screen_share_button: toggleable_icon_button(theme, { + screen_share_button: toggleable_icon_button({ margin: { ...margin_y, left: space.half_item, @@ -263,7 +263,7 @@ export function titlebar(): any { ...call_controls(), - toggle_contacts_button: toggleable_icon_button(theme, { + toggle_contacts_button: toggleable_icon_button({ margin: { left: ITEM_SPACING, }, diff --git a/styles/src/style_tree/toolbar.ts b/styles/src/style_tree/toolbar.ts index 32fd4ab1b5..b3f323eb9e 100644 --- a/styles/src/style_tree/toolbar.ts +++ b/styles/src/style_tree/toolbar.ts @@ -10,7 +10,7 @@ export const toolbar = () => { background: background(theme.highest), border: border(theme.highest, { bottom: true }), item_spacing: 8, - toggleable_tool: toggleable_icon_button(theme, { + toggleable_tool: toggleable_icon_button({ margin: { left: 8 }, variant: "ghost", active_color: "accent", diff --git a/styles/src/style_tree/workspace.ts b/styles/src/style_tree/workspace.ts index 7feccfc8bc..c24bc3f770 100644 --- a/styles/src/style_tree/workspace.ts +++ b/styles/src/style_tree/workspace.ts @@ -12,7 +12,6 @@ import tabBar from "./tab_bar" import { interactive } from "../element" import { titlebar } from "./titlebar" import { useTheme } from "../theme" -import { toggleable_icon_button } from "../component/icon_button" import { toolbar } from "./toolbar" export default function workspace(): any {