refactor: convert all title components

This commit is contained in:
RadoslavDimchev 2023-08-08 10:50:32 +03:00
parent 94fbbb6f15
commit f00d26e955
7 changed files with 21 additions and 11 deletions

View File

@ -1,6 +1,6 @@
import { Text } from 'tamagui'
type TextElement = {
export type TextElement = {
text: string
bold?: boolean
italic?: boolean

View File

@ -5,6 +5,7 @@ export type IconProps = {
width?: number
height?: number
style?: unknown
className?: string
}
const Icon = ({ source, width = 16, height = 16, ...props }: IconProps) => {

View File

@ -2,9 +2,12 @@ import Icon from './Icon'
import ReactButton from './ReactButton'
type IconButtonProps = {
icon: string
children: string
onClick: () => void
icon: string
style?: unknown
size?: string
fontSize?: string
onClick?: () => void
}
const IconButton = ({ icon, children, ...props }: IconButtonProps) => {

View File

@ -6,7 +6,7 @@ type ReactButtonProps = {
style?: unknown
icon?: ReactNode
size?: string
onClick: () => void
onClick?: () => void
}
const ReactButton = ({ children, ...props }: ReactButtonProps) => {

View File

@ -1,9 +1,14 @@
import { XStack, YStack } from 'tamagui'
import { SubTitle } from './SubTitle'
import { Title } from './Title'
import { IconButton } from './IconButton'
import Title from './Title'
import SubTitle from './SubTitle'
import IconButton from './IconButton'
const Titles = ({ title, subtitle }) => {
type TitlesProps = {
title: string
subtitle: string
}
const Titles = ({ title, subtitle }: TitlesProps) => {
return (
<YStack>
<XStack justifyContent="space-between">
@ -12,13 +17,14 @@ const Titles = ({ title, subtitle }) => {
style={{
backgroundColor: 'transparent',
border: '1px solid #DCE0E5',
color: '#09101C',
}}
color={'#09101C'}
size={'$3'}
icon={'/icons/reveal.png'}
text={'Advanced Settings'}
fontSize={'$5'}
/>
>
Advanced Settings
</IconButton>
</XStack>
<SubTitle color={'#09101C'}>{subtitle}</SubTitle>
</YStack>