-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodyGarciaa/Legal-Rights-Prea-Pages (#13)
* set up legal rights skeleton, can go to video page with nothing there yet tho * added video and testing player * more testing with video, lowk not getting .mp4 to work * legal rights page scrollable * added caption buttons, lowk still to add more to it * closed caption buttons are toggleable and XOR * finished pr * resolved philip's problems lol
- Loading branch information
1 parent
c0eb400
commit 965ac43
Showing
11 changed files
with
327 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// import * as React from 'react'; | ||
// import { createNativeStackNavigator } from '@react-navigation/native-stack'; | ||
// import VideoPage from '@/screens/LegalRights/VideoPage'; | ||
// import LegalRights from '@/screens/LegalRights/'; | ||
|
||
// const Stack = createNativeStackNavigator(); | ||
|
||
// export default function LegalRightsNav() { | ||
// return ( | ||
// <> | ||
// <Stack.Screen name="Legal Rights" component={LegalRights} /> | ||
// <Stack.Screen name="Video Page" component={VideoPage} /> | ||
// </> | ||
// ); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Pressable, ScrollView, Text, View } from 'react-native'; | ||
import { Video } from 'expo-av'; | ||
import { styles } from './styles'; | ||
|
||
export default function VideoPage() { | ||
return ( | ||
<ScrollView style={styles.container}> | ||
<Video | ||
source={require('@/assets/videos/da_link.mp4')} | ||
rate={1.0} | ||
volume={1.0} | ||
isMuted={false} | ||
shouldPlay | ||
isLooping | ||
style={styles.video} | ||
/> | ||
|
||
<View style={styles.buttonContainer}> | ||
<Pressable style={[styles.captionButtons]}> | ||
<Text style={styles.buttonText}>{'< Previous Section'}</Text> | ||
</Pressable> | ||
<Pressable style={[styles.captionButtons]}> | ||
<Text style={styles.buttonText}>{'Next Section >'}</Text> | ||
</Pressable> | ||
</View> | ||
</ScrollView> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { StyleSheet } from 'react-native'; | ||
|
||
export const styles = StyleSheet.create({ | ||
container: { | ||
display: 'flex', | ||
flexDirection: 'column', | ||
marginTop: 10, | ||
padding: 30, | ||
}, | ||
video: { | ||
width: '100%', | ||
height: 630, | ||
}, | ||
buttonContainer: { | ||
display: 'flex', | ||
flexDirection: 'row', | ||
justifyContent: 'space-between', | ||
paddingVertical: 25, | ||
}, | ||
captionButtons: { | ||
borderRadius: 10, | ||
width: 180, | ||
height: 50, | ||
borderWidth: 1, | ||
backgroundColor: '#D9D9D9', | ||
borderColor: '#D9D9D9', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
}, | ||
buttonText: { | ||
fontWeight: 'bold', | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
import { useState } from 'react'; | ||
import { Image, Pressable, ScrollView, Text, View } from 'react-native'; | ||
import placeholderPoster from '@/assets/images/placeholder.png'; | ||
import { styles } from './styles'; | ||
|
||
export default function LegalRights({ navigation }: { navigation: any }) { | ||
const rickRolls = () => { | ||
navigation.navigate('Video Page'); | ||
}; | ||
|
||
const placeholderModulesEnglish = [ | ||
{ | ||
title: 'Section Title 1', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Section Title 2', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Section Title 3', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Section Title 4', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Section Title 5', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Section Title 6', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Section Title 7', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Section Title 8', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Section Title 9', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
]; | ||
|
||
const placeholderModulesSpanish = [ | ||
{ | ||
title: 'Título de la Sección 1', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Título de la Sección 2', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Título de la Sección 3', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Título de la Sección 4', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Título de la Sección 5', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Título de la Sección 6', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Título de la Sección 7', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Título de la Sección 8', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
{ | ||
title: 'Título de la Sección 9', | ||
poster_url: placeholderPoster, | ||
onClickFunction: rickRolls, | ||
}, | ||
]; | ||
|
||
const [spanishPressed, setSpanishPressed] = useState(false); | ||
|
||
const currentModules = spanishPressed | ||
? placeholderModulesEnglish | ||
: placeholderModulesSpanish; | ||
|
||
return ( | ||
<> | ||
<Text style={styles.title}>Legal Rights</Text> | ||
<View style={styles.buttonContainer}> | ||
<Pressable | ||
style={[ | ||
styles.captionButtons, | ||
spanishPressed && styles.captionButtonsPressed, | ||
]} | ||
onPress={() => { | ||
if (!spanishPressed) { | ||
setSpanishPressed(!spanishPressed); | ||
} | ||
}} | ||
> | ||
<Text style={styles.buttonText}>English CC</Text> | ||
</Pressable> | ||
<Pressable | ||
style={[ | ||
styles.captionButtons, | ||
!spanishPressed && styles.captionButtonsPressed, | ||
]} | ||
onPress={() => { | ||
if (spanishPressed) { | ||
setSpanishPressed(!spanishPressed); | ||
} | ||
}} | ||
> | ||
<Text style={styles.buttonText}>Spanish CC</Text> | ||
</Pressable> | ||
</View> | ||
<ScrollView> | ||
<View style={styles.preaModulesView}> | ||
{currentModules.map(section => ( | ||
<Pressable | ||
style={styles.preaModule} | ||
onPress={section['onClickFunction']} | ||
> | ||
<Image | ||
style={styles.modulePoster} | ||
source={section['poster_url']} | ||
/> | ||
<Text style={styles.moduleTitle}>{section['title']}</Text> | ||
</Pressable> | ||
))} | ||
</View> | ||
</ScrollView> | ||
</> | ||
); | ||
} |
Oops, something went wrong.