From 1b7fef188ec2aee0706fc1204432315db3d4fec6 Mon Sep 17 00:00:00 2001 From: Shravya Ramesh <37447613+shravyaramesh@users.noreply.github.com> Date: Mon, 19 Oct 2020 12:42:15 -0700 Subject: Tma235/231 Individual view and horizontal view (#59) * Implemented modal stack navigation for moment view, created a rough UI for individual moment view [incl: title, image(not displayed)] * bare bones beginnning * Created individual moment screen, moment tile for horizontal view * Alert * Fix initial route Co-authored-by: Ashm Walia Co-authored-by: Ashm Walia <40498934+ashmgarv@users.noreply.github.com> --- src/routes/profile/MomentStack.tsx | 11 ++++++++ src/routes/profile/MomentStackScreen.tsx | 46 ++++++++++++++++++++++++++++++++ src/routes/profile/ProfileStack.tsx | 5 +++- src/routes/profile/index.ts | 2 ++ 4 files changed, 63 insertions(+), 1 deletion(-) create mode 100644 src/routes/profile/MomentStack.tsx create mode 100644 src/routes/profile/MomentStackScreen.tsx (limited to 'src/routes/profile') diff --git a/src/routes/profile/MomentStack.tsx b/src/routes/profile/MomentStack.tsx new file mode 100644 index 00000000..83853c99 --- /dev/null +++ b/src/routes/profile/MomentStack.tsx @@ -0,0 +1,11 @@ +import {createStackNavigator} from '@react-navigation/stack'; +import {MomentType} from '../../types'; + +export type MomentStackParams = { + Profile: undefined; + IndividualMoment: { + moment: MomentType; + }; +}; + +export const MomentStack = createStackNavigator(); diff --git a/src/routes/profile/MomentStackScreen.tsx b/src/routes/profile/MomentStackScreen.tsx new file mode 100644 index 00000000..8768199a --- /dev/null +++ b/src/routes/profile/MomentStackScreen.tsx @@ -0,0 +1,46 @@ +import React from 'react'; +import {IndividualMoment} from '../../screens'; +import {MomentStack} from './MomentStack'; +import Profile from './Profile'; + +const MomentStackScreen: React.FC = () => { + return ( + ({ + cardStyle: { + opacity: progress.interpolate({ + inputRange: [0, 0.5, 0.9, 1], + outputRange: [0, 0.25, 0.7, 1], + }), + }, + overlayStyle: { + backgroundColor: '#808080', + opacity: progress.interpolate({ + inputRange: [0, 1], + outputRange: [0, 0.9], + extrapolate: 'clamp', + }), + }, + }), + }} + initialRouteName="Profile" + mode="modal"> + + + + ); +}; + +export default MomentStackScreen; diff --git a/src/routes/profile/ProfileStack.tsx b/src/routes/profile/ProfileStack.tsx index 63ab9a10..df4d234f 100644 --- a/src/routes/profile/ProfileStack.tsx +++ b/src/routes/profile/ProfileStack.tsx @@ -10,7 +10,10 @@ export type ProfileStackParams = { socialMediaHandle: string; isProfileView: boolean; }; - CaptionScreen: {title: string; image: object}; + CaptionScreen: { + title: string; + image: object; + }; }; export const ProfileStack = createStackNavigator(); diff --git a/src/routes/profile/index.ts b/src/routes/profile/index.ts index 367f4cc6..1ab9cb7e 100644 --- a/src/routes/profile/index.ts +++ b/src/routes/profile/index.ts @@ -1,2 +1,4 @@ export * from './ProfileStack'; +export * from './MomentStack'; +export * from './MomentStackScreen'; export {default} from './Profile'; -- cgit v1.2.3-70-g09d2