-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from WeConnection/org
OrgView 대략적 구현
- Loading branch information
Showing
5 changed files
with
164 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,61 @@ | ||
import React from 'react'; | ||
import { View } from 'react-native'; | ||
import { ScrollView, Text, View, Image, TouchableHighlight, useWindowDimensions } from 'react-native'; | ||
import hostaddr from '../config' | ||
|
||
const OrgView = () => { | ||
const OrgIcon = (props) => { | ||
return ( | ||
<View> | ||
|
||
<TouchableHighlight> | ||
<Image source={require('../assets/favicon.png')} /> | ||
</TouchableHighlight> | ||
<Text> | ||
이름 | ||
</Text> | ||
<Text> | ||
테그, 테그 | ||
</Text> | ||
</View> | ||
); | ||
} | ||
|
||
const OrgView = () => { | ||
const width = useWindowDimensions().width; | ||
const count = 10; | ||
const fit = parseInt(width / 120); | ||
let contents = []; | ||
|
||
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> | ||
); | ||
}; | ||
|
||
export default OrgView; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters