Fakultas Ilmu Komputer UI
Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ppl-fasilkom-ui
PPL KI Ganjil 2021 2022
Clicks - Ecosystem Business
clicks-frontend
Commits
cb4da3e9
Commit
cb4da3e9
authored
Oct 09, 2021
by
Abraham Rudolf Brahmana
Committed by
angelin depthios
Oct 09, 2021
Browse files
Vertical Card Component
parent
6a930499
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/components/Cards/VerticalCard.tsx
0 → 100644
View file @
cb4da3e9
import
{
MaterialIcons
}
from
"
@expo/vector-icons
"
;
import
React
from
"
react
"
;
import
{
View
,
Text
,
StyleSheet
,
Dimensions
,
Image
}
from
"
react-native
"
;
import
{
TouchableOpacity
}
from
"
react-native-gesture-handler
"
;
import
Colors
from
"
../../constants/Colors
"
;
import
Spacer
from
"
../Spacer/Spacer
"
;
type
props
=
{
imageSource
?:
string
;
members
:
number
;
title
:
string
;
onPressFunction
:
()
=>
void
;
};
const
VerticalCard
=
({
imageSource
,
members
,
title
,
onPressFunction
,
}:
props
)
=>
{
return
(
<
View
testID
=
"VerticalCard"
>
<
TouchableOpacity
onPress
=
{
()
=>
onPressFunction
()
}
style
=
{
styles
.
touchableContainer
}
>
<
View
style
=
{
styles
.
cardContainer
}
>
<
View
style
=
{
styles
.
contentContainer
}
>
<
View
style
=
{
styles
.
imageContainer
}
>
<
Image
style
=
{
styles
.
image
}
source
=
{
{
uri
:
imageSource
}
}
/>
</
View
>
<
Spacer
variant
=
"m"
/>
<
View
style
=
{
styles
.
textContainer
}
testID
=
"textContainer"
>
<
View
style
=
{
styles
.
membersContainer
}
testID
=
"membersContainer"
>
<
MaterialIcons
testID
=
"groupIcon"
name
=
{
"
group
"
}
size
=
{
18
}
style
=
{
styles
.
icon
}
/>
<
Text
style
=
{
styles
.
membersText
}
testID
=
"membersText"
>
{
"
"
}
{
members
}
Anggota
</
Text
>
</
View
>
<
Spacer
variant
=
"m"
/>
<
View
style
=
{
styles
.
titleContainer
}
testID
=
"titleContainer"
>
<
Text
style
=
{
styles
.
titleText
}
testID
=
"titleText"
>
{
title
}
</
Text
>
</
View
>
</
View
>
</
View
>
</
View
>
</
TouchableOpacity
>
</
View
>
);
};
const
deviceWidth
=
Math
.
round
(
Dimensions
.
get
(
"
window
"
).
width
);
const
containerDimension
=
deviceWidth
*
0.51
;
const
styles
=
StyleSheet
.
create
({
touchableContainer
:
{
shadowColor
:
"
#000
"
,
shadowOffset
:
{
width
:
0
,
height
:
6
},
shadowOpacity
:
0.3
,
shadowRadius
:
6
,
elevation
:
4
,
},
cardContainer
:
{
width
:
containerDimension
,
height
:
containerDimension
,
color
:
Colors
.
background
,
borderRadius
:
8
,
overflow
:
"
hidden
"
,
},
contentContainer
:
{
height
:
"
100%
"
,
width
:
"
100%
"
,
backgroundColor
:
"
#fff
"
,
},
icon
:
{
color
:
Colors
.
text
.
disabled
,
fontSize
:
15
,
},
membersText
:
{
color
:
Colors
.
text
.
disabled
,
fontSize
:
12
,
fontWeight
:
"
300
"
,
},
imageContainer
:
{
height
:
"
53.6%
"
,
width
:
"
100%
"
,
backgroundColor
:
Colors
.
form
.
disabled
.
bg
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
},
image
:
{
height
:
"
100%
"
,
width
:
"
100%
"
,
},
membersContainer
:
{
flexDirection
:
"
row
"
,
},
titleContainer
:
{
flexDirection
:
"
row
"
,
},
textContainer
:
{
paddingHorizontal
:
8
,
paddingBottom
:
8
,
},
titleText
:
{
fontSize
:
14
,
fontWeight
:
"
300
"
,
},
});
export
default
VerticalCard
;
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment