feat: update tab bars with blurview
This commit is contained in:
@@ -2,23 +2,35 @@ import React, { useCallback, useRef } from 'react';
|
||||
import { Platform, TextInput, TextInputProps } from 'react-native';
|
||||
import styled, { css } from 'styled-components/native';
|
||||
import useDefaultStyles from './Colors';
|
||||
import { Gap } from './Utility';
|
||||
|
||||
export interface InputProps extends TextInputProps {
|
||||
icon?: React.ReactNode;
|
||||
}
|
||||
|
||||
const Container = styled.Pressable`
|
||||
const Container = styled.Pressable<{ hasIcon?: boolean }>`
|
||||
position: relative;
|
||||
margin: 6px 0;
|
||||
border-radius: 8px;
|
||||
border-radius: 12px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
${Platform.select({
|
||||
ios: css`padding: 12px;`,
|
||||
android: css`padding: 4px 12px;`,
|
||||
})}
|
||||
|
||||
${({ hasIcon }) => hasIcon && css`
|
||||
padding-left: 36px;
|
||||
`}
|
||||
`;
|
||||
|
||||
const IconWrapper = styled.View`
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding-left: 12px;
|
||||
`;
|
||||
|
||||
function Input({ icon = null, style, testID, ...rest }: InputProps) {
|
||||
@@ -28,12 +40,17 @@ function Input({ icon = null, style, testID, ...rest }: InputProps) {
|
||||
const handlePress = useCallback(() => inputRef.current?.focus(), []);
|
||||
|
||||
return (
|
||||
<Container style={[defaultStyles.input, style]} onPress={handlePress} testID={`${testID}-container`} accessible={false}>
|
||||
<Container
|
||||
style={[defaultStyles.input, style]}
|
||||
onPress={handlePress}
|
||||
testID={`${testID}-container`}
|
||||
accessible={false}
|
||||
hasIcon={!!icon}
|
||||
>
|
||||
{icon && (
|
||||
<>
|
||||
<IconWrapper>
|
||||
{icon}
|
||||
<Gap size={8} />
|
||||
</>
|
||||
</IconWrapper>
|
||||
)}
|
||||
<TextInput
|
||||
{...rest}
|
||||
|
||||
@@ -15,7 +15,8 @@ export function Text(props: PropsWithChildren<TextProps>) {
|
||||
export const Header = styled(Text)`
|
||||
margin: 0 0 6px 0;
|
||||
font-size: 28px;
|
||||
font-weight: 400;
|
||||
font-weight: 500;
|
||||
letter-spacing: -0.3px;
|
||||
`;
|
||||
|
||||
export const SubHeader = styled(Text)`
|
||||
|
||||
Reference in New Issue
Block a user