diff --git a/.github/workflows/commitlint.yml b/.github/workflows/commitlint.yml index dcb06c4..6aa5bdd 100644 --- a/.github/workflows/commitlint.yml +++ b/.github/workflows/commitlint.yml @@ -1,5 +1,5 @@ name: Lint Commit Messages -on: [pull_request, push] +on: [push] jobs: commitlint: diff --git a/.husky/commit-msg b/.husky/commit-msg index 535cc98..5f3e1b1 100755 --- a/.husky/commit-msg +++ b/.husky/commit-msg @@ -1,9 +1,36 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -StartString='-> PRE-COMMIT HOOK STARTING...' -FinishString='\n-> PRE-COMMIT HOOK CHECKS FINISHED\n' +startString='-> PRE-COMMIT HOOK STARTING...' +statusSuccessString='Status: success' +finishString='-> PRE-COMMIT HOOK CHECKS SUCCESSFULLY FINISHED\n' -echo "$StartString" +configParse() { + pathToConfig="./commitlint.config.js" + + allLineCountInFile=$(wc -l < "$pathToConfig") + blockWithKeysFromEnd=$((allLineCountInFile - 6)) + blockWithKeysPartWithoutTrash=$((blockWithKeysFromEnd - 3)) + + formattedKeysArray=$(cat "$pathToConfig" | tail -n "$blockWithKeysFromEnd" | head -n "$blockWithKeysPartWithoutTrash" | sed 's/^[ \t]*//' | tr -d '\r\n') + + echo "$formattedKeysArray" +} + +keys=$(configParse) + +echo 'keys: $keys' + +echo "$startString" + +echo "\nКоммит должен соответствовать шаблону:\n$keys:␣<описание коммита>\n" + +echo "Проверка именования коммита..." npx --no -- commitlint --edit -echo "$FinishString" +echo "$statusSuccessString" + +echo "Запуск prettier..." +npm run prettier:write +echo "$statusSuccessString" + +echo "$finishString" diff --git a/.husky/pre-push b/.husky/pre-push index ab32ad0..215b9cb 100755 --- a/.husky/pre-push +++ b/.husky/pre-push @@ -1,9 +1,9 @@ #!/usr/bin/env sh . "$(dirname -- "$0")/_/husky.sh" -StartString='-> PRE-PUSH HOOK STARTING...' -FinishString='\n-> PRE-PUSH HOOK CHECKS FINISHED\n' +startString='-> PRE-PUSH HOOK STARTING...' +finishString='\n-> PRE-PUSH HOOK CHECKS SUCCESSFULLY FINISHED\n' -echo "$StartString" +echo "$startString" -echo "$FinishString" +echo "$finishString" diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..ab4c12f --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +commitlint.config.js diff --git a/.prettierrc b/.prettierrc index 8c16088..6f3af52 100644 --- a/.prettierrc +++ b/.prettierrc @@ -4,4 +4,4 @@ "tabWidth": 4, "semi": true, "endOfLine": "auto" -} \ No newline at end of file +} diff --git a/README.md b/README.md index a2534f0..50a3a2d 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,44 @@ -# Pose - -## Badges +# Kiru client ![Prettier/eslint](https://github.com/Mon-Keys/drssr/actions/workflows/pipeline.yml/badge.svg) +## Content +1. [Dependencies installing](#1) +2. [Starting app for expo](#2) +3. [Run on device via Expo Go](#2) +3. [Commit rules](#4) -### Install dependencies - +### Dependencies installing ``` -npm ci +npm install ``` -### Start app for expo +### Starting app for expo ``` npx expo start --tunnel ``` -### Запуск на устройстве через Expo Go +### Run on device via Expo Go ``` необходимо отсканировать QR-код, появившийся в консоли ``` +### Commit rules + +Все коммиты должны соответствовать шаблону: +```['fix'|'ci'|'refact'|'code']:␣<описание коммита>``` + +В случае если нужно указать несколько тегов дополнительный тег можно указать в скобках. +Например, если это рефакторинг CI (изменение шага создания билда) команда на коммит будет выглядеть следующим образом: +```git commit -m "ci(refact): rewrite build stage"``` + +При согласовании всей командой, список ключей можно изменить в файле в корне проекта - ```commitlint.config.js``` + +Проверка именования коммита производится как локально, так и при пуше на сервере (commitlint.yml) + +Отключать локальные проверки не рекоммендуется, однако можно следующими командами: +``` +git commit --no-verify -m "..." +``` +``` +git push --no-verify +``` diff --git a/app.json b/app.json index 23ce8f0..5053802 100644 --- a/app.json +++ b/app.json @@ -1,49 +1,45 @@ { - "expo": { - "name": "drssr", - "slug": "kiru", - "version": "1.0.0", - "orientation": "portrait", - "icon": "./assets/images/icon.png", - "scheme": "myapp", - "userInterfaceStyle": "automatic", - "splash": { - "image": "./assets/images/splash.png", - "resizeMode": "contain", - "backgroundColor": "#ffffff" - }, - "updates": { - "fallbackToCacheTimeout": 0, - "url": "https://u.expo.dev/855a16af-9293-435f-a61b-4d8220a37e9d" - }, - "assetBundlePatterns": [ - "**/*" - ], - "ios": { - "supportsTablet": true, - "bundleIdentifier": "com.leonidperlin.drssr", - "infoPlist": { - "NSCameraUsageDescription": "$(PRODUCT_NAME) needs access to your Camera." - } - }, - "android": { - "adaptiveIcon": { - "foregroundImage": "./assets/images/adaptive-icon.png", - "backgroundColor": "#ffffff" - }, - "permissions": [ - "android.permission.CAMERA" - ], - "package": "com.leonidperlin.drssr" - }, - "web": { - "favicon": "./assets/images/favicon.png" - }, - "extra": { - "eas": { - "projectId": "855a16af-9293-435f-a61b-4d8220a37e9d" - } - }, - "runtimeVersion": "1.0.0" - } + "expo": { + "name": "drssr", + "slug": "kiru", + "version": "1.0.0", + "orientation": "portrait", + "icon": "./assets/images/icon.png", + "scheme": "myapp", + "userInterfaceStyle": "automatic", + "splash": { + "image": "./assets/images/splash.png", + "resizeMode": "contain", + "backgroundColor": "#ffffff" + }, + "updates": { + "fallbackToCacheTimeout": 0, + "url": "https://u.expo.dev/855a16af-9293-435f-a61b-4d8220a37e9d" + }, + "assetBundlePatterns": ["**/*"], + "ios": { + "supportsTablet": true, + "bundleIdentifier": "com.leonidperlin.drssr", + "infoPlist": { + "NSCameraUsageDescription": "$(PRODUCT_NAME) needs access to your Camera." + } + }, + "android": { + "adaptiveIcon": { + "foregroundImage": "./assets/images/adaptive-icon.png", + "backgroundColor": "#ffffff" + }, + "permissions": ["android.permission.CAMERA"], + "package": "com.leonidperlin.drssr" + }, + "web": { + "favicon": "./assets/images/favicon.png" + }, + "extra": { + "eas": { + "projectId": "855a16af-9293-435f-a61b-4d8220a37e9d" + } + }, + "runtimeVersion": "1.0.0" + } } diff --git a/commitlint.config.js b/commitlint.config.js index 8b84e27..92c845f 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -1,8 +1,15 @@ module.exports = { - extends: [ - "@commitlint/config-conventional" - ], - rules: { - "type-enum": [2, "always", ["build", "ci", "docs", "fix", "perf", "refactor", "revert", "style", "test", "feature"]], - } -} + extends: ['@commitlint/config-conventional'], + rules: { + 'type-enum': [ + 2, + 'always', + [ + 'fix', + 'ci', + 'refact', + 'code' + ] + ] + } +}; diff --git a/components/base/BecomeStylistCard.tsx b/components/base/BecomeStylistCard.tsx index 5cb2ac8..e9ae6ac 100644 --- a/components/base/BecomeStylistCard.tsx +++ b/components/base/BecomeStylistCard.tsx @@ -1,5 +1,5 @@ import { View } from './Themed'; -import {Pressable, StyleSheet, Text, TouchableOpacity} from 'react-native'; +import { Pressable, StyleSheet, Text, TouchableOpacity } from 'react-native'; import React from 'react'; import ProfileVerified from '../icons/profileVerified'; import Colors from '../../styles/Colors'; @@ -11,7 +11,7 @@ const styles = StyleSheet.create({ borderRadius: Layout.cornerRadius, width: '100%', height: 300, - marginTop: Layout.margins.default, + marginTop: Layout.margins.default }, button: { height: 40, diff --git a/components/base/InputFieldForEdit.tsx b/components/base/InputFieldForEdit.tsx index 1e9c1c9..eab8ded 100644 --- a/components/base/InputFieldForEdit.tsx +++ b/components/base/InputFieldForEdit.tsx @@ -9,7 +9,8 @@ import { } from 'react-native'; import Colors from '../../styles/Colors'; -interface InputFieldForEditProps extends Omit {} +interface InputFieldForEditProps + extends Omit {} const styles = StyleSheet.create({ inputContainer: { @@ -18,7 +19,7 @@ const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'center', paddingLeft: 9, - width: 300, + width: 300 }, input: { color: Colors.base.black, @@ -27,13 +28,13 @@ const styles = StyleSheet.create({ fontSize: 18, width: 280, paddingLeft: 10 - }, + } }); const InputFieldForEdit = (props: InputFieldForEditProps) => { return ( - + { { {props.name} - {props.isVerified && - - } + {props.isVerified && ( + + )} diff --git a/components/base/RequestStylist.tsx b/components/base/RequestStylist.tsx index e689a27..6d64919 100644 --- a/components/base/RequestStylist.tsx +++ b/components/base/RequestStylist.tsx @@ -1,5 +1,5 @@ import { View } from './Themed'; -import { StyleSheet, Text } from 'react-native'; +import { StyleSheet, Text } from 'react-native'; import React from 'react'; import Exclamation from '../icons/exclamation'; import Colors from '../../styles/Colors'; @@ -13,7 +13,7 @@ const styles = StyleSheet.create({ height: 300, marginTop: Layout.margins.default, alignItems: 'center', - justifyContent: 'center', + justifyContent: 'center' }, exclamation: { width: 60, @@ -45,18 +45,17 @@ const styles = StyleSheet.create({ } }); - export const RequestStylist = () => ( - < Exclamation /> + Заявка рассматривается {' '} - Ваша заявка на статус стилиста рассматривается модерацией. Процесс -может занять от 1 до 24 часов.{' '} + Ваша заявка на статус стилиста рассматривается модерацией. + Процесс может занять от 1 до 24 часов.{' '} diff --git a/components/feed/FeedCard.tsx b/components/feed/FeedCard.tsx index 4c8571b..3533e6a 100644 --- a/components/feed/FeedCard.tsx +++ b/components/feed/FeedCard.tsx @@ -4,7 +4,7 @@ import React from 'react'; import { LikeFeedCardButton } from './LikeFeedCardButton'; import { IPost } from '../../reducers/posts/post'; import { getUri } from '../../network/const'; -import { Layout } from "../../styles"; +import { Layout } from '../../styles'; const styles = StyleSheet.create({ cardContainer: { @@ -16,7 +16,7 @@ const styles = StyleSheet.create({ flex: 1, // resizeMode: 'contain', по дефолту будет cover, это плохо потому что он обрезает картинку. contain плохо выглядит на ios, поэтому пока так borderRadius: Layout.cornerRadius - }, + } }); export interface FeedCardProps { @@ -29,7 +29,7 @@ export interface FeedCardProps { export const FeedCard = (props: FeedCardProps) => { return ( - + { @@ -56,4 +56,4 @@ export const FeedCard = (props: FeedCardProps) => { ); -} +}; diff --git a/components/feed/FeedCommon.tsx b/components/feed/FeedCommon.tsx index 1fcf556..7b118d2 100644 --- a/components/feed/FeedCommon.tsx +++ b/components/feed/FeedCommon.tsx @@ -52,16 +52,31 @@ export const FeedCommon = (props: FeedCommonProps) => { keyExtractor={(item) => `${item.id}`} style={styles.container} columnWrapperStyle={styles.columnWrapper} - renderItem={({item, index}) => ( + renderItem={({ item, index }) => ( <> - {(item.id == -1) ? ( - + {item.id == -1 ? ( + ) : ( - + props.navigation.navigate('Post', { post: item })} + onPress={() => + props.navigation.navigate('Post', { + post: item + }) + } id={item.id} /> @@ -71,4 +86,4 @@ export const FeedCommon = (props: FeedCommonProps) => { /> ); -} +}; diff --git a/components/feed/LikeFeedCardButton.tsx b/components/feed/LikeFeedCardButton.tsx index efa49ce..8366554 100644 --- a/components/feed/LikeFeedCardButton.tsx +++ b/components/feed/LikeFeedCardButton.tsx @@ -1,10 +1,10 @@ import { View } from '../base/Themed'; import { Pressable, StyleSheet } from 'react-native'; import React from 'react'; -import {Colors, Layout} from '../../styles'; +import { Colors, Layout } from '../../styles'; import { AntDesign } from '@expo/vector-icons'; import { useAppDispatch } from '../../hooks/useAppDispatch'; -import {dislikePost, likePost} from '../../reducers/feedReducer'; +import { dislikePost, likePost } from '../../reducers/feedReducer'; const styles = StyleSheet.create({ container: { @@ -38,17 +38,12 @@ export const LikeFeedCardButton = (props: LikeFeedCardButtonProps) => { likePost({ id: props.id, likesAmount: props.currentLikes }) ); } else { - dispatch( - dislikePost({ id: props.id }) - ); + dispatch(dislikePost({ id: props.id })); } - } + }; return ( - + {props.is_liked ? ( - } + icon={} onPress={props.back} /> {props.title} {props.icon ? ( - + ) : ( - + )} diff --git a/components/posts/postcard/LikeButton.tsx b/components/posts/postcard/LikeButton.tsx index bc1cab0..2b16a49 100644 --- a/components/posts/postcard/LikeButton.tsx +++ b/components/posts/postcard/LikeButton.tsx @@ -1,14 +1,13 @@ import { View } from '../../base/Themed'; -import {Pressable, StyleSheet, ViewStyle} from 'react-native'; +import { Pressable, StyleSheet, ViewStyle } from 'react-native'; import React from 'react'; import { Colors } from '../../../styles'; import { AntDesign } from '@expo/vector-icons'; import { useAppDispatch } from '../../../hooks/useAppDispatch'; -import {dislikePost, likePost} from '../../../reducers/feedReducer'; +import { dislikePost, likePost } from '../../../reducers/feedReducer'; const styles = StyleSheet.create({ - likeButton: { - } + likeButton: {} }); export interface LikeFeedCardButtonProps { @@ -28,20 +27,15 @@ export const LikeButton = (props: LikeFeedCardButtonProps) => { likePost({ id: props.id, likesAmount: props.currentLikes }) ); } else { - dispatch( - dislikePost({ id: props.id }) - ); + dispatch(dislikePost({ id: props.id })); } if (props.callback) { props.callback(); } - } + }; return ( - + {props.is_liked ? ( void; @@ -39,7 +41,7 @@ const styles = StyleSheet.create({ image: { backgroundColor: Colors.base.lightgray, borderRadius: Layout.cornerRadius, - flex: 1, + flex: 1 // resizeMode: 'contain' }, @@ -51,7 +53,7 @@ const styles = StyleSheet.create({ postDescriptionUpperContainer: { height: 36, margin: Layout.margins.default, - flexDirection: 'row', + flexDirection: 'row' }, postDescriptionAuthorContainer: { flexDirection: 'row', @@ -81,7 +83,7 @@ const styles = StyleSheet.create({ }, postDescriptionDescription: { marginVertical: Layout.margins.small, - fontSize: Layout.fontSize.default, + fontSize: Layout.fontSize.default }, postDescriptionLikes: { marginVertical: Layout.margins.small, @@ -90,7 +92,7 @@ const styles = StyleSheet.create({ }, postDescriptionLike: { alignItems: 'flex-start', - marginVertical: Layout.margins.small, + marginVertical: Layout.margins.small }, itemsContainer: { @@ -129,10 +131,7 @@ const styles = StyleSheet.create({ function _renderItem(props) { return ( - + ); } @@ -169,10 +168,12 @@ export const PostCard = (props: PostCardProps) => { const [authorAvatar, setAuthorAvatar] = React.useState(''); React.useEffect(() => { if (props.post.look.creator_id && authorName == '') { - network.Common.getUserData(props.post.look.creator_id).then((data) => { - setAuthorName(data.data.name); - setAuthorAvatar(getUri(data.data.avatar)); - }); + network.Common.getUserData(props.post.look.creator_id).then( + (data) => { + setAuthorName(data.data.name); + setAuthorAvatar(getUri(data.data.avatar)); + } + ); } }); @@ -214,7 +215,7 @@ export const PostCard = (props: PostCardProps) => { ref={(ref) => (carouselRef = ref)} data={data} sliderWidth={250} // TODO пиздец - itemWidth={Dimensions.get('window').width-14} // TODO пиздец + itemWidth={Dimensions.get('window').width - 14} // TODO пиздец renderItem={_renderItem} onSnapToItem={(index) => setActiveIndex(index)} /> @@ -254,19 +255,26 @@ export const PostCard = (props: PostCardProps) => { - + {authorName} {look.name ? ( - + {props.post.name} ) : null} @@ -284,7 +292,7 @@ export const PostCard = (props: PostCardProps) => { is_liked={is_liked} style={styles.postDescriptionLike} callback={() => { - setLikes(likes + (!is_liked ? 1 : -1)) + setLikes(likes + (!is_liked ? 1 : -1)); setLike(!is_liked); }} /> diff --git a/eas.json b/eas.json index 58049f3..c71811a 100644 --- a/eas.json +++ b/eas.json @@ -1,25 +1,25 @@ { - "cli": { - "version": ">= 2.3.0" - }, - "build": { - "development": { - "developmentClient": true, - "distribution": "internal", - "channel": "development" + "cli": { + "version": ">= 2.3.0" }, - "preview": { - "distribution": "internal", - "channel": "preview", - "android": { - "buildType": "apk" - } + "build": { + "development": { + "developmentClient": true, + "distribution": "internal", + "channel": "development" + }, + "preview": { + "distribution": "internal", + "channel": "preview", + "android": { + "buildType": "apk" + } + }, + "production": { + "channel": "production" + } }, - "production": { - "channel": "production" + "submit": { + "production": {} } - }, - "submit": { - "production": {} - } -} \ No newline at end of file +} diff --git a/index.js b/index.js index abd0be8..ce8f207 100644 --- a/index.js +++ b/index.js @@ -2,4 +2,4 @@ import { registerRootComponent } from 'expo'; import App from './App'; -registerRootComponent(App); \ No newline at end of file +registerRootComponent(App); diff --git a/navigation/TapBarNavigation/Profile.tsx b/navigation/TapBarNavigation/Profile.tsx index 5f06306..330b33a 100644 --- a/navigation/TapBarNavigation/Profile.tsx +++ b/navigation/TapBarNavigation/Profile.tsx @@ -23,7 +23,10 @@ export function ProfileNavigation(): any { headerShown: true }} /> - + ); } diff --git a/network/api/common.ts b/network/api/common.ts index 50a01d6..f7dad9c 100644 --- a/network/api/common.ts +++ b/network/api/common.ts @@ -2,7 +2,7 @@ import http from '../instace'; import * as ImagePicker from 'expo-image-picker'; import { IPost } from '../../reducers/posts/post'; import { ILook } from '../../reducers/looks/looks'; -import {Clothes} from "../../reducers/items/clothesReducer"; +import { Clothes } from '../../reducers/items/clothesReducer'; export interface IItemData { id?: number; diff --git a/network/api/user.ts b/network/api/user.ts index 42095a2..14b050e 100644 --- a/network/api/user.ts +++ b/network/api/user.ts @@ -27,7 +27,6 @@ export interface ICheckStylist { exists: boolean; } - export default class User { /** * Returns axios request handle @@ -100,7 +99,7 @@ export default class User { * * @beta */ - requestStylist() { + requestStylist() { return http.post('/private/users/stylist', { withCredentials: true }); @@ -114,7 +113,7 @@ export default class User { * * @beta */ - checkStylist() { + checkStylist() { return http.get('/private/users/stylist', { withCredentials: true }); diff --git a/screens/HomeScreen/SubscriptionsFeedScreen/SubscriptionsFeedScreen.tsx b/screens/HomeScreen/SubscriptionsFeedScreen/SubscriptionsFeedScreen.tsx index 494f09d..6fe2f6b 100644 --- a/screens/HomeScreen/SubscriptionsFeedScreen/SubscriptionsFeedScreen.tsx +++ b/screens/HomeScreen/SubscriptionsFeedScreen/SubscriptionsFeedScreen.tsx @@ -1,17 +1,24 @@ import React from 'react'; -import {ActivityIndicator, Platform, RefreshControl, StatusBar, StyleSheet} from 'react-native'; +import { + ActivityIndicator, + Platform, + RefreshControl, + StatusBar, + StyleSheet +} from 'react-native'; import { View } from '../../../components/base/Themed'; import { RootTabScreenProps } from '../../../types'; import { FeedCommon } from '../../../components/feed/FeedCommon'; import { fetchSubscribtionPosts, - selectFeeds, selectSubscribtionFeed + selectFeeds, + selectSubscribtionFeed } from '../../../reducers/feedReducer'; import { useAppSelector } from '../../../hooks/useAppSelector'; import { useDispatch } from 'react-redux'; import { AppDispatch } from '../../../store'; -import {useAppDispatch} from "../../../hooks/useAppDispatch"; +import { useAppDispatch } from '../../../hooks/useAppDispatch'; const styles = StyleSheet.create({ container: { @@ -44,10 +51,7 @@ export default function SubscriptionsFeedScreen({ } diff --git a/screens/Modals/CreatePostModal.tsx b/screens/Modals/CreatePostModal.tsx index 6b7b4ea..958daf8 100644 --- a/screens/Modals/CreatePostModal.tsx +++ b/screens/Modals/CreatePostModal.tsx @@ -17,7 +17,7 @@ import InputContainer, { } from '../../components/item/InputContainer'; import PhotosPreview from '../../components/posts/PhotosPreview'; import { clearNewPost, selectNewPosts } from '../../reducers/posts/postReducer'; -import {KeyboardAwareScrollView} from "react-native-keyboard-aware-scroll-view"; +import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; const styles = StyleSheet.create({ container: { @@ -81,7 +81,7 @@ export default function CreatePostModal() { title: 'Описание', placeholder: 'Расскажите подробнее о вашем образе', value: defaultDescription - }, + } // { key: 'price', title: 'Цена', placeholder: 'Укажите цену образа' } ]; diff --git a/screens/Modals/EditProfileModal.tsx b/screens/Modals/EditProfileModal.tsx index aebc844..31ecb28 100644 --- a/screens/Modals/EditProfileModal.tsx +++ b/screens/Modals/EditProfileModal.tsx @@ -1,12 +1,24 @@ import React from 'react'; -import { StyleSheet, Image, Text, Pressable, Platform, StatusBar, } from 'react-native'; +import { + StyleSheet, + Image, + Text, + Pressable, + Platform, + StatusBar +} from 'react-native'; import { View } from '../../components/base/Themed'; import { Colors } from '../../styles'; import { Abstracts } from '../../styles'; import { useNavigation } from '@react-navigation/native'; import { RootStackParamList } from '../../types'; import { useAppDispatch } from '../../hooks/useAppDispatch'; -import { addAvatar, deleteAvatar, selectUser, updateUserData } from '../../reducers/userReducer'; +import { + addAvatar, + deleteAvatar, + selectUser, + updateUserData +} from '../../reducers/userReducer'; import { useAppSelector } from '../../hooks/useAppSelector'; import InputFieldForEdit from '../../components/base/InputFieldForEdit'; import * as ImagePicker from 'expo-image-picker'; @@ -44,7 +56,7 @@ const styles = StyleSheet.create({ justifyContent: 'center', position: 'absolute', top: 10, - left: 10, + left: 10 }, submit: { height: 45, @@ -53,52 +65,58 @@ const styles = StyleSheet.create({ justifyContent: 'center', position: 'absolute', top: 10, - right: 10, + right: 10 }, uploadPhoto: { height: 45, backgroundColor: Colors.base.transparent, alignItems: 'center', - justifyContent: 'center', + justifyContent: 'center' }, text: { top: 5, height: 50, fontSize: 12, fontFamily: 'proxima-nova' - }, + } }); export default function EditProfileModalScreen() { const user = useAppSelector(selectUser); - const userData = user.userData + const userData = user.userData; const [name, setName] = React.useState(userData.name); - const [desc, setDesc] = React.useState(userData.description ? userData.description : ''); + const [desc, setDesc] = React.useState( + userData.description ? userData.description : '' + ); const navigation = useNavigation(); const dispatch = useAppDispatch(); const updateProfile = () => { - console.log(user.status) - dispatch(updateUserData({ - nickname: userData.nickname, - email: userData.email, - name: name, - birth_date: userData.birthDate ? userData.birthDate : '2001-06-29', - description: desc, - })).then(() => { + console.log(user.status); + dispatch( + updateUserData({ + nickname: userData.nickname, + email: userData.email, + name: name, + birth_date: userData.birthDate + ? userData.birthDate + : '2001-06-29', + description: desc + }) + ).then(() => { if (user.status === 'resolved') { - navigation.goBack() + navigation.goBack(); } }); }; const cancel = () => { // dispatch(deleteAvatar()) - navigation.goBack() - } + navigation.goBack(); + }; const pickImage = async () => { let result = await ImagePicker.launchImageLibraryAsync({ @@ -106,9 +124,11 @@ export default function EditProfileModalScreen() { quality: 1 }); if (!result.cancelled) { - dispatch(addAvatar({ - file: result, - })) + dispatch( + addAvatar({ + file: result + }) + ); // .then( () => {console.log(user.userData)}); } }; @@ -116,20 +136,25 @@ export default function EditProfileModalScreen() { return ( - - Отмена + + Отмена - - Готово + + Готово - - Загрузить новое фото + + + Загрузить новое фото + - Расскажите о себе. Почему клиенты выбирают вас? + + Расскажите о себе. Почему клиенты выбирают вас? + ); diff --git a/screens/Modals/ItemModal.tsx b/screens/Modals/ItemModal.tsx index 88c841d..fc10c36 100644 --- a/screens/Modals/ItemModal.tsx +++ b/screens/Modals/ItemModal.tsx @@ -4,10 +4,13 @@ import { Clothes, selectUserItems } from '../../reducers/items/clothesReducer'; import { ThingScreenRouteProp } from '../../types'; import { useRoute } from '@react-navigation/native'; import Item from '../../components/items/Item'; -import { fetchClothesById, selectFeedClothes } from "../../reducers/feedReducer"; -import { useAppDispatch } from "../../hooks/useAppDispatch"; -import { ActivityIndicator } from "react-native"; -import { Colors } from "../../styles"; +import { + fetchClothesById, + selectFeedClothes +} from '../../reducers/feedReducer'; +import { useAppDispatch } from '../../hooks/useAppDispatch'; +import { ActivityIndicator } from 'react-native'; +import { Colors } from '../../styles'; export default function ItemModal() { const dispatch = useAppDispatch(); @@ -35,16 +38,18 @@ export default function ItemModal() { dispatch(fetchClothesById(id)); return null; - } + }; const item = smartGetItem(); if (!item) { return ( - + ); } - return ( - - ); + return ; } diff --git a/screens/ProfileScreen/ProfileScreen.tsx b/screens/ProfileScreen/ProfileScreen.tsx index fc29467..7b83578 100644 --- a/screens/ProfileScreen/ProfileScreen.tsx +++ b/screens/ProfileScreen/ProfileScreen.tsx @@ -11,14 +11,19 @@ import { import { useAppSelector } from '../../hooks/useAppSelector'; import { useAppDispatch } from '../../hooks/useAppDispatch'; -import { checkStylist, fetchUserData, requestStylist, selectUser } from '../../reducers/userReducer'; +import { + checkStylist, + fetchUserData, + requestStylist, + selectUser +} from '../../reducers/userReducer'; import { RootNavigation, RootTabScreenProps } from '../../types'; import Colors from '../../styles/Colors'; import { ProfileCard } from '../../components/base/ProfileCard'; import { useNavigation } from '@react-navigation/native'; import { getPosts } from '../../reducers/posts/createPost'; import { Layout } from '../../styles'; -import {selectPosts, selectPosts2} from '../../reducers/posts/postReducer'; +import { selectPosts, selectPosts2 } from '../../reducers/posts/postReducer'; import { BecomeStylistCard } from '../../components/base/BecomeStylistCard'; import { PostPreview } from '../../components/posts/PostPreview'; import NewPostBottomMenu from '../../components/profile/NewPostBottomMenu'; @@ -29,7 +34,7 @@ import { selectUserItems } from '../../reducers/items/clothesReducer'; import BaseButton from '../../components/base/BaseButton'; import { FeedCommon } from '../../components/feed/FeedCommon'; import { RequestStylist } from '../../components/base/RequestStylist'; -import {Feed} from "../../reducers/feedReducer"; +import { Feed } from '../../reducers/feedReducer'; const styles = StyleSheet.create({ container: { @@ -69,13 +74,13 @@ export default function ProfileScreen() { const navigation = useNavigation(); const user = useAppSelector(selectUser); - const userData = user.userData + const userData = user.userData; const posts = useAppSelector(selectPosts); const postsProfile: Feed = { data: posts, status: '' - } + }; const clothes = useAppSelector(selectUserItems); const hasClothes = (): boolean => { @@ -90,7 +95,7 @@ export default function ProfileScreen() { const dispatch = useAppDispatch(); useEffect(() => { - dispatch(checkStylist()) + dispatch(checkStylist()); dispatch(fetchUserData()); dispatch(getPosts()); dispatch(fetchUsersClothes()); @@ -98,7 +103,7 @@ export default function ProfileScreen() { }, [dispatch]); const refresh = () => { - dispatch(checkStylist()) + dispatch(checkStylist()); dispatch(fetchUserData()); dispatch(getPosts()); }; @@ -132,7 +137,7 @@ export default function ProfileScreen() { style={{ paddingHorizontal: Layout.margins.small }} > { navigation.navigate('EditProfile'); }} - description={ userData.description ? userData.description : ''} + description={ + userData.description ? userData.description : '' + } /> {userData.stylist && ( <> @@ -163,9 +170,7 @@ export default function ProfileScreen() { {!userData.stylist && !user.isRequest && ( )} - {!userData.stylist && user.isRequest && ( - - )} + {!userData.stylist && user.isRequest && } diff --git a/screens/SearchScreen/DiscoverScreen.tsx b/screens/SearchScreen/DiscoverScreen.tsx index bc4c146..d394ab8 100644 --- a/screens/SearchScreen/DiscoverScreen.tsx +++ b/screens/SearchScreen/DiscoverScreen.tsx @@ -13,23 +13,26 @@ import { RootTabScreenProps } from '../../types'; import { AppDispatch } from '../../store'; import { useDispatch } from 'react-redux'; import { useAppSelector } from '../../hooks/useAppSelector'; -import { fetchFavoritePosts, selectFavoriteFeeds } from '../../reducers/feedReducer'; -import {Layout} from "../../styles"; -import EmptyView from "../../components/base/EmptyView"; -import {useAppDispatch} from "../../hooks/useAppDispatch"; +import { + fetchFavoritePosts, + selectFavoriteFeeds +} from '../../reducers/feedReducer'; +import { Layout } from '../../styles'; +import EmptyView from '../../components/base/EmptyView'; +import { useAppDispatch } from '../../hooks/useAppDispatch'; const styles = StyleSheet.create({ container: { flex: 1, alignContent: 'center', justifyContent: 'center', - paddingTop: 30,// Platform.OS === 'android' ? StatusBar.currentHeight : 0, + paddingTop: 30, // Platform.OS === 'android' ? StatusBar.currentHeight : 0, backgroundColor: 'transparent' }, headerContainer: { height: 53, // такой хардкод епта не просто так, чтобы EmptyView на разных экранах одинаково выглядили justifyContent: 'center', - alignItems: 'center', + alignItems: 'center' }, headerText: { fontSize: Layout.fontSize.big, @@ -58,8 +61,8 @@ export default function DiscoverScreen({ }, [dispatch]); const hasFavoriteFeed = (): boolean => { - return favoriteFeed.data && favoriteFeed.data.length != 0 - } + return favoriteFeed.data && favoriteFeed.data.length != 0; + }; return ( @@ -71,10 +74,7 @@ export default function DiscoverScreen({ } diff --git a/screens/WardrobeScreen/ItemsScreen/AddItemModal.tsx b/screens/WardrobeScreen/ItemsScreen/AddItemModal.tsx index 432867c..cc9e1b3 100644 --- a/screens/WardrobeScreen/ItemsScreen/AddItemModal.tsx +++ b/screens/WardrobeScreen/ItemsScreen/AddItemModal.tsx @@ -1,6 +1,12 @@ import React, { useEffect } from 'react'; -import {ActivityIndicator, KeyboardAvoidingView, Platform, ScrollView, StyleSheet} from 'react-native'; +import { + ActivityIndicator, + KeyboardAvoidingView, + Platform, + ScrollView, + StyleSheet +} from 'react-native'; import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; import { useAppSelector } from '../../../hooks/useAppSelector'; import { useAppDispatch } from '../../../hooks/useAppDispatch'; @@ -23,7 +29,7 @@ import BaseButton from '../../../components/base/BaseButton'; import { useNavigation } from '@react-navigation/native'; import { RootNavigation } from '../../../types'; import { linkItemRegExp, typeItemRegExp } from '../../../constants/validation'; -import {selectUser} from "../../../reducers/userReducer"; +import { selectUser } from '../../../reducers/userReducer'; const styles = StyleSheet.create({ container: { diff --git a/screens/WardrobeScreen/ItemsScreen/ItemScreen.tsx b/screens/WardrobeScreen/ItemsScreen/ItemScreen.tsx index c8ba343..6adc152 100644 --- a/screens/WardrobeScreen/ItemsScreen/ItemScreen.tsx +++ b/screens/WardrobeScreen/ItemsScreen/ItemScreen.tsx @@ -16,7 +16,7 @@ import { useNavigation, useRoute } from '@react-navigation/native'; import IconButton from '../../../components/base/IconButton'; import { AntDesign } from '@expo/vector-icons'; import Item from '../../../components/items/Item'; -import Back from "../../../components/icons/back"; +import Back from '../../../components/icons/back'; const styles = StyleSheet.create({ container: { @@ -66,12 +66,7 @@ export default function ItemScreen() { - } + icon={} onPress={() => navigation.goBack()} /> diff --git a/screens/WardrobeScreen/ItemsScreen/ItemsByCategoryScreen.tsx b/screens/WardrobeScreen/ItemsScreen/ItemsByCategoryScreen.tsx index 7dc1a3c..e81c26c 100644 --- a/screens/WardrobeScreen/ItemsScreen/ItemsByCategoryScreen.tsx +++ b/screens/WardrobeScreen/ItemsScreen/ItemsByCategoryScreen.tsx @@ -25,7 +25,7 @@ import { useAppDispatch } from '../../../hooks/useAppDispatch'; import { fetchUsersClothes } from '../../../reducers/items/fetchClothes'; import ViewBottomMenu from '../../../components/items/ViewBottomMenu'; import { BottomSheetModal } from '@gorhom/bottom-sheet'; -import Back from "../../../components/icons/back"; +import Back from '../../../components/icons/back'; const styles = StyleSheet.create({ container: { @@ -92,12 +92,7 @@ export default function ItemsByCategoryScreen() { - } + icon={} onPress={() => navigation.goBack()} /> diff --git a/screens/WardrobeScreen/LooksScreen/LookScreen.tsx b/screens/WardrobeScreen/LooksScreen/LookScreen.tsx index a4f3222..3978946 100644 --- a/screens/WardrobeScreen/LooksScreen/LookScreen.tsx +++ b/screens/WardrobeScreen/LooksScreen/LookScreen.tsx @@ -20,7 +20,7 @@ import IconButton from '../../../components/base/IconButton'; import { AntDesign } from '@expo/vector-icons'; import { selectLook } from '../../../reducers/looks/lookReducer'; import { Look } from '../../../components/Look/Look'; -import Back from "../../../components/icons/back"; +import Back from '../../../components/icons/back'; const styles = StyleSheet.create({ container: { @@ -65,12 +65,7 @@ export default function LookScreen() { - } + icon={} onPress={() => navigation.goBack()} /> diff --git a/screens/WardrobeScreen/LooksScreen/SaveLookModal.tsx b/screens/WardrobeScreen/LooksScreen/SaveLookModal.tsx index 0a97f38..4374c6c 100644 --- a/screens/WardrobeScreen/LooksScreen/SaveLookModal.tsx +++ b/screens/WardrobeScreen/LooksScreen/SaveLookModal.tsx @@ -27,12 +27,12 @@ import InputContainer, { } from '../../../components/item/InputContainer'; import BaseButton from '../../../components/base/BaseButton'; import { GenerateRandomName, ICreateLook } from '../../../network/api/common'; -import {KeyboardAwareScrollView} from "react-native-keyboard-aware-scroll-view"; +import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; // @ts-ignore const styles = StyleSheet.create({ container: { - backgroundColor: 'transparent', + backgroundColor: 'transparent' }, lookContainer: { flex: 1, @@ -164,15 +164,15 @@ export default function SaveLookModal({ /> ) : null} - - + + );