diff --git a/src/components/accordion/AccordionItem.tsx b/src/components/accordion/AccordionItem.tsx
index dc923890..935c578f 100644
--- a/src/components/accordion/AccordionItem.tsx
+++ b/src/components/accordion/AccordionItem.tsx
@@ -11,7 +11,12 @@ import Animated, {
useAnimatedStyle,
withSpring
} from "react-native-reanimated";
-import { IOAccordionRadius, IOStyles, type IOSpacingScale } from "../../core";
+import {
+ IOAccordionRadius,
+ IOStyles,
+ useIOTheme,
+ type IOSpacingScale
+} from "../../core";
import { IOSpringValues } from "../../core/IOAnimations";
import { IOColors, hexToRgba } from "../../core/IOColors";
import { makeFontStyleObject } from "../../utils/fonts";
@@ -32,8 +37,6 @@ type AccordionBody = {
const accordionBodySpacing: IOSpacingScale = 16;
const accordionIconMargin: IOSpacingScale = 12;
const accordionChevronMargin: IOSpacingScale = 8;
-const accordionBorder: IOColors = "grey-200";
-const accordionBackground: IOColors = "white";
// Icon size
const iconSize: IOIconSizeScale = 24;
@@ -73,8 +76,14 @@ export const AccordionBody = ({ children, expanded }: AccordionBody) => {
};
export const AccordionItem = ({ title, body, icon }: AccordionItem) => {
+ const theme = useIOTheme();
const [expanded, setExpanded] = useState(false);
+ // Visual attributes
+ const accordionBackground: IOColors = theme["appBackground-primary"];
+ const accordionBorder: IOColors = theme["cardBorder-default"];
+ const accordionIconColor: IOColors = theme["icon-default"];
+
const onItemPress = () => {
setExpanded(!expanded);
};
@@ -93,7 +102,15 @@ export const AccordionItem = ({ title, body, icon }: AccordionItem) => {
);
return (
-
+
{
>
{icon && (
-
+
)}
- {title}
+ {title}
-
+
@@ -156,11 +176,9 @@ export const AccordionItem = ({ title, body, icon }: AccordionItem) => {
const styles = StyleSheet.create({
accordionWrapper: {
- borderColor: IOColors[accordionBorder],
borderWidth: 1,
borderRadius: IOAccordionRadius,
- borderCurve: "continuous",
- backgroundColor: IOColors[accordionBackground]
+ borderCurve: "continuous"
},
accordionCollapsableContainer: {
overflow: "hidden"
diff --git a/src/components/modules/ModuleAttachment.tsx b/src/components/modules/ModuleAttachment.tsx
index 29fc316b..111d3cbf 100644
--- a/src/components/modules/ModuleAttachment.tsx
+++ b/src/components/modules/ModuleAttachment.tsx
@@ -56,8 +56,6 @@ const styles = StyleSheet.create({
paddingHorizontal: 16,
paddingVertical: 16,
borderRadius: 8,
- borderColor: IOColors.bluegreyLight,
- backgroundColor: IOColors.white,
borderStyle: "solid",
borderWidth: 1
},
@@ -154,6 +152,7 @@ export const ModuleAttachment = ({
testID,
title
}: ModuleAttachmentProps) => {
+ const theme = useIOTheme();
const isPressed: Animated.SharedValue = useSharedValue(0);
// Scaling transformation applied when the button is pressed
@@ -225,7 +224,11 @@ export const ModuleAttachment = ({
style={[
styles.button,
animatedStyle,
- { opacity: disabled ? DISABLED_OPACITY : 1 }
+ {
+ opacity: disabled ? DISABLED_OPACITY : 1,
+ borderColor: IOColors[theme["cardBorder-default"]],
+ backgroundColor: IOColors[theme["appBackground-primary"]]
+ }
]}
accessibilityElementsHidden={true}
importantForAccessibility="no-hide-descendants"
@@ -242,17 +245,27 @@ export const ModuleAttachment = ({
const SkeletonComponent = ({
loadingAccessibilityLabel
-}: SkeletonComponentProps) => (
-
-
-
-
-
+}: SkeletonComponentProps) => {
+ const theme = useIOTheme();
+
+ return (
+
+
+
+
+
+
-
-);
+ );
+};