Parcourir la source

Bugfix: General type problems fixed.

lfabl il y a 2 semaines
Parent
commit
6739bbd8e2

+ 10 - 0
TODO.md

@@ -0,0 +1,10 @@
+# İNCELENMESİ GEREKENLER (TODO)
+
+## 1. Modal Bileşeni - TouchableWithoutFeedback Stil Değişikliği
+**Dosya:** `src/components/modal/index.tsx`
+
+**Yapılan Değişiklik:** 
+Daha önce `TouchableWithoutFeedback` bileşenine verilen `style={[stylesheet.overlay]}` prop'u, Typescript hatasına yol açtığı ve React Native'in standartlarına uymadığı (Touchable bileşenleri doğrudan stil almaz) için kaldırılarak, içerisindeki asıl render edilen `<View>` bileşenine aktarıldı.
+
+**Neden Kontrol Edilmeli:**
+Her ne kadar `overlay` ve `overlayContent` stilleri pozisyonlama (`position: "absolute", bottom: 0, right: 0...`) anlamında birebir aynı işlevi yapsa da, `TouchableWithoutFeedback` üzerindeki `style` dizisinin doğrudan içerideki `<View>`'a aktarılmasının, Web, iOS ve Android tarafında (özellikle zIndex veya overlay sınırları/hitbox bağlamında) umulmadık bir yan etki veya görsel/etkileşimsel kayma yaratıp yaratmadığı gerçek bir developer tarafından test edilmeli ve onaylanmalıdır.

+ 3 - 4
src/components/bottomSheet/index.tsx

@@ -1,11 +1,10 @@
 import {
     useImperativeHandle,
-    type ComponentRef,
+    type PointerEvent,
     forwardRef,
     useEffect,
     useState,
-    useRef,
-    type PointerEvent
+    useRef
 } from "react";
 import {
     type LayoutChangeEvent,
@@ -119,7 +118,7 @@ const BottomSheet: RefForwardingComponent<IBottomSheetRef, IBottomSheetProps> =
         topSafeArea = 0;
     }
 
-    const scrollViewRef = useRef<ComponentRef<ScrollView>>(null);
+    const scrollViewRef = useRef<ScrollView>(null);
     const modalRef = useRef<IModalRef>(null);
 
     const containerHeightRef = useRef(windowHeight);

+ 3 - 3
src/components/button/stylesheet.ts

@@ -156,7 +156,7 @@ const stylesheet = StyleSheet.create({
     },
     title: {
         textAlign: "center",
-        margin: "0"
+        margin: 0
     },
     loading: {},
     overlay: {
@@ -245,12 +245,12 @@ export const useStyles = ({
 
     if (isLoading && spreadBehaviour === "stretch") {
         styles.title.marginLeft = spaces.spacingSm;
-        styles.title.margin = "initial";
+        styles.title.margin = undefined;
     }
 
     if (icon && !isLoading) {
         styles.title.marginLeft = spaces.spacingSm;
-        styles.title.margin = "initial";
+        styles.title.margin = undefined;
     }
 
     if (spreadBehaviour === "baseline") {

+ 3 - 3
src/components/highlightButton/stylesheet.ts

@@ -124,7 +124,7 @@ const stylesheet = StyleSheet.create({
     },
     title: {
         textAlign: "center",
-        margin: "0"
+        margin: 0
     },
     loading: {},
     overlay: {
@@ -199,12 +199,12 @@ export const useStyles = ({
 
     if (isLoading && spreadBehaviour === "stretch") {
         styles.title.marginLeft = spaces.spacingSm;
-        styles.title.margin = "initial";
+        styles.title.margin = undefined;
     }
 
     if (icon && !isLoading) {
         styles.title.marginLeft = spaces.spacingSm;
-        styles.title.margin = "initial";
+        styles.title.margin = undefined;
     }
 
     if (spreadBehaviour === "baseline") {

+ 3 - 2
src/components/markdownViewer/index.tsx

@@ -4,6 +4,7 @@ import {
     type FC
 } from "react";
 import {
+    type DimensionValue,
     Text as NativeText,
     TouchableOpacity,
     Linking,
@@ -285,8 +286,8 @@ const MarkdownViewer: FC<IMarkdownViewerProps> = ({
             }}
             style={{
                 ...stylesheet.image,
-                height: currentHeight,
-                width: currentWidth,
+                height: currentHeight as DimensionValue,
+                width: currentWidth as DimensionValue,
                 ...imageProps?.style
             }}
         />;

+ 10 - 4
src/components/modal/index.tsx

@@ -146,11 +146,16 @@ const Modal: RefForwardingComponent<IModalRef, IModalProps> = ({
             return null;
         }
 
+        const {
+            onBlur,
+            onFocus,
+            ...restOverlayProps
+        } = overlayProps || {};
+
         return <TouchableWithoutFeedback
-            {...overlayProps}
-            style={[
-                stylesheet.overlay
-            ]}
+            {...restOverlayProps}
+            onBlur={onBlur ? onBlur : undefined}
+            onFocus={onFocus ? onFocus : undefined}
             onPress={() => {
                 if(isDisabledOverlay) {
                     return;
@@ -163,6 +168,7 @@ const Modal: RefForwardingComponent<IModalRef, IModalProps> = ({
         >
             <View
                 style={[
+                    stylesheet.overlay,
                     stylesheet.overlayContent,
                     {
                         backgroundColor: colors.system.scrim

+ 0 - 6
src/components/pageContainer/stylesheet.ts

@@ -1,9 +1,6 @@
 import {
     StyleSheet
 } from "react-native";
-import {
-    webStyle
-} from "../../utils";
 
 const stylesheet = StyleSheet.create({
     container: {
@@ -13,9 +10,6 @@ const stylesheet = StyleSheet.create({
         flex: 1
     },
     contentContainer: {
-        ...webStyle({
-            alignItems: "auto"
-        })
     }
 });
 export default stylesheet;

+ 3 - 2
src/components/seperator/stylesheet.ts

@@ -1,4 +1,5 @@
 import {
+    type DimensionValue,
     type TextStyle,
     type ViewStyle,
     StyleSheet
@@ -59,9 +60,9 @@ export const useStyles = ({
 
     if(length !== undefined) {
         if(direction === "horizontal") {
-            styles.container.width = length;
+            styles.container.width = length as DimensionValue;
         } else {
-            styles.container.height = length;
+            styles.container.height = length as DimensionValue;
         }
     }