about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAnsh <anshnanda10@gmail.com>2023-06-01 08:40:26 -0700
committerGitHub <noreply@github.com>2023-06-01 10:40:26 -0500
commit54e5e30945fc727d48594eb7d8cdb6fb9c56eac7 (patch)
treebd16969042ec31dd102bd31d2525148a69748397 /src
parent49840f3a2739ea0c6134f1801dd843ec4771bccb (diff)
downloadvoidsky-54e5e30945fc727d48594eb7d8cdb6fb9c56eac7.tar.zst
[APP-674] Fix search results tab bar (#822)
* fix search results tab bar

* Fix spacing on web

---------

Co-authored-by: Paul Frazee <pfrazee@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/view/com/search/SearchResults.tsx29
1 files changed, 25 insertions, 4 deletions
diff --git a/src/view/com/search/SearchResults.tsx b/src/view/com/search/SearchResults.tsx
index ca6a0dba2..74d6e2ef0 100644
--- a/src/view/com/search/SearchResults.tsx
+++ b/src/view/com/search/SearchResults.tsx
@@ -14,6 +14,7 @@ import {
 import {Text} from 'view/com/util/text/Text'
 import {usePalette} from 'lib/hooks/usePalette'
 import {s} from 'lib/styles'
+import {isDesktopWeb} from 'platform/detection'
 
 const SECTIONS = ['Posts', 'Users']
 
@@ -24,7 +25,12 @@ export const SearchResults = observer(({model}: {model: SearchUIModel}) => {
     (props: RenderTabBarFnProps) => {
       return (
         <CenteredView style={[pal.border, styles.tabBar]}>
-          <TabBar {...props} items={SECTIONS} />
+          <TabBar
+            items={SECTIONS}
+            {...props}
+            key={SECTIONS.join()}
+            indicatorColor={pal.colors.link}
+          />
         </CenteredView>
       )
     },
@@ -33,8 +39,12 @@ export const SearchResults = observer(({model}: {model: SearchUIModel}) => {
 
   return (
     <Pager renderTabBar={renderTabBar} tabBarPosition="top" initialPage={0}>
-      <PostResults key="0" model={model} />
-      <Profiles key="1" model={model} />
+      <View style={[styles.results]}>
+        <PostResults key="0" model={model} />
+      </View>
+      <View style={[styles.results]}>
+        <Profiles key="1" model={model} />
+      </View>
     </Pager>
   )
 })
@@ -60,7 +70,7 @@ const PostResults = observer(({model}: {model: SearchUIModel}) => {
   }
 
   return (
-    <ScrollView style={pal.view}>
+    <ScrollView style={[pal.view]}>
       {model.posts.map(post => (
         <Post
           key={post.resolvedUri}
@@ -111,9 +121,20 @@ const Profiles = observer(({model}: {model: SearchUIModel}) => {
 const styles = StyleSheet.create({
   tabBar: {
     borderBottomWidth: 1,
+    position: 'absolute',
+    zIndex: 1,
+    left: 0,
+    right: 0,
+    top: 0,
+    flexDirection: 'column',
+    alignItems: 'center',
+    backgroundColor: 'white',
   },
   empty: {
     paddingHorizontal: 14,
     paddingVertical: 16,
   },
+  results: {
+    paddingTop: isDesktopWeb ? 50 : 42,
+  },
 })