rn-vs-lb 1.0.55 → 1.0.57
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/README.md +79 -4
- package/app/(pages)/index.tsx +20 -0
- package/app/(storybook)/index.tsx +7 -0
- package/app/_layout.tsx +19 -0
- package/app.json +45 -0
- package/assets/adaptive-icon.png +0 -0
- package/assets/favicon.png +0 -0
- package/assets/icon-storybook.png +0 -0
- package/assets/icon.png +0 -0
- package/assets/splash-icon.png +0 -0
- package/assets/splash.png +0 -0
- package/babel.config.js +11 -0
- package/components/Button/Button.stories.tsx +131 -0
- package/components/Button/Button.tsx +146 -0
- package/components/Button/DeleteAccountButton.stories.tsx +26 -0
- package/components/Button/DeleteAccountButton.tsx +84 -0
- package/components/Button/PostButton.stories.tsx +36 -0
- package/components/Button/PostButton.tsx +45 -0
- package/components/Button/TelegramFeedbackLink.stories.tsx +28 -0
- package/components/Button/TelegramFeedbackLink.tsx +44 -0
- package/{dist/types/components/buttons/index.d.ts → components/Button/index.ts} +2 -0
- package/components/Cards/EventCard.stories.tsx +128 -0
- package/components/Cards/EventCard.tsx +193 -0
- package/components/Cards/PlaceCard.stories.tsx +87 -0
- package/components/Cards/PlaceCard.tsx +83 -0
- package/components/Cards/index.tsx +4 -0
- package/components/Chat/ChatItem.stories.tsx +174 -0
- package/components/Chat/ChatItem.styles.ts +72 -0
- package/components/Chat/ChatItem.tsx +133 -0
- package/components/Chat/ChatTab/ChatTabs.stories.tsx +68 -0
- package/components/Chat/ChatTab/ChatTabs.tsx +90 -0
- package/components/Chat/ChatTab/SubTabButton.stories.tsx +30 -0
- package/components/Chat/ChatTab/SubTabButton.tsx +52 -0
- package/components/Chat/InputMessage.stories.tsx +200 -0
- package/components/Chat/InputMessage.tsx +290 -0
- package/components/Chat/MessageItem/ImagesStrip.tsx +26 -0
- package/components/Chat/MessageItem/LinkyText.tsx +43 -0
- package/components/Chat/MessageItem/MessageItem.stories.tsx +292 -0
- package/components/Chat/MessageItem/MessageItem.tsx +139 -0
- package/components/Chat/MessageItem/ReplyBox.tsx +27 -0
- package/components/Chat/MessageItem/index.ts +4 -0
- package/components/Chat/MessageItem/styles.ts +138 -0
- package/components/Chat/MessageItem/types.ts +47 -0
- package/components/Chat/PinnedMessagesBar/PinnedChip.tsx +82 -0
- package/components/Chat/PinnedMessagesBar/PinnedMessagesBar.stories.tsx +168 -0
- package/components/Chat/PinnedMessagesBar/PinnedMessagesBar.tsx +191 -0
- package/components/Chat/PinnedMessagesBar/PinnedModal.tsx +81 -0
- package/components/Chat/PinnedMessagesBar/index.ts +3 -0
- package/components/Chat/PinnedMessagesBar/styles.ts +116 -0
- package/components/Chat/PinnedMessagesBar/types.ts +34 -0
- package/components/Chat/index.ts +21 -0
- package/components/Header/HeaderDefault.stories.tsx +79 -0
- package/components/Header/HeaderDefault.tsx +74 -0
- package/components/Header/HeaderEdit.stories.tsx +45 -0
- package/components/Header/HeaderEdit.tsx +74 -0
- package/components/Header/HeaderHome.stories.tsx +63 -0
- package/components/Header/HeaderHome.tsx +63 -0
- package/components/Header/HeaderSwitcher.stories.tsx +73 -0
- package/components/Header/HeaderSwitcher.tsx +47 -0
- package/components/Header/HeaderWithImg.stories.tsx +84 -0
- package/components/Header/HeaderWithImg.tsx +171 -0
- package/components/Header/index.ts +5 -0
- package/components/Modals/GalleryModal.stories.tsx +40 -0
- package/components/Modals/GalleryModal.tsx +51 -0
- package/components/Modals/ReportModal.stories.tsx +191 -0
- package/components/Modals/ReportModal.tsx +200 -0
- package/components/Modals/index.ts +2 -0
- package/components/Poll/CommentItem.stories.tsx +154 -0
- package/components/Poll/CommentItem.tsx +132 -0
- package/components/Poll/PollCardList.stories.tsx +60 -0
- package/components/Poll/PollCardList.tsx +60 -0
- package/components/Poll/index.ts +2 -0
- package/components/Posts/EventCardList.stories.tsx +128 -0
- package/components/Posts/EventCardList.tsx +153 -0
- package/components/Posts/PlaceCardList.stories.tsx +43 -0
- package/components/Posts/PlaceCardList.tsx +58 -0
- package/components/Posts/index.ts +2 -0
- package/components/Profile/ModalProfilePhoto.stories.tsx +62 -0
- package/components/Profile/ModalProfilePhoto.tsx +98 -0
- package/components/Profile/ProfileCard/ProfileCard.stories.tsx +60 -0
- package/components/Profile/ProfileCard/ProfileCard.tsx +208 -0
- package/components/Profile/ProfileCard/useProfileCardStyles.ts +76 -0
- package/components/Profile/ProfilePhotoBanner.stories.tsx +73 -0
- package/components/Profile/ProfilePhotoBanner.tsx +52 -0
- package/components/Profile/ProfilePhotoUpload/ProfilePhotoUpload.stories.tsx +60 -0
- package/components/Profile/ProfilePhotoUpload/ProfilePhotoUpload.tsx +245 -0
- package/components/Profile/ProfileTabs/UserProfileTabs.stories.tsx +44 -0
- package/components/Profile/ProfileTabs/UserProfileTabs.tsx +108 -0
- package/components/Profile/index.ts +8 -0
- package/components/Specialist/Hero.stories.tsx +61 -0
- package/components/Specialist/Hero.tsx +101 -0
- package/components/Specialist/PortfolioCarousel.stories.tsx +33 -0
- package/components/Specialist/PortfolioCarousel.tsx +54 -0
- package/components/Specialist/ServicesList.stories.tsx +58 -0
- package/components/Specialist/ServicesList.tsx +81 -0
- package/components/Specialist/SpecialistProfileScreen.tsx +79 -0
- package/components/Specialist/index.ts +6 -0
- package/components/Tooltip/DangerTooltip.stories.tsx +101 -0
- package/components/Tooltip/DangerTooltip.tsx +25 -0
- package/components/Tooltip/InfoTooltip.stories.tsx +98 -0
- package/components/Tooltip/InfoTooltip.tsx +24 -0
- package/components/Tooltip/InfoTooltipBase.stories.tsx +114 -0
- package/components/Tooltip/InfoTooltipBase.tsx +242 -0
- package/components/Tooltip/SucceedTooltip.stories.tsx +95 -0
- package/components/Tooltip/SucceedTooltip.tsx +25 -0
- package/components/Tooltip/WarningTooltip.stories.tsx +103 -0
- package/components/Tooltip/WarningTooltip.tsx +25 -0
- package/components/Tooltip/index.tsx +5 -0
- package/components/UI/CardContainer.stories.tsx +49 -0
- package/components/UI/CardContainer.tsx +44 -0
- package/components/UI/DeletedState.stories.tsx +24 -0
- package/components/UI/DeletedState.tsx +36 -0
- package/components/UI/DescriptionMore.stories.tsx +43 -0
- package/components/UI/DescriptionMore.tsx +40 -0
- package/components/UI/DetailsCard/AddressBlock.stories.tsx +62 -0
- package/components/UI/DetailsCard/AddressBlock.tsx +37 -0
- package/components/UI/DetailsCard/IconLabel.stories.tsx +86 -0
- package/components/UI/DetailsCard/IconLabel.tsx +45 -0
- package/components/UI/DetailsCard/InfoNotification.stories.tsx +81 -0
- package/components/UI/DetailsCard/InfoNotification.tsx +44 -0
- package/components/UI/DetailsCard/PriceBlock.stories.tsx +53 -0
- package/components/UI/DetailsCard/PriceBlock.tsx +20 -0
- package/components/UI/DetailsCard/index.ts +4 -0
- package/components/UI/Dot.stories.tsx +42 -0
- package/components/UI/Dot.tsx +26 -0
- package/components/UI/EmptyState.stories.tsx +14 -0
- package/components/UI/EmptyState.tsx +33 -0
- package/components/UI/Hr.stories.tsx +45 -0
- package/components/UI/Hr.tsx +31 -0
- package/components/UI/LinkPreview.stories.tsx +82 -0
- package/components/UI/LinkPreview.tsx +81 -0
- package/components/UI/ListBlockItem.stories.tsx +69 -0
- package/components/UI/ListBlockItem.tsx +90 -0
- package/components/UI/ListItem.stories.tsx +67 -0
- package/components/UI/ListItem.tsx +64 -0
- package/components/UI/LoadingScreen.stories.tsx +14 -0
- package/components/UI/LoadingScreen.tsx +25 -0
- package/components/UI/NoAuth.stories.tsx +21 -0
- package/components/UI/NoAuth.tsx +34 -0
- package/components/UI/ParticipantItem.stories.tsx +67 -0
- package/components/UI/ParticipantItem.tsx +107 -0
- package/components/UI/Social/SocialIconsRow.stories.tsx +28 -0
- package/components/UI/Social/SocialIconsRow.tsx +59 -0
- package/components/UI/Social/SocialStatsEvent.stories.tsx +89 -0
- package/components/UI/Social/SocialStatsEvent.tsx +64 -0
- package/components/UI/Social/SocialStatsPlace.stories.tsx +84 -0
- package/components/UI/Social/SocialStatsPlace.tsx +61 -0
- package/components/UI/Social/index.ts +4 -0
- package/components/UI/Spacer.stories.tsx +35 -0
- package/components/UI/Spacer.tsx +23 -0
- package/components/UI/StatusFilter/StatusFilter.stories.tsx +67 -0
- package/components/UI/StatusFilter/StatusFilter.tsx +85 -0
- package/components/UI/TabBar/TabBar.stories.tsx +76 -0
- package/components/UI/TabBar/TabBar.tsx +84 -0
- package/components/UI/TabButton/TabButton.stories.tsx +220 -0
- package/components/UI/TabButton/TabButton.tsx +60 -0
- package/components/UI/TextWithLinks.stories.tsx +69 -0
- package/components/UI/TextWithLinks.tsx +58 -0
- package/components/UI/ThemeSwitcher.stories.tsx +22 -0
- package/components/UI/ThemeSwitcher.tsx +46 -0
- package/components/UI/ThreeDotsMenu.stories.tsx +65 -0
- package/components/UI/ThreeDotsMenu.tsx +113 -0
- package/components/UI/TripleSwitch.stories.tsx +66 -0
- package/components/UI/TripleSwitch.tsx +77 -0
- package/components/UI/index.ts +27 -0
- package/components/UserCards/Organazer.tsx +40 -0
- package/components/UserCards/Organizer.stories.tsx +54 -0
- package/components/UserCards/SpecialistCard.stories.tsx +101 -0
- package/components/UserCards/SpecialistCard.tsx +146 -0
- package/components/UserCards/StoryCard.stories.tsx +173 -0
- package/components/UserCards/StoryCard.tsx +187 -0
- package/components/UserCards/UserProfileCard.stories.tsx +62 -0
- package/components/UserCards/UserProfileCard.tsx +248 -0
- package/components/UserCards/UserRow.stories.tsx +64 -0
- package/components/UserCards/UserRow.tsx +44 -0
- package/components/UserCards/index.ts +5 -0
- package/components/index.ts +12 -0
- package/expo-env.d.ts +3 -0
- package/index.ts +1 -0
- package/metro.config.js +14 -0
- package/package.json +97 -72
- package/theme/index.ts +12 -0
- package/theme/styles/commonFormStyles.ts +41 -0
- package/theme/styles/style.ts +102 -0
- package/theme/styles/styleSheet.ts +212 -0
- package/theme/theme.ts +252 -0
- package/theme/themeContext.tsx +102 -0
- package/theme/types.ts +4 -0
- package/tsconfig.json +13 -0
- package/types/Icon.ts +1 -0
- package/types/event.ts +9 -0
- package/types/message.ts +21 -0
- package/types/svg.d.ts +6 -0
- package/dist/components/bottomsheet/DefaultSheet.js +0 -65
- package/dist/components/bottomsheet/DefaultSheetLong.js +0 -66
- package/dist/components/bottomsheet/PostOptionSheet copy.js +0 -67
- package/dist/components/bottomsheet/PostOptionSheet.js +0 -116
- package/dist/components/bottomsheet/index.js +0 -12
- package/dist/components/buttons/Button.js +0 -72
- package/dist/components/buttons/PostButton.js +0 -34
- package/dist/components/buttons/index.js +0 -10
- package/dist/components/eventCard/Tag.js +0 -36
- package/dist/components/eventCard/index.js +0 -12
- package/dist/components/eventCard/vsCard/EventCard.js +0 -76
- package/dist/components/eventCard/vsCard/Footer.js +0 -81
- package/dist/components/eventCard/vsCard/OrganizerContainer.js +0 -51
- package/dist/components/footer/Footer copy.js +0 -114
- package/dist/components/footer/Footer.js +0 -118
- package/dist/components/footer/index.js +0 -6
- package/dist/components/header/headerHome.js +0 -25
- package/dist/components/header/index.js +0 -5
- package/dist/components/icon/Icon.js +0 -33
- package/dist/components/icon/index.js +0 -6
- package/dist/components/index.js +0 -24
- package/dist/components/listItem/index.js +0 -8
- package/dist/components/listItem/listItem.js +0 -50
- package/dist/components/profile/ProfileCard.js +0 -82
- package/dist/components/profile/index.js +0 -10
- package/dist/components/profile/meetProfileCard.js +0 -112
- package/dist/constants/index.js +0 -25
- package/dist/constants/styleSheet.js +0 -256
- package/dist/constants/theme copy.js +0 -214
- package/dist/constants/theme.js +0 -89
- package/dist/constants/themeContext.js +0 -5
- package/dist/form/AutoComplete.js +0 -159
- package/dist/form/DatePicker.js +0 -86
- package/dist/form/ImageUploader.js +0 -181
- package/dist/form/MultiSelect.js +0 -85
- package/dist/form/PasswordInput.js +0 -61
- package/dist/form/Select.js +0 -53
- package/dist/form/TextArea.js +0 -56
- package/dist/form/TextInput.js +0 -38
- package/dist/form/commonFormStyles.js +0 -30
- package/dist/form/index.js +0 -20
- package/dist/index.js +0 -19
- package/dist/types/components/bottomsheet/DefaultSheet.d.ts +0 -10
- package/dist/types/components/bottomsheet/DefaultSheetLong.d.ts +0 -10
- package/dist/types/components/bottomsheet/PostOptionSheet copy.d.ts +0 -0
- package/dist/types/components/bottomsheet/PostOptionSheet.d.ts +0 -8
- package/dist/types/components/bottomsheet/index.d.ts +0 -3
- package/dist/types/components/buttons/Button.d.ts +0 -10
- package/dist/types/components/buttons/PostButton.d.ts +0 -10
- package/dist/types/components/eventCard/Tag.d.ts +0 -8
- package/dist/types/components/eventCard/index.d.ts +0 -3
- package/dist/types/components/eventCard/vsCard/EventCard.d.ts +0 -20
- package/dist/types/components/eventCard/vsCard/Footer.d.ts +0 -10
- package/dist/types/components/eventCard/vsCard/OrganizerContainer.d.ts +0 -8
- package/dist/types/components/footer/Footer copy.d.ts +0 -0
- package/dist/types/components/footer/Footer.d.ts +0 -20
- package/dist/types/components/footer/index.d.ts +0 -1
- package/dist/types/components/header/headerHome.d.ts +0 -8
- package/dist/types/components/header/index.d.ts +0 -1
- package/dist/types/components/icon/Icon.d.ts +0 -15
- package/dist/types/components/icon/index.d.ts +0 -1
- package/dist/types/components/index.d.ts +0 -8
- package/dist/types/components/listItem/index.d.ts +0 -1
- package/dist/types/components/listItem/listItem.d.ts +0 -10
- package/dist/types/components/profile/ProfileCard.d.ts +0 -12
- package/dist/types/components/profile/index.d.ts +0 -2
- package/dist/types/components/profile/meetProfileCard.d.ts +0 -12
- package/dist/types/constants/index.d.ts +0 -3
- package/dist/types/constants/styleSheet.d.ts +0 -309
- package/dist/types/constants/theme copy.d.ts +0 -0
- package/dist/types/constants/theme.d.ts +0 -229
- package/dist/types/constants/themeContext.d.ts +0 -2
- package/dist/types/form/AutoComplete.d.ts +0 -13
- package/dist/types/form/DatePicker.d.ts +0 -14
- package/dist/types/form/ImageUploader.d.ts +0 -14
- package/dist/types/form/MultiSelect.d.ts +0 -18
- package/dist/types/form/PasswordInput.d.ts +0 -10
- package/dist/types/form/Select.d.ts +0 -19
- package/dist/types/form/TextArea.d.ts +0 -17
- package/dist/types/form/TextInput.d.ts +0 -17
- package/dist/types/form/commonFormStyles.d.ts +0 -26
- package/dist/types/form/index.d.ts +0 -8
- package/dist/types/index.d.ts +0 -3
- package/dist/types/utils/formatDate.d.ts +0 -1
- package/dist/types/utils/index.d.ts +0 -2
- package/dist/utils/formatDate.js +0 -15
- package/dist/utils/index.js +0 -5
package/README.md
CHANGED
|
@@ -1,7 +1,82 @@
|
|
|
1
|
-
|
|
1
|
+

