Skip to content

Commit

Permalink
Merge branch 'master' into dev-onting
Browse files Browse the repository at this point in the history
  • Loading branch information
onting authored Aug 5, 2020
2 parents 7c48bd8 + 3503a11 commit fc9073d
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 6 deletions.
16 changes: 13 additions & 3 deletions App.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import AsyncStorage from '@react-native-community/async-storage';
import { StatusBar } from 'expo-status-bar';
import React from 'react';
import { StyleSheet, View, TouchableHighlight } from 'react-native';
import { StyleSheet, View, Text, TouchableHighlight } from 'react-native';
import { Entypo, Octicons, AntDesign } from '@expo/vector-icons';
import { NavigationContainer } from '@react-navigation/native';
import LoginView from './compo/loginview';
Expand All @@ -13,6 +13,7 @@ import ProfileView from './compo/profileview';
const MainView = () => {
const [state, setState] = React.useState('feed');
const target = {feed: <FeedView />, org: <OrgView />, notice: <NoticeView />, profile: <ProfileView />}[state];
const title = {feed: '피드', org: '단체', notice: '알림', profile: '내정보'}[state];

return(
<View style={{
Expand All @@ -22,10 +23,19 @@ const MainView = () => {
<View style={{
flex: 1,
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'cornsilk',
}}>
<View style={{
paddingHorizontal: 30,
paddingVertical: 20,
backgroundColor: 'white'
}}>
<Text style={{
fontSize: 30,
}}>
{title}
</Text>
</View>
{target}
</View>
<View style={{
Expand Down
54 changes: 51 additions & 3 deletions compo/orgview.js
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;

0 comments on commit fc9073d

Please sign in to comment.