Skip to content

Commit 00dc120

Browse files
katsuhira02Danil
andauthored
ButtonPhoto component add (#75)
Co-authored-by: Danil <[email protected]>
1 parent 184a85d commit 00dc120

File tree

3 files changed

+42
-6
lines changed

3 files changed

+42
-6
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import React from 'react'
2+
import { StyleSheet, Pressable } from 'react-native'
3+
import Ionicons from 'react-native-vector-icons/Ionicons'
4+
import { PRIMARY, WHITE } from '../../constants'
5+
6+
const styles = StyleSheet.create({
7+
container: {
8+
height: 52,
9+
width: 52,
10+
backgroundColor: PRIMARY,
11+
borderRadius: 100
12+
},
13+
iconStyle: {
14+
alignItems: 'center',
15+
justifyContent: 'center'
16+
}
17+
})
18+
19+
function ButtonPhoto() {
20+
const { container, iconStyle } = styles
21+
22+
return (
23+
<Pressable
24+
style={({ pressed }) => [
25+
{
26+
opacity: pressed ? 0.9 : 1
27+
},
28+
container,
29+
iconStyle
30+
]}
31+
>
32+
<Ionicons name="camera" size={30} color={WHITE} />
33+
</Pressable>
34+
)
35+
}
36+
37+
export { ButtonPhoto }

src/components/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export * from './Button'
22
export * from './Space'
33
export * from './Text'
44
export * from './Switch'
5-
export * from './Labels'
5+
export * from './Labels'
6+
export * from './ButtonPhoto'

src/index.tsx

Lines changed: 3 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 { DARK, WHITE } from './constants'
4-
import { Space, Labels, Text } from './components'
4+
import { Space, Text, ButtonPhoto } from './components'
55

66
const styles = StyleSheet.create({
77
container: {
@@ -24,11 +24,9 @@ export default function App({}) {
2424

2525
return (
2626
<View style={container}>
27-
<Text title="Labels" h0 />
27+
<Text title="ButtonPhoto" h0 />
2828
<Space height={15} />
29-
<Labels isSaleOrNew={true} title={'90%'} />
30-
<Space height={15} />
31-
<Labels isSaleOrNew={false} title={'90%'} />
29+
<ButtonPhoto />
3230
</View>
3331
)
3432
}

0 commit comments

Comments
 (0)