|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# getting started
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
```sh
|
|
6
|
+
npx create-expo-app --template expo-template-storybook AwesomeStorybook
|
|
7
|
+
```
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
or
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
yarn create expo-app --template expo-template-storybook AwesomeStorybook
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
# app
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
yarn start
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
# RN Storybook (ondevice)
|
|
22
|
+
|
|
23
|
+
In this template you can now run `yarn storybook` to start ondevice storybook or `yarn start` to start your expo app.
|
|
24
|
+
This works via env variables and expo constants.
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
# either
|
|
28
|
+
yarn storybook
|
|
29
|
+
|
|
30
|
+
# ios
|
|
31
|
+
yarn storybook:ios
|
|
32
|
+
|
|
33
|
+
# android
|
|
34
|
+
yarn storybook:android
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If you add new stories on the native (ondevice version) you either need to have the watcher running or run the stories loader
|
|
38
|
+
|
|
39
|
+
To update the stories one time
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
yarn storybook-generate
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
# Web
|
|
46
|
+
|
|
47
|
+
Start react native web storybook:
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
yarn storybook:web
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
build react native web storybook:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
yarn build-storybook
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Публикация в npm
|
|
60
|
+
|
|
61
|
+
1. **Проверьте метаданные**. Обновите поля `name`, `version`, `description`, `keywords`, `author`, `repository` и `homepage` в `package.json`, чтобы они отражали вашу организацию и назначение пакета.
|
|
62
|
+
2. **Подготовьте содержимое пакета**. В корне проекта уже настроено поле `files`, которое ограничивает набор публикуемых файлов. При необходимости добавьте или удалите пути, чтобы в npm попали только нужные артефакты.
|
|
63
|
+
3. **Соберите и протестируйте**. Запустите важные проверки перед публикацией, например:
|
|
64
|
+
```sh
|
|
65
|
+
npm install
|
|
66
|
+
npm run storybook-generate
|
|
67
|
+
npm run build-storybook
|
|
68
|
+
```
|
|
69
|
+
Убедитесь, что команда `npm pack` создаёт корректный архив.
|
|
70
|
+
4. **Авторизуйтесь в npm**. Выполните вход под своей учётной записью и убедитесь, что у вас есть права на публикацию пакета:
|
|
71
|
+
```sh
|
|
72
|
+
npm login
|
|
73
|
+
```
|
|
74
|
+
5. **Проведите пробную упаковку** (опционально). Запустите dry‑run, чтобы убедиться, что публикуемый состав выглядит корректно:
|
|
75
|
+
```sh
|
|
76
|
+
npm publish --access public --dry-run
|
|
77
|
+
```
|
|
78
|
+
6. **Опубликуйте релиз**. Убедившись, что версия не занята, выполните:
|
|
79
|
+
```sh
|
|
80
|
+
npm publish --access public
|
|
81
|
+
```
|
|
82
|
+
7. **Проверьте публикацию**. После успешной публикации обновите теги в git (`git tag vX.Y.Z && git push --tags`) и убедитесь, что пакет появился на npmjs.com.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Link } from "expo-router";
|
|
2
|
+
import { Text, View } from "react-native";
|
|
3
|
+
|
|
4
|
+
export default function Index() {
|
|
5
|
+
return (
|
|
6
|
+
<View
|
|
7
|
+
style={{
|
|
8
|
+
flex: 1,
|
|
9
|
+
justifyContent: "center",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
}}
|
|
12
|
+
>
|
|
13
|
+
{process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === "true" ? (
|
|
14
|
+
<Link href="/(storybook)">Open Storybook</Link>
|
|
15
|
+
) : (
|
|
16
|
+
<Text>Hello World (storybook disabled)</Text>
|
|
17
|
+
)}
|
|
18
|
+
</View>
|
|
19
|
+
);
|
|
20
|
+
}
|
package/app/_layout.tsx
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Stack } from "expo-router";
|
|
2
|
+
|
|
3
|
+
const StorybookEnabled = process.env.EXPO_PUBLIC_STORYBOOK_ENABLED === "true";
|
|
4
|
+
|
|
5
|
+
export const unstable_settings = {
|
|
6
|
+
initialRouteName: StorybookEnabled ? "(storybook)/index" : "(pages)/index",
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export default function RootLayout() {
|
|
10
|
+
return (
|
|
11
|
+
<Stack screenOptions={{ headerShown: false }}>
|
|
12
|
+
<Stack.Protected guard={StorybookEnabled}>
|
|
13
|
+
<Stack.Screen name="(storybook)/index" />
|
|
14
|
+
</Stack.Protected>
|
|
15
|
+
|
|
16
|
+
<Stack.Screen name="(pages)/index" />
|
|
17
|
+
</Stack>
|
|
18
|
+
);
|
|
19
|
+
}
|
package/app.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "rn-vs-lb",
|
|
3
|
+
"slug": "rn-vs-lb",
|
|
4
|
+
"scheme": "rnvslb",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"orientation": "portrait",
|
|
7
|
+
"icon": "./assets/icon.png",
|
|
8
|
+
"newArchEnabled": true,
|
|
9
|
+
"userInterfaceStyle": "automatic",
|
|
10
|
+
"ios": {
|
|
11
|
+
"supportsTablet": true,
|
|
12
|
+
"infoPlist": {
|
|
13
|
+
"ITSAppUsesNonExemptEncryption": false
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"android": {
|
|
17
|
+
"adaptiveIcon": {
|
|
18
|
+
"foregroundImage": "./assets/adaptive-icon.png",
|
|
19
|
+
"backgroundColor": "#FFFFFF"
|
|
20
|
+
},
|
|
21
|
+
"edgeToEdgeEnabled": true
|
|
22
|
+
},
|
|
23
|
+
"web": {
|
|
24
|
+
"favicon": "./assets/favicon.png",
|
|
25
|
+
"bundler": "metro",
|
|
26
|
+
"output": "single"
|
|
27
|
+
},
|
|
28
|
+
"plugins": [
|
|
29
|
+
"expo-router",
|
|
30
|
+
[
|
|
31
|
+
"expo-splash-screen",
|
|
32
|
+
{
|
|
33
|
+
"image": "./assets/splash-icon.png",
|
|
34
|
+
"imageWidth": 200,
|
|
35
|
+
"resizeMode": "contain",
|
|
36
|
+
"backgroundColor": "#ffffff"
|
|
37
|
+
}
|
|
38
|
+
]
|
|
39
|
+
],
|
|
40
|
+
"experiments": {
|
|
41
|
+
"reactCompiler": true,
|
|
42
|
+
"typedRoutes": true,
|
|
43
|
+
"tsconfigPaths": true
|
|
44
|
+
}
|
|
45
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/assets/icon.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/babel.config.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
module.exports = function (api) {
|
|
2
|
+
api.cache(true);
|
|
3
|
+
return {
|
|
4
|
+
presets: ["babel-preset-expo"],
|
|
5
|
+
plugins: [
|
|
6
|
+
["babel-plugin-react-docgen-typescript", { exclude: "node_modules" }],
|
|
7
|
+
"@babel/plugin-transform-class-static-block",
|
|
8
|
+
"react-native-worklets/plugin",
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// stories/Button/Button.stories.tsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
|
+
import { View } from 'react-native';
|
|
5
|
+
import { MaterialIcons } from '@expo/vector-icons';
|
|
6
|
+
import Button, { MyButtonProps } from './Button';
|
|
7
|
+
|
|
8
|
+
const meta: Meta<MyButtonProps> = {
|
|
9
|
+
title: 'Button/Base',
|
|
10
|
+
component: Button,
|
|
11
|
+
decorators: [
|
|
12
|
+
(Story) => (
|
|
13
|
+
<View style={{ padding: 16 }}>
|
|
14
|
+
<View>
|
|
15
|
+
<Story />
|
|
16
|
+
</View>
|
|
17
|
+
</View>
|
|
18
|
+
),
|
|
19
|
+
],
|
|
20
|
+
parameters: {
|
|
21
|
+
actions: { argTypesRegex: '^on[A-Z].*' },
|
|
22
|
+
},
|
|
23
|
+
argTypes: {
|
|
24
|
+
title: { control: 'text', description: 'Text displayed on the button' },
|
|
25
|
+
type: {
|
|
26
|
+
control: { type: 'select' },
|
|
27
|
+
options: ['primary', 'gray', 'primary-outline', 'gray-outline', 'report-outline'],
|
|
28
|
+
description: 'Visual style of the button',
|
|
29
|
+
},
|
|
30
|
+
loading: { control: 'boolean', description: 'Shows a loading indicator and disables the button' },
|
|
31
|
+
disabled: { control: 'boolean', description: 'Disables the button interaction' },
|
|
32
|
+
iconGap: { control: { type: 'number', min: 0, step: 1 }, description: 'Gap between icon and text' },
|
|
33
|
+
onPress: { action: 'onPress' },
|
|
34
|
+
},
|
|
35
|
+
args: {
|
|
36
|
+
title: 'Press me',
|
|
37
|
+
type: 'primary',
|
|
38
|
+
loading: false,
|
|
39
|
+
disabled: false,
|
|
40
|
+
iconGap: 8,
|
|
41
|
+
},
|
|
42
|
+
} satisfies Meta<typeof Button>;
|
|
43
|
+
|
|
44
|
+
export default meta;
|
|
45
|
+
type S = StoryObj<typeof Button>;
|
|
46
|
+
|
|
47
|
+
/* Базовые */
|
|
48
|
+
export const Primary: S = { args: { title: 'Continue', type: 'primary' } };
|
|
49
|
+
export const Outline: S = { args: { title: 'Learn more', type: 'primary-outline' } };
|
|
50
|
+
export const Gray: S = { args: { title: 'Cancel', type: 'gray' } };
|
|
51
|
+
export const DangerOutline: S = { args: { title: 'Report content', type: 'report-outline' } };
|
|
52
|
+
export const LoadingState: S = { args: { title: 'Submitting...', type: 'primary', loading: true } };
|
|
53
|
+
|
|
54
|
+
/* Варианты с иконками — через render (React-ноды нельзя класть в args) */
|
|
55
|
+
export const WithLeftIcon: S = {
|
|
56
|
+
render: (args) => (
|
|
57
|
+
<Button
|
|
58
|
+
{...args}
|
|
59
|
+
title="Upload"
|
|
60
|
+
type="primary"
|
|
61
|
+
leftIcon={<MaterialIcons name="cloud-upload" size={20} color="#fff" />}
|
|
62
|
+
/>
|
|
63
|
+
),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const WithRightIcon: S = {
|
|
67
|
+
render: (args) => (
|
|
68
|
+
<Button
|
|
69
|
+
{...args}
|
|
70
|
+
title="Next"
|
|
71
|
+
type="primary-outline"
|
|
72
|
+
rightIcon={<MaterialIcons name="arrow-forward" size={20} color="#6f2da8" />}
|
|
73
|
+
/>
|
|
74
|
+
),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export const WithBothIcons: S = {
|
|
78
|
+
render: (args) => (
|
|
79
|
+
<Button
|
|
80
|
+
{...args}
|
|
81
|
+
title="Share"
|
|
82
|
+
type="gray"
|
|
83
|
+
leftIcon={<MaterialIcons name="share" size={20} color="#fff" />}
|
|
84
|
+
rightIcon={<MaterialIcons name="keyboard-arrow-right" size={20} color="#fff" />}
|
|
85
|
+
iconGap={6}
|
|
86
|
+
/>
|
|
87
|
+
),
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/* Только иконка (icon-only) */
|
|
91
|
+
export const IconOnlyPrimary: S = {
|
|
92
|
+
render: (args) => (
|
|
93
|
+
<View style={{ width: 64 }}>
|
|
94
|
+
<Button
|
|
95
|
+
{...args}
|
|
96
|
+
title={undefined}
|
|
97
|
+
type="primary"
|
|
98
|
+
leftIcon={<MaterialIcons name="settings" size={20} color="#fff" />}
|
|
99
|
+
accessibilityLabel="Open settings"
|
|
100
|
+
// title не передаём
|
|
101
|
+
/>
|
|
102
|
+
</View>
|
|
103
|
+
),
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
export const IconOnlyOutline: S = {
|
|
107
|
+
render: (args) => (
|
|
108
|
+
<View style={{ width: 64 }}>
|
|
109
|
+
<Button
|
|
110
|
+
{...args}
|
|
111
|
+
title={undefined}
|
|
112
|
+
type="primary-outline"
|
|
113
|
+
leftIcon={<MaterialIcons name="favorite-border" size={20} color="#6f2da8" />}
|
|
114
|
+
accessibilityLabel="Add to favorites"
|
|
115
|
+
/>
|
|
116
|
+
</View>
|
|
117
|
+
),
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/* Disabled + Icon */
|
|
121
|
+
export const DisabledWithIcon: S = {
|
|
122
|
+
render: (args) => (
|
|
123
|
+
<Button
|
|
124
|
+
{...args}
|
|
125
|
+
title="Download"
|
|
126
|
+
type="gray-outline"
|
|
127
|
+
disabled
|
|
128
|
+
leftIcon={<MaterialIcons name="download" size={20} color="#777" />}
|
|
129
|
+
/>
|
|
130
|
+
),
|
|
131
|
+
};
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
TouchableOpacity,
|
|
4
|
+
Text,
|
|
5
|
+
StyleSheet,
|
|
6
|
+
ViewStyle,
|
|
7
|
+
TextStyle,
|
|
8
|
+
ActivityIndicator,
|
|
9
|
+
TouchableOpacityProps,
|
|
10
|
+
StyleProp,
|
|
11
|
+
View,
|
|
12
|
+
} from 'react-native';
|
|
13
|
+
import { ThemeType, useTheme } from '../../theme';
|
|
14
|
+
|
|
15
|
+
export interface MyButtonProps extends TouchableOpacityProps {
|
|
16
|
+
title?: string; // ← стал необязательным для icon-only
|
|
17
|
+
type?: 'primary' | 'gray' | 'primary-outline' | 'gray-outline' | 'report-outline';
|
|
18
|
+
style?: StyleProp<ViewStyle>;
|
|
19
|
+
textStyle?: StyleProp<TextStyle>;
|
|
20
|
+
loading?: boolean;
|
|
21
|
+
|
|
22
|
+
/** Иконки */
|
|
23
|
+
leftIcon?: React.ReactNode;
|
|
24
|
+
rightIcon?: React.ReactNode;
|
|
25
|
+
/** Отступ между иконкой и текстом */
|
|
26
|
+
iconGap?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const Button: React.FC<MyButtonProps> = ({
|
|
30
|
+
title,
|
|
31
|
+
onPress,
|
|
32
|
+
type = 'primary',
|
|
33
|
+
style,
|
|
34
|
+
textStyle,
|
|
35
|
+
loading = false,
|
|
36
|
+
leftIcon,
|
|
37
|
+
rightIcon,
|
|
38
|
+
iconGap = 8,
|
|
39
|
+
...props
|
|
40
|
+
}) => {
|
|
41
|
+
const { theme } = useTheme();
|
|
42
|
+
const styles = getStyles({ theme });
|
|
43
|
+
|
|
44
|
+
const isIconOnly = !title && (leftIcon || rightIcon);
|
|
45
|
+
|
|
46
|
+
const buttonStyles = [
|
|
47
|
+
styles.button,
|
|
48
|
+
type === 'primary' && styles.primaryButton,
|
|
49
|
+
type === 'gray' && styles.grayButton,
|
|
50
|
+
type === 'primary-outline' && styles.primaryOutlineButton,
|
|
51
|
+
type === 'gray-outline' && styles.grayOutlineButton,
|
|
52
|
+
type === 'report-outline' && styles.reportOutlineButton,
|
|
53
|
+
isIconOnly && styles.iconOnlyButton,
|
|
54
|
+
style,
|
|
55
|
+
(loading || props.disabled) && styles.disabledButton,
|
|
56
|
+
];
|
|
57
|
+
|
|
58
|
+
const textStyles = [
|
|
59
|
+
styles.buttonText,
|
|
60
|
+
type === 'primary' && styles.primaryButtonText,
|
|
61
|
+
type === 'gray' && styles.grayButtonText,
|
|
62
|
+
type === 'primary-outline' && styles.primaryOutlineButtonText,
|
|
63
|
+
type === 'gray-outline' && styles.grayOutlineButtonText,
|
|
64
|
+
type === 'report-outline' && styles.reportOutlineButtonText,
|
|
65
|
+
textStyle,
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<TouchableOpacity
|
|
70
|
+
style={buttonStyles}
|
|
71
|
+
onPress={loading ? undefined : onPress}
|
|
72
|
+
disabled={loading || props.disabled}
|
|
73
|
+
{...props}
|
|
74
|
+
>
|
|
75
|
+
{loading ? (
|
|
76
|
+
<ActivityIndicator color={type.includes('outline') ? theme.primary : theme.white} />
|
|
77
|
+
) : isIconOnly ? (
|
|
78
|
+
// Только иконка
|
|
79
|
+
leftIcon ? <View pointerEvents="none">{leftIcon}</View> : <View pointerEvents="none">{rightIcon}</View>
|
|
80
|
+
) : (
|
|
81
|
+
// Иконка + текст (или просто текст)
|
|
82
|
+
<View style={[styles.contentRow, { columnGap: iconGap }]}>
|
|
83
|
+
{leftIcon ? <View pointerEvents="none">{leftIcon}</View> : null}
|
|
84
|
+
{title ? <Text style={textStyles}>{title}</Text> : null}
|
|
85
|
+
{rightIcon ? <View pointerEvents="none">{rightIcon}</View> : null}
|
|
86
|
+
</View>
|
|
87
|
+
)}
|
|
88
|
+
</TouchableOpacity>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const getStyles = ({ theme }: { theme: ThemeType }) =>
|
|
93
|
+
StyleSheet.create({
|
|
94
|
+
button: {
|
|
95
|
+
minHeight: 50,
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
alignItems: 'center',
|
|
98
|
+
borderRadius: 6,
|
|
99
|
+
paddingHorizontal: 16,
|
|
100
|
+
width: '100%',
|
|
101
|
+
},
|
|
102
|
+
contentRow: {
|
|
103
|
+
flexDirection: 'row',
|
|
104
|
+
alignItems: 'center',
|
|
105
|
+
justifyContent: 'center',
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
// Варианты
|
|
109
|
+
primaryButton: { backgroundColor: theme.primary },
|
|
110
|
+
primaryOutlineButton: {
|
|
111
|
+
backgroundColor: theme.white,
|
|
112
|
+
borderWidth: 1,
|
|
113
|
+
borderColor: theme.primary,
|
|
114
|
+
},
|
|
115
|
+
grayButton: { backgroundColor: theme.backgroundBtn },
|
|
116
|
+
grayOutlineButton: {
|
|
117
|
+
backgroundColor: theme.backgroundBtn,
|
|
118
|
+
borderColor: theme.border,
|
|
119
|
+
borderWidth: 1,
|
|
120
|
+
},
|
|
121
|
+
reportOutlineButton: {
|
|
122
|
+
borderColor: theme.red,
|
|
123
|
+
borderWidth: 1,
|
|
124
|
+
backgroundColor: theme.white,
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
// Текст
|
|
128
|
+
buttonText: { fontSize: 16, fontWeight: '500' },
|
|
129
|
+
primaryButtonText: { color: 'white' },
|
|
130
|
+
primaryOutlineButtonText: { color: theme.primary },
|
|
131
|
+
grayButtonText: { color: theme.greyBtnText },
|
|
132
|
+
grayOutlineButtonText: { color: theme.greyBtnText },
|
|
133
|
+
reportOutlineButtonText: { color: theme.red },
|
|
134
|
+
|
|
135
|
+
// Состояния
|
|
136
|
+
disabledButton: { opacity: 0.7 },
|
|
137
|
+
|
|
138
|
+
// Icon-only
|
|
139
|
+
iconOnlyButton: {
|
|
140
|
+
width: 50,
|
|
141
|
+
minHeight: 50,
|
|
142
|
+
paddingHorizontal: 0,
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
export default Button;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
import { DeleteAccountButton, DeleteAccountButtonProps } from './DeleteAccountButton';
|
|
4
|
+
|
|
5
|
+
const meta: Meta<DeleteAccountButtonProps> = {
|
|
6
|
+
title: 'Button/DeleteAccountButton',
|
|
7
|
+
component: DeleteAccountButton,
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export default meta;
|
|
11
|
+
|
|
12
|
+
const Template: StoryFn<DeleteAccountButtonProps> = (args) => <DeleteAccountButton {...args} />;
|
|
13
|
+
|
|
14
|
+
const createMockDelete = (delay = 800) => async () => {
|
|
15
|
+
await new Promise((resolve) => setTimeout(resolve, delay));
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const Default = Template.bind({});
|
|
19
|
+
Default.args = {
|
|
20
|
+
deleteAccount: createMockDelete(),
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const SlowNetwork = Template.bind({});
|
|
24
|
+
SlowNetwork.args = {
|
|
25
|
+
deleteAccount: createMockDelete(2000),
|
|
26
|
+
};
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import React, { FC, useState } from 'react';
|
|
2
|
+
import { View, Text, Modal, StyleSheet, TouchableOpacity } from 'react-native';
|
|
3
|
+
import Spacer from '../UI/Spacer';
|
|
4
|
+
import Button from './Button';
|
|
5
|
+
import { ThemeType, useTheme } from '../../theme';
|
|
6
|
+
|
|
7
|
+
export type DeleteAccountButtonProps = {
|
|
8
|
+
deleteAccount: () => Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const DeleteAccountButton: FC<DeleteAccountButtonProps> = ({ deleteAccount }) => {
|
|
12
|
+
const [modalVisible, setModalVisible] = useState(false);
|
|
13
|
+
const { theme, typography } = useTheme();
|
|
14
|
+
const styles = getStyles({ theme });
|
|
15
|
+
|
|
16
|
+
const handleDeleteAccount = async () => {
|
|
17
|
+
deleteAccount()
|
|
18
|
+
setModalVisible(false);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<View style={styles.container}>
|
|
23
|
+
<TouchableOpacity style={styles.deleteButton} onPress={() => setModalVisible(true)}>
|
|
24
|
+
<Text style={[typography.titleH6, { color: theme.red }]}>Delete account</Text>
|
|
25
|
+
</TouchableOpacity>
|
|
26
|
+
|
|
27
|
+
<Modal
|
|
28
|
+
transparent
|
|
29
|
+
visible={modalVisible}
|
|
30
|
+
animationType="slide"
|
|
31
|
+
onRequestClose={() => setModalVisible(false)}
|
|
32
|
+
>
|
|
33
|
+
<View style={styles.modalOverlay}>
|
|
34
|
+
<View style={styles.modalContent}>
|
|
35
|
+
<Text style={typography.titleH5}>Confirm Deletion</Text>
|
|
36
|
+
<Spacer size="xxs" />
|
|
37
|
+
<Text style={[typography.body, { textAlign: "center" }]}>
|
|
38
|
+
All your data, including profile, events, and chat history, will be permanently deleted.
|
|
39
|
+
This process is irreversible and will be completed within 24 hours.
|
|
40
|
+
Are you sure you want to proceed?
|
|
41
|
+
</Text>
|
|
42
|
+
<Spacer size="lg" />
|
|
43
|
+
<View style={styles.buttonRow}>
|
|
44
|
+
<Button onPress={() => setModalVisible(false)} style={styles.cancelButton} type="gray-outline" title="Cancel" />
|
|
45
|
+
<Button onPress={handleDeleteAccount} type="report-outline" style={styles.confirmButton} title="Delete" />
|
|
46
|
+
</View>
|
|
47
|
+
</View>
|
|
48
|
+
</View>
|
|
49
|
+
</Modal>
|
|
50
|
+
</View>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const getStyles = ({ theme }: { theme: ThemeType }) =>
|
|
55
|
+
StyleSheet.create({
|
|
56
|
+
container: {
|
|
57
|
+
alignItems: 'center',
|
|
58
|
+
},
|
|
59
|
+
deleteButton: {
|
|
60
|
+
paddingVertical: 6,
|
|
61
|
+
},
|
|
62
|
+
modalOverlay: {
|
|
63
|
+
flex: 1,
|
|
64
|
+
backgroundColor: theme.backgroundSemiTransparent,
|
|
65
|
+
justifyContent: 'center',
|
|
66
|
+
padding: 20,
|
|
67
|
+
},
|
|
68
|
+
modalContent: {
|
|
69
|
+
backgroundColor: theme.white,
|
|
70
|
+
borderRadius: 10,
|
|
71
|
+
padding: 20,
|
|
72
|
+
alignItems: 'center',
|
|
73
|
+
},
|
|
74
|
+
buttonRow: {
|
|
75
|
+
flexDirection: 'row',
|
|
76
|
+
gap: 10,
|
|
77
|
+
},
|
|
78
|
+
confirmButton: {
|
|
79
|
+
width: '50%',
|
|
80
|
+
},
|
|
81
|
+
cancelButton: {
|
|
82
|
+
width: '50%',
|
|
83
|
+
},
|
|
84
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta, StoryFn } from '@storybook/react';
|
|
3
|
+
import PostButton from './PostButton';
|
|
4
|
+
|
|
5
|
+
const meta: Meta = {
|
|
6
|
+
title: 'Button/PostButton',
|
|
7
|
+
component: PostButton,
|
|
8
|
+
argTypes: {
|
|
9
|
+
title: {
|
|
10
|
+
control: 'text',
|
|
11
|
+
defaultValue: 'Create new event',
|
|
12
|
+
},
|
|
13
|
+
onPress: { action: 'press' },
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default meta;
|
|
18
|
+
|
|
19
|
+
const Template: StoryFn<React.ComponentProps<typeof PostButton>> = (args) => <PostButton {...args} />;
|
|
20
|
+
|
|
21
|
+
export const Default = Template.bind({});
|
|
22
|
+
Default.args = {
|
|
23
|
+
title: 'Create post',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const CustomStyling = Template.bind({});
|
|
27
|
+
CustomStyling.args = {
|
|
28
|
+
title: 'Invite a friend',
|
|
29
|
+
buttonStyle: {
|
|
30
|
+
backgroundColor: '#FFE8D6',
|
|
31
|
+
borderRadius: 20,
|
|
32
|
+
},
|
|
33
|
+
textStyle: {
|
|
34
|
+
fontWeight: '700',
|
|
35
|
+
},
|
|
36
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { TouchableOpacity, Text, StyleSheet, ViewStyle, TextStyle } from 'react-native';
|
|
3
|
+
import { MaterialIcons } from '@expo/vector-icons';
|
|
4
|
+
import { ThemeType, useTheme } from '../../theme';
|
|
5
|
+
|
|
6
|
+
interface PostButtonProps {
|
|
7
|
+
title: string;
|
|
8
|
+
onPress: () => void;
|
|
9
|
+
buttonStyle?: ViewStyle;
|
|
10
|
+
textStyle?: TextStyle;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const PostButton: React.FC<PostButtonProps> = ({ title, onPress, buttonStyle, textStyle }) => {
|
|
14
|
+
const { theme } = useTheme();
|
|
15
|
+
const styles = getStyles({ theme });
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<TouchableOpacity style={[styles.button, buttonStyle]} onPress={onPress}>
|
|
19
|
+
<MaterialIcons name="add-circle-outline" size={20} color={theme.primaryLight} />
|
|
20
|
+
<Text style={[styles.buttonText, textStyle]}>{title}</Text>
|
|
21
|
+
</TouchableOpacity>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const getStyles = ({ theme }: { theme: ThemeType }) => StyleSheet.create({
|
|
26
|
+
button: {
|
|
27
|
+
backgroundColor: theme.backgroundThird, // light grey background
|
|
28
|
+
paddingVertical: 13,
|
|
29
|
+
paddingHorizontal: 20,
|
|
30
|
+
borderRadius: 8,
|
|
31
|
+
width: "100%",
|
|
32
|
+
alignItems: 'center',
|
|
33
|
+
display: "flex",
|
|
34
|
+
flexDirection: "row",
|
|
35
|
+
justifyContent: "center",
|
|
36
|
+
},
|
|
37
|
+
buttonText: {
|
|
38
|
+
color: theme.primaryLight,
|
|
39
|
+
fontSize: 16,
|
|
40
|
+
fontWeight: '500',
|
|
41
|
+
marginLeft: 4,
|
|
42
|
+
},
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
export default PostButton;
|