Skip to content

Commit 14de673

Browse files
committed
meetup 7/18/2024
1 parent 8a4b3bc commit 14de673

File tree

4 files changed

+138
-18
lines changed

4 files changed

+138
-18
lines changed

.github/workflows/release.yaml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ jobs:
3232
--paths "$env:GITHUB_WORKSPACE\controller" `
3333
"manage.py"
3434
35-
- name: List/print files in dist folder
36-
run: |
37-
Get-ChildItem -Path dist -Recurse
38-
3935
- name: Copy additional files
4036
run: |
4137
Copy-Item -Path "sample.env" -Destination "dist\manage\sample.env"
@@ -47,18 +43,8 @@ jobs:
4743
run: |
4844
cd dist
4945
Compress-Archive -Path manage -DestinationPath manage-windows.zip
50-
Write-Host "Current Directory: $(Get-Location)"
51-
Get-ChildItem -Path manage-windows.zip
5246
Move-Item -Path manage-windows.zip -Destination $env:GITHUB_WORKSPACE
53-
Write-Host "Files in $env:GITHUB_WORKSPACE:"
54-
Get-ChildItem -Path $env:GITHUB_WORKSPACE
5547
56-
- name: Verify current directory and contents
57-
run: |
58-
Write-Host "Current Directory: $(Get-Location)"
59-
Get-ChildItem -Path $env:GITHUB_WORKSPACE
60-
61-
6248
- name: Upload artifact
6349
uses: actions/upload-artifact@v4
6450
with:

capture/App.tsx

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
import React, { useState } from 'react';
2-
import { TextInput, View, Text, TouchableOpacity, StyleSheet, PermissionsAndroid, Platform } from 'react-native';
2+
import { TextInput, View, Text, TouchableOpacity, StyleSheet, PermissionsAndroid, Platform, Modal } from 'react-native';
33
import RNFS from 'react-native-fs';
44
import { launchCamera, CameraOptions } from 'react-native-image-picker';
55
import { request, PERMISSIONS, RESULTS } from 'react-native-permissions';
6+
import { Calendar, DateData } from 'react-native-calendars';
67

78
const App = () => {
89
const [inputText, setInputText] = useState('');
10+
const [isCalendarVisible, setIsCalendarVisible] = useState(false);
11+
const [selectedDate, setSelectedDate] = useState('');
912

1013
const requestPermissions = async () => {
1114
if (Platform.OS === 'android') {
@@ -28,7 +31,6 @@ const App = () => {
2831
console.warn(err);
2932
}
3033
} else {
31-
// iOS Permissions
3234
const cameraPermission = await request(PERMISSIONS.IOS.CAMERA);
3335
const storagePermission = await request(PERMISSIONS.IOS.PHOTO_LIBRARY);
3436
if (cameraPermission !== RESULTS.GRANTED || storagePermission !== RESULTS.GRANTED) {
@@ -71,6 +73,18 @@ const App = () => {
7173
}
7274
};
7375

76+
const schedulePost = () => {
77+
setIsCalendarVisible(true);
78+
};
79+
80+
81+
82+
const onDayPress = (day: DateData) => {
83+
setSelectedDate(day.dateString);
84+
setIsCalendarVisible(false);
85+
console.log('Selected date: ', day.dateString);
86+
};
87+
7488
return (
7589
<View style={styles.container}>
7690
<Text style={styles.title}>Social media scheduler</Text>
@@ -86,17 +100,62 @@ const App = () => {
86100
</TouchableOpacity>
87101
</View>
88102

103+
<View style={styles.captureContainer}>
104+
<TouchableOpacity onPress={schedulePost} style={styles.capture}>
105+
<Text style={styles.captureText}>SCHEDULE</Text>
106+
</TouchableOpacity>
107+
</View>
108+
89109
<TextInput
90110
style={styles.textInput}
91111
placeholder="Enter text to save"
92112
value={inputText}
93113
onChangeText={setInputText}
94114
/>
115+
116+
{/* Full screen Modal */}
117+
<Modal presentationStyle='fullScreen'
118+
visible={isCalendarVisible}
119+
animationType='slide'
120+
onRequestClose={() => setIsCalendarVisible(false)}
121+
>
122+
123+
<Calendar
124+
onDayPress={onDayPress}
125+
markedDates={{
126+
[selectedDate]: { selected: true, marked: true, selectedColor: 'blue' },
127+
}}
128+
theme={{
129+
'stylesheet.calendar.main': {
130+
base: {
131+
width: '100%',
132+
height: '100%',
133+
justifyContent: 'center',
134+
alignItems: 'center',
135+
},
136+
},
137+
}}
138+
/>
139+
140+
141+
</Modal>
142+
95143
</View>
96144
);
97145
};
98146

99147
const styles = StyleSheet.create({
148+
fullScreenModal: {
149+
flex: 1,
150+
justifyContent: 'center',
151+
alignItems: 'center',
152+
backgroundColor: 'rgba(0,0,0,0.5)',
153+
},
154+
calendarContainer: {
155+
flex: 1,
156+
justifyContent: 'center',
157+
alignItems: 'center',
158+
},
100159
container: {
101160
flex: 1,
102161
justifyContent: 'center',
@@ -131,6 +190,12 @@ const styles = StyleSheet.create({
131190
padding: 10,
132191
color: 'white',
133192
},
193+
modalContainer: {
194+
flex: 1,
195+
justifyContent: 'center',
196+
alignItems: 'center',
197+
backgroundColor: 'rgba(0,0,0,0.5)',
198+
},
134199
});
135200

136201
export default App;

capture/package-lock.json

Lines changed: 70 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

capture/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"dependencies": {
1313
"react": "18.2.0",
1414
"react-native": "0.74.1",
15+
"react-native-calendars": "^1.1305.0",
1516
"react-native-camera": "^4.2.1",
1617
"react-native-fs": "^2.20.0",
1718
"react-native-permissions": "^4.1.5"

0 commit comments

Comments
 (0)