Don't require passing theme to toggleable_icon_button

This commit is contained in:
Nate Butler 2023-08-29 16:01:08 -04:00
parent 0a14e33dba
commit 33c9f14852
5 changed files with 7 additions and 11 deletions

View file

@ -77,10 +77,7 @@ export function icon_button({ color, margin, layer, variant, size }: IconButtonO
}) })
} }
export function toggleable_icon_button( export function toggleable_icon_button({ color, active_color, margin, variant, size, active_layer }: ToggleableIconButtonOptions) {
theme: Theme,
{ color, active_color, margin, variant, size, active_layer }: ToggleableIconButtonOptions
) {
if (!color) color = "base" if (!color) color = "base"
return toggleable({ return toggleable({

View file

@ -61,7 +61,7 @@ export default function contacts_panel(): any {
width: 14, width: 14,
} }
const header_icon_button = toggleable_icon_button(theme, { const header_icon_button = toggleable_icon_button({
variant: "ghost", variant: "ghost",
size: "sm", size: "sm",
active_layer: theme.lowest, active_layer: theme.lowest,

View file

@ -34,7 +34,7 @@ function call_controls() {
} }
return { return {
toggle_microphone_button: toggleable_icon_button(theme, { toggle_microphone_button: toggleable_icon_button({
margin: { margin: {
...margin_y, ...margin_y,
left: space.group, left: space.group,
@ -43,7 +43,7 @@ function call_controls() {
active_color: "negative", active_color: "negative",
}), }),
toggle_speakers_button: toggleable_icon_button(theme, { toggle_speakers_button: toggleable_icon_button({
margin: { margin: {
...margin_y, ...margin_y,
left: space.half_item, 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: {
...margin_y, ...margin_y,
left: space.half_item, left: space.half_item,
@ -263,7 +263,7 @@ export function titlebar(): any {
...call_controls(), ...call_controls(),
toggle_contacts_button: toggleable_icon_button(theme, { toggle_contacts_button: toggleable_icon_button({
margin: { margin: {
left: ITEM_SPACING, left: ITEM_SPACING,
}, },

View file

@ -10,7 +10,7 @@ export const toolbar = () => {
background: background(theme.highest), background: background(theme.highest),
border: border(theme.highest, { bottom: true }), border: border(theme.highest, { bottom: true }),
item_spacing: 8, item_spacing: 8,
toggleable_tool: toggleable_icon_button(theme, { toggleable_tool: toggleable_icon_button({
margin: { left: 8 }, margin: { left: 8 },
variant: "ghost", variant: "ghost",
active_color: "accent", active_color: "accent",

View file

@ -12,7 +12,6 @@ import tabBar from "./tab_bar"
import { interactive } from "../element" import { interactive } from "../element"
import { titlebar } from "./titlebar" import { titlebar } from "./titlebar"
import { useTheme } from "../theme" import { useTheme } from "../theme"
import { toggleable_icon_button } from "../component/icon_button"
import { toolbar } from "./toolbar" import { toolbar } from "./toolbar"
export default function workspace(): any { export default function workspace(): any {