about summary refs log tree commit diff
path: root/src/components/dms/NewMessagesPill.tsx
diff options
context:
space:
mode:
authorHailey <me@haileyok.com>2024-05-16 10:40:12 -0700
committerGitHub <noreply@github.com>2024-05-16 10:40:12 -0700
commitef0ce951e7c95ce3374a3e49db16f72a344ef779 (patch)
treeb263d7613fce22ad4416dee5cd4ab2cb5b3f1f0c /src/components/dms/NewMessagesPill.tsx
parentb15b49a48f2d8242e31ba5fdde52123fa5e7ff64 (diff)
downloadvoidsky-ef0ce951e7c95ce3374a3e49db16f72a344ef779.tar.zst
[🐴] Only scroll down one "screen" in height when foregrounding (#4027)
* maintain position after foreground

* one possibility

* don't overscroll when content size changes.

* ignore the rule on 1 item

* fix

* [🐴] Pill for additional unreads when coming from background (#4043)

* create a pill with some animatons

* add some basic styles to the pill

* make the animations reusable

* bit better styling

* rm logs

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>

* import

---------

Co-authored-by: Samuel Newman <mozzius@protonmail.com>
Diffstat (limited to 'src/components/dms/NewMessagesPill.tsx')
-rw-r--r--src/components/dms/NewMessagesPill.tsx47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/components/dms/NewMessagesPill.tsx b/src/components/dms/NewMessagesPill.tsx
new file mode 100644
index 000000000..4a0ba22c9
--- /dev/null
+++ b/src/components/dms/NewMessagesPill.tsx
@@ -0,0 +1,47 @@
+import React from 'react'
+import {View} from 'react-native'
+import Animated from 'react-native-reanimated'
+import {Trans} from '@lingui/macro'
+
+import {
+  ScaleAndFadeIn,
+  ScaleAndFadeOut,
+} from 'lib/custom-animations/ScaleAndFade'
+import {atoms as a, useTheme} from '#/alf'
+import {Text} from '#/components/Typography'
+
+export function NewMessagesPill() {
+  const t = useTheme()
+
+  React.useEffect(() => {}, [])
+
+  return (
+    <Animated.View
+      style={[
+        a.py_sm,
+        a.rounded_full,
+        a.shadow_sm,
+        a.border,
+        t.atoms.bg_contrast_50,
+        t.atoms.border_contrast_medium,
+        {
+          position: 'absolute',
+          bottom: 70,
+          width: '40%',
+          left: '30%',
+          alignItems: 'center',
+          shadowOpacity: 0.125,
+          shadowRadius: 12,
+          shadowOffset: {width: 0, height: 5},
+        },
+      ]}
+      entering={ScaleAndFadeIn}
+      exiting={ScaleAndFadeOut}>
+      <View style={{flex: 1}}>
+        <Text style={[a.font_bold]}>
+          <Trans>New messages</Trans>
+        </Text>
+      </View>
+    </Animated.View>
+  )
+}