Browse Source

FIX | bugs comments

merge-requests/250/merge
Vitalik 3 years ago
parent
commit
2b5f6ac168
  1. 4
      ios/taskme.xcodeproj/project.pbxproj
  2. 9
      src/modules/comments/components/comments-layout.component.tsx
  3. 1
      src/modules/home/atoms/home-groups-block.componen.tsx
  4. 7
      src/modules/root/smart-components/modal-picker.smart-component.tsx
  5. 10
      src/modules/tasks/config/task-card-buttons.config.ts
  6. 8
      src/modules/tasks/hooks/use-task-actions.hook.ts
  7. 2
      src/modules/users/smart-components/select-user-modal/index.tsx
  8. 6
      src/services/domain/tasks.service.ts
  9. 16
      src/services/system/notification.service.ts
  10. 11
      src/shared/components/forms/form-large-control-with-icon.component.tsx
  11. 9
      src/shared/components/forms/form-textarea.component.tsx
  12. 49
      src/shared/components/plugins/chat/chat-bar.component.tsx
  13. 15
      src/shared/themes/dark/chat.ts
  14. 15
      src/shared/themes/dark/shared-components.ts
  15. 12
      src/shared/themes/interfaces/chat.interface.ts
  16. 11
      src/shared/themes/interfaces/shared-components.interface.ts
  17. 15
      src/shared/themes/light/chat.ts
  18. 11
      src/shared/themes/light/shared-components.ts

4
ios/taskme.xcodeproj/project.pbxproj

@ -763,7 +763,7 @@ @@ -763,7 +763,7 @@
CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = HQ3J3TDPR2;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";
@ -801,7 +801,7 @@ @@ -801,7 +801,7 @@
CODE_SIGN_ENTITLEMENTS = taskme/taskme.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 56;
CURRENT_PROJECT_VERSION = 57;
DEVELOPMENT_TEAM = HQ3J3TDPR2;
ENABLE_BITCODE = NO;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "";

9
src/modules/comments/components/comments-layout.component.tsx

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
import { defaultChatBgConfig } from '@/config/default-chat-bg.config'
import { storageService } from '@/services/system/storage.service'
import { ChatBgKeys, ScreenLayout, StorageKey, useTheme } from '@/shared'
import { $size, ChatBgKeys, ScreenLayout, StorageKey, useTheme } from '@/shared'
import { selectCurrentChatBgId } from '@/store/chat-bg'
import React, { FC, useEffect, useState } from 'react'
import {
@ -48,12 +48,12 @@ export const CommentsLayout: FC<IProps> = ({ children, ...props }) => { @@ -48,12 +48,12 @@ export const CommentsLayout: FC<IProps> = ({ children, ...props }) => {
<ScreenLayout
needScroll={false}
horizontalPadding={0}
header={{ ...props }}>
header={{ ...props, style: styles.header }}>
<ImageBackground
style={styles.bg}
source={chanBg}
resizeMode="cover">
<View style={styles.container}>{children}</View>
{children}
</ImageBackground>
</ScreenLayout>
)
@ -81,4 +81,7 @@ const createStyles = theme => @@ -81,4 +81,7 @@ const createStyles = theme =>
position: 'relative',
zIndex: 2,
},
header: {
paddingTop: $size(10, 10),
},
})

1
src/modules/home/atoms/home-groups-block.componen.tsx

