Skip to content

Commit

Permalink
scroll view and safe area for homescreen. BottomNavBar font resize.
Browse files Browse the repository at this point in the history
  • Loading branch information
armenbalian committed May 23, 2024
1 parent d610cf8 commit d147bc1
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 26 deletions.
47 changes: 26 additions & 21 deletions apps/releaf/mobile/src/app/home/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { View, Text } from 'react-native';
import { View, Text, ScrollView } from 'react-native';
import { TreeStateCard } from './components/TreeStateCard';
import { SafeAreaView } from 'react-native-safe-area-context';

export class TreeState {
name = '';
Expand Down Expand Up @@ -31,27 +32,31 @@ const trees = [

export const Home = () => {
return (
<View style={{ backgroundColor: '#ffffff' }}>
<View
style={{
margin: 10,
}}
>
<Text>Home</Text>
</View>
<SafeAreaView>
<ScrollView>
<View style={{ backgroundColor: '#ffffff' }}>
<View
style={{
margin: 10,
}}
>
<Text>Home</Text>
</View>

{trees.map((tree, index) => (
<View
key={index}
style={{
marginBottom: index !== trees.length - 1 ? 15 : 0,
marginLeft: 20,
marginRight: 20,
}}
>
<TreeStateCard treeState={tree}></TreeStateCard>
{trees.map((tree, index) => (
<View
key={index}
style={{
marginBottom: index !== trees.length - 1 ? 15 : 0,
marginLeft: 20,
marginRight: 20,
}}
>
<TreeStateCard treeState={tree}></TreeStateCard>
</View>
))}
</View>
))}
</View >
</ScrollView>
</SafeAreaView>
);
};
16 changes: 11 additions & 5 deletions apps/releaf/mobile/src/app/navigation/components/Icons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export const Icons = (props: { type: IconType; isSelected: boolean }) => {

let color = '#FFFFFF';

const fontSize = 12;

if (props.isSelected) {
componentStyles = [styles.circle, styles.center];
color = '#009959';
Expand All @@ -51,21 +53,25 @@ export const Icons = (props: { type: IconType; isSelected: boolean }) => {
return (
<View style={componentStyles}>
<StoreFront fill={color} />
<Text style={{ color: color }}>{!props.isSelected ? 'Order' : ''}</Text>
<Text style={{ fontSize: fontSize, color: color }}>
{!props.isSelected ? 'Order' : ''}
</Text>
</View>
);
} else if (props.type === IconType.Face) {
return (
<View style={componentStyles}>
<Face fill={color} />
<Text style={{ color: color }}>{!props.isSelected ? 'Me' : ''}</Text>
<Text style={{ fontSize: fontSize, color: color }}>
{!props.isSelected ? 'Me' : ''}
</Text>
</View>
);
} else if (props.type === IconType.MenuBook) {
return (
<View style={componentStyles}>
<MenuBook fill={color} />
<Text style={{ color: color }}>
<Text style={{ fontSize: fontSize, color: color }}>
{!props.isSelected ? 'Knowledge' : ''}
</Text>
</View>
Expand All @@ -74,7 +80,7 @@ export const Icons = (props: { type: IconType; isSelected: boolean }) => {
return (
<View style={componentStyles}>
<Notification fill={color} />
<Text style={{ color: color }}>
<Text style={{ fontSize: fontSize, color: color }}>
{!props.isSelected ? 'Notification' : ''}
</Text>
</View>
Expand All @@ -83,7 +89,7 @@ export const Icons = (props: { type: IconType; isSelected: boolean }) => {
return (
<View style={componentStyles}>
<PottedPlant fill={color} />
<Text style={{ color: color }}>
<Text style={{ fontSize: fontSize, color: color }}>
{!props.isSelected ? 'Details' : ''}
</Text>
</View>
Expand Down

0 comments on commit d147bc1

Please sign in to comment.