Skip to content

Commit 707d81f

Browse files
katsuhira02Danil
andauthored
CardImage component create (#89)
Co-authored-by: Danil <[email protected]>
1 parent e701be9 commit 707d81f

3 files changed

Lines changed: 25 additions & 6 deletions

File tree

src/UI.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useState } from 'react'
22
import { StyleSheet, View } from 'react-native'
33
import { BLACK, WHITE } from './constants'
4-
import { Space, Text, CategoryCard } from './components'
4+
import { Space, Text, CardImage } from './components'
55

66
const styles = StyleSheet.create({
77
container: {
@@ -38,10 +38,7 @@ function Home({ navigation, route }: HomeT) {
3838
<View style={container}>
3939
<Text title="CategoryCard" h0 />
4040
<Space height={15} />
41-
<CategoryCard
42-
title="New"
43-
imageUri="https://avatars.mds.yandex.net/i?id=a832e7f3d01fa1cb0d468cbb92106605-5233897-images-thumbs&n=13"
44-
/>
41+
<CardImage imageUri="https://i.ebayimg.com/00/s/NzQzWDczMQ==/z/ooQAAOSwAolakPD5/$_57.JPG?set_id=8800005007" />
4542
</View>
4643
)
4744
}

src/components/CardImage/index.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import React from 'react'
2+
import { Image, StyleSheet } from 'react-native'
3+
4+
const styles = StyleSheet.create({
5+
container: {
6+
width: 130,
7+
height: 135,
8+
borderRadius: 8
9+
}
10+
})
11+
12+
interface CardImageT {
13+
imageUri: string
14+
}
15+
16+
function CardImage({ imageUri }: CardImageT) {
17+
const { container } = styles
18+
return <Image source={{ uri: imageUri }} style={container} />
19+
}
20+
21+
export { CardImage }

src/components/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ export * from './Selector'
1212
export * from './PopUp'
1313
export * from './CardOrder'
1414
export * from './Filter'
15-
export * from './CategoryCard'
15+
export * from './CategoryCard'
16+
export * from './CardImage'

0 commit comments

Comments
 (0)