Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

refactor container top section

ammarahm-ed86ae221cc125
diff --git a/apps/mobile/src/components/Container/ContainerTopSection.js b/apps/mobile/src/components/Container/ContainerTopSection.js
new file mode 100644
index 000000000..7a880d460
--- /dev/null
+++ b/apps/mobile/src/components/Container/ContainerTopSection.js
@@ -0,0 +1,27 @@
+import React from 'react';
+import * as Animatable from 'react-native-animatable';
+import {useTracked} from '../../provider';
+import {Header} from '../header';
+import {Search} from '../SearchInput';
+
+export const ContainerTopSection = ({root}) => {
+ const [state, dispatch] = useTracked();
+ const {colors, selectionMode} = state;
+
+ return (
+ <Animatable.View
+ transition="backgroundColor"
+ duration={300}
+ style={{
+ position: selectionMode ? 'relative' : 'absolute',
+ backgroundColor: colors.bg,
+ zIndex: 999,
+ display: selectionMode ? 'none' : 'flex',
+ width: '100%',
+ }}>
+ <Header root={root} />
+
+ <Search root={root} />
+ </Animatable.View>
+ );
+};