about summary refs log tree commit diff
path: root/src/components/Admonition.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-10-14 21:45:47 +0300
committerGitHub <noreply@github.com>2024-10-14 21:45:47 +0300
commitef5bc5243e4dff6a8e9d01116f1f8a29079e80f8 (patch)
tree07b81ce6487535762752bf38b2b69ad02282bd70 /src/components/Admonition.tsx
parent240535fd8bac133fea312452af5397b69c623dd8 (diff)
downloadvoidsky-ef5bc5243e4dff6a8e9d01116f1f8a29079e80f8.tar.zst
Use admonitions in settings screens (#5741)
Diffstat (limited to 'src/components/Admonition.tsx')
-rw-r--r--src/components/Admonition.tsx13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/components/Admonition.tsx b/src/components/Admonition.tsx
index 7c8682119..140e838e7 100644
--- a/src/components/Admonition.tsx
+++ b/src/components/Admonition.tsx
@@ -1,5 +1,5 @@
 import React from 'react'
-import {View} from 'react-native'
+import {StyleProp, View, ViewStyle} from 'react-native'
 
 import {atoms as a, useBreakpoints, useTheme} from '#/alf'
 import {CircleInfo_Stroke2_Corner0_Rounded as ErrorIcon} from '#/components/icons/CircleInfo'
@@ -70,9 +70,11 @@ export function Row({children}: {children: React.ReactNode}) {
 export function Outer({
   children,
   type = 'info',
+  style,
 }: {
   children: React.ReactNode
   type?: Context['type']
+  style?: StyleProp<ViewStyle>
 }) {
   const t = useTheme()
   const {gtMobile} = useBreakpoints()
@@ -90,9 +92,8 @@ export function Outer({
           a.rounded_sm,
           a.border,
           t.atoms.bg_contrast_25,
-          {
-            borderColor,
-          },
+          {borderColor},
+          style,
         ]}>
         {children}
       </View>
@@ -103,12 +104,14 @@ export function Outer({
 export function Admonition({
   children,
   type,
+  style,
 }: {
   children: TextProps['children']
   type?: Context['type']
+  style?: StyleProp<ViewStyle>
 }) {
   return (
-    <Outer type={type}>
+    <Outer type={type} style={style}>
       <Row>
         <Icon />
         <Text>{children}</Text>