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
b7b8359c
Commit
b7b8359c
authored
Oct 09, 2021
by
Mohammad Faraz Abisha Mirza
Committed by
Ahmad Izzudin Alifyandra
Oct 09, 2021
Browse files
feat: create carousel VerticalCard and category with PlainButton
parent
4e700b18
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/components/carousel/CategoryHorizontalCarousel.tsx
0 → 100644
View file @
b7b8359c
import
React
from
"
react
"
;
import
{
StyleSheet
,
View
,
FlatList
,
ScrollView
}
from
"
react-native
"
;
import
Spacer
from
"
../Spacer/Spacer
"
;
import
ArrowlessPlainButton
from
"
../button/ArrowlessPlainButton
"
;
type
props
=
{
list
:
{
id
:
string
;
name
:
string
}[];
};
const
CategoryHorizontalCarousel
=
({
list
}:
props
)
=>
{
return
(
<
ScrollView
horizontal
=
{
true
}
showsHorizontalScrollIndicator
=
{
false
}
style
=
{
styles
.
carousel
}
>
<
FlatList
data
=
{
list
}
renderItem
=
{
({
item
})
=>
{
return
(
<
View
style
=
{
styles
.
slide
}
>
<
ArrowlessPlainButton
content
=
{
item
.
name
}
onPress
=
{
null
}
/>
</
View
>
);
}
}
numColumns
=
{
Math
.
ceil
(
list
.
length
/
2
)
}
keyExtractor
=
{
(
item
)
=>
item
.
id
}
ItemSeparatorComponent
=
{
()
=>
<
Spacer
variant
=
{
"
l
"
}
/>
}
showsVerticalScrollIndicator
=
{
false
}
showsHorizontalScrollIndicator
=
{
false
}
/>
<
Spacer
variant
=
{
"
l
"
}
/>
</
ScrollView
>
);
};
const
styles
=
StyleSheet
.
create
({
carousel
:
{
flex
:
1
,
flexDirection
:
"
row
"
,
},
slide
:
{
width
:
288
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
paddingRight
:
16
,
},
});
export
default
CategoryHorizontalCarousel
;
src/components/carousel/VerticalEcosystemCarousel.tsx
0 → 100644
View file @
b7b8359c
import
React
from
"
react
"
;
import
{
StyleSheet
,
View
,
FlatList
,
ScrollView
}
from
"
react-native
"
;
import
Spacer
from
"
../Spacer/Spacer
"
;
import
VerticalCard
from
"
../Cards/VerticalCard
"
;
type
props
=
{
list
:
{
id
:
string
;
name
:
string
;
pic
:
string
;
followerCount
:
number
;
}[];
};
const
VerticalEcosystemCarousel
=
({
list
}:
props
)
=>
{
return
(
<
ScrollView
horizontal
=
{
true
}
showsHorizontalScrollIndicator
=
{
false
}
style
=
{
styles
.
carousel
}
>
<
FlatList
horizontal
=
{
true
}
data
=
{
list
}
renderItem
=
{
({
item
})
=>
{
return
(
<
View
style
=
{
styles
.
slide
}
>
<
VerticalCard
members
=
{
item
.
followerCount
}
title
=
{
item
.
name
}
imageSource
=
{
item
.
pic
}
onPressFunction
=
{
null
}
/>
</
View
>
);
}
}
ItemSeparatorComponent
=
{
()
=>
<
Spacer
variant
=
{
"
l
"
}
/>
}
keyExtractor
=
{
(
item
)
=>
item
.
id
}
showsVerticalScrollIndicator
=
{
false
}
showsHorizontalScrollIndicator
=
{
false
}
/>
</
ScrollView
>
);
};
const
styles
=
StyleSheet
.
create
({
carousel
:
{
flex
:
1
,
flexDirection
:
"
row
"
,
},
slide
:
{
width
:
210
,
justifyContent
:
"
center
"
,
alignItems
:
"
center
"
,
},
});
export
default
VerticalEcosystemCarousel
;
src/types/firestore/ecosystem.ts
deleted
100644 → 0
View file @
4e700b18
export
type
IEcosystem
=
{
item
:
{
id
?:
string
;
image
:
string
;
member
:
string
;
title
:
string
;
rate
:
string
;
};
};
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