Skip to content

Commit

Permalink
meetup 7/18/2024
Browse files Browse the repository at this point in the history
  • Loading branch information
Masterjx9 committed Jul 18, 2024
1 parent 8a4b3bc commit 14de673
Show file tree
Hide file tree
Showing 4 changed files with 138 additions and 18 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ jobs:
--paths "$env:GITHUB_WORKSPACE\controller" `
"manage.py"
- name: List/print files in dist folder
run: |
Get-ChildItem -Path dist -Recurse
- name: Copy additional files
run: |
Copy-Item -Path "sample.env" -Destination "dist\manage\sample.env"
Expand All @@ -47,18 +43,8 @@ jobs:
run: |
cd dist
Compress-Archive -Path manage -DestinationPath manage-windows.zip
Write-Host "Current Directory: $(Get-Location)"
Get-ChildItem -Path manage-windows.zip
Move-Item -Path manage-windows.zip -Destination $env:GITHUB_WORKSPACE
Write-Host "Files in $env:GITHUB_WORKSPACE:"
Get-ChildItem -Path $env:GITHUB_WORKSPACE
- name: Verify current directory and contents
run: |
Write-Host "Current Directory: $(Get-Location)"
Get-ChildItem -Path $env:GITHUB_WORKSPACE
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
69 changes: 67 additions & 2 deletions capture/App.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React, { useState } from 'react';
import { TextInput, View, Text, TouchableOpacity, StyleSheet, PermissionsAndroid, Platform } from 'react-native';
import { TextInput, View, Text, TouchableOpacity, StyleSheet, PermissionsAndroid, Platform, Modal } from 'react-native';
import RNFS from 'react-native-fs';
import { launchCamera, CameraOptions } from 'react-native-image-picker';
import { request, PERMISSIONS, RESULTS } from 'react-native-permissions';
import { Calendar, DateData } from 'react-native-calendars';

const App = () => {
const [inputText, setInputText] = useState('');
const [isCalendarVisible, setIsCalendarVisible] = useState(false);
const [selectedDate, setSelectedDate] = useState('');

const requestPermissions = async () => {
if (Platform.OS === 'android') {
Expand All @@ -28,7 +31,6 @@ const App = () => {
console.warn(err);
}
} else {
// iOS Permissions
const cameraPermission = await request(PERMISSIONS.IOS.CAMERA);
const storagePermission = await request(PERMISSIONS.IOS.PHOTO_LIBRARY);
if (cameraPermission !== RESULTS.GRANTED || storagePermission !== RESULTS.GRANTED) {
Expand Down Expand Up @@ -71,6 +73,18 @@ const App = () => {
}
};

const schedulePost = () => {
setIsCalendarVisible(true);
};



const onDayPress = (day: DateData) => {
setSelectedDate(day.dateString);
setIsCalendarVisible(false);
console.log('Selected date: ', day.dateString);
};

return (
<View style={styles.container}>
<Text style={styles.title}>Social media scheduler</Text>
Expand All @@ -86,17 +100,62 @@ const App = () => {
</TouchableOpacity>
</View>

<View style={styles.captureContainer}>
<TouchableOpacity onPress={schedulePost} style={styles.capture}>
<Text style={styles.captureText}>SCHEDULE</Text>
</TouchableOpacity>
</View>

<TextInput
style={styles.textInput}
placeholder="Enter text to save"
value={inputText}
onChangeText={setInputText}
/>

{/* Full screen Modal */}
<Modal presentationStyle='fullScreen'
visible={isCalendarVisible}
animationType='slide'
onRequestClose={() => setIsCalendarVisible(false)}
>

<Calendar
onDayPress={onDayPress}
markedDates={{
[selectedDate]: { selected: true, marked: true, selectedColor: 'blue' },
}}
theme={{
'stylesheet.calendar.main': {
base: {
width: '100%',
height: '100%',
justifyContent: 'center',
alignItems: 'center',
},
},
}}
/>


</Modal>

</View>
);
};

const styles = StyleSheet.create({
fullScreenModal: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.5)',
},
calendarContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
},
container: {
flex: 1,
justifyContent: 'center',
Expand Down Expand Up @@ -131,6 +190,12 @@ const styles = StyleSheet.create({
padding: 10,
color: 'white',
},
modalContainer: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: 'rgba(0,0,0,0.5)',
},
});

export default App;
72 changes: 70 additions & 2 deletions capture/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions capture/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"dependencies": {
"react": "18.2.0",
"react-native": "0.74.1",
"react-native-calendars": "^1.1305.0",
"react-native-camera": "^4.2.1",
"react-native-fs": "^2.20.0",
"react-native-permissions": "^4.1.5"
Expand Down

0 comments on commit 14de673

Please sign in to comment.