diff --git a/crates/components/src/table.rs b/crates/components/src/table.rs
index 0ca984760..dee8fea24 100644
--- a/crates/components/src/table.rs
+++ b/crates/components/src/table.rs
@@ -1,11 +1,13 @@
use dioxus::prelude::*;
use freya_elements::elements as dioxus_elements;
use freya_elements::events::MouseEvent;
+use freya_hooks::{use_get_theme, TableTheme};
#[allow(non_snake_case)]
#[inline_props]
fn TableArrow(cx: Scope, order_direction: OrderDirection) -> Element {
- let color = "rgb(40, 40, 40)";
+ let theme = use_get_theme(cx);
+ let TableTheme { arrow_fill, .. } = theme.table;
let rotate = match order_direction {
OrderDirection::Down => "0",
OrderDirection::Up => "180",
@@ -17,7 +19,7 @@ fn TableArrow(cx: Scope, order_direction: OrderDirection) -> Element {
rotate: "{rotate}deg",
svg_content: r#"
"#
})
@@ -69,10 +71,17 @@ pub struct TableRowProps<'a> {
#[allow(non_snake_case)]
pub fn TableRow<'a>(cx: Scope<'a, TableRowProps<'a>>) -> Element {
+ let theme = use_get_theme(cx);
+ let TableTheme {
+ divider_fill,
+ alternate_row_background,
+ row_background,
+ ..
+ } = theme.table;
let background = if cx.props.alternate_colors {
- "rgb(240, 240, 240)"
+ alternate_row_background
} else {
- "transparent"
+ row_background
};
render!(
rect {
@@ -85,7 +94,7 @@ pub fn TableRow<'a>(cx: Scope<'a, TableRowProps<'a>>) -> Element {
rect {
height: "1",
width: "100%",
- background: "rgb(200, 200, 200)"
+ background: "{divider_fill}"
}
)
}
@@ -107,23 +116,25 @@ pub struct TableCellProps<'a> {
/// The direction in which this TableCell's column will be ordered.
#[props(into)]
order_direction: Option