trying golden ratio
This commit is contained in:
@@ -5,6 +5,7 @@ import TabNavigationPhone from './TabNavigationPhone';
|
||||
import { Ionicons } from '@expo/vector-icons';
|
||||
import React, { useState } from 'react';
|
||||
import useColorScheme from '../../hooks/colorScheme';
|
||||
import HomeView from '../../views/V2/HomeView';
|
||||
|
||||
export type NaviTab = {
|
||||
id: string;
|
||||
@@ -62,6 +63,8 @@ const TabNavigation = () => {
|
||||
const [activeTab, setActiveTab] = useState(tabs[0]?.id ?? 'home');
|
||||
const colorScheme = useColorScheme();
|
||||
|
||||
const child = <HomeView />;
|
||||
|
||||
const appTabs = tabs.map((t) => {
|
||||
return {
|
||||
...t,
|
||||
@@ -90,7 +93,9 @@ const TabNavigation = () => {
|
||||
tabs={appTabs}
|
||||
activeTabID={activeTab}
|
||||
setActiveTabID={setActiveTab}
|
||||
/>
|
||||
>
|
||||
{child}
|
||||
</TabNavigationPhone>
|
||||
) : (
|
||||
<TabNavigationDesktop
|
||||
tabs={appTabs}
|
||||
@@ -98,7 +103,9 @@ const TabNavigation = () => {
|
||||
setActiveTabID={setActiveTab}
|
||||
isCollapsed={isDesktopCollapsed}
|
||||
setIsCollapsed={setIsDesktopCollapsed}
|
||||
/>
|
||||
>
|
||||
{child}
|
||||
</TabNavigationDesktop>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
|
||||
@@ -12,6 +12,7 @@ type TabNavigationDesktopProps = {
|
||||
setIsCollapsed: (isCollapsed: boolean) => void;
|
||||
activeTabID: string;
|
||||
setActiveTabID: (id: string) => void;
|
||||
children?: React.ReactNode;
|
||||
};
|
||||
|
||||
const TabNavigationDesktop = (props: TabNavigationDesktopProps) => {
|
||||
@@ -139,9 +140,10 @@ const TabNavigationDesktop = (props: TabNavigationDesktopProps) => {
|
||||
</TabNavigationList>
|
||||
</View>
|
||||
</View>
|
||||
<View>
|
||||
<Text>Main content page</Text>
|
||||
</View>
|
||||
<View style={{
|
||||
height: '100%',
|
||||
width: 'calc(100% - 300px)',
|
||||
}}>{props.children}</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -7,6 +7,7 @@ type TabNavigationPhoneProps = {
|
||||
tabs: NaviTab[];
|
||||
activeTabID: string;
|
||||
setActiveTabID: (id: string) => void;
|
||||
children?: React.ReactNode;
|
||||
};
|
||||
|
||||
const TabNavigationPhone = (props: TabNavigationPhoneProps) => {
|
||||
@@ -54,9 +55,10 @@ const TabNavigationPhone = (props: TabNavigationPhoneProps) => {
|
||||
</View>
|
||||
</Center>
|
||||
</View>
|
||||
<View>
|
||||
<Text>Main content page</Text>
|
||||
</View>
|
||||
<View style={{
|
||||
width: '100%',
|
||||
height: 'calc(100% - 90px)',
|
||||
}}>{props.children}</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
146
front/views/V2/HomeView.tsx
Normal file
146
front/views/V2/HomeView.tsx
Normal file
@@ -0,0 +1,146 @@
|
||||
import { View, Image } from 'react-native';
|
||||
import { Text } from 'native-base';
|
||||
import React from 'react';
|
||||
|
||||
const bigSideRatio = 100;
|
||||
const smallSideRatio = 61;
|
||||
|
||||
const HomeView = () => {
|
||||
return (
|
||||
<View
|
||||
style={{
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
width: '100%',
|
||||
aspectRatio: 16 / 9,
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
alignSelf: 'stretch',
|
||||
alignItems: 'stretch',
|
||||
flexDirection: 'row',
|
||||
display: 'flex',
|
||||
gap: '0px',
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: bigSideRatio,
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
source={{
|
||||
uri: 'https://media.discordapp.net/attachments/717080637038788731/1153688155292180560/image_homeview1.png',
|
||||
}}
|
||||
style={{
|
||||
aspectRatio: 1,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: smallSideRatio,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
||||
alignItems: 'stretch',
|
||||
gap: '0px',
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: bigSideRatio,
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
source={{
|
||||
uri: 'https://media.discordapp.net/attachments/717080637038788731/1153688154923090093/image_homeview2.png',
|
||||
}}
|
||||
style={{
|
||||
aspectRatio: 1,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: smallSideRatio,
|
||||
width: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'row-reverse',
|
||||
alignItems: 'stretch',
|
||||
gap: '0px',
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: bigSideRatio,
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
source={{
|
||||
uri: 'https://media.discordapp.net/attachments/717080637038788731/1153688154499457096/image_homeview3.png',
|
||||
}}
|
||||
style={{
|
||||
aspectRatio: 1,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: smallSideRatio,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
flexDirection: 'column-reverse',
|
||||
alignItems: 'stretch',
|
||||
gap: '0px',
|
||||
}}
|
||||
>
|
||||
<View
|
||||
style={{
|
||||
flexGrow: bigSideRatio,
|
||||
}}
|
||||
>
|
||||
<Image
|
||||
source={{
|
||||
uri: 'https://media.discordapp.net/attachments/717080637038788731/1153688154109394985/image_homeview4.png',
|
||||
}}
|
||||
style={{
|
||||
aspectRatio: 1,
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
width: '100%',
|
||||
flexGrow: smallSideRatio,
|
||||
}}
|
||||
>
|
||||
<Text>More</Text>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
</View>
|
||||
<View
|
||||
style={{
|
||||
flexShrink: 0,
|
||||
flexGrow: 0,
|
||||
flexBasis: '15%',
|
||||
width: '100%',
|
||||
}}
|
||||
>
|
||||
<Text>Footer</Text>
|
||||
</View>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
export default HomeView;
|
||||
Reference in New Issue
Block a user