Skip to content

Commit

Permalink
OrgView 대략적 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
onting committed Aug 5, 2020
1 parent b8509cb commit 99776d1
Showing 1 changed file with 43 additions and 9 deletions.
52 changes: 43 additions & 9 deletions compo/orgview.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,60 @@
import React from 'react';
import { View, Image, TouchableHighlight } from 'react-native';
import { ScrollView, Text, View, Image, TouchableHighlight, useWindowDimensions } from 'react-native';
import hostaddr from '../config'

const OrgIcon = (props) => {
return (
<TouchableHighlight>
<Image source={{uri: props.imageUri}} />
<View>
<TouchableHighlight>
<Image source={require('../assets/favicon.png')} />
</TouchableHighlight>
<Text>
{props.name}
이름
</Text>
<Text>
{props.tags[0]}
테그, 테그
</Text>
</TouchableHighlight>
</View>
);
}

const OrgView = () => {
return (
<View>
const width = useWindowDimensions().width;
const count = 10;
const fit = parseInt(width / 120);
let contents = [];

</View>
for(let i = 0; i < count / fit; i++)
{
let row = [];
for(let j = 0; (j < fit) && (i * fit + j < count); j++)
{
row.push(<OrgIcon />);
}

contents.push(
<View style={{
flex: 1,
flexDirection: 'row',
justifyContent: 'space-around',
alignItems: 'center',
marginHorizontal: 10,
marginVertical: 20,
}}>
{row}
</View>
);
}

return (
<ScrollView style={{
flex: 1,
flexDirection: 'column',
marginHorizontal: 20,
marginVertical: 10,
}}>
{contents}
</ScrollView>
);
};

Expand Down

0 comments on commit 99776d1

Please sign in to comment.