This commit is contained in:
ammarahm-ed
2022-02-28 23:34:47 +05:00
parent 6fd462ad13
commit e1adb1982c
5 changed files with 28 additions and 38 deletions

View File

@@ -5,7 +5,13 @@ import { SIZE } from '../../../utils/size';
import { IconButton } from '../icon-button';
import Paragraph from '../typography/paragraph';
export const Notice = ({ type, text, size }) => {
export interface NoticeProps {
type?: 'alert' | 'information';
text: string;
size?: 'small' | 'large';
}
export const Notice = ({ type = 'alert', text, size = 'large' }: NoticeProps) => {
const colors = useThemeStore(state => state.colors);
const isSmall = size === 'small';
@@ -22,8 +28,8 @@ export const Notice = ({ type, text, size }) => {
size={isSmall ? SIZE.xs + 1 : SIZE.xxl}
name={type}
customStyle={{
width: isSmall ? null : 40,
height: isSmall ? null : 40
width: isSmall ? undefined : 40,
height: isSmall ? undefined : 40
}}
color={type === 'alert' ? colors.errorText : colors.accent}
/>

View File

@@ -2,9 +2,8 @@ import React from 'react';
import { Platform, View } from 'react-native';
import ActionSheet from 'react-native-actions-sheet';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { useThemeStore } from '../../../stores/theme';
import { useSettingStore } from '../../../stores/stores';
import layoutmanager from '../../../utils/layout-manager';
import { useThemeStore } from '../../../stores/theme';
import { PremiumToast } from '../../premium/premium-toast';
import { Toast } from '../../toast';
import { BouncingView } from '../transitions/bouncing-view';
@@ -58,8 +57,6 @@ const SheetWrapper = ({
}
};
console.log('Sheet keyboard handler', sheetKeyboardHandler);
return (
<ActionSheet
ref={fwdRef}

View File

@@ -1,21 +1,15 @@
import React from 'react';
import { Platform } from 'react-native';
import { Platform, TextProps } from 'react-native';
import { Text } from 'react-native';
import { useThemeStore } from '../../../stores/theme';
import { SIZE } from '../../../utils/size';
/**
*
* @typedef {import('react-native').TextProps} TextType
* @typedef {Object} restTypes
* @property {string} color color
* @property {number} size color
*/
/**
*
* @param {TextType | restTypes} props all props
*/
const Heading = ({ color, size = SIZE.xl, style, ...restProps }) => {
interface HeadingProps extends TextProps {
color?: string;
size?: number;
}
const Heading = ({ color, size = SIZE.xl, style, ...restProps }: HeadingProps) => {
const colors = useThemeStore(state => state.colors);
return (
@@ -27,8 +21,8 @@ const Heading = ({ color, size = SIZE.xl, style, ...restProps }) => {
{
fontSize: size || SIZE.xl,
color: color || colors.heading,
fontFamily: Platform.OS === 'android' ? 'OpenSans-SemiBold' : null,
fontWeight: Platform.OS === 'ios' ? '600' : null
fontFamily: Platform.OS === 'android' ? 'OpenSans-SemiBold' : undefined,
fontWeight: Platform.OS === 'ios' ? '600' : undefined
},
style
]}

View File

@@ -1,20 +1,14 @@
import React from 'react';
import { Text } from 'react-native';
import { Text, TextProps } from 'react-native';
import { useThemeStore } from '../../../stores/theme';
import { SIZE } from '../../../utils/size';
/**
*
* @typedef {import('react-native').TextProps} TextType
* @typedef {Object} restTypes
* @property {string} color color
* @property {number} size color
*/
/**
*
* @param {TextType | restTypes} props all props
*/
const Paragraph = ({ color, size = SIZE.sm, style, ...restProps }) => {
interface ParagraphProps extends TextProps {
color?: string;
size?: number;
}
const Paragraph = ({ color, size = SIZE.sm, style, ...restProps }: ParagraphProps) => {
const colors = useThemeStore(state => state.colors);
return (

View File

@@ -1,12 +1,11 @@
import React, { useCallback, useEffect } from 'react';
import { ContainerHeader } from '../../components/container/containerheader';
import { Header } from '../../components/header';
import { Placeholder } from '../../components/ui/svg';
import SelectionHeader from '../../components/selection-header';
import List from '../../components/list';
import { useTagStore } from '../../stores/stores';
import SelectionHeader from '../../components/selection-header';
import Navigation from '../../services/navigation';
import SearchService from '../../services/search';
import { useTagStore } from '../../stores/stores';
import { InteractionManager } from '../../utils';
export const Tags = ({ navigation }) => {