Skip to content

Commit 650b8a8

Browse files
committed
added data to content and added scrollview
2 parents 2096684 + 38d2a27 commit 650b8a8

File tree

10 files changed

+145
-7
lines changed

10 files changed

+145
-7
lines changed

src/Components/Content/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import Projects from './../Projects';
44
import Home from './../Home';
55
import AboutUs from './../AboutUs';
66
import Contribute from '../Contribute';
7+
import OurEvents from './../OurEvents';
78

89
function Content({ selected, titles }) {
910
if (selected === 0) {
@@ -12,7 +13,9 @@ function Content({ selected, titles }) {
1213
return <AboutUs />;
1314
} else if (selected === 3) {
1415
return <Projects />;
15-
}
16+
} else if(selected === 4) {
17+
return <OurEvents />;
18+
}
1619
if (selected === 5) {
1720
return <Contribute />;
1821
} else {

src/Components/Header/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function MenuItem(index, selected, setSelected, title) {
6464
const styles = StyleSheet.create({
6565
logoContainer: {
6666
flex: 1,
67+
marginRight:80,
6768
},
6869
buttonContainer: { marginTop: 25, marginLeft: 40 },
6970
});

src/Components/ImageContent/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ const ImageContent = ({
2626
}
2727
}}
2828
>
29+
<View style={styles.sectionImage}>
2930
<ScaledImage
3031
source={image}
3132
width={imageContainerWidth}
32-
style={styles.sectionImage}
3333
/>
34+
</View>
3435
<View style={styles.subContainer}>
3536
<Children />
3637
</View>
@@ -55,7 +56,6 @@ const createStyles = (imageSide) =>
5556
minWidth: 200,
5657
},
5758
sectionImage: {
58-
flex: 1,
5959
paddingLeft: 16,
6060
paddingRight: 16,
6161
},

src/Components/ImageTextSection/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ const ImageTextSection = ({
1212
const styles = createStyles(imageSide);
1313
return (
1414
<View style={styles.container}>
15+
<View style={styles.sectionImage}>
1516
<ScaledImage
1617
source={image}
1718
height={imageHeight}
18-
style={styles.sectionImage}
1919
/>
20+
</View>
2021
<View style={styles.subContainer}>
2122
<Text style={styles.header}>{title}</Text>
2223
{content.map((text) => (

src/Components/OurEvents/index.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import React from 'react';
2+
import ImageContent from './../ImageContent';
3+
import SectionHeader from './../SectionHeader';
4+
import { getEvents } from './../../content/our_events';
5+
import { Box, Content, Description } from './styles';
6+
7+
8+
function OurEvents() {
9+
const content = getEvents();
10+
const renderContent = (index, section) => {
11+
return (
12+
<Content key={index}>
13+
<SectionHeader title={section.title} />
14+
{section.content.map((content, indx) => {
15+
return <Description key={indx}>{content.par}</Description>;
16+
})}
17+
</Content>
18+
);
19+
};
20+
21+
return (
22+
<Box>
23+
{content.sections.map((section, index) => {
24+
return (
25+
<ImageContent
26+
image={section.image.source}
27+
imageSide={index % 2 === 0 ? 'right' : 'left'}
28+
Children={() => renderContent(index, section)}
29+
/>
30+
);
31+
})}
32+
</Box>
33+
34+
);
35+
}
36+
export default OurEvents;

src/Components/OurEvents/styles.js

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
import { View, Text, StyleSheet } from 'react-native';
2+
import { styled } from 'react-native-reflect';
3+
4+
export const Box = styled(View, {
5+
flex: 1,
6+
width: '80%',
7+
flexDirection: 'column',
8+
paddingLeft: 16,
9+
paddingRight: 16,
10+
flexWrap: 'wrap',
11+
marginTop: 32,
12+
});
13+
14+
export const Content = styled(View, {
15+
flexDirection: 'column',
16+
paddingLeft: 16,
17+
marginRight:77,
18+
});
19+
20+
export const Description = styled(Text, {
21+
flex: 1,
22+
marginTop: 32,
23+
paddingLeft: 16,
24+
fontSize: 18,
25+
flexGrow: 1,
26+
fontWeight: 200,
27+
color: '#103B81',
28+
textAlign: 'left',
29+
});
30+
31+
const styles = StyleSheet.create({
32+
container: {
33+
display: 'flex',
34+
flexDirection: 'row',
35+
flexWrap: 'wrap',
36+
marginTop: 18,
37+
marginBottom: 18,
38+
},
39+
card: {
40+
width: '33%',
41+
minWidth: 251,
42+
},
43+
cardMiddle: {
44+
alignItems: 'center',
45+
},
46+
cardLast: {
47+
alignItems: 'flex-end',
48+
},
49+
imageText: {
50+
fontSize: 14,
51+
fontWeight: '300',
52+
fontFamily: 'Avenir',
53+
textAlign: 'center',
54+
width: 180,
55+
flex: 1,
56+
color: '#103B81',
57+
},
58+
description: {
59+
fontSize: 14,
60+
fontWeight: '300',
61+
color: '#103B81',
62+
marginLeft: 32,
63+
},
64+
});
65+
66+
export default styles;

src/assets/our_events.png

29.6 KB
Loading

src/content/our_events.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
const our_events={
2+
sections: [
3+
{
4+
title: "EVENTS",
5+
image: {
6+
source:require("./../assets/our_events.png"),
7+
},
8+
content: [
9+
{
10+
par : "We at AnitaB.org Open Source beleive in Inspiration through Action. To facilitate our Open Souce journey and continue the AnitaB.org legacy we conduct enthralling events all year long, with the purpose of bridging the gap between creative developers and our Open Source community. Keep scrolling to catch a glipse of few such events! ",
11+
}
12+
]
13+
},
14+
{
15+
title: "TITLE 2",
16+
image:{
17+
source:require("./../assets/our_events.png"),
18+
},
19+
content: [
20+
{
21+
par: "We at AnitaB.org Open Source beleive in Inspiration through Action. To facilitate our Open Souce journey and continue the AnitaB.org legacy we conduct enthralling events all year long, with the purpose of bridging the gap between creative developers and our Open Source community. Keep scrolling to catch a glipse of few such events! ",
22+
}
23+
]
24+
}
25+
]
26+
}
27+
28+
29+
export const getEvents = () => {
30+
return our_events;
31+
};
File renamed without changes.

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5353,9 +5353,9 @@ [email protected]:
53535353
integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=
53545354

53555355
ini@^1.3.5:
5356-
version "1.3.5"
5357-
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"
5358-
integrity sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==
5356+
version "1.3.8"
5357+
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
5358+
integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
53595359

53605360
inline-style-prefixer@^5.1.0:
53615361
version "5.1.2"

0 commit comments

Comments
 (0)