@sendbird/uikit-react-native-foundation 1.1.1 → 2.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/{ui → components}/Divider/index.js +0 -0
- package/lib/commonjs/{ui → components}/Divider/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/Icon/index.js +0 -0
- package/lib/commonjs/{ui → components}/Icon/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/Modal/index.js +0 -0
- package/lib/commonjs/{ui → components}/Modal/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/Switch/index.js +0 -0
- package/lib/commonjs/{ui → components}/Switch/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/Text/index.js +0 -0
- package/lib/commonjs/{ui → components}/Text/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/TextInput/index.js +0 -0
- package/lib/commonjs/{ui → components}/TextInput/index.js.map +0 -0
- package/lib/commonjs/{ui → components}/URLParsedText/index.js +0 -0
- package/lib/commonjs/{ui → components}/URLParsedText/index.js.map +0 -0
- package/lib/commonjs/index.js +14 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/ui/ActionMenu/index.js +4 -4
- package/lib/commonjs/ui/ActionMenu/index.js.map +1 -1
- package/lib/commonjs/ui/Alert/index.js +4 -4
- package/lib/commonjs/ui/Alert/index.js.map +1 -1
- package/lib/commonjs/ui/Avatar/AvatarIcon.js +2 -2
- package/lib/commonjs/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/commonjs/ui/Avatar/index.js +2 -2
- package/lib/commonjs/ui/Avatar/index.js.map +1 -1
- package/lib/commonjs/ui/Badge/index.js +2 -2
- package/lib/commonjs/ui/Badge/index.js.map +1 -1
- package/lib/commonjs/ui/BottomSheet/index.js +2 -2
- package/lib/commonjs/ui/BottomSheet/index.js.map +1 -1
- package/lib/commonjs/ui/Button/index.js +4 -4
- package/lib/commonjs/ui/Button/index.js.map +1 -1
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js +2 -2
- package/lib/commonjs/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/commonjs/ui/Dialog/DialogSheet.js +5 -4
- package/lib/commonjs/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/commonjs/ui/GroupChannelPreview/index.js +15 -13
- package/lib/commonjs/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/commonjs/ui/Header/index.js +2 -2
- package/lib/commonjs/ui/Header/index.js.map +1 -1
- package/lib/commonjs/ui/LoadingSpinner/index.js +2 -2
- package/lib/commonjs/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/commonjs/ui/MenuBar/index.js +5 -5
- package/lib/commonjs/ui/MenuBar/index.js.map +1 -1
- package/lib/commonjs/ui/Placeholder/index.js +4 -4
- package/lib/commonjs/ui/Placeholder/index.js.map +1 -1
- package/lib/commonjs/ui/Prompt/index.js +6 -6
- package/lib/commonjs/ui/Prompt/index.js.map +1 -1
- package/lib/commonjs/ui/Toast/index.js +4 -4
- package/lib/commonjs/ui/Toast/index.js.map +1 -1
- package/lib/module/{ui → components}/Divider/index.js +0 -0
- package/lib/module/{ui → components}/Divider/index.js.map +0 -0
- package/lib/module/{ui → components}/Icon/index.js +0 -0
- package/lib/module/{ui → components}/Icon/index.js.map +0 -0
- package/lib/module/{ui → components}/Modal/index.js +0 -0
- package/lib/module/{ui → components}/Modal/index.js.map +0 -0
- package/lib/module/{ui → components}/Switch/index.js +0 -0
- package/lib/module/{ui → components}/Switch/index.js.map +0 -0
- package/lib/module/{ui → components}/Text/index.js +0 -0
- package/lib/module/{ui → components}/Text/index.js.map +0 -0
- package/lib/module/{ui → components}/TextInput/index.js +0 -0
- package/lib/module/{ui → components}/TextInput/index.js.map +0 -0
- package/lib/module/{ui → components}/URLParsedText/index.js +0 -0
- package/lib/module/{ui → components}/URLParsedText/index.js.map +0 -0
- package/lib/module/index.js +7 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/ui/ActionMenu/index.js +2 -2
- package/lib/module/ui/ActionMenu/index.js.map +1 -1
- package/lib/module/ui/Alert/index.js +2 -2
- package/lib/module/ui/Alert/index.js.map +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js +1 -1
- package/lib/module/ui/Avatar/AvatarIcon.js.map +1 -1
- package/lib/module/ui/Avatar/index.js +1 -1
- package/lib/module/ui/Avatar/index.js.map +1 -1
- package/lib/module/ui/Badge/index.js +1 -1
- package/lib/module/ui/Badge/index.js.map +1 -1
- package/lib/module/ui/BottomSheet/index.js +1 -1
- package/lib/module/ui/BottomSheet/index.js.map +1 -1
- package/lib/module/ui/Button/index.js +2 -2
- package/lib/module/ui/Button/index.js.map +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js +1 -1
- package/lib/module/ui/ChannelFrozenBanner/index.js.map +1 -1
- package/lib/module/ui/Dialog/DialogSheet.js +3 -2
- package/lib/module/ui/Dialog/DialogSheet.js.map +1 -1
- package/lib/module/ui/GroupChannelPreview/index.js +13 -11
- package/lib/module/ui/GroupChannelPreview/index.js.map +1 -1
- package/lib/module/ui/Header/index.js +1 -1
- package/lib/module/ui/Header/index.js.map +1 -1
- package/lib/module/ui/LoadingSpinner/index.js +1 -1
- package/lib/module/ui/LoadingSpinner/index.js.map +1 -1
- package/lib/module/ui/MenuBar/index.js +3 -3
- package/lib/module/ui/MenuBar/index.js.map +1 -1
- package/lib/module/ui/Placeholder/index.js +2 -2
- package/lib/module/ui/Placeholder/index.js.map +1 -1
- package/lib/module/ui/Prompt/index.js +3 -3
- package/lib/module/ui/Prompt/index.js.map +1 -1
- package/lib/module/ui/Toast/index.js +2 -2
- package/lib/module/ui/Toast/index.js.map +1 -1
- package/lib/typescript/src/{ui → components}/Divider/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/Icon/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/Modal/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/Switch/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/Text/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/TextInput/index.d.ts +0 -0
- package/lib/typescript/src/{ui → components}/URLParsedText/index.d.ts +0 -0
- package/lib/typescript/src/index.d.ts +7 -7
- package/lib/typescript/src/ui/Avatar/AvatarIcon.d.ts +1 -1
- package/lib/typescript/src/ui/BottomSheet/index.d.ts +1 -1
- package/lib/typescript/src/ui/Button/index.d.ts +1 -1
- package/lib/typescript/src/ui/Dialog/DialogSheet.d.ts +1 -1
- package/lib/typescript/src/ui/GroupChannelPreview/index.d.ts +1 -1
- package/lib/typescript/src/ui/Header/index.d.ts +1 -1
- package/lib/typescript/src/ui/MenuBar/index.d.ts +1 -1
- package/lib/typescript/src/ui/Placeholder/index.d.ts +1 -1
- package/package.json +4 -4
- package/src/{ui → components}/Divider/index.tsx +0 -0
- package/src/{ui → components}/Icon/index.tsx +0 -0
- package/src/{ui → components}/Modal/index.tsx +0 -0
- package/src/{ui → components}/Switch/index.tsx +0 -0
- package/src/{ui → components}/Text/index.tsx +0 -0
- package/src/{ui → components}/TextInput/index.tsx +0 -0
- package/src/{ui → components}/URLParsedText/index.tsx +0 -0
- package/src/index.ts +8 -7
- package/src/ui/ActionMenu/index.tsx +2 -2
- package/src/ui/Alert/index.tsx +2 -2
- package/src/ui/Avatar/AvatarIcon.tsx +1 -1
- package/src/ui/Avatar/index.tsx +1 -1
- package/src/ui/Badge/index.tsx +1 -1
- package/src/ui/BottomSheet/index.tsx +2 -2
- package/src/ui/Button/index.tsx +2 -2
- package/src/ui/ChannelFrozenBanner/index.tsx +1 -1
- package/src/ui/Dialog/DialogSheet.tsx +3 -2
- package/src/ui/GroupChannelPreview/index.tsx +9 -7
- package/src/ui/Header/index.tsx +1 -1
- package/src/ui/LoadingSpinner/index.tsx +1 -1
- package/src/ui/MenuBar/index.tsx +3 -3
- package/src/ui/Placeholder/index.tsx +2 -2
- package/src/ui/Prompt/index.tsx +3 -3
- package/src/ui/Toast/index.tsx +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","View","conditionChaining","
|
|
1
|
+
{"version":3,"names":["React","View","conditionChaining","Icon","Text","createStyleSheet","useUIKitTheme","Button","LoadingSpinner","Placeholder","icon","loading","message","errorRetryLabel","onPressRetry","colors","styles","containerLoading","containerError","container","ui","placeholder","default","none","highlight","content","Boolean","width","height","alignItems","justifyContent"],"sources":["index.tsx"],"sourcesContent":["import React from 'react';\nimport { View } from 'react-native';\n\nimport { conditionChaining } from '@sendbird/uikit-utils';\n\nimport Icon from '../../components/Icon';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Button from '../Button';\nimport LoadingSpinner from '../LoadingSpinner';\n\ntype Props = {\n loading?: boolean;\n\n icon: keyof typeof Icon.Assets;\n message?: string;\n errorRetryLabel?: string;\n onPressRetry?: () => void;\n};\n\nconst Placeholder = ({ icon, loading = false, message = '', errorRetryLabel, onPressRetry }: Props) => {\n const { colors } = useUIKitTheme();\n\n // loading ? styles.containerLoading : errorRetryLabel ? styles.containerError : styles.container\n return (\n <View\n style={conditionChaining(\n [loading, errorRetryLabel],\n [styles.containerLoading, styles.containerError, styles.container],\n )}\n >\n {conditionChaining(\n [loading],\n [\n <LoadingSpinner size={64} color={colors.ui.placeholder.default.none.highlight} />,\n <Icon icon={icon} size={64} color={colors.ui.placeholder.default.none.content} />,\n ],\n )}\n {Boolean(message) && !loading && (\n <Text body3 color={colors.ui.placeholder.default.none.content}>\n {message}\n </Text>\n )}\n {Boolean(errorRetryLabel) && !loading && (\n <Button\n variant={'text'}\n onPress={onPressRetry}\n contentColor={colors.ui.placeholder.default.none.highlight}\n icon={'refresh'}\n >\n {errorRetryLabel}\n </Button>\n )}\n </View>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n width: 200,\n height: 100,\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n containerError: {\n width: 200,\n height: 148,\n alignItems: 'center',\n justifyContent: 'space-between',\n },\n containerLoading: {\n width: 200,\n height: 100,\n alignItems: 'center',\n justifyContent: 'center',\n },\n});\n\nexport default Placeholder;\n"],"mappings":"AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,IAAT,QAAqB,cAArB;AAEA,SAASC,iBAAT,QAAkC,uBAAlC;AAEA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,cAAP,MAA2B,mBAA3B;;AAWA,MAAMC,WAAW,GAAG,QAAmF;EAAA,IAAlF;IAAEC,IAAF;IAAQC,OAAO,GAAG,KAAlB;IAAyBC,OAAO,GAAG,EAAnC;IAAuCC,eAAvC;IAAwDC;EAAxD,CAAkF;EACrG,MAAM;IAAEC;EAAF,IAAaT,aAAa,EAAhC,CADqG,CAGrG;;EACA,oBACE,oBAAC,IAAD;IACE,KAAK,EAAEJ,iBAAiB,CACtB,CAACS,OAAD,EAAUE,eAAV,CADsB,EAEtB,CAACG,MAAM,CAACC,gBAAR,EAA0BD,MAAM,CAACE,cAAjC,EAAiDF,MAAM,CAACG,SAAxD,CAFsB;EAD1B,GAMGjB,iBAAiB,CAChB,CAACS,OAAD,CADgB,EAEhB,cACE,oBAAC,cAAD;IAAgB,IAAI,EAAE,EAAtB;IAA0B,KAAK,EAAEI,MAAM,CAACK,EAAP,CAAUC,WAAV,CAAsBC,OAAtB,CAA8BC,IAA9B,CAAmCC;EAApE,EADF,eAEE,oBAAC,IAAD;IAAM,IAAI,EAAEd,IAAZ;IAAkB,IAAI,EAAE,EAAxB;IAA4B,KAAK,EAAEK,MAAM,CAACK,EAAP,CAAUC,WAAV,CAAsBC,OAAtB,CAA8BC,IAA9B,CAAmCE;EAAtE,EAFF,CAFgB,CANpB,EAaGC,OAAO,CAACd,OAAD,CAAP,IAAoB,CAACD,OAArB,iBACC,oBAAC,IAAD;IAAM,KAAK,MAAX;IAAY,KAAK,EAAEI,MAAM,CAACK,EAAP,CAAUC,WAAV,CAAsBC,OAAtB,CAA8BC,IAA9B,CAAmCE;EAAtD,GACGb,OADH,CAdJ,EAkBGc,OAAO,CAACb,eAAD,CAAP,IAA4B,CAACF,OAA7B,iBACC,oBAAC,MAAD;IACE,OAAO,EAAE,MADX;IAEE,OAAO,EAAEG,YAFX;IAGE,YAAY,EAAEC,MAAM,CAACK,EAAP,CAAUC,WAAV,CAAsBC,OAAtB,CAA8BC,IAA9B,CAAmCC,SAHnD;IAIE,IAAI,EAAE;EAJR,GAMGX,eANH,CAnBJ,CADF;AA+BD,CAnCD;;AAqCA,MAAMG,MAAM,GAAGX,gBAAgB,CAAC;EAC9Bc,SAAS,EAAE;IACTQ,KAAK,EAAE,GADE;IAETC,MAAM,EAAE,GAFC;IAGTC,UAAU,EAAE,QAHH;IAITC,cAAc,EAAE;EAJP,CADmB;EAO9BZ,cAAc,EAAE;IACdS,KAAK,EAAE,GADO;IAEdC,MAAM,EAAE,GAFM;IAGdC,UAAU,EAAE,QAHE;IAIdC,cAAc,EAAE;EAJF,CAPc;EAa9Bb,gBAAgB,EAAE;IAChBU,KAAK,EAAE,GADS;IAEhBC,MAAM,EAAE,GAFQ;IAGhBC,UAAU,EAAE,QAHI;IAIhBC,cAAc,EAAE;EAJA;AAbY,CAAD,CAA/B;AAqBA,eAAerB,WAAf"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React, { useEffect, useRef, useState } from 'react';
|
|
2
2
|
import { Keyboard, Platform, View, useWindowDimensions } from 'react-native';
|
|
3
3
|
import { NOOP } from '@sendbird/uikit-utils';
|
|
4
|
+
import Modal from '../../components/Modal';
|
|
5
|
+
import Text from '../../components/Text';
|
|
6
|
+
import TextInput from '../../components/TextInput';
|
|
4
7
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
8
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
6
9
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
7
10
|
import Button from '../Button';
|
|
8
11
|
import DialogBox from '../Dialog/DialogBox';
|
|
9
|
-
import Modal from '../Modal';
|
|
10
|
-
import Text from '../Text';
|
|
11
|
-
import TextInput from '../TextInput';
|
|
12
12
|
|
|
13
13
|
const Prompt = _ref => {
|
|
14
14
|
let {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","useRef","useState","Keyboard","Platform","View","useWindowDimensions","NOOP","
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","useState","Keyboard","Platform","View","useWindowDimensions","NOOP","Modal","Text","TextInput","createStyleSheet","useHeaderStyle","useUIKitTheme","Button","DialogBox","Prompt","onDismiss","visible","onHide","autoFocus","title","defaultValue","placeholder","onSubmit","onCancel","submitLabel","cancelLabel","statusBarTranslucent","colors","inputRef","width","height","buttons","text","onPress","setText","setTimeout","OS","current","blur","focus","alignItems","justifyContent","styles","container","Boolean","titleContainer","ui","dialog","default","none","flex","inputContainer","paddingHorizontal","paddingVertical","buttonContainer","map","index","button","highlight","dismiss","paddingTop","marginBottom","flexDirection","padding","marginLeft"],"sources":["index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from 'react';\nimport { Keyboard, Platform, TextInput as RNTextInput, View, useWindowDimensions } from 'react-native';\n\nimport { NOOP } from '@sendbird/uikit-utils';\n\nimport Modal from '../../components/Modal';\nimport Text from '../../components/Text';\nimport TextInput from '../../components/TextInput';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useHeaderStyle from '../../styles/useHeaderStyle';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\nimport Button from '../Button';\nimport DialogBox from '../Dialog/DialogBox';\n\nexport type PromptItem = {\n title: string;\n placeholder?: string;\n defaultValue?: string;\n onSubmit?: (text: string) => void;\n submitLabel?: string;\n onCancel?: () => void;\n cancelLabel?: string;\n};\n\ntype Props = {\n visible: boolean;\n onHide: () => void;\n onDismiss?: () => void;\n autoFocus?: boolean;\n} & PromptItem;\nconst Prompt = ({\n onDismiss,\n visible,\n onHide,\n autoFocus = true,\n title,\n defaultValue = '',\n placeholder = 'Enter',\n onSubmit = NOOP,\n onCancel = NOOP,\n submitLabel = 'Submit',\n cancelLabel = 'Cancel',\n}: Props) => {\n const { statusBarTranslucent } = useHeaderStyle();\n const { colors } = useUIKitTheme();\n const inputRef = useRef<RNTextInput>(null);\n const { width, height } = useWindowDimensions();\n\n const buttons = [\n { text: cancelLabel, onPress: onCancel },\n { text: submitLabel, onPress: () => onSubmit(text) },\n ];\n\n const [text, setText] = useState(defaultValue);\n\n // FIXME: autoFocus trick with modal\n // Android\n // - InputProps.autoFocus is not trigger keyboard appearing.\n // - InputRef.focus() is trigger keyboard appearing, but position of keyboard selection is always the start of text.\n // iOS\n // - InputProps.autoFocus is trigger weird UI behavior on landscape mode.\n useEffect(() => {\n if (autoFocus && visible) {\n setTimeout(() => {\n if (Platform.OS === 'android') inputRef.current?.blur();\n inputRef.current?.focus();\n }, 250);\n }\n }, [autoFocus, visible, `${width}-${height}`]);\n\n return (\n <Modal\n enableKeyboardAvoid\n disableBackgroundClose\n onClose={onHide}\n onDismiss={() => {\n setText('');\n onDismiss?.();\n }}\n statusBarTranslucent={statusBarTranslucent}\n visible={visible}\n backgroundStyle={{ alignItems: 'center', justifyContent: 'center' }}\n >\n <DialogBox style={styles.container}>\n {Boolean(title) && (\n <View style={styles.titleContainer}>\n <Text h1 color={colors.ui.dialog.default.none.text} numberOfLines={1} style={{ flex: 1 }}>\n {title}\n </Text>\n </View>\n )}\n\n <View style={styles.inputContainer}>\n <TextInput\n autoFocus={autoFocus && Platform.OS === 'android'}\n ref={inputRef}\n placeholder={placeholder}\n variant={'underline'}\n value={text}\n onChangeText={setText}\n style={{ paddingHorizontal: 0, paddingVertical: 10 }}\n />\n </View>\n\n <View style={styles.buttonContainer}>\n {buttons.map(({ text, onPress }, index) => {\n return (\n <Button\n key={text + index}\n variant={'text'}\n style={styles.button}\n contentColor={colors.ui.dialog.default.none.highlight}\n onPress={() => {\n Keyboard.dismiss();\n try {\n onPress?.();\n } finally {\n onHide();\n }\n }}\n >\n {text}\n </Button>\n );\n })}\n </View>\n </DialogBox>\n </Modal>\n );\n};\n\nconst styles = createStyleSheet({\n container: {\n paddingTop: 8,\n },\n titleContainer: {\n marginBottom: 12,\n paddingVertical: 12,\n paddingHorizontal: 24,\n flexDirection: 'row',\n alignItems: 'center',\n },\n inputContainer: {\n paddingHorizontal: 24,\n marginBottom: 12,\n },\n buttonContainer: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'flex-end',\n padding: 12,\n },\n button: {\n marginLeft: 8,\n },\n});\n\nexport default Prompt;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,SAAhB,EAA2BC,MAA3B,EAAmCC,QAAnC,QAAmD,OAAnD;AACA,SAASC,QAAT,EAAmBC,QAAnB,EAAuDC,IAAvD,EAA6DC,mBAA7D,QAAwF,cAAxF;AAEA,SAASC,IAAT,QAAqB,uBAArB;AAEA,OAAOC,KAAP,MAAkB,wBAAlB;AACA,OAAOC,IAAP,MAAiB,uBAAjB;AACA,OAAOC,SAAP,MAAsB,4BAAtB;AACA,OAAOC,gBAAP,MAA6B,+BAA7B;AACA,OAAOC,cAAP,MAA2B,6BAA3B;AACA,OAAOC,aAAP,MAA0B,2BAA1B;AACA,OAAOC,MAAP,MAAmB,WAAnB;AACA,OAAOC,SAAP,MAAsB,qBAAtB;;AAkBA,MAAMC,MAAM,GAAG,QAYF;EAAA,IAZG;IACdC,SADc;IAEdC,OAFc;IAGdC,MAHc;IAIdC,SAAS,GAAG,IAJE;IAKdC,KALc;IAMdC,YAAY,GAAG,EAND;IAOdC,WAAW,GAAG,OAPA;IAQdC,QAAQ,GAAGjB,IARG;IASdkB,QAAQ,GAAGlB,IATG;IAUdmB,WAAW,GAAG,QAVA;IAWdC,WAAW,GAAG;EAXA,CAYH;EACX,MAAM;IAAEC;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CAFD,SAEU;UACRhB,MAAM;QACP;MACF;IAZH,GAcGe,IAdH,CADF;EAkBD,CAnBA,CADH,CArBF,CAZF,CADF;AA2DD,CAnGD;;AAqGA,MAAMU,MAAM,GAAGjC,gBAAgB,CAAC;EAC9BkC,SAAS,EAAE;IACTiB,UAAU,EAAE;EADH,CADmB;EAI9Bf,cAAc,EAAE;IACdgB,YAAY,EAAE,EADA;IAEdR,eAAe,EAAE,EAFH;IAGdD,iBAAiB,EAAE,EAHL;IAIdU,aAAa,EAAE,KAJD;IAKdtB,UAAU,EAAE;EALE,CAJc;EAW9BW,cAAc,EAAE;IACdC,iBAAiB,EAAE,EADL;IAEdS,YAAY,EAAE;EAFA,CAXc;EAe9BP,eAAe,EAAE;IACfQ,aAAa,EAAE,KADA;IAEftB,UAAU,EAAE,QAFG;IAGfC,cAAc,EAAE,UAHD;IAIfsB,OAAO,EAAE;EAJM,CAfa;EAqB9BN,MAAM,EAAE;IACNO,UAAU,EAAE;EADN;AArBsB,CAAD,CAA/B;AA0BA,eAAelD,MAAf"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
2
|
import { Animated } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
5
|
+
import Text from '../../components/Text';
|
|
4
6
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
7
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
|
-
import Text from '../Text';
|
|
8
8
|
const ToastContext = /*#__PURE__*/createContext(null);
|
|
9
9
|
|
|
10
10
|
const useOpacity = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","Animated","useSafeAreaInsets","
|
|
1
|
+
{"version":3,"names":["React","createContext","useCallback","useContext","useEffect","useMemo","useRef","useState","Animated","useSafeAreaInsets","Icon","Text","createStyleSheet","useUIKitTheme","ToastContext","useOpacity","opacity","Value","current","transition","value","timing","toValue","duration","useNativeDriver","start","show","hide","Toast","visible","type","children","top","bottom","colors","select","palette","color","dark","error300","light","error200","secondary300","secondary200","backgroundColor","styles","toast","icon","onBackgroundReverse01","text","VISIBLE_MS","ToastProvider","dismissTimeout","state","setState","hideTimeout","setTimeout","prev","clearTimeout","toastPosition","useToast","context","Error","position","height","paddingHorizontal","justifyContent","alignItems","alignSelf","borderRadius","flexDirection","marginRight","maxWidth"],"sources":["index.tsx"],"sourcesContent":["import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\nimport { Animated } from 'react-native';\nimport { useSafeAreaInsets } from 'react-native-safe-area-context';\n\nimport Icon from '../../components/Icon';\nimport Text from '../../components/Text';\nimport createStyleSheet from '../../styles/createStyleSheet';\nimport useUIKitTheme from '../../theme/useUIKitTheme';\n\ntype ToastType = 'normal' | 'error' | 'success';\ntype Context = { show(text: string, type?: ToastType): void };\n\nconst ToastContext = createContext<Context | null>(null);\n\ntype Props = React.PropsWithChildren<{\n top?: number;\n bottom?: number;\n visible: boolean;\n type: ToastType;\n children: string;\n}>;\n\nconst useOpacity = () => {\n const opacity = useRef(new Animated.Value(0)).current;\n const transition = useCallback(\n (value: number) => Animated.timing(opacity, { toValue: value, duration: 500, useNativeDriver: true }).start(),\n [],\n );\n return {\n opacity,\n show: () => transition(1),\n hide: () => transition(0),\n };\n};\n\nconst Toast = ({ visible, type, children, top, bottom }: Props) => {\n const { colors, select, palette } = useUIKitTheme();\n const { opacity, show, hide } = useOpacity();\n\n const color = useMemo(() => {\n if (type === 'error') {\n return select({ dark: palette.error300, light: palette.error200 });\n }\n if (type === 'success') {\n return select({ dark: palette.secondary300, light: palette.secondary200 });\n }\n return 'transparent';\n }, [type, select]);\n\n const backgroundColor = useMemo(() => {\n return select({ light: 'rgba(0,0,0,0.64)', dark: 'rgba(255,255,255,0.64)' });\n }, [select]);\n\n useEffect(() => {\n visible ? show() : hide();\n }, [visible]);\n\n return (\n <Animated.View pointerEvents={'none'} style={[styles.toast, { opacity, top, bottom, backgroundColor }]}>\n {type !== 'normal' && (\n <Icon icon={type === 'success' ? 'done' : 'error'} color={color} containerStyle={styles.icon} />\n )}\n <Text color={colors.onBackgroundReverse01} body3 numberOfLines={2} style={styles.text}>\n {children}\n </Text>\n </Animated.View>\n );\n};\n\nconst VISIBLE_MS = 3000;\nexport const ToastProvider = ({\n children,\n dismissTimeout = VISIBLE_MS,\n}: React.PropsWithChildren<{ dismissTimeout?: number }>) => {\n const [state, setState] = useState({ visible: false, type: 'error' as ToastType, text: '' });\n const { bottom } = useSafeAreaInsets();\n\n useEffect(() => {\n if (!state.visible) return;\n\n const hideTimeout = setTimeout(() => {\n setState((prev) => ({ ...prev, visible: false }));\n }, dismissTimeout);\n return () => clearTimeout(hideTimeout);\n });\n\n return (\n <ToastContext.Provider value={{ show: (text, type = 'normal') => text && setState({ text, type, visible: true }) }}>\n {children}\n <Toast type={state.type} visible={state.visible} bottom={bottom + styles.toastPosition.bottom}>\n {state.text}\n </Toast>\n </ToastContext.Provider>\n );\n};\n\nexport const useToast = () => {\n const context = useContext(ToastContext);\n if (!context) throw new Error('ToastContext is not provided, wrap your app with ToastProvider');\n return context;\n};\n\nconst styles = createStyleSheet({\n toast: {\n position: 'absolute',\n height: 48,\n paddingHorizontal: 12,\n justifyContent: 'center',\n alignItems: 'center',\n alignSelf: 'center',\n borderRadius: 24,\n flexDirection: 'row',\n },\n icon: {\n marginRight: 4,\n },\n text: {\n maxWidth: 240,\n paddingHorizontal: 4,\n },\n toastPosition: {\n bottom: 60,\n },\n});\n\nexport default Toast;\n"],"mappings":"AAAA,OAAOA,KAAP,IAAgBC,aAAhB,EAA+BC,WAA/B,EAA4CC,UAA5C,EAAwDC,SAAxD,EAAmEC,OAAnE,EAA4EC,MAA5E,EAAoFC,QAApF,QAAoG,OAApG;AACA,S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B,MAAM,GAAGjC,gBAAgB,CAAC;EAC9BkC,KAAK,EAAE;IACLiB,QAAQ,EAAE,UADL;IAELC,MAAM,EAAE,EAFH;IAGLC,iBAAiB,EAAE,EAHd;IAILC,cAAc,EAAE,QAJX;IAKLC,UAAU,EAAE,QALP;IAMLC,SAAS,EAAE,QANN;IAOLC,YAAY,EAAE,EAPT;IAQLC,aAAa,EAAE;EARV,CADuB;EAW9BvB,IAAI,EAAE;IACJwB,WAAW,EAAE;EADT,CAXwB;EAc9BtB,IAAI,EAAE;IACJuB,QAAQ,EAAE,GADN;IAEJP,iBAAiB,EAAE;EAFf,CAdwB;EAkB9BN,aAAa,EAAE;IACb1B,MAAM,EAAE;EADK;AAlBe,CAAD,CAA/B;AAuBA,eAAeL,KAAf"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
/** Assets **/
|
|
2
2
|
export { default as IconAssets } from './assets/icon';
|
|
3
3
|
/** Component **/
|
|
4
|
+
export { default as Divider } from './components/Divider';
|
|
5
|
+
export { default as Icon } from './components/Icon';
|
|
4
6
|
export { default as Image } from './components/Image';
|
|
7
|
+
export { default as Modal } from './components/Modal';
|
|
8
|
+
export { default as Switch } from './components/Switch';
|
|
9
|
+
export { default as Text } from './components/Text';
|
|
10
|
+
export { default as TextInput } from './components/TextInput';
|
|
11
|
+
export { default as URLParsedText } from './components/URLParsedText';
|
|
5
12
|
/** UI **/
|
|
6
13
|
export { default as ActionMenu, ActionMenuItem } from './ui/ActionMenu';
|
|
7
14
|
export { default as Alert } from './ui/Alert';
|
|
@@ -11,20 +18,13 @@ export { default as BottomSheet, BottomSheetItem } from './ui/BottomSheet';
|
|
|
11
18
|
export { default as Button } from './ui/Button';
|
|
12
19
|
export { default as ChannelFrozenBanner } from './ui/ChannelFrozenBanner';
|
|
13
20
|
export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } from './ui/Dialog';
|
|
14
|
-
export { default as Divider } from './ui/Divider';
|
|
15
21
|
export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
|
|
16
22
|
export { default as Header } from './ui/Header';
|
|
17
|
-
export { default as Icon } from './ui/Icon';
|
|
18
23
|
export { default as LoadingSpinner } from './ui/LoadingSpinner';
|
|
19
24
|
export { default as MenuBar, MenuBarProps } from './ui/MenuBar';
|
|
20
|
-
export { default as Modal } from './ui/Modal';
|
|
21
25
|
export { default as Placeholder } from './ui/Placeholder';
|
|
22
26
|
export { default as Prompt } from './ui/Prompt';
|
|
23
|
-
export { default as Switch } from './ui/Switch';
|
|
24
|
-
export { default as Text } from './ui/Text';
|
|
25
|
-
export { default as TextInput } from './ui/TextInput';
|
|
26
27
|
export { default as Toast, useToast, ToastProvider } from './ui/Toast';
|
|
27
|
-
export { default as URLParsedText } from './ui/URLParsedText';
|
|
28
28
|
/** Styles **/
|
|
29
29
|
export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';
|
|
30
30
|
export { default as createScaleFactor } from './styles/createScaleFactor';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, ViewStyle } from 'react-native';
|
|
3
|
-
import Icon from '
|
|
3
|
+
import Icon from '../../components/Icon';
|
|
4
4
|
declare type Props = React.PropsWithChildren<{
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
6
|
icon?: keyof typeof Icon.Assets;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { TouchableOpacityProps } from 'react-native';
|
|
3
|
+
import { TextProps } from '../../components/Text';
|
|
3
4
|
import type { BaseHeaderProps } from '../../index';
|
|
4
|
-
import { TextProps } from '../Text';
|
|
5
5
|
declare type HeaderElement = string | React.ReactElement | null;
|
|
6
6
|
declare type HeaderProps = BaseHeaderProps<{
|
|
7
7
|
title?: HeaderElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sendbird/uikit-react-native-foundation",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-rc.0",
|
|
4
4
|
"description": "react-native-uikit",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -38,13 +38,13 @@
|
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@sendbird/uikit-utils": "
|
|
41
|
+
"@sendbird/uikit-utils": "2.0.0-rc.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "*",
|
|
45
45
|
"@types/react-native": "*",
|
|
46
46
|
"react": "17.0.2",
|
|
47
|
-
"react-native": "0.
|
|
47
|
+
"react-native": "0.67.4",
|
|
48
48
|
"react-native-builder-bob": "^0.18.0",
|
|
49
49
|
"react-native-fast-image": "^8.5.11",
|
|
50
50
|
"react-native-safe-area-context": "^3.3.2",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"readmeFile": "./README.md",
|
|
81
81
|
"displayName": "@sendbird/uikit-react-native-foundation"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "394d5e3e259086c2226a24406462f119d4af9860"
|
|
84
84
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/index.ts
CHANGED
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
/** Assets **/
|
|
2
2
|
export { default as IconAssets } from './assets/icon';
|
|
3
|
+
|
|
3
4
|
/** Component **/
|
|
5
|
+
export { default as Divider } from './components/Divider';
|
|
6
|
+
export { default as Icon } from './components/Icon';
|
|
4
7
|
export { default as Image } from './components/Image';
|
|
8
|
+
export { default as Modal } from './components/Modal';
|
|
9
|
+
export { default as Switch } from './components/Switch';
|
|
10
|
+
export { default as Text } from './components/Text';
|
|
11
|
+
export { default as TextInput } from './components/TextInput';
|
|
12
|
+
export { default as URLParsedText } from './components/URLParsedText';
|
|
5
13
|
|
|
6
14
|
/** UI **/
|
|
7
15
|
export { default as ActionMenu, ActionMenuItem } from './ui/ActionMenu';
|
|
@@ -12,20 +20,13 @@ export { default as BottomSheet, BottomSheetItem } from './ui/BottomSheet';
|
|
|
12
20
|
export { default as Button } from './ui/Button';
|
|
13
21
|
export { default as ChannelFrozenBanner } from './ui/ChannelFrozenBanner';
|
|
14
22
|
export { DialogProvider, useActionMenu, useAlert, usePrompt, useBottomSheet } from './ui/Dialog';
|
|
15
|
-
export { default as Divider } from './ui/Divider';
|
|
16
23
|
export { default as GroupChannelPreview } from './ui/GroupChannelPreview';
|
|
17
24
|
export { default as Header } from './ui/Header';
|
|
18
|
-
export { default as Icon } from './ui/Icon';
|
|
19
25
|
export { default as LoadingSpinner } from './ui/LoadingSpinner';
|
|
20
26
|
export { default as MenuBar, MenuBarProps } from './ui/MenuBar';
|
|
21
|
-
export { default as Modal } from './ui/Modal';
|
|
22
27
|
export { default as Placeholder } from './ui/Placeholder';
|
|
23
28
|
export { default as Prompt } from './ui/Prompt';
|
|
24
|
-
export { default as Switch } from './ui/Switch';
|
|
25
|
-
export { default as Text } from './ui/Text';
|
|
26
|
-
export { default as TextInput } from './ui/TextInput';
|
|
27
29
|
export { default as Toast, useToast, ToastProvider } from './ui/Toast';
|
|
28
|
-
export { default as URLParsedText } from './ui/URLParsedText';
|
|
29
30
|
|
|
30
31
|
/** Styles **/
|
|
31
32
|
export { default as createSelectByColorScheme } from './styles/createSelectByColorScheme';
|
|
@@ -3,13 +3,13 @@ import { TouchableOpacity, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { Logger } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Modal from '../../components/Modal';
|
|
7
|
+
import Text from '../../components/Text';
|
|
6
8
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
9
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
8
10
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
9
11
|
import DialogBox from '../Dialog/DialogBox';
|
|
10
12
|
import LoadingSpinner from '../LoadingSpinner';
|
|
11
|
-
import Modal from '../Modal';
|
|
12
|
-
import Text from '../Text';
|
|
13
13
|
|
|
14
14
|
export type ActionMenuItem = {
|
|
15
15
|
title?: string;
|
package/src/ui/Alert/index.tsx
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { AlertButton, View } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Modal from '../../components/Modal';
|
|
5
|
+
import Text from '../../components/Text';
|
|
4
6
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
7
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
6
8
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
7
9
|
import Button from '../Button';
|
|
8
10
|
import DialogBox from '../Dialog/DialogBox';
|
|
9
|
-
import Modal from '../Modal';
|
|
10
|
-
import Text from '../Text';
|
|
11
11
|
|
|
12
12
|
export type AlertItem = {
|
|
13
13
|
title?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
4
5
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
6
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
9
|
icon: keyof typeof Icon.Assets;
|
package/src/ui/Avatar/index.tsx
CHANGED
|
@@ -3,10 +3,10 @@ import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Icon from '../../components/Icon';
|
|
6
7
|
import Image from '../../components/Image';
|
|
7
8
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
8
9
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
9
|
-
import Icon from '../Icon';
|
|
10
10
|
import AvatarGroup from './AvatarGroup';
|
|
11
11
|
import AvatarIcon from './AvatarIcon';
|
|
12
12
|
|
package/src/ui/Badge/index.tsx
CHANGED
|
@@ -3,9 +3,9 @@ import { Platform, StyleProp, View, ViewStyle } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { truncatedBadgeCount } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Text from '../../components/Text';
|
|
6
7
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
8
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
8
|
-
import Text from '../Text';
|
|
9
9
|
|
|
10
10
|
type Props = {
|
|
11
11
|
count: number;
|
|
@@ -2,10 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import { TouchableOpacity, useWindowDimensions } from 'react-native';
|
|
3
3
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
4
4
|
|
|
5
|
+
import type Icon from '../../components/Icon';
|
|
6
|
+
import Modal from '../../components/Modal';
|
|
5
7
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
6
8
|
import DialogSheet from '../Dialog/DialogSheet';
|
|
7
|
-
import type Icon from '../Icon';
|
|
8
|
-
import Modal from '../Modal';
|
|
9
9
|
|
|
10
10
|
export type BottomSheetItem = {
|
|
11
11
|
sheetItems: {
|
package/src/ui/Button/index.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Pressable, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
5
|
+
import Text from '../../components/Text';
|
|
4
6
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
7
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
|
-
import Text from '../Text';
|
|
8
8
|
|
|
9
9
|
type Props = React.PropsWithChildren<{
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Text from '../../components/Text';
|
|
4
5
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
6
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Text from '../Text';
|
|
7
7
|
|
|
8
8
|
type Props = {
|
|
9
9
|
style?: StyleProp<ViewStyle>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { StyleProp, View, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
5
|
+
import Text from '../../components/Text';
|
|
4
6
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
5
7
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
6
|
-
import Icon from '../Icon';
|
|
7
|
-
import Text from '../Text';
|
|
8
8
|
|
|
9
9
|
type Props = React.PropsWithChildren<{
|
|
10
10
|
style?: StyleProp<ViewStyle>;
|
|
@@ -64,6 +64,7 @@ const styles = createStyleSheet({
|
|
|
64
64
|
marginLeft: 16,
|
|
65
65
|
},
|
|
66
66
|
sheetItemText: {
|
|
67
|
+
flex: 1,
|
|
67
68
|
marginHorizontal: 24,
|
|
68
69
|
},
|
|
69
70
|
});
|
|
@@ -3,12 +3,12 @@ import { View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Icon from '../../components/Icon';
|
|
6
7
|
import Image from '../../components/Image';
|
|
8
|
+
import Text from '../../components/Text';
|
|
7
9
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
8
10
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
9
11
|
import Badge from '../Badge';
|
|
10
|
-
import Icon from '../Icon';
|
|
11
|
-
import Text from '../Text';
|
|
12
12
|
|
|
13
13
|
type Props = {
|
|
14
14
|
customCover?: React.ReactElement;
|
|
@@ -107,8 +107,8 @@ const GroupChannelPreview = ({
|
|
|
107
107
|
</View>
|
|
108
108
|
<View>{badgeCount > 0 && <Badge count={badgeCount} maxCount={maxBadgeCount} />}</View>
|
|
109
109
|
</View>
|
|
110
|
+
<Separator color={color.default.none.separator} />
|
|
110
111
|
</View>
|
|
111
|
-
<Separator color={color.default.none.separator} />
|
|
112
112
|
</View>
|
|
113
113
|
);
|
|
114
114
|
};
|
|
@@ -121,11 +121,11 @@ const styles = createStyleSheet({
|
|
|
121
121
|
height: 76,
|
|
122
122
|
width: '100%',
|
|
123
123
|
flexDirection: 'row',
|
|
124
|
-
paddingHorizontal: 16,
|
|
125
|
-
paddingTop: 10,
|
|
126
124
|
alignItems: 'center',
|
|
125
|
+
justifyContent: 'center',
|
|
127
126
|
},
|
|
128
127
|
coverContainer: {
|
|
128
|
+
marginLeft: 16,
|
|
129
129
|
marginRight: 16,
|
|
130
130
|
},
|
|
131
131
|
channelCover: {
|
|
@@ -135,6 +135,8 @@ const styles = createStyleSheet({
|
|
|
135
135
|
},
|
|
136
136
|
rightSection: {
|
|
137
137
|
flex: 1,
|
|
138
|
+
paddingTop: 10,
|
|
139
|
+
paddingRight: 16,
|
|
138
140
|
},
|
|
139
141
|
rightTopSection: {
|
|
140
142
|
flexDirection: 'row',
|
|
@@ -198,10 +200,10 @@ const styles = createStyleSheet({
|
|
|
198
200
|
},
|
|
199
201
|
separator: {
|
|
200
202
|
position: 'absolute',
|
|
201
|
-
|
|
203
|
+
left: 0,
|
|
204
|
+
right: -16,
|
|
202
205
|
bottom: 0,
|
|
203
206
|
height: 1,
|
|
204
|
-
width: '84.5%',
|
|
205
207
|
},
|
|
206
208
|
});
|
|
207
209
|
|
package/src/ui/Header/index.tsx
CHANGED
|
@@ -4,11 +4,11 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
|
4
4
|
|
|
5
5
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
6
6
|
|
|
7
|
+
import Text, { TextProps } from '../../components/Text';
|
|
7
8
|
import type { BaseHeaderProps } from '../../index';
|
|
8
9
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
9
10
|
import useHeaderStyle from '../../styles/useHeaderStyle';
|
|
10
11
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
11
|
-
import Text, { TextProps } from '../Text';
|
|
12
12
|
|
|
13
13
|
type HeaderElement = string | React.ReactElement | null;
|
|
14
14
|
type HeaderProps = BaseHeaderProps<
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { Animated, Easing, StyleProp, ViewStyle } from 'react-native';
|
|
3
3
|
|
|
4
|
+
import Icon from '../../components/Icon';
|
|
4
5
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
5
|
-
import Icon from '../Icon';
|
|
6
6
|
|
|
7
7
|
type Props = {
|
|
8
8
|
size?: number;
|
package/src/ui/MenuBar/index.tsx
CHANGED
|
@@ -3,11 +3,11 @@ import { Pressable, View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Divider from '../../components/Divider';
|
|
7
|
+
import Icon from '../../components/Icon';
|
|
8
|
+
import Text from '../../components/Text';
|
|
6
9
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
10
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
8
|
-
import Divider from '../Divider';
|
|
9
|
-
import Icon from '../Icon';
|
|
10
|
-
import Text from '../Text';
|
|
11
11
|
|
|
12
12
|
export type MenuBarProps = {
|
|
13
13
|
variant?: 'default' | 'contained';
|
|
@@ -3,12 +3,12 @@ import { View } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
import { conditionChaining } from '@sendbird/uikit-utils';
|
|
5
5
|
|
|
6
|
+
import Icon from '../../components/Icon';
|
|
7
|
+
import Text from '../../components/Text';
|
|
6
8
|
import createStyleSheet from '../../styles/createStyleSheet';
|
|
7
9
|
import useUIKitTheme from '../../theme/useUIKitTheme';
|
|
8
10
|
import Button from '../Button';
|
|
9
|
-
import Icon from '../Icon';
|
|
10
11
|
import LoadingSpinner from '../LoadingSpinner';
|
|
11
|
-
import Text from '../Text';
|
|
12
12
|
|
|
13
13
|
type Props = {
|
|
14
14
|
loading?: boolean;
|