Merge pull request #39 from status-im/rd.remove-not-used-components

fix: remove not used components
This commit is contained in:
Radoslav Dimchev 2023-08-11 12:24:42 +03:00 committed by GitHub
commit cdbd4416bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 71 additions and 157 deletions

View File

@ -1,7 +1,7 @@
import StandartLineChart from './StandardLineChart' import StandartLineChart from './StandardLineChart'
import ShadowBox from './ShadowBox'
import IconText from './IconText' import IconText from './IconText'
import { Paragraph, Separator, XStack, YStack } from 'tamagui' import { Paragraph, Separator, XStack, YStack } from 'tamagui'
import { Shadow } from '@status-im/components'
type DataPoint = { type DataPoint = {
x: number x: number
@ -34,7 +34,7 @@ const DeviceCPULoad: React.FC<DeviceCPULoadProps> = ({ load }) => {
const message = currentLoad < 80 ? 'Good' : 'Poor' const message = currentLoad < 80 ? 'Good' : 'Poor'
return ( return (
<ShadowBox boxStyle={{ width: '284px', height: '136px' }}> <Shadow style={{ width: '284px', height: '136px', borderRadius: '16px' }}>
<YStack> <YStack>
<XStack <XStack
justifyContent="space-between" justifyContent="space-between"
@ -63,7 +63,7 @@ const DeviceCPULoad: React.FC<DeviceCPULoadProps> = ({ load }) => {
{/* <Text color={'#E95460'}>This is additional text</Text> */} {/* <Text color={'#E95460'}>This is additional text</Text> */}
</XStack> </XStack>
</YStack> </YStack>
</ShadowBox> </Shadow>
) )
} }

View File

@ -1,7 +1,7 @@
import ShadowBox from './ShadowBox'
import IconText from './IconText' import IconText from './IconText'
import { Paragraph, Separator, XStack, YStack } from 'tamagui' import { Paragraph, Separator, XStack, YStack } from 'tamagui'
import StandardGauge from './StandardGauge' import StandardGauge from './StandardGauge'
import { Shadow } from '@status-im/components'
interface DeviceStorageHealthProps { interface DeviceStorageHealthProps {
storage: number storage: number
maxStorage: number maxStorage: number
@ -28,7 +28,7 @@ const DeviceStorageHealth: React.FC<DeviceStorageHealthProps> = ({ storage, maxS
] ]
} }
return ( return (
<ShadowBox boxStyle={{ width: '284px', height: '136px' }}> <Shadow style={{ width: '284px', height: '136px', borderRadius: '16px' }}>
<YStack> <YStack>
<XStack <XStack
justifyContent="space-between" justifyContent="space-between"
@ -64,7 +64,7 @@ const DeviceStorageHealth: React.FC<DeviceStorageHealthProps> = ({ storage, maxS
{/* <Text color={'#E95460'}>This is additional text</Text> */} {/* <Text color={'#E95460'}>This is additional text</Text> */}
</XStack> </XStack>
</YStack> </YStack>
</ShadowBox> </Shadow>
) )
} }

View File

@ -1,35 +1,27 @@
import { Text } from 'tamagui' import { Text } from '@status-im/components'
export type TextElement = { export type TextElement = {
text: string text: string
bold?: boolean bold?: boolean
italic?: boolean italic?: boolean
weight?: 'regular' | 'medium' | 'semibold'
} }
type FormattedTextProps = { type FormattedTextProps = {
textElements: TextElement[] textElements: TextElement[]
color?: string color?: string
fontSize?: string size: 27 | 19 | 15 | 13 | 11
}
const FormattedText = ({ textElements, color, fontSize }: FormattedTextProps) => {
const calculateStyle = (textElement: TextElement) => {
const isBold = textElement.bold ?? false
const isItalic = textElement.italic ?? false
return { fontWeight: isBold ? 'bold' : '', fontStyle: isItalic ? 'italic' : '' }
} }
const FormattedText = ({ textElements, color, size }: FormattedTextProps) => {
return ( return (
<Text color={color} fontSize={fontSize}> <>
{textElements.map((textElement, index) => { {textElements.map((textElement, index) => (
return ( <Text key={index} size={size} color={color} weight={textElement.weight}>
<span style={calculateStyle(textElement)} key={index}>
{textElement.text} {textElement.text}
</span>
)
})}
</Text> </Text>
))}
</>
) )
} }

View File

@ -1,14 +1,13 @@
import { Image } from 'tamagui' import { Image } from '@status-im/components'
export type IconProps = { export type IconProps = {
source: string src: string
width?: number width?: number
height?: number height?: number
className?: string
} }
const Icon = ({ source, width = 16, height = 16, ...props }: IconProps) => { const Icon = ({ src, width = 16, height = 16 }: IconProps) => {
return <Image {...props} source={{ uri: source }} width={width} height={height} /> return <Image src={src} source={{ uri: src }} width={width} height={height} />
} }
export default Icon export default Icon

View File

@ -1,21 +0,0 @@
import Icon from './Icon'
import ReactButton from './ReactButton'
type IconButtonProps = {
children: string
icon: string
style?: unknown
size?: string
fontSize?: string
onClick?: () => void
}
const IconButton = ({ icon, children, ...props }: IconButtonProps) => {
return (
<ReactButton {...props} icon={<Icon source={icon} />}>
{children}
</ReactButton>
)
}
export default IconButton

View File

@ -1,12 +1,13 @@
import { Paragraph, XStack } from 'tamagui' import { XStack } from 'tamagui'
import Icon from './Icon' import Icon from './Icon'
import { Text } from '@status-im/components'
type IconTextProps = { type IconTextProps = {
icon: string icon: string
children: string children: string
} }
const IconText = ({ icon, children, ...props }: IconTextProps) => { const IconText = ({ icon, children }: IconTextProps) => {
return ( return (
<XStack <XStack
style={{ style={{
@ -14,10 +15,10 @@ const IconText = ({ icon, children, ...props }: IconTextProps) => {
}} }}
space={'$2'} space={'$2'}
> >
<Icon source={icon} /> <Icon src={icon} />
<Paragraph {...props} color={'#000000'} fontWeight={'bold'}> <Text size={11} color={'#000000'} weight={"medium"} >
{children} {children}
</Paragraph> </Text>
</XStack> </XStack>
) )
} }

View File

@ -1,29 +0,0 @@
import { XStack } from 'tamagui'
import Icon from './Icon'
import FormattedText, { TextElement } from './FormattedText'
type InformationBoxProps = {
icon: string
textElements: TextElement[]
}
const InformationBox = ({ icon, textElements }: InformationBoxProps) => {
return (
<XStack
style={{
border: '2px solid #E7EAEE',
borderRadius: '12px',
padding: '11px 16px',
maxWidth: '590px',
alignItems: 'start',
}}
space={'$2'}
>
<Icon source={icon} width={12} height={12} />
<FormattedText textElements={textElements} color={'#647084'} fontSize={'$3'} />
</XStack>
)
}
export default InformationBox

View File

@ -1,6 +1,7 @@
import { Text, XStack } from 'tamagui' import { XStack } from 'tamagui'
import Icon from './Icon' import Icon from './Icon'
import Tag from './Tag' import Tag from './Tag'
import { Text } from '@status-im/components'
const NimbusLogo = () => { const NimbusLogo = () => {
return ( return (
@ -11,8 +12,10 @@ const NimbusLogo = () => {
}} }}
space={'$2'} space={'$2'}
> >
<Icon source={'/icons/marks.png'} width={55} height={60} /> <Icon src={'/icons/marks.png'} width={55} height={60} />
<Text style={{ fontWeight: '650', fontSize: '24px' }}>Nimbus</Text> <Text size={27} weight={'medium'}>
Nimbus
</Text>
<Tag text="BETA" /> <Tag text="BETA" />
</XStack> </XStack>
) )

View File

@ -1,6 +1,7 @@
import { Text, XStack } from 'tamagui' import { XStack } from 'tamagui'
import Icon from './Icon' import Icon from './Icon'
import Tag from './Tag' import Tag from './Tag'
import { Text } from '@status-im/components'
const NodesLogo = () => { const NodesLogo = () => {
return ( return (
@ -11,8 +12,10 @@ const NodesLogo = () => {
}} }}
space={'$2'} space={'$2'}
> >
<Icon source={'src/assets/nodes-app-icon.png'} width={32} height={32} /> <Icon src={'src/assets/nodes-app-icon.png'} width={32} height={32} />
<Text style={{ fontWeight: '700', fontSize: '28px' }}>nodes</Text> <Text size={27} weight={'semibold'}>
nodes
</Text>
<Tag text="BETA" /> <Tag text="BETA" />
</XStack> </XStack>
) )

View File

@ -1,16 +0,0 @@
import { Button } from 'tamagui'
import { ReactNode } from 'react'
type ReactButtonProps = {
children: string
style?: unknown
icon?: ReactNode
size?: string
onClick?: () => void
}
const ReactButton = ({ children, ...props }: ReactButtonProps) => {
return <Button {...props}>{children}</Button>
}
export default ReactButton

View File

@ -1,24 +0,0 @@
import { ReactNode } from 'react'
import { Stack } from 'tamagui'
type ShadowBoxProps = {
boxStyle?: React.CSSProperties
children: ReactNode
}
const ShadowBox = ({boxStyle, children }: ShadowBoxProps) => {
return (
<Stack
style={{
boxSizing: 'border-box',
borderRadius: '16px',
boxShadow: '0px 4px 20px 0px rgba(9, 16, 28, 0.08)',
...boxStyle
}}
>
{children}
</Stack>
)
}
export default ShadowBox

View File

@ -1,9 +1,16 @@
import { Paragraph, styled } from 'tamagui' import { Text } from '@status-im/components'
const SubTitle = styled(Paragraph, { type SubTitleProps = {
name: 'SubTitle', color?: string
accessibilityRole: 'header', children: string
size: '$3', }
})
const SubTitle = ({ color, children }: SubTitleProps) => {
return (
<Text size={15} color={color}>
{children}
</Text>
)
}
export default SubTitle export default SubTitle

View File

@ -1,9 +1,16 @@
import { Paragraph, styled } from 'tamagui' import { Text } from '@status-im/components'
const Title = styled(Paragraph, { type TitleProps = {
name: 'Title', color?: string
accessibilityRole: 'header', children: string
size: '$9', }
})
const Title = ({ color, children }: TitleProps) => {
return (
<Text size={27} weight={'medium'} color={color}>
{children}
</Text>
)
}
export default Title export default Title

View File

@ -1,7 +1,8 @@
import { XStack, YStack } from 'tamagui' import { XStack, YStack } from 'tamagui'
import Title from './Title' import Title from './Title'
import SubTitle from './SubTitle' import SubTitle from './SubTitle'
import IconButton from './IconButton' import { Button } from '@status-im/components'
import Icon from './Icon'
type TitlesProps = { type TitlesProps = {
title: string title: string
@ -10,21 +11,12 @@ type TitlesProps = {
const Titles = ({ title, subtitle }: TitlesProps) => { const Titles = ({ title, subtitle }: TitlesProps) => {
return ( return (
<YStack> <YStack style={{ width: '100%' }}>
<XStack justifyContent="space-between"> <XStack style={{ justifyContent: 'space-between', alignItems: 'center' }}>
<Title color={'#09101C'}>{title}</Title> <Title color={'#09101C'}>{title}</Title>
<IconButton <Button variant="outline" size={32} icon={<Icon src={'/icons/reveal.png'} />}>
style={{
backgroundColor: 'transparent',
border: '1px solid #DCE0E5',
color: '#09101C',
}}
size={'$3'}
icon={'/icons/reveal.png'}
fontSize={'$5'}
>
Advanced Settings Advanced Settings
</IconButton> </Button>
</XStack> </XStack>
<SubTitle color={'#09101C'}>{subtitle}</SubTitle> <SubTitle color={'#09101C'}>{subtitle}</SubTitle>
</YStack> </YStack>