Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Introduction section of Home Page #178

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 25 additions & 4 deletions src/Components/Home/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { TouchableHighlight, Linking } from 'react-native';
import ImageContent from './../ImageContent';
import SectionHeader from './../SectionHeader';
import SectionSubheader from './../SectionSubheader';
import { getHome } from './../../content/home';
import { Box, Content, Description } from './styles';
import { Box, Content, Description, IconContainer, Icon } from './styles';
import ContributionSection from './contribution/ContributionSection';

function Home() {
Expand All @@ -21,12 +21,33 @@ function Home() {

return (
<Box>
<SectionHeader title="AnitaB.org Open Source" />
<ImageContent
image={content.introduction.image.source}
imageSide='right'
Children={() => (
<Content>
<SectionSubheader title={content.introduction.title} />
<IconContainer>
<TouchableHighlight onPress={() => Linking.openURL('https://medium.com/anitab-org-open-source')}>
<Icon source={require('../../assets/medium.png')} />
</TouchableHighlight>
<TouchableHighlight onPress={() => Linking.openURL('https://anitab-org.zulipchat.com/#')}>
<Icon source={require('../../assets/zulip.png')} />
</TouchableHighlight>
<TouchableHighlight onPress={() => Linking.openURL('https://github.com/anitab-org')}>
<Icon source={require('../../assets/github.png')} />
</TouchableHighlight>
</IconContainer>
<Description>{content.introduction.content.par}</Description>
</Content>
)}
/>

{content.sections.map((section, index) => {
return (
<ImageContent
image={section.image.source}
imageSide={index % 2 === 0 ? 'right' : 'left'}
imageSide={index % 2 ? 'right' : 'left'}
Children={() => renderContent(index, section)}
/>
);
Expand Down
18 changes: 14 additions & 4 deletions src/Components/Home/styles.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { View, Text, StyleSheet } from 'react-native';
import { View, Text, StyleSheet, Image } from 'react-native';
import { styled } from 'react-native-reflect';

export const Box = styled(View, {
flex: 1,
width: '80%',
flexDirection: 'column',
paddingLeft: 16,
paddingRight: 16,
paddingRight: 32,
flexWrap: 'wrap',
marginTop: 32,
});

export const Content = styled(View, {
Expand All @@ -27,6 +25,18 @@ export const Description = styled(Text, {
textAlign: 'left',
});

export const IconContainer = styled(View, {
flexDirection: 'row',
marginVertical: 8,
paddingLeft: 16,
});

export const Icon = styled(Image, {
marginRight: 8,
width: 32,
height: 32,
});

const styles = StyleSheet.create({
container: {
display: 'flex',
Expand Down
Binary file added src/assets/medium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions src/content/home.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
const home = {
introduction: {
title: 'AnitaB.org Open Source',
image: {
source: require('./../assets/landing/landing.png'),
},
content: {
par:
'Lorem ipsum dolor sit amet consectetur, adipisicing elit. Quis omnis minus, quisquam ab architecto dolor hic dolores, ducimus explicabo, voluptates fugit dolorum itaque enim nam. Enim nulla, vitae recusandae est pariatur consequuntur aperiam molestiae, minus vero, fugiat ipsam facilis cupiditate alias dolorem mollitia officiis. Excepturi, blanditiis?',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why random text is used here? Is it intentional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for pointing this out. The real content is not there yet, so I used random text. I've also updated the description to inform this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no Lorem ipsum will be merged. Rise issue and wait for content or write content by your own. Thanks!

},
},
sections: [
{
title: 'Getting Started',
Expand Down