@ -18,6 +18,7 @@ export const HomeGroupsBlock: FC<Props> = ({ items }) => { @@ -18,6 +18,7 @@ export const HomeGroupsBlock: FC<Props> = ({ items }) => {
const { navigate } = useNav()
const renderItem = item => {
if (!item || !item.tasksCount) return null
return (
<View key={item.id}>
<InfoRowCard

7
src/modules/root/smart-components/modal-picker.smart-component.tsx

@ -8,6 +8,7 @@ import RBSheet from 'react-native-raw-bottom-sheet' @@ -8,6 +8,7 @@ import RBSheet from 'react-native-raw-bottom-sheet'
import { useTheme } from '@/shared/hooks/use-theme.hook'
import { Picker } from 'react-native-wheel-pick'
import _ from 'lodash'
import { Theme } from '@/shared/themes/interfaces'
interface ISettingsProps {
callback(key: string): void
@ -100,7 +101,7 @@ export const ModalPickerSmartComponent: FC = () => { @@ -100,7 +101,7 @@ export const ModalPickerSmartComponent: FC = () => {
)
}
const createStyles = () =>
const createStyles = (theme: Theme) =>
StyleSheet.create({
wrapper: {
overflow: 'hidden',
@ -111,13 +112,15 @@ const createStyles = () => @@ -111,13 +112,15 @@ const createStyles = () =>
container: {
borderTopRightRadius: 35,
borderTopLeftRadius: 35,
backgroundColor: theme.picker.$bg,
},
picker: {
flex: 1,
width: '100%',
backgroundColor: '#fff',
backgroundColor: theme.picker.$bg,
},
item: {
fontSize: $size(18, 16),
color: theme.picker.$text,
},
})

10
src/modules/tasks/config/task-card-buttons.config.ts

@ -18,7 +18,15 @@ export const getTaskCardButtons = ( @@ -18,7 +18,15 @@ export const getTaskCardButtons = (
bgColor: getTheme().$deleteBtn,
txtColor: getTheme().$deleteText,
iconName: 'bin',
onPress: () => console.log(`Видалити ${id}`),
onPress: () =>
appEvents.emit('openConfirmModal', {
title: 'Видалити задачу?',
buttonToHighlight: 'notAllow',
allowBtnAction: () => {
setTimeout(() => onPress(FullTaskActions.Destroy, {}), 300)
},
notAllowBtnAction: () => {},
}),
}
const result = [
{

8
src/modules/tasks/hooks/use-task-actions.hook.ts

@ -21,6 +21,7 @@ const actionRequests: Partial<Record<FullTaskActions, any>> = { @@ -21,6 +21,7 @@ const actionRequests: Partial<Record<FullTaskActions, any>> = {
[FullTaskActions.Done]: tasksService.markTasksAsDone,
[FullTaskActions.AddFavorite]: tasksService.addTasksToFavorite,
[FullTaskActions.RemoveFavorite]: tasksService.removeTasksFromFavorite,
[FullTaskActions.Destroy]: tasksService.removeTasks,
}
export const useTaskActions = () => {
@ -65,6 +66,7 @@ export const useTaskActions = () => { @@ -65,6 +66,7 @@ export const useTaskActions = () => {
task: ITaskPreview,
payload: ITaskActionPayload = {},
) => {
console.log('action/', action)
const isActionPermitted = checkIsActionPermitted(action, [task])
if (isActionPermitted) {
@ -185,13 +187,13 @@ export const useTaskActions = () => { @@ -185,13 +187,13 @@ export const useTaskActions = () => {
}
const handleDeleteTasks = () => {
const taskIds = getTasksIds().map(id => (`#${id}`))
const taskIds = getTasksIds().map(id => `#${id}`)
appEvents.emit('openConfirmModal', {
title: `Ви впевнені, що хочете видалити задачі: ${taskIds}?`,
buttonToHighlight: 'notAllow',
allowBtnAction: () => deleteTasks(),
notAllowBtnAction: () => { },
notAllowBtnAction: () => {},
})
}
@ -204,7 +206,7 @@ export const useTaskActions = () => { @@ -204,7 +206,7 @@ export const useTaskActions = () => {
await tasksService.removeTasks(getTasksIds())
simpleDispatch(new UnselectAll())
} catch (e) { }
} catch (e) {}
}
return {

2
src/modules/users/smart-components/select-user-modal/index.tsx

@ -132,10 +132,10 @@ export const SelectUserModalSmart = () => { @@ -132,10 +132,10 @@ export const SelectUserModalSmart = () => {
closeOnDragDown={true}
closeOnPressBack={true}
closeOnPressMask={true}
animationType="fade"
onClose={() => {
setModalHeight(screenHeight - $size(250))
}}
openDuration={250}
customStyles={{
container: { ...styles.container, height: modalHeight },
draggableIcon: {

6
src/services/domain/tasks.service.ts

@ -136,9 +136,9 @@ const getUnreadTasksCount = async () => { @@ -136,9 +136,9 @@ const getUnreadTasksCount = async () => {
}
}
const removeTasks = async (ids: number[]) => {
await removeTasksReq(ids)
appEvents.emit('onTaskDeleted', { ids })
const removeTasks = async (payload: any) => {
await removeTasksReq(payload.taskIds)
appEvents.emit('onTaskDeleted', { ids: payload.taskIds })
}
export const tasksService = {

16
src/services/system/notification.service.ts

@ -4,7 +4,7 @@ import { INotification } from '@/shared/interfaces' @@ -4,7 +4,7 @@ import { INotification } from '@/shared/interfaces'
import { NotificationKeys, RouteKey } from '@/shared/enums'
import { SelectChat } from '@/store/chats'
import { simpleDispatch } from '@/store/store-helpers'
import { Platform } from 'react-native'
import { Alert, Platform } from 'react-native'
import OneSignal from 'react-native-onesignal'
import { DeviceInfoService } from './device-info.service'
import { navigate } from './navigation.service'
@ -140,6 +140,10 @@ export const init = async () => { @@ -140,6 +140,10 @@ export const init = async () => {
OneSignal.setNotificationOpenedHandler(onOpened)
} catch (e) {
Alert.alert(
'Error init push notificatio ( test )',
JSON.stringify(e),
)
resolve(null)
console.log(e)
}
@ -151,13 +155,21 @@ export const initAndSaveDevice = async () => { @@ -151,13 +155,21 @@ export const initAndSaveDevice = async () => {
const pushNotificationsDevice: any = await init()
const deviceUuid = DeviceInfoService.getDeviceUniqueId()
// Alert.alert(
// 'pushNotificationsDevice',
// JSON.stringify({ pushNotificationsDevice, deviceUuid }),
// )
if (pushNotificationsDevice) {
await saveUserDeviceReq({
deviceUuid,
notificationUserId: pushNotificationsDevice.userId,
})
}
} catch (e) {}
} catch (e) {
Alert.alert('Error init device', JSON.stringify(e))
}
}
export const notificationService = {

11
src/shared/components/forms/form-large-control-with-icon.component.tsx

@ -48,7 +48,11 @@ export const LargeFormControlWithIcon = (props: IProps) => { @@ -48,7 +48,11 @@ export const LargeFormControlWithIcon = (props: IProps) => {
<Text style={[styles.label]}>{props.label}</Text>
)}
{props.title}
<View style={[styles.inputWrap]}>
<View
style={[
styles.inputWrap,
{ marginBottom: props.error ? $size(6, 3) : 0 },
]}>
{props.beforeIcon && (
<View
style={[
@ -102,13 +106,12 @@ const createStyles = (theme: PartialTheme) => @@ -102,13 +106,12 @@ const createStyles = (theme: PartialTheme) =>
borderRadius: 14,
flexDirection: 'row',
paddingHorizontal: $size(20),
marginBottom: $size(6, 3),
},
input: {
height: $size(56, 50),
height: $size(50, 46),
flex: 1,
fontSize: $size(16, 14),
lineHeight: $size(16, 14),
lineHeight: $size(20, 18),
color: theme.input.$text,
},
icon: {

9
src/shared/components/forms/form-textarea.component.tsx

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import React from 'react'
import React, { useMemo } from 'react'
import { $size } from '@/shared/helpers'
import { useTheme } from '@/shared/hooks/use-theme.hook'
import { PartialTheme } from '@/shared/themes/interfaces'
@ -31,11 +31,14 @@ interface IProps { @@ -31,11 +31,14 @@ interface IProps {
disabled?: boolean
}
const INPUT_ACCESSORIES_VIEW_ID = Math.random().toString()
export const FormTextarea = (props: IProps) => {
const { styles } = useTheme(createStyles)
const INPUT_ACCESSORIES_VIEW_ID = useMemo(
() => Math.random().toString(),
[],
)
return (
<View style={[styles.wrapper, props.wrapStyle]}>
{props.label ? (

49
src/shared/components/plugins/chat/chat-bar.component.tsx

@ -1,7 +1,7 @@ @@ -1,7 +1,7 @@
import { $size } from '@/shared/helpers'
import { useTheme } from '@/shared/hooks'
import { PartialTheme } from '@/shared/themes/interfaces'
import React, { FC } from 'react'
import React, { FC, useMemo } from 'react'
import {
ActivityIndicator,
Platform,
@ -10,7 +10,7 @@ import { @@ -10,7 +10,7 @@ import {
TouchableOpacity,
View,
} from 'react-native'
import { SafeAreaView } from 'react-native-safe-area-context'
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context'
import { IconComponent } from '../../elements'
import { KeyboardSpacer } from '../../tools'
import { ChatSendButton } from './chat-send-button.component'
@ -24,6 +24,12 @@ interface ChatBarProps { @@ -24,6 +24,12 @@ interface ChatBarProps {
export const ChatBar: FC<ChatBarProps> = props => {
const { styles, theme } = useTheme(createStyles)
const insets = useSafeAreaInsets()
const paddingBottom = useMemo(() => {
if (insets.bottom > 15) return insets.bottom
else return 15
}, [insets])
const renderRightPart = () => {
if (props.isSending) {
@ -39,22 +45,23 @@ export const ChatBar: FC<ChatBarProps> = props => { @@ -39,22 +45,23 @@ export const ChatBar: FC<ChatBarProps> = props => {
}
}
return (
<View style={styles.container}>
<SafeAreaView edges={['bottom']}>
<View style={styles.row}>
<TextInput
multiline={true}
placeholder="Повідомлення..."
style={styles.input}
value={props.message}
onChangeText={val => props.onChangeMessage(val)}
/>
{renderRightPart()}
</View>
{Platform.OS === 'ios' ? (
<KeyboardSpacer clearSpace={true} />
) : null}
</SafeAreaView>
<View style={[styles.container, { paddingBottom: paddingBottom }]}>
{/* <SafeAreaView edges={['bottom']}> */}
<View style={styles.row}>
<TextInput
multiline={true}
placeholder="Повідомлення..."
style={styles.input}
value={props.message}
onChangeText={val => props.onChangeMessage(val)}
placeholderTextColor={theme?.$secondaryText}
/>
{renderRightPart()}
</View>
{Platform.OS === 'ios' ? (
<KeyboardSpacer clearSpace={true} />
) : null}
{/* </SafeAreaView> */}
</View>
)
}
@ -72,7 +79,7 @@ const createStyles = (theme: PartialTheme) => @@ -72,7 +79,7 @@ const createStyles = (theme: PartialTheme) =>
fontSize: $size(14, 12),
lineHeight: $size(20),
color: theme?.$secondaryText,
minHeight: 50,
maxHeight: 200,
paddingTop: 15,
paddingLeft: 15,
paddingBottom: 10,
@ -80,9 +87,9 @@ const createStyles = (theme: PartialTheme) => @@ -80,9 +87,9 @@ const createStyles = (theme: PartialTheme) =>
container: {
paddingHorizontal: 20,
paddingTop: 15,
borderTopColor: '#EAEAEA',
borderTopColor: theme?.chats?.bar?.$border,
borderTopWidth: 1,
paddingBottom: 15,
paddingBottom: 0,
},
row: {
flexDirection: 'row',

15
src/shared/themes/dark/chat.ts

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
import { accountColors } from './account';
import { accountColors } from './account'
import { ChatColors } from '../interfaces/chat.interface'
import { colors } from './colors'
@ -6,7 +6,7 @@ export const chatColors: ChatColors = { @@ -6,7 +6,7 @@ export const chatColors: ChatColors = {
chats: {
$elementsBg: colors.$primary,
messageIcon: {
$color: '#9E2843'
$color: '#9E2843',
},
onlineIndicator: {
$bg: '#38B362',
@ -15,7 +15,7 @@ export const chatColors: ChatColors = { @@ -15,7 +15,7 @@ export const chatColors: ChatColors = {
attachmentsMenu: {
$icon: '#FFFFFF',
$iconBg: '#1F1F1F',
$title: '#7F7F7F'
$title: '#7F7F7F',
},
rowCard: {
newMessageIndicator: {
@ -36,7 +36,6 @@ export const chatColors: ChatColors = { @@ -36,7 +36,6 @@ export const chatColors: ChatColors = {
$readBg: '#0D4587',
$readTxt: colors.$textPrimary,
},
},
message: {
$titleName: '#FFFFFF',
@ -45,8 +44,10 @@ export const chatColors: ChatColors = { @@ -45,8 +44,10 @@ export const chatColors: ChatColors = {
$timeMessage: '#FFFFFF',
$ticks: '#DE253B',
$btnSend: '#FFFFFF',
$btnAttach: '#FFFFFF'
}
$btnAttach: '#FFFFFF',
},
bar: {
$border: '#2C2C2C',
},
},
}

15
src/shared/themes/dark/shared-components.ts

@ -64,7 +64,7 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -64,7 +64,7 @@ export const sharedComponentsColors: SharedComponentsColors = {
$icon: colors.$primary,
$iconBg: '#D2D2D2',
$text: colors.$textPrimary,
$textDisabled: '#7F7F7F'
$textDisabled: '#7F7F7F',
},
circleCheckBox: {
@ -79,7 +79,7 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -79,7 +79,7 @@ export const sharedComponentsColors: SharedComponentsColors = {
modal: {
$bg: '#141414',
$title: colors.$textPrimary,
$input: '#000000'
$input: '#000000',
},
ImgWithBgCircle: {
@ -91,7 +91,7 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -91,7 +91,7 @@ export const sharedComponentsColors: SharedComponentsColors = {
},
primaryFooter: {
$bg: '#000000'
$bg: '#000000',
},
calendar: {
@ -110,7 +110,7 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -110,7 +110,7 @@ export const sharedComponentsColors: SharedComponentsColors = {
$primaryBtnTxt: '#fff',
$secondaryBtnBg: '#fff',
$secondaryBtnTxt: '#000000',
$borderColor: '#000000'
$borderColor: '#000000',
},
switch: {
@ -121,7 +121,12 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -121,7 +121,12 @@ export const sharedComponentsColors: SharedComponentsColors = {
},
thumbColor: {
false: '#C6C6C6',
true: '#C6C6C6'
true: '#C6C6C6',
},
},
picker: {
$bg: '#000',
$buttonBg: '#000',
$text: '#fff',
},
}

12
src/shared/themes/interfaces/chat.interface.ts

@ -9,8 +9,8 @@ export interface ChatColors { @@ -9,8 +9,8 @@ export interface ChatColors {
$border: string
}
attachmentsMenu: {
$icon: string,
$iconBg: string,
$icon: string
$iconBg: string
$title: string
}
rowCard: {
@ -32,7 +32,7 @@ export interface ChatColors { @@ -32,7 +32,7 @@ export interface ChatColors {
$readBg: string
$readTxt: string
}
},
}
message: {
$titleName: string
$bgPrimary: string
@ -42,6 +42,8 @@ export interface ChatColors { @@ -42,6 +42,8 @@ export interface ChatColors {
$btnSend: string
$btnAttach: string
}
},
bar: {
$border: string
}
}
}

11
src/shared/themes/interfaces/shared-components.interface.ts

@ -148,6 +148,14 @@ export interface ISwitchColors { @@ -148,6 +148,14 @@ export interface ISwitchColors {
}
}
export interface IPickerColors {
picker: {
$bg: string
$buttonBg: string
$text: string
}
}
export type SharedComponentsColors = ButtonsColors &
InputColors &
IconColors &
@ -161,4 +169,5 @@ export type SharedComponentsColors = ButtonsColors & @@ -161,4 +169,5 @@ export type SharedComponentsColors = ButtonsColors &
PrimaryFooterColors &
ICalendarColors &
ActionsMenuColors &
ISwitchColors
ISwitchColors &
IPickerColors

15
src/shared/themes/light/chat.ts

@ -4,7 +4,7 @@ export const chatColors: ChatColors = { @@ -4,7 +4,7 @@ export const chatColors: ChatColors = {
chats: {
$elementsBg: '#ffffff',
messageIcon: {
$color: '#9E2843'
$color: '#9E2843',
},
onlineIndicator: {
$bg: '#38B362',
@ -13,7 +13,7 @@ export const chatColors: ChatColors = { @@ -13,7 +13,7 @@ export const chatColors: ChatColors = {
attachmentsMenu: {
$icon: '#7F7F7F',
$iconBg: '#FFFFFF',
$title: '#7F7F7F'
$title: '#7F7F7F',
},
rowCard: {
newMessageIndicator: {
@ -34,7 +34,6 @@ export const chatColors: ChatColors = { @@ -34,7 +34,6 @@ export const chatColors: ChatColors = {
$readBg: '#B9C5E4',
$readTxt: '#0D4587',
},
},
message: {
$titleName: '#7F7F7F',
@ -43,10 +42,10 @@ export const chatColors: ChatColors = { @@ -43,10 +42,10 @@ export const chatColors: ChatColors = {
$timeMessage: '#7F7F7F',
$ticks: '#7F7F7F',
$btnSend: '#9F2843',
$btnAttach: '#9F2843'
}
$btnAttach: '#9F2843',
},
bar: {
$border: '#EAEAEA',
},
},
}

11
src/shared/themes/light/shared-components.ts

@ -64,7 +64,7 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -64,7 +64,7 @@ export const sharedComponentsColors: SharedComponentsColors = {
$icon: '#7F7F7F',
$iconBg: '#EAEAEA',
$text: colors.$textPrimary,
$textDisabled: '#7F7F7F'
$textDisabled: '#7F7F7F',
},
circleCheckBox: {
@ -79,7 +79,7 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -79,7 +79,7 @@ export const sharedComponentsColors: SharedComponentsColors = {
modal: {
$bg: '#F8F8F8',
$title: colors.$textPrimary,
$input: '#ffffff'
$input: '#ffffff',
},
ImgWithBgCircle: {
@ -110,7 +110,7 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -110,7 +110,7 @@ export const sharedComponentsColors: SharedComponentsColors = {
$primaryBtnTxt: '#3B3B3B',
$secondaryBtnBg: '#fff',
$secondaryBtnTxt: '#9E2743',
$borderColor: '#EAEAEA'
$borderColor: '#EAEAEA',
},
switch: {
@ -124,4 +124,9 @@ export const sharedComponentsColors: SharedComponentsColors = { @@ -124,4 +124,9 @@ export const sharedComponentsColors: SharedComponentsColors = {
true: '#fff',
},
},
picker: {
$bg: '#fff',
$buttonBg: '#fff',
$text: '#000',
},
}

Loading…
Cancel
Save