From c3d0cc55d98fb32b25cd2164cfa1c399985e7c84 Mon Sep 17 00:00:00 2001
From: Samuel Newman <mozzius@protonmail.com>
Date: Tue, 15 Oct 2024 21:57:28 +0300
Subject: Edit profile dialog ALF refresh (#5633)

---
 src/components/Dialog/shared.tsx | 61 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 61 insertions(+)
 create mode 100644 src/components/Dialog/shared.tsx

(limited to 'src/components/Dialog/shared.tsx')

diff --git a/src/components/Dialog/shared.tsx b/src/components/Dialog/shared.tsx
new file mode 100644
index 000000000..6f9bc2678
--- /dev/null
+++ b/src/components/Dialog/shared.tsx
@@ -0,0 +1,61 @@
+import React from 'react'
+import {StyleProp, TextStyle, View, ViewStyle} from 'react-native'
+
+import {atoms as a, useTheme, web} from '#/alf'
+import {Text} from '#/components/Typography'
+
+export function Header({
+  renderLeft,
+  renderRight,
+  children,
+  style,
+}: {
+  renderLeft?: () => React.ReactNode
+  renderRight?: () => React.ReactNode
+  children?: React.ReactNode
+  style?: StyleProp<ViewStyle>
+}) {
+  const t = useTheme()
+  return (
+    <View
+      style={[
+        a.relative,
+        a.w_full,
+        a.py_sm,
+        a.flex_row,
+        a.justify_center,
+        a.align_center,
+        {minHeight: 50},
+        a.border_b,
+        t.atoms.border_contrast_medium,
+        t.atoms.bg,
+        web([
+          {borderRadiusTopLeft: a.rounded_md.borderRadius},
+          {borderRadiusTopRight: a.rounded_md.borderRadius},
+        ]),
+        style,
+      ]}>
+      {renderLeft && (
+        <View style={[a.absolute, {left: 6}]}>{renderLeft()}</View>
+      )}
+      {children}
+      {renderRight && (
+        <View style={[a.absolute, {right: 6}]}>{renderRight()}</View>
+      )}
+    </View>
+  )
+}
+
+export function HeaderText({
+  children,
+  style,
+}: {
+  children?: React.ReactNode
+  style?: StyleProp<TextStyle>
+}) {
+  return (
+    <Text style={[a.text_lg, a.text_center, a.font_bold, style]}>
+      {children}
+    </Text>
+  )
+}
-- 
cgit 1.4.1

