diff --git a/apps/mobile/src/components/Menu/index.js b/apps/mobile/src/components/Menu/index.js index f29e138e0..8254a4869 100644 --- a/apps/mobile/src/components/Menu/index.js +++ b/apps/mobile/src/components/Menu/index.js @@ -31,6 +31,7 @@ import Icon from 'react-native-vector-icons/Feather'; import {getElevation, w, h, Toast} from '../../utils/utils'; import AsyncStorage from '@react-native-community/async-storage'; import {useForceUpdate} from '../../views/ListsEditor'; +import {AnimatedSafeAreaView} from '../../views/Home'; export const Menu = ({close = () => {}, hide, update = () => {}}) => { const [colors, setColors] = useState(COLOR_SCHEME); @@ -48,25 +49,24 @@ export const Menu = ({close = () => {}, hide, update = () => {}}) => { }, []); return ( - {}, hide, update = () => {}}) => { {}, hide, update = () => {}}) => { {}, hide, update = () => {}}) => { width: '100%', justifyContent: 'center', alignItems: 'center', - borderColor: colors.accent, + backgroundColor: colors.accent, - borderWidth: 1, }}> {}, hide, update = () => {}}) => { */} - + ); }; diff --git a/apps/mobile/src/components/Recents/index.js b/apps/mobile/src/components/Recents/index.js index 9c3bd74e3..912d4f81d 100644 --- a/apps/mobile/src/components/Recents/index.js +++ b/apps/mobile/src/components/Recents/index.js @@ -65,7 +65,6 @@ export const RecentList = ({update, onScroll, margin}) => { style={{ height: '100%', width: '100%', - backgroundColor: colors.bg, }} ListHeaderComponent={ { borderRadius: br, borderWidth: props.hide ? 0 : 1.5, paddingHorizontal: ph, - backgroundColor: colors.bg, + paddingVertical: props.hide ? 0 : Platform.OS == 'ios' diff --git a/apps/mobile/src/components/header/index.js b/apps/mobile/src/components/header/index.js index 2a956d1ce..34dc52b8c 100644 --- a/apps/mobile/src/components/header/index.js +++ b/apps/mobile/src/components/header/index.js @@ -20,8 +20,8 @@ export const Header = ({ sendHeight(e.nativeEvent.layout.height); } }} - transition="height" - duration={300} + transition={['height', 'marginBottom']} + duration={250} style={{ height: hide ? 50 : 50, flexDirection: 'row', @@ -30,7 +30,11 @@ export const Header = ({ alignItems: 'center', paddingHorizontal: Platform.isPad ? '2.5%' : '5%', paddingTop: Platform.OS == 'ios' ? h * 0.02 : h * 0.06, - marginBottom: h * 0.06, + marginBottom: hide + ? h * 0.03 + : Platform.OS == 'ios' + ? h * 0.04 + : h * 0.04, }}> { // STATE const [colors, setColors] = useState(COLOR_SCHEME); const [keyboardHeight, setKeyboardHeight] = useState(0); const [dialog, setDialog] = useState(false); + const [resize, setResize] = useState(false); // VARIABLES let updateInterval = null; @@ -53,7 +58,6 @@ const Editor = ({navigation}) => { let EditorWebView = createRef(); const _textRender = createRef(); - const titleRef = createRef(); // FUNCTIONS @@ -86,10 +90,6 @@ const Editor = ({navigation}) => { } }; - useEffect(() => { - titleRef.current.focus(); - }, []); - const _renderEditor = () => { return ( { alignSelf: 'center', marginTop: Platform.OS == 'ios' ? h * 0.01 : h * 0.04, }}> - { + setDialog(true); }} - name="chevron-left" - color={colors.icon} - size={SIZE.xxl} - /> + transition={['width', 'height']} + duration={250} + style={{ + width: resize ? 35 : 40, + height: resize ? 35 : 40, + }}> + + - { title = value; + if (title.length > 12) { + setResize(true); + } else if (title.length < 12) { + setResize(false); + } }} onSubmitEditing={async () => await saveNote()} /> - + width: resize ? 35 : 40, + height: resize ? 35 : 40, + }}> + + { const [loading, setLoading] = useState(true); const [colors, setColors] = useState(COLOR_SCHEME); @@ -43,7 +48,7 @@ export const Home = ({navigation}) => { const [buttonHide, setButtonHide] = useState(false); const forceUpdate = useForceUpdate(); let offsetY = 0; - let countUp = 0; + let countUp = 1; let countDown = 0; let headerHeight = 0; let searchHeight = 0; @@ -157,25 +162,28 @@ export const Home = ({navigation}) => { ) : ( - { setUpdate(update + 1); }} /> - @@ -211,7 +219,7 @@ export const Home = ({navigation}) => { clearSearch={clearSearch} value={text} /> - + {hidden ? ( { { if (buttonHide) return; - if (y < 30) setHideHeader(false); + if (y < 30) { + setHideHeader(false); + countDown = 0; + countUp = 1; + } + if (y > offsetY) { - if (y - offsetY < 150 || countDown > 0) return; + if (y - offsetY < 100 || countDown > 0) return; countDown = 1; countUp = 0; setHideHeader(true); + offsetY = y; + console.log(y, offsetY, 'down'); } else { - if (offsetY - y < 150 || countUp > 0) return; + if (offsetY - y < 100 || countUp > 0) return; countDown = 0; countUp = 1; setHideHeader(false); + offsetY = y; + console.log(y, offsetY, 'up'); } offsetY = y; + console.log(offsetY); }} margin={margin} update={update} @@ -294,7 +312,7 @@ export const Home = ({navigation}) => { )} - + ); };