setting screens for small view

This commit is contained in:
balzack 2022-09-16 23:54:57 -07:00
parent d8ad6ebf41
commit c1141b2102
7 changed files with 128 additions and 9 deletions

View File

@ -312,6 +312,8 @@ PODS:
- React-jsi (= 0.69.5) - React-jsi (= 0.69.5)
- React-logger (= 0.69.5) - React-logger (= 0.69.5)
- React-perflogger (= 0.69.5) - React-perflogger (= 0.69.5)
- RNGestureHandler (2.6.1):
- React-Core
- Yoga (1.14.0) - Yoga (1.14.0)
DEPENDENCIES: DEPENDENCIES:
@ -357,6 +359,7 @@ DEPENDENCIES:
- React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`)
- React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RNGestureHandler (from `../node_modules/react-native-gesture-handler`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`) - Yoga (from `../node_modules/react-native/ReactCommon/yoga`)
SPEC REPOS: SPEC REPOS:
@ -446,6 +449,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/runtimeexecutor" :path: "../node_modules/react-native/ReactCommon/runtimeexecutor"
ReactCommon: ReactCommon:
:path: "../node_modules/react-native/ReactCommon" :path: "../node_modules/react-native/ReactCommon"
RNGestureHandler:
:path: "../node_modules/react-native-gesture-handler"
Yoga: Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga" :path: "../node_modules/react-native/ReactCommon/yoga"
@ -492,6 +497,7 @@ SPEC CHECKSUMS:
React-RCTVibration: 42b34fde72e42446d9b08d2b9a3ddc2fa9ac6189 React-RCTVibration: 42b34fde72e42446d9b08d2b9a3ddc2fa9ac6189
React-runtimeexecutor: c778439c3c430a5719d027d3c67423b390a221fe React-runtimeexecutor: c778439c3c430a5719d027d3c67423b390a221fe
ReactCommon: ab1003b81be740fecd82509c370a45b1a7dda0c1 ReactCommon: ab1003b81be740fecd82509c370a45b1a7dda0c1
RNGestureHandler: 28ad20bf02257791f7f137b31beef34b9549f54b
Yoga: c2b1f2494060865ac1f27e49639e72371b1205fa Yoga: c2b1f2494060865ac1f27e49639e72371b1205fa
PODFILE CHECKSUM: df5a4d8901f42ad69df9f07100579df01b20e7e8 PODFILE CHECKSUM: df5a4d8901f42ad69df9f07100579df01b20e7e8

View File

@ -11,6 +11,7 @@
"dependencies": { "dependencies": {
"@react-navigation/bottom-tabs": "^6.4.0", "@react-navigation/bottom-tabs": "^6.4.0",
"@react-navigation/native": "^6.0.13", "@react-navigation/native": "^6.0.13",
"@react-navigation/stack": "^6.3.0",
"expo": "~46.0.9", "expo": "~46.0.9",
"expo-splash-screen": "~0.16.2", "expo-splash-screen": "~0.16.2",
"expo-status-bar": "~1.4.0", "expo-status-bar": "~1.4.0",
@ -18,6 +19,7 @@
"react-dom": "18.0.0", "react-dom": "18.0.0",
"react-native": "0.69.5", "react-native": "0.69.5",
"react-native-base64": "^0.2.1", "react-native-base64": "^0.2.1",
"react-native-gesture-handler": "^2.6.1",
"react-native-safe-area-context": "^4.3.3", "react-native-safe-area-context": "^4.3.3",
"react-native-safe-area-view": "^1.1.1", "react-native-safe-area-view": "^1.1.1",
"react-native-sqlite-storage": "^6.0.1", "react-native-sqlite-storage": "^6.0.1",

View File

@ -1,11 +1,15 @@
import { View, TouchableOpacity, Text } from 'react-native'; import { View, TouchableOpacity, Text } from 'react-native';
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context'; import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
import { createBottomTabNavigator } from '@react-navigation/bottom-tabs'; import { createBottomTabNavigator } from '@react-navigation/bottom-tabs';
import { createStackNavigator } from '@react-navigation/stack';
import { NavigationContainer } from '@react-navigation/native'; import { NavigationContainer } from '@react-navigation/native';
import Ionicons from '@expo/vector-icons/AntDesign'; import Ionicons from '@expo/vector-icons/AntDesign';
import { useSession } from './useSession.hook'; import { useSession } from './useSession.hook';
import { styles } from './Session.styled'; import { styles } from './Session.styled';
import Colors from 'constants/Colors'; import Colors from 'constants/Colors';
import { Profile } from './profile/Profile';
import { Channels } from './channels/Channels';
import { Cards } from './cards/Cards';
export function Session() { export function Session() {
@ -13,10 +17,32 @@ export function Session() {
const Tab = createBottomTabNavigator(); const Tab = createBottomTabNavigator();
const Conversation = () => (<TouchableOpacity style={{ width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }} onPress={actions.logout}><Text>LOGOUT</Text></TouchableOpacity>); const ConversationStack = createStackNavigator();
const ConversationStackScreen = () => {
return (
<ConversationStack.Navigator screenOptions={({ route }) => ({ headerShown: false })}>
<ConversationStack.Screen name="channels" component={Channels} />
</ConversationStack.Navigator>
);
}
const Profile = () => (<SafeAreaView edges={['top']}><View style={{ width: '100%', height: '100%', backgroundColor: 'yellow'}} /></SafeAreaView>); const ProfileStack = createStackNavigator();
const Contacts = () => (<SafeAreaView edges={['top']}><View style={{ width: '100%', height: '100%', backgroundColor: 'yellow'}} /></SafeAreaView>); const ProfileStackScreen = () => {
return (
<ProfileStack.Navigator screenOptions={({ route }) => ({ headerShown: false })}>
<ProfileStack.Screen name="channels" component={Profile} />
</ProfileStack.Navigator>
);
}
const ContactStack = createStackNavigator();
const ContactStackScreen = () => {
return (
<ContactStack.Navigator screenOptions={({ route }) => ({ headerShown: false })}>
<ContactStack.Screen name="channels" component={Cards} />
</ContactStack.Navigator>
);
}
return ( return (
<SafeAreaProvider> <SafeAreaProvider>
@ -36,13 +62,14 @@ export function Session() {
return <Ionicons name={'contacts'} size={size} color={color} />; return <Ionicons name={'contacts'} size={size} color={color} />;
} }
}, },
tabBarShowLabel: false,
tabBarActiveTintColor: Colors.white, tabBarActiveTintColor: Colors.white,
tabBarInactiveTintColor: Colors.disabled, tabBarInactiveTintColor: Colors.disabled,
})} })}
> >
<Tab.Screen name="Conversation" component={Conversation} /> <Tab.Screen name="Conversation" component={ConversationStackScreen} />
<Tab.Screen name="Profile" component={Profile} /> <Tab.Screen name="Profile" component={ProfileStackScreen} />
<Tab.Screen name="Contacts" component={Contacts} /> <Tab.Screen name="Contacts" component={ContactStackScreen} />
</Tab.Navigator> </Tab.Navigator>
</NavigationContainer> </NavigationContainer>
</SafeAreaProvider> </SafeAreaProvider>

View File

@ -0,0 +1,12 @@
import { useContext } from 'react';
import { View, TouchableOpacity, Text } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { AppContext } from 'context/AppContext';
export function Cards() {
const app = useContext(AppContext);
return (<SafeAreaView edges={['top']}><TouchableOpacity style={{ width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }} onPress={app.actions.logout}><Text>~ CARDS LOGOUT</Text></TouchableOpacity></SafeAreaView>)
}

View File

@ -0,0 +1,12 @@
import { useContext } from 'react';
import { View, TouchableOpacity, Text } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { AppContext } from 'context/AppContext';
export function Channels() {
const app = useContext(AppContext);
return (<SafeAreaView edges={['top']}><TouchableOpacity style={{ width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }} onPress={app.actions.logout}><Text>~ CHANNELS LOGOUT</Text></TouchableOpacity></SafeAreaView>)
}

View File

@ -0,0 +1,12 @@
import { useContext } from 'react';
import { View, TouchableOpacity, Text } from 'react-native';
import { SafeAreaView } from 'react-native-safe-area-context';
import { AppContext } from 'context/AppContext';
export function Profile() {
const app = useContext(AppContext);
return (<SafeAreaView edges={['top']}><TouchableOpacity style={{ width: '100%', height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center' }} onPress={app.actions.logout}><Text>~ PROFILE LOGOUT</Text></TouchableOpacity></SafeAreaView>)
}

View File

@ -1054,6 +1054,13 @@
"@babel/helper-validator-identifier" "^7.18.6" "@babel/helper-validator-identifier" "^7.18.6"
to-fast-properties "^2.0.0" to-fast-properties "^2.0.0"
"@egjs/hammerjs@^2.0.17":
version "2.0.17"
resolved "https://registry.yarnpkg.com/@egjs/hammerjs/-/hammerjs-2.0.17.tgz#5dc02af75a6a06e4c2db0202cae38c9263895124"
integrity sha512-XQsZgjm2EcVUiZQf11UBJQfmZeEmOW8DpI1gsFeln6w0ae0ii4dMQEQ0kjl6DspdWX1aGY1/loyXnP0JS06e/A==
dependencies:
"@types/hammerjs" "^2.0.36"
"@expo/bunyan@4.0.0", "@expo/bunyan@^4.0.0": "@expo/bunyan@4.0.0", "@expo/bunyan@^4.0.0":
version "4.0.0" version "4.0.0"
resolved "https://registry.npmjs.org/@expo/bunyan/-/bunyan-4.0.0.tgz" resolved "https://registry.npmjs.org/@expo/bunyan/-/bunyan-4.0.0.tgz"
@ -1725,6 +1732,15 @@
dependencies: dependencies:
nanoid "^3.1.23" nanoid "^3.1.23"
"@react-navigation/stack@^6.3.0":
version "6.3.0"
resolved "https://registry.yarnpkg.com/@react-navigation/stack/-/stack-6.3.0.tgz#3b268c5c61eba17fff1ed711e20ea94a9d5a1809"
integrity sha512-CCzdXkt57t3ikfV8TQIA7p4srf/o35ncT22ciGOAwZorB1M7Lqga18tsEqkk9R3qENl12a1Ei6VC7dkZezDXQQ==
dependencies:
"@react-navigation/elements" "^1.3.6"
color "^4.2.3"
warn-once "^0.1.0"
"@segment/loosely-validate-event@^2.0.0": "@segment/loosely-validate-event@^2.0.0":
version "2.0.0" version "2.0.0"
resolved "https://registry.npmjs.org/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz" resolved "https://registry.npmjs.org/@segment/loosely-validate-event/-/loosely-validate-event-2.0.0.tgz"
@ -1757,6 +1773,11 @@
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@types/hammerjs@^2.0.36":
version "2.0.41"
resolved "https://registry.yarnpkg.com/@types/hammerjs/-/hammerjs-2.0.41.tgz#f6ecf57d1b12d2befcce00e928a6a097c22980aa"
integrity sha512-ewXv/ceBaJprikMcxCmWU1FKyMAQ2X7a9Gtmzw8fcg2kIePI1crERDM818W+XYrxqdBBOdlf2rm137bU+BltCA==
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
version "2.0.4" version "2.0.4"
resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz" resolved "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz"
@ -3612,6 +3633,13 @@ hoist-non-react-statics@^2.3.1:
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz#c5903cf409c0dfd908f388e619d86b9c1174cb47"
integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw== integrity sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw==
hoist-non-react-statics@^3.3.0:
version "3.3.2"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45"
integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==
dependencies:
react-is "^16.7.0"
hosted-git-info@^3.0.2: hosted-git-info@^3.0.2:
version "3.0.8" version "3.0.8"
resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz" resolved "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-3.0.8.tgz"
@ -4276,7 +4304,7 @@ lodash.throttle@^4.1.1:
resolved "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz" resolved "https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-4.1.1.tgz"
integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ== integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ==
lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.4: lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.21, lodash@^4.17.4:
version "4.17.21" version "4.17.21"
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz" resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
@ -4305,7 +4333,7 @@ logkitty@^0.7.1:
dayjs "^1.8.15" dayjs "^1.8.15"
yargs "^15.1.0" yargs "^15.1.0"
loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1: loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4.0:
version "1.4.0" version "1.4.0"
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz" resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
@ -5324,6 +5352,15 @@ prompts@^2.3.2, prompts@^2.4.0:
kleur "^3.0.3" kleur "^3.0.3"
sisteransi "^1.0.5" sisteransi "^1.0.5"
prop-types@^15.7.2:
version "15.8.1"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5"
integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==
dependencies:
loose-envify "^1.4.0"
object-assign "^4.1.1"
react-is "^16.13.1"
pump@^3.0.0: pump@^3.0.0:
version "3.0.0" version "3.0.0"
resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz" resolved "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz"
@ -5408,7 +5445,7 @@ react-dom@18.0.0:
resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz" resolved "https://registry.npmjs.org/react-is/-/react-is-18.2.0.tgz"
integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w== integrity sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==
react-is@^16.13.0: react-is@^16.13.0, react-is@^16.13.1, react-is@^16.7.0:
version "16.13.1" version "16.13.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4"
integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==
@ -5433,6 +5470,17 @@ react-native-codegen@^0.69.2:
jscodeshift "^0.13.1" jscodeshift "^0.13.1"
nullthrows "^1.1.1" nullthrows "^1.1.1"
react-native-gesture-handler@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-2.6.1.tgz#66c40c8d720eb4729b301836a40fd34d14ec840f"
integrity sha512-0MXjRgNCrsQJSo3B9oXORw5spdm/9dkDbP2JU/3zrVyV9/MnRz5Oo3oy7hREKYWVMF9Gk2UpsCquFLRFQxeSxQ==
dependencies:
"@egjs/hammerjs" "^2.0.17"
hoist-non-react-statics "^3.3.0"
invariant "^2.2.4"
lodash "^4.17.21"
prop-types "^15.7.2"
react-native-gradle-plugin@^0.0.7: react-native-gradle-plugin@^0.0.7:
version "0.0.7" version "0.0.7"
resolved "https://registry.npmjs.org/react-native-gradle-plugin/-/react-native-gradle-plugin-0.0.7.tgz" resolved "https://registry.npmjs.org/react-native-gradle-plugin/-/react-native-gradle-plugin-0.0.7.tgz"