You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
import React from 'react';
|
|
import { Text, SectionList, View, StyleSheet } from 'react-native';
|
|
|
|
|
|
const KanjiList = () => {
|
|
|
|
return (
|
|
<View style={kanjiListStyle.container}>
|
|
<SectionList sections={[
|
|
{
|
|
title: "N5",
|
|
data: ["aa", "aaa"]
|
|
},
|
|
{
|
|
title: "N4",
|
|
data: ["b", "bbb"]
|
|
}
|
|
]}
|
|
renderItem={
|
|
({ item }) => <Text style={kanjiListStyle.item}>{item}</Text>
|
|
}
|
|
renderSectionHeader={({ section }) => (
|
|
<Text style={kanjiListStyle.sectionHeader}>{section.title}</Text>
|
|
)}
|
|
keyExtractor={item => `basicListEntry-${item}`}
|
|
>
|
|
</SectionList>
|
|
</View>
|
|
);
|
|
};
|
|
|
|
const kanjiListStyle = StyleSheet.create({
|
|
container: {
|
|
width: '100%',
|
|
height: '100%',
|
|
padding: 10
|
|
},
|
|
sectionHeader: {
|
|
paddingTop: 2,
|
|
paddingLeft: 10,
|
|
paddingRight: 10,
|
|
paddingBottom: 2,
|
|
fontSize: 14,
|
|
fontWeight: 'bold',
|
|
backgroundColor: '#e6e6e6',
|
|
},
|
|
item: {
|
|
padding: 10,
|
|
fontSize: 18,
|
|
height: 44,
|
|
},
|
|
})
|
|
|
|
export default KanjiList; |