2.0 KiB
2.0 KiB
Architecture Quality Gate
Structural integrity
- Components organized by Atomic Design: atoms, molecules, organisms in
src/components/. - Logic extracted to custom hooks in
src/hooks/. - No monolithic files. Each component in its own file.
- All static text, image URIs, and list data moved to
src/data/mockData.ts.
Type safety and syntax
- Every component exports a
[ComponentName]Propsinterface withreadonlyproperty modifiers. - File is syntactically valid TypeScript (no parse errors).
- Placeholders from template (e.g.,
StitchComponent) have been replaced with actual names. - Navigation screen params are typed with
NativeStackScreenPropsor equivalent.
React Native primitives
- No HTML elements (
div,span,p,img,button). Only React Native components. - All text wrapped in
Textcomponents. No raw strings insideView. Pressableused for interactive elements (notTouchableOpacityorTouchableHighlight).FlatListused for dynamic/long lists (notScrollViewwith.map()).Imagecomponents have explicitwidthandheightoraspectRatio.
Styling
- All styles defined via
StyleSheet.create()at the bottom of the file. - No inline style objects (use
StyleSheetreferences). - No hardcoded hex values. Colors referenced from
src/theme.ts. - Shadows use
Platform.select()for iOS/Android differences. flexDirectionexplicitly set where row layout is needed (default iscolumn).
Accessibility
- Interactive elements have
accessibilityLabelandaccessibilityRole. - Images have descriptive
accessibilityLabel. - Toggle/checkbox elements use
accessibilityState.
Platform handling
- Top-level screens wrapped with
SafeAreaViewfromreact-native-safe-area-context. - Platform-specific code uses
Platform.select()orPlatform.OSchecks. - Responsive dimensions use
useWindowDimensions()(not hardcoded pixel values for screen-relative sizing).