@mediacubeco/expo-template-fsd 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/mcp.json +0 -0
- package/.claude/rules/abstract-skills-agents.mdc +25 -0
- package/.claude/rules/app-routing.mdc +47 -0
- package/.claude/rules/exports-at-end.mdc +55 -0
- package/.claude/rules/kebab-case-naming.mdc +29 -0
- package/.claude/rules/prettier-eslint-typescript.mdc +24 -0
- package/.claude/settings.json +0 -0
- package/.claude/skills/generate-api-model/SKILL.md +98 -0
- package/.claude/skills/generate-api-model-mock/SKILL.md +56 -0
- package/.env +1 -0
- package/.env.example +1 -0
- package/.husky/pre-commit +6 -0
- package/.secret/README.md +26 -0
- package/README.md +36 -0
- package/app.config.js +54 -0
- package/env.d.ts +7 -0
- package/eslint.config.js +14 -0
- package/i18next.d.ts +12 -0
- package/package.json +76 -0
- package/prettier.config.js +9 -0
- package/src/app/_app.tsx +18 -0
- package/src/app/_layout.tsx +20 -0
- package/src/app/_splash.tsx +22 -0
- package/src/entities/.gitkeep +0 -0
- package/src/features/.gitkeep +0 -0
- package/src/screens/.gitkeep +0 -0
- package/src/shared/assets/fonts/index.ts +7 -0
- package/src/shared/assets/icons/index.ts +3 -0
- package/src/shared/assets/icons/like.tsx +17 -0
- package/src/shared/assets/icons/type.ts +6 -0
- package/src/shared/assets/images/default.png +0 -0
- package/src/shared/assets/images/index.ts +11 -0
- package/src/shared/assets/images/logo-android-background.png +0 -0
- package/src/shared/assets/images/logo-android-foreground.png +0 -0
- package/src/shared/assets/images/logo-android-monochrome.png +0 -0
- package/src/shared/assets/images/logo-ios.png +0 -0
- package/src/shared/assets/images/logo-web.png +0 -0
- package/src/shared/assets/images/splash-dark.png +0 -0
- package/src/shared/assets/images/splash.png +0 -0
- package/src/shared/assets/index.ts +4 -0
- package/src/shared/assets/translations/en.ts +3 -0
- package/src/shared/assets/translations/index.ts +9 -0
- package/src/shared/assets/translations/ru.ts +3 -0
- package/src/shared/constants/environment.ts +13 -0
- package/src/shared/constants/index.ts +1 -0
- package/src/shared/hooks/index.ts +4 -0
- package/src/shared/hooks/use-animated.ts +194 -0
- package/src/shared/hooks/use-breakpoints.ts +25 -0
- package/src/shared/hooks/use-mixins.ts +36 -0
- package/src/shared/hooks/use-safe-area.ts +56 -0
- package/src/shared/lib/api/api.provider.tsx +47 -0
- package/src/shared/lib/api/api.ts +7 -0
- package/src/shared/lib/api/api.types.ts +9 -0
- package/src/shared/lib/api/constants/index.ts +6 -0
- package/src/shared/lib/api/entities/common.ts +28 -0
- package/src/shared/lib/api/entities/index.ts +1 -0
- package/src/shared/lib/api/hooks/common.ts +31 -0
- package/src/shared/lib/api/hooks/index.ts +0 -0
- package/src/shared/lib/api/index.ts +4 -0
- package/src/shared/lib/api/models/api-instance/api-instance.constants.ts +9 -0
- package/src/shared/lib/api/models/api-instance/api-instance.ts +118 -0
- package/src/shared/lib/api/models/api-instance/api-instance.types.ts +31 -0
- package/src/shared/lib/api/models/api-instance/api-instance.utils.ts +22 -0
- package/src/shared/lib/api/models/api-instance/index.ts +1 -0
- package/src/shared/lib/api/models/index.ts +1 -0
- package/src/shared/lib/api/repositories/auth/auth.ts +18 -0
- package/src/shared/lib/api/repositories/auth/auth.types.ts +22 -0
- package/src/shared/lib/api/repositories/auth/index.ts +1 -0
- package/src/shared/lib/api/repositories/index.ts +1 -0
- package/src/shared/lib/api/resources/common.ts +8 -0
- package/src/shared/lib/api/resources/index.ts +1 -0
- package/src/shared/lib/api/utils/index.ts +1 -0
- package/src/shared/lib/api/utils/storage.ts +9 -0
- package/src/shared/lib/index.ts +4 -0
- package/src/shared/lib/localization/components/index.ts +1 -0
- package/src/shared/lib/localization/components/localization-translate/index.ts +1 -0
- package/src/shared/lib/localization/components/localization-translate/localization-translate.tsx +5 -0
- package/src/shared/lib/localization/components/localization-translate/localization-translate.types.ts +0 -0
- package/src/shared/lib/localization/constants/index.ts +54 -0
- package/src/shared/lib/localization/hooks/index.ts +2 -0
- package/src/shared/lib/localization/hooks/use-localization-setup.ts +34 -0
- package/src/shared/lib/localization/hooks/use-localization-text.ts +9 -0
- package/src/shared/lib/localization/hooks/use-localization.ts +23 -0
- package/src/shared/lib/localization/index.ts +4 -0
- package/src/shared/lib/localization/localization.provider.tsx +30 -0
- package/src/shared/lib/localization/localization.types.ts +5 -0
- package/src/shared/lib/localization/utils/index.ts +1 -0
- package/src/shared/lib/localization/utils/storage.ts +11 -0
- package/src/shared/lib/navigation/components/index.ts +1 -0
- package/src/shared/lib/navigation/components/navigation-logger/index.ts +1 -0
- package/src/shared/lib/navigation/components/navigation-logger/navigation-logger.ts +17 -0
- package/src/shared/lib/navigation/components/navigation-logger/navigation-logger.types.ts +0 -0
- package/src/shared/lib/navigation/hooks/index.ts +3 -0
- package/src/shared/lib/navigation/hooks/use-navigation-options.ts +94 -0
- package/src/shared/lib/navigation/hooks/use-navigation-params.ts +9 -0
- package/src/shared/lib/navigation/hooks/use-navigation.ts +9 -0
- package/src/shared/lib/navigation/index.ts +7 -0
- package/src/shared/lib/navigation/navigation.provider.tsx +26 -0
- package/src/shared/lib/navigation/navigation.types.ts +5 -0
- package/src/shared/lib/theme/constants/borders.ts +8 -0
- package/src/shared/lib/theme/constants/colors.ts +57 -0
- package/src/shared/lib/theme/constants/delays.ts +8 -0
- package/src/shared/lib/theme/constants/durations.ts +8 -0
- package/src/shared/lib/theme/constants/fonts.ts +7 -0
- package/src/shared/lib/theme/constants/index.ts +54 -0
- package/src/shared/lib/theme/constants/shadows.ts +40 -0
- package/src/shared/lib/theme/constants/sizes.ts +32 -0
- package/src/shared/lib/theme/constants/transparencies.ts +10 -0
- package/src/shared/lib/theme/constants/weights.ts +13 -0
- package/src/shared/lib/theme/hooks/index.ts +2 -0
- package/src/shared/lib/theme/hooks/use-theme-mode.ts +9 -0
- package/src/shared/lib/theme/hooks/use-theme-setup.ts +49 -0
- package/src/shared/lib/theme/hooks/use-theme.ts +15 -0
- package/src/shared/lib/theme/index.ts +4 -0
- package/src/shared/lib/theme/theme.context.ts +6 -0
- package/src/shared/lib/theme/theme.provider.tsx +60 -0
- package/src/shared/lib/theme/theme.types.ts +15 -0
- package/src/shared/lib/theme/utils/index.ts +1 -0
- package/src/shared/lib/theme/utils/storage.ts +11 -0
- package/src/shared/ui/atoms/index.ts +1 -0
- package/src/shared/ui/index.ts +4 -0
- package/src/shared/ui/molecules/index.ts +2 -0
- package/src/shared/ui/molecules/keyboard-area/index.ts +2 -0
- package/src/shared/ui/molecules/keyboard-area/keyboard-area.styles.ts +20 -0
- package/src/shared/ui/molecules/keyboard-area/keyboard-area.tsx +34 -0
- package/src/shared/ui/molecules/keyboard-area/keyboard-area.types.ts +3 -0
- package/src/shared/ui/molecules/refresh-control/index.ts +2 -0
- package/src/shared/ui/molecules/refresh-control/refresh-control.tsx +32 -0
- package/src/shared/ui/molecules/refresh-control/refresh-control.types.ts +6 -0
- package/src/shared/ui/organisms/index.ts +1 -0
- package/src/shared/ui/templates/index.ts +1 -0
- package/src/shared/ui/templates/screen-container/index.ts +12 -0
- package/src/shared/ui/templates/screen-container/screen-container-list.tsx +23 -0
- package/src/shared/ui/templates/screen-container/screen-container-scroll.tsx +23 -0
- package/src/shared/ui/templates/screen-container/screen-container-section-list.tsx +24 -0
- package/src/shared/ui/templates/screen-container/screen-container.hooks.tsx +72 -0
- package/src/shared/ui/templates/screen-container/screen-container.styles.ts +45 -0
- package/src/shared/ui/templates/screen-container/screen-container.types.tsx +75 -0
- package/src/shared/utils/generators.ts +11 -0
- package/src/shared/utils/index.ts +1 -0
- package/src/widgets/.gitkeep +0 -0
- package/svg.d.ts +7 -0
- package/tsconfig.json +8 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
2
|
+
import { View } from 'react-native'
|
|
3
|
+
import { KeyboardArea, RefreshControl } from '../../molecules'
|
|
4
|
+
import { useScreenContainerStyles } from './screen-container.styles'
|
|
5
|
+
import {
|
|
6
|
+
ScreenContainerListProps,
|
|
7
|
+
ScreenContainerScrollProps,
|
|
8
|
+
ScreenContainerSectionListProps,
|
|
9
|
+
} from './screen-container.types'
|
|
10
|
+
|
|
11
|
+
const useScreenContainerProps = <
|
|
12
|
+
Props extends
|
|
13
|
+
| ScreenContainerScrollProps
|
|
14
|
+
| ScreenContainerListProps<any>
|
|
15
|
+
| ScreenContainerSectionListProps<any>,
|
|
16
|
+
>({
|
|
17
|
+
// omit
|
|
18
|
+
// @ts-ignore
|
|
19
|
+
style,
|
|
20
|
+
// @ts-ignore
|
|
21
|
+
contentContainerStyle,
|
|
22
|
+
// @ts-ignore
|
|
23
|
+
refreshing,
|
|
24
|
+
// internal
|
|
25
|
+
withOverflowTop = false,
|
|
26
|
+
withOverflowBottom = false,
|
|
27
|
+
// native
|
|
28
|
+
header: initHeader,
|
|
29
|
+
footer: initFooter,
|
|
30
|
+
wrapperStyle,
|
|
31
|
+
outerStyle,
|
|
32
|
+
innerStyle,
|
|
33
|
+
onRefresh,
|
|
34
|
+
...props
|
|
35
|
+
}: Props) => {
|
|
36
|
+
const { styles } = useScreenContainerStyles({
|
|
37
|
+
withOverflowTop: withOverflowTop || !!initHeader,
|
|
38
|
+
withOverflowBottom: withOverflowBottom || !!initFooter,
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
const header = useMemo(() => {
|
|
42
|
+
return <View style={styles.header}>{initHeader}</View>
|
|
43
|
+
}, [styles.header, initHeader])
|
|
44
|
+
|
|
45
|
+
const footer = useMemo(() => {
|
|
46
|
+
return (
|
|
47
|
+
<View style={styles.footer}>
|
|
48
|
+
{initFooter}
|
|
49
|
+
<KeyboardArea />
|
|
50
|
+
</View>
|
|
51
|
+
)
|
|
52
|
+
}, [styles.footer, initFooter])
|
|
53
|
+
|
|
54
|
+
return {
|
|
55
|
+
...props,
|
|
56
|
+
header,
|
|
57
|
+
footer,
|
|
58
|
+
wrapperStyle: [styles.wrapper, wrapperStyle],
|
|
59
|
+
outerStyle: [styles.outer, outerStyle],
|
|
60
|
+
innerStyle: [styles.inner, innerStyle],
|
|
61
|
+
showsVerticalScrollIndicator: false,
|
|
62
|
+
showsHorizontalScrollIndicator: false,
|
|
63
|
+
keyboardDismissMode: 'interactive',
|
|
64
|
+
keyboardShouldPersistTaps: 'handled',
|
|
65
|
+
contentInsetAdjustmentBehavior: 'never',
|
|
66
|
+
refreshControl: onRefresh ? (
|
|
67
|
+
<RefreshControl withOffset={!withOverflowTop && !initHeader} onRefresh={onRefresh} />
|
|
68
|
+
) : undefined,
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export { useScreenContainerProps }
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native'
|
|
2
|
+
import { useSafeArea } from '../../../hooks'
|
|
3
|
+
import { useThemeMode } from '../../../lib'
|
|
4
|
+
import { ScreenContainerStylesConfig } from './screen-container.types'
|
|
5
|
+
|
|
6
|
+
const useScreenContainerStyles = ({
|
|
7
|
+
withOverflowTop,
|
|
8
|
+
withOverflowBottom,
|
|
9
|
+
}: ScreenContainerStylesConfig) => {
|
|
10
|
+
const { COLORS } = useThemeMode()
|
|
11
|
+
const { TOP, BOTTOM } = useSafeArea()
|
|
12
|
+
|
|
13
|
+
const styles = StyleSheet.create({
|
|
14
|
+
wrapper: {
|
|
15
|
+
flex: 1,
|
|
16
|
+
paddingTop: withOverflowTop ? TOP + 16 : 0,
|
|
17
|
+
paddingBottom: withOverflowBottom ? BOTTOM + 16 : 0,
|
|
18
|
+
backgroundColor: COLORS.FILL.BASE,
|
|
19
|
+
},
|
|
20
|
+
outer: {
|
|
21
|
+
zIndex: 1,
|
|
22
|
+
flex: 1,
|
|
23
|
+
},
|
|
24
|
+
inner: {
|
|
25
|
+
flexGrow: 1,
|
|
26
|
+
paddingTop: withOverflowTop ? 8 : TOP + 16,
|
|
27
|
+
paddingBottom: withOverflowBottom ? 8 : BOTTOM + 16,
|
|
28
|
+
paddingHorizontal: 16,
|
|
29
|
+
},
|
|
30
|
+
header: {
|
|
31
|
+
zIndex: 2,
|
|
32
|
+
paddingBottom: withOverflowTop ? 8 : 0,
|
|
33
|
+
paddingHorizontal: 16,
|
|
34
|
+
},
|
|
35
|
+
footer: {
|
|
36
|
+
zIndex: 2,
|
|
37
|
+
paddingTop: withOverflowBottom ? 8 : 0,
|
|
38
|
+
paddingHorizontal: 16,
|
|
39
|
+
},
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
return { styles }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export { useScreenContainerStyles }
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { ReactNode, Ref } from 'react'
|
|
2
|
+
import {
|
|
3
|
+
FlatList,
|
|
4
|
+
FlatListProps,
|
|
5
|
+
ListRenderItemInfo,
|
|
6
|
+
ScrollView,
|
|
7
|
+
ScrollViewProps,
|
|
8
|
+
SectionList,
|
|
9
|
+
SectionListData,
|
|
10
|
+
SectionListProps,
|
|
11
|
+
SectionListRenderItemInfo,
|
|
12
|
+
StyleProp,
|
|
13
|
+
ViewStyle,
|
|
14
|
+
} from 'react-native'
|
|
15
|
+
|
|
16
|
+
type ScreenContainerExcludeExtraNativeProps<
|
|
17
|
+
Props extends ScrollViewProps | FlatListProps<unknown> | SectionListProps<unknown>,
|
|
18
|
+
Prop extends string = '',
|
|
19
|
+
> = Omit<
|
|
20
|
+
Props,
|
|
21
|
+
'style' | 'contentContainerStyle' | 'refreshControl' | 'refreshing' | 'onRefresh' | Prop
|
|
22
|
+
>
|
|
23
|
+
|
|
24
|
+
type ScreenContainerProps<Component extends ScrollView | FlatList | SectionList> = {
|
|
25
|
+
reference?: Ref<Component>
|
|
26
|
+
wrapperStyle?: StyleProp<ViewStyle>
|
|
27
|
+
outerStyle?: StyleProp<ViewStyle>
|
|
28
|
+
innerStyle?: StyleProp<ViewStyle>
|
|
29
|
+
header?: ReactNode
|
|
30
|
+
footer?: ReactNode
|
|
31
|
+
withOverflowTop?: boolean
|
|
32
|
+
withOverflowBottom?: boolean
|
|
33
|
+
onRefresh?: () => any | Promise<any>
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
type ScreenContainerScrollProps = ScreenContainerExcludeExtraNativeProps<ScrollViewProps> &
|
|
37
|
+
ScreenContainerProps<ScrollView> & {}
|
|
38
|
+
|
|
39
|
+
type ScreenContainerListProps<Item = unknown> = ScreenContainerExcludeExtraNativeProps<
|
|
40
|
+
FlatListProps<Item>
|
|
41
|
+
> &
|
|
42
|
+
ScreenContainerProps<FlatList<Item>> & {}
|
|
43
|
+
|
|
44
|
+
type ScreenContainerSectionListProps<Item = unknown> = ScreenContainerExcludeExtraNativeProps<
|
|
45
|
+
SectionListProps<Item>
|
|
46
|
+
> &
|
|
47
|
+
ScreenContainerProps<SectionList<Item>> & {}
|
|
48
|
+
|
|
49
|
+
type ScreenContainerListRenderItemInfo<Item = unknown> = ListRenderItemInfo<Item>
|
|
50
|
+
|
|
51
|
+
type ScreenContainerSectionListRenderItemInfo<Item = unknown> = SectionListRenderItemInfo<Item>
|
|
52
|
+
|
|
53
|
+
type ScreenContainerSectionListRenderHeaderInfo<Item = unknown> = {
|
|
54
|
+
section: SectionListData<Item>
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type ScreenContainerSectionListRenderFooterInfo<Item = unknown> = {
|
|
58
|
+
section: SectionListData<Item>
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
type ScreenContainerStylesConfig = {
|
|
62
|
+
withOverflowTop: boolean
|
|
63
|
+
withOverflowBottom: boolean
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export type {
|
|
67
|
+
ScreenContainerScrollProps,
|
|
68
|
+
ScreenContainerListProps,
|
|
69
|
+
ScreenContainerSectionListProps,
|
|
70
|
+
ScreenContainerListRenderItemInfo,
|
|
71
|
+
ScreenContainerSectionListRenderItemInfo,
|
|
72
|
+
ScreenContainerSectionListRenderHeaderInfo,
|
|
73
|
+
ScreenContainerSectionListRenderFooterInfo,
|
|
74
|
+
ScreenContainerStylesConfig,
|
|
75
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './generators'
|
|
File without changes
|
package/svg.d.ts
ADDED