diff --git a/apps/mobile/src/components/ActionSheetComponent/index.js b/apps/mobile/src/components/ActionSheetComponent/index.js index 8dfa3b71e..1db25f264 100644 --- a/apps/mobile/src/components/ActionSheetComponent/index.js +++ b/apps/mobile/src/components/ActionSheetComponent/index.js @@ -71,8 +71,6 @@ export const ActionSheetComponent = ({ function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) { let newColors = setColorScheme(colors, accent); - StatusBar.setBarStyle(colors.night ? 'light-content' : 'dark-content'); - dispatch({type: Actions.THEME, colors: newColors}); } diff --git a/apps/mobile/src/components/Button/index.js b/apps/mobile/src/components/Button/index.js index 98295d90c..4646d084d 100644 --- a/apps/mobile/src/components/Button/index.js +++ b/apps/mobile/src/components/Button/index.js @@ -1,9 +1,9 @@ import React from 'react'; -import { ActivityIndicator, StyleSheet, Text } from 'react-native'; +import {ActivityIndicator, StyleSheet, Text} from 'react-native'; import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; -import { useTracked } from '../../provider'; -import { PressableButton } from '../PressableButton'; -import {ph, pv, SIZE, WEIGHT} from "../../utils/SizeUtils"; +import {useTracked} from '../../provider'; +import {PressableButton} from '../PressableButton'; +import {ph, pv, SIZE, WEIGHT} from '../../utils/SizeUtils'; export const Button = ({ height = 40, @@ -14,11 +14,12 @@ export const Button = ({ title = '', icon, color = 'accent', - fontSize=SIZE.sm + fontSize = SIZE.sm, + iconColor = 'white', }) => { const [state, dispatch] = useTracked(); const {colors} = state; - const usedColor = 'accent' ? colors.accent : color; + const usedColor = color === 'accent' ? colors.accent : colors[color]; return ( ) : null} + style={[ + styles.buttonText, + {color: grayed ? colors.icon : colors[iconColor], fontSize: fontSize}, + ]}> {title} diff --git a/apps/mobile/src/components/Container/ContainerBottomButton.js b/apps/mobile/src/components/Container/ContainerBottomButton.js index a34b9bc6c..94e4eff5b 100644 --- a/apps/mobile/src/components/Container/ContainerBottomButton.js +++ b/apps/mobile/src/components/Container/ContainerBottomButton.js @@ -82,7 +82,7 @@ export const ContainerBottomButton = ({title, onPress, color}) => { diff --git a/apps/mobile/src/components/Header/HeaderMenu.js b/apps/mobile/src/components/Header/HeaderMenu.js index 314de2412..dfe58121a 100644 --- a/apps/mobile/src/components/Header/HeaderMenu.js +++ b/apps/mobile/src/components/Header/HeaderMenu.js @@ -24,12 +24,12 @@ export const HeaderMenu = () => { }}> {settings.sort.slice(0, 1).toUpperCase() + settings.sort.slice(1, settings.sort.length)} @@ -40,7 +40,7 @@ export const HeaderMenu = () => { settings.sortOrder === 'asc' ? 'sort-ascending' : 'sort-descending' } style={{ - textAlignVertical: 'bottom', + textAlignVertical:'center', height: 30, }} size={SIZE.md} diff --git a/apps/mobile/src/components/ListPlaceholders/index.js b/apps/mobile/src/components/ListPlaceholders/index.js index 83008a3dc..cc06a4757 100644 --- a/apps/mobile/src/components/ListPlaceholders/index.js +++ b/apps/mobile/src/components/ListPlaceholders/index.js @@ -7,9 +7,10 @@ import { TAG_SVG, FAV_SVG, TRASH_SVG, + SETTINGS_SVG, } from '../../assets/images/assets'; -import { useTracked } from '../../provider'; -export const Placeholder = ({type}) => { +import {useTracked} from '../../provider'; +export const Placeholder = ({type, w, h}) => { const [state, dispatch] = useTracked(); const {colors} = state; const getSVG = () => { @@ -24,14 +25,16 @@ export const Placeholder = ({type}) => { return FAV_SVG(colors.accent); case 'trash': return TRASH_SVG(colors.accent); + case 'settings': + return SETTINGS_SVG(colors.accent); } }; return ( diff --git a/apps/mobile/src/components/Menu/TagsSection.js b/apps/mobile/src/components/Menu/TagsSection.js index 1860b059c..8d1a6dcd7 100644 --- a/apps/mobile/src/components/Menu/TagsSection.js +++ b/apps/mobile/src/components/Menu/TagsSection.js @@ -1,11 +1,11 @@ import React, {useEffect} from 'react'; -import {Text, TouchableOpacity, View} from 'react-native'; +import {Text, View} from 'react-native'; import {useTracked} from '../../provider'; import {Actions} from '../../provider/Actions'; import {eSendEvent} from '../../services/EventManager'; -import {refreshNotesPage} from '../../utils/Events'; import NavigationService from '../../services/Navigation'; -import {opacity, SIZE, WEIGHT} from '../../utils/SizeUtils'; +import {refreshNotesPage} from '../../utils/Events'; +import {SIZE, WEIGHT} from '../../utils/SizeUtils'; import {PressableButton} from '../PressableButton'; export const TagsSection = () => { @@ -33,7 +33,7 @@ export const TagsSection = () => { heading: item.title, }, }); - NavigationService.navigate('Notes', params); + NavigationService.navigate('NotesPage', params); eSendEvent(refreshNotesPage, params); NavigationService.closeDrawer(); }; diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js index 8d926e4c5..eb5ce203e 100644 --- a/apps/mobile/src/components/Menu/index.js +++ b/apps/mobile/src/components/Menu/index.js @@ -25,7 +25,6 @@ export const Menu = ({close = () => {}, hide, noTextMode = false}) => { function changeColorScheme(colors = COLOR_SCHEME, accent = ACCENT) { let newColors = setColorScheme(colors, accent); - StatusBar.setBarStyle(colors.night ? 'light-content' : 'dark-content'); dispatch({type: Actions.THEME, colors: newColors}); } @@ -70,7 +69,7 @@ export const Menu = ({close = () => {}, hide, noTextMode = false}) => { minHeight: '50%', }} showsVerticalScrollIndicator={false}> - + {MenuItemsList.map((item, index) => ( ( { - NavigationService.navigate('Notes', { + NavigationService.navigate('NotesPage', { ...topic, }); }} diff --git a/apps/mobile/src/components/SimpleList/ListHeaderComponent.js b/apps/mobile/src/components/SimpleList/ListHeaderComponent.js new file mode 100644 index 000000000..aeaba2815 --- /dev/null +++ b/apps/mobile/src/components/SimpleList/ListHeaderComponent.js @@ -0,0 +1,100 @@ +import React, {useEffect} from 'react'; +import {Text, View} from 'react-native'; +import {useTracked} from '../../provider'; +import {normalize, SIZE} from '../../utils/SizeUtils'; +import Heading from '../Typography/Heading'; +import {Placeholder} from '../ListPlaceholders'; +import {eScrollEvent} from '../../utils/Events'; +import {eSubscribeEvent, eUnSubscribeEvent} from '../../services/EventManager'; +import Animated from 'react-native-reanimated'; +import {dWidth} from '../../utils'; +import {MessageCard} from './MessageCard'; +import Paragraph from '../Typography/Paragraph'; + +const opacity = new Animated.Value(1); +export const ListHeaderComponent = ({ + type, + data, + messageCard = true, + title, + paragraph, + color +}) => { + const [state] = useTracked(); + const {colors, headerTextState} = state; + + const onScroll = async (y) => { + if (y > 25) { + let o = y / 125; + o = 1 - o; + console.log(o); + opacity.setValue(o); + } else { + opacity.setValue(1); + } + }; + + useEffect(() => { + eSubscribeEvent(eScrollEvent, onScroll); + return () => { + eUnSubscribeEvent(eScrollEvent, onScroll); + }; + }, []); + + return ( + + {messageCard && } + + {/* */} + + + + + + + + {headerTextState.heading.slice(0, 1) === '#' ? '#' : null} + + + {title + ? title + : headerTextState.heading.slice(0, 1) === '#' + ? headerTextState.heading.slice(1) + : headerTextState.heading} + + {paragraph && ( + {'\n' + paragraph} + )} + + + ); +}; diff --git a/apps/mobile/src/components/SimpleList/MessageCard.js b/apps/mobile/src/components/SimpleList/MessageCard.js new file mode 100644 index 000000000..2eb38a472 --- /dev/null +++ b/apps/mobile/src/components/SimpleList/MessageCard.js @@ -0,0 +1,56 @@ +import React from 'react'; +import { Text, TouchableOpacity, View } from 'react-native'; +import Icon from 'react-native-vector-icons/MaterialCommunityIcons'; +import { useTracked } from '../../provider'; +import { COLORS_NOTE } from '../../utils/Colors'; +import { SIZE } from '../../utils/SizeUtils'; + +export const MessageCard = ({data}) => { + const [state] = useTracked(); + const {colors, selectionMode, currentScreen, messageBoardState} = state; + + return ( + + {!messageBoardState.visible || selectionMode ? null : ( + + + + {messageBoardState.actionText} + + + + + + )} + + ); +}; diff --git a/apps/mobile/src/components/SimpleList/index.js b/apps/mobile/src/components/SimpleList/index.js index d74b9d4f6..808b1f27d 100644 --- a/apps/mobile/src/components/SimpleList/index.js +++ b/apps/mobile/src/components/SimpleList/index.js @@ -22,6 +22,11 @@ import {COLORS_NOTE} from '../../utils/Colors'; import {SIZE, WEIGHT} from '../../utils/SizeUtils'; import {db} from '../../utils/DB'; import {HeaderMenu} from '../Header/HeaderMenu'; +import Heading from '../Typography/Heading'; +import {ListHeaderComponent} from './ListHeaderComponent'; +import Paragraph from '../Typography/Paragraph'; +import {Button} from '../Button'; +import Seperator from '../Seperator'; const header = { type: 'MAIN_HEADER', @@ -38,9 +43,10 @@ const SimpleList = ({ sortMenuButton, scrollRef, jumpToDialog, + placeholderData, }) => { const [state, dispatch] = useTracked(); - const {colors, selectionMode, messageBoardState} = state; + const {colors, selectionMode} = state; const searchResults = {...state.searchResults}; const [refreshing, setRefreshing] = useState(false); const [dataProvider, setDataProvider] = useState( @@ -53,7 +59,6 @@ const SimpleList = ({ const listData = data; const dataType = type; const _onScroll = (event) => { - console.log(event.nativeEvent); if (!event) return; let y = event.nativeEvent.contentOffset.y; eSendEvent(eScrollEvent, y); @@ -76,7 +81,7 @@ const SimpleList = ({ width: '100%', justifyContent: 'space-between', paddingHorizontal: 12, - height: 30, + height: 35, }}> { @@ -89,9 +94,8 @@ const SimpleList = ({ styles.sectionHeader, { color: colors.accent, - height: 30, + height: 35, minWidth: 60, - textAlignVertical: 'bottom', }, ]}> {item.title} @@ -146,10 +150,29 @@ const SimpleList = ({ style={[ { backgroundColor: colors.bg, + height: '100%', }, - styles.emptyList, ]}> - <>{placeholder} + + + + {placeholderData.heading} + {placeholderData.paragraph} + + {placeholderData.button &&