Compare commits
6 Commits
f98ffef4ce
...
925dc6e0c0
| Author | SHA1 | Date | |
|---|---|---|---|
| 925dc6e0c0 | |||
| c2014b2176 | |||
| 917c7e1524 | |||
| f81591ccb0 | |||
| ccc8b00348 | |||
| dd6627ae35 |
4
app.json
4
app.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"expo": {
|
"expo": {
|
||||||
"name": "iso-test-app",
|
"name": "mcbeno",
|
||||||
"slug": "mcbeno",
|
"slug": "mcbeno",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"orientation": "portrait",
|
"orientation": "portrait",
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
"newArchEnabled": true,
|
"newArchEnabled": true,
|
||||||
"ios": {
|
"ios": {
|
||||||
"supportsTablet": true,
|
"supportsTablet": true,
|
||||||
"bundleIdentifier": "com.anonymous.iso-test-app"
|
"bundleIdentifier": "com.devbeni.mcbeno"
|
||||||
},
|
},
|
||||||
"android": {
|
"android": {
|
||||||
"adaptiveIcon": {
|
"adaptiveIcon": {
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { MaterialIcons } from '@expo/vector-icons';
|
import { MaterialIcons } from '@expo/vector-icons';
|
||||||
import axios from 'axios';
|
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter } from 'expo-router';
|
||||||
import * as SecureStore from 'expo-secure-store';
|
import * as SecureStore from 'expo-secure-store';
|
||||||
import { StatusBar } from 'expo-status-bar';
|
import { StatusBar } from 'expo-status-bar';
|
||||||
@@ -20,7 +19,6 @@ export default function Index() {
|
|||||||
(async () => {
|
(async () => {
|
||||||
const savedEmail = await SecureStore.getItemAsync('email');
|
const savedEmail = await SecureStore.getItemAsync('email');
|
||||||
const savedPassword = await SecureStore.getItemAsync('password');
|
const savedPassword = await SecureStore.getItemAsync('password');
|
||||||
// ...
|
|
||||||
if (savedEmail && savedPassword) {
|
if (savedEmail && savedPassword) {
|
||||||
setUsername(savedEmail);
|
setUsername(savedEmail);
|
||||||
setPassword(savedPassword);
|
setPassword(savedPassword);
|
||||||
@@ -36,45 +34,45 @@ export default function Index() {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
const user = emailOverride ?? username;
|
const user = emailOverride ?? username;
|
||||||
const pass = passwordOverride ?? password;
|
const pass = passwordOverride ?? password;
|
||||||
// ...
|
|
||||||
try {
|
try {
|
||||||
const response = await axios.post(
|
|
||||||
"https://mymenu.mcdonalds.hu/api/AccountApi/Login",
|
const response = await fetch('https://menuapi.devbeni.lol/api/login', {
|
||||||
{
|
method: 'POST',
|
||||||
Data: {
|
|
||||||
UserName: user,
|
|
||||||
Password: pass
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Accept': 'application/json',
|
'Accept': 'application/json',
|
||||||
'referer': 'https://mymenu.mcdonalds.hu/',
|
},
|
||||||
'origin': 'https://mymenu.mcdonalds.hu'
|
body: JSON.stringify({ username: user, password: pass })
|
||||||
|
});
|
||||||
|
const loginData = await response.json();
|
||||||
|
if (!loginData || !loginData.token) {
|
||||||
|
throw new Error('Hibás bejelentkezés vagy hiányzó token!');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
const cookie = response.headers['set-cookie']?.join('; ') || '';
|
await SecureStore.setItemAsync('token', loginData.token);
|
||||||
|
|
||||||
const userId = response.data.Data.UserID;
|
|
||||||
const fullName = response.data.Data.FullName;
|
|
||||||
await SecureStore.setItemAsync('cookie', cookie || '');
|
|
||||||
await SecureStore.setItemAsync('userId', String(userId));
|
|
||||||
await SecureStore.setItemAsync('email', user);
|
await SecureStore.setItemAsync('email', user);
|
||||||
await SecureStore.setItemAsync('password', pass);
|
await SecureStore.setItemAsync('password', pass);
|
||||||
await SecureStore.setItemAsync('fullName', fullName || '');
|
|
||||||
|
const meResponse = await fetch('https://menuapi.devbeni.lol/api/@me', {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${loginData.token}`,
|
||||||
|
'Accept': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const meData = await meResponse.json();
|
||||||
|
if (meData && meData.data) {
|
||||||
|
await SecureStore.setItemAsync('fullName', meData.data.fullName || '');
|
||||||
|
await SecureStore.setItemAsync('userId', String(meData.data.userId || ''));
|
||||||
|
}
|
||||||
|
|
||||||
if (isAuto) {
|
if (isAuto) {
|
||||||
if (Platform.OS === 'android') {
|
if (Platform.OS === 'android') {
|
||||||
ToastAndroid.show('Sikeres automatikus bejelentkezés', ToastAndroid.SHORT);
|
ToastAndroid.show('Sikeres automatikus bejelentkezés', ToastAndroid.SHORT);
|
||||||
} else {
|
|
||||||
// ...
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
router.replace('/profile');
|
router.replace('/profile');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// ...
|
|
||||||
Alert.alert('Hiba', 'Hibás felhasználónév vagy jelszó, vagy hálózati hiba.');
|
Alert.alert('Hiba', 'Hibás felhasználónév vagy jelszó, vagy hálózati hiba.');
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|||||||
@@ -9,28 +9,47 @@ const PRIMARY = '#A24BFA';
|
|||||||
const BG = '#0c0a0a';
|
const BG = '#0c0a0a';
|
||||||
|
|
||||||
export default function Profile() {
|
export default function Profile() {
|
||||||
const [fullName, setFullName] = useState('');
|
const [user, setUser] = useState<any>(null);
|
||||||
const [email, setEmail] = useState('');
|
const [loading, setLoading] = useState(false);
|
||||||
const [userId, setUserId] = useState('');
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
(async () => {
|
fetchUser();
|
||||||
const name = await SecureStore.getItemAsync('fullName');
|
|
||||||
const mail = await SecureStore.getItemAsync('email');
|
|
||||||
const uid = await SecureStore.getItemAsync('userId');
|
|
||||||
setFullName(name || '');
|
|
||||||
setEmail(mail || '');
|
|
||||||
setUserId(uid || '');
|
|
||||||
})();
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
async function fetchUser() {
|
||||||
|
setLoading(true);
|
||||||
|
try {
|
||||||
|
const token = await SecureStore.getItemAsync('token');
|
||||||
|
if (!token) {
|
||||||
|
throw new Error('Nincs elmentett token, kérlek jelentkezz be újra!');
|
||||||
|
}
|
||||||
|
const response = await fetch('https://menuapi.devbeni.lol/api/@me', {
|
||||||
|
method: 'GET',
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
|
'Accept': 'application/json',
|
||||||
|
},
|
||||||
|
});
|
||||||
|
const data = await response.json();
|
||||||
|
if (!data || !data.data || !data.data.Data) {
|
||||||
|
setUser(null);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setUser(data.data.Data);
|
||||||
|
} catch (e) {
|
||||||
|
setUser(null);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function handleLogout() {
|
async function handleLogout() {
|
||||||
await SecureStore.deleteItemAsync('cookie');
|
await SecureStore.deleteItemAsync('token');
|
||||||
await SecureStore.deleteItemAsync('userId');
|
|
||||||
await SecureStore.deleteItemAsync('email');
|
await SecureStore.deleteItemAsync('email');
|
||||||
await SecureStore.deleteItemAsync('password');
|
await SecureStore.deleteItemAsync('password');
|
||||||
await SecureStore.deleteItemAsync('fullName');
|
await SecureStore.deleteItemAsync('fullName');
|
||||||
|
await SecureStore.deleteItemAsync('userId');
|
||||||
router.replace('/');
|
router.replace('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,11 +58,13 @@ export default function Profile() {
|
|||||||
<Text style={styles.title}>Profil</Text>
|
<Text style={styles.title}>Profil</Text>
|
||||||
<View style={styles.card}>
|
<View style={styles.card}>
|
||||||
<Text style={styles.label}>Név:</Text>
|
<Text style={styles.label}>Név:</Text>
|
||||||
<Text style={styles.value}>{fullName}</Text>
|
<Text style={styles.value}>{user?.FullName || '-'}</Text>
|
||||||
<Text style={styles.label}>Email:</Text>
|
|
||||||
<Text style={styles.value}>{email}</Text>
|
|
||||||
<Text style={styles.label}>UserID:</Text>
|
<Text style={styles.label}>UserID:</Text>
|
||||||
<Text style={styles.value}>{userId}</Text>
|
<Text style={styles.value}>{user?.UserID || '-'}</Text>
|
||||||
|
<Text style={styles.label}>Szerepkör:</Text>
|
||||||
|
<Text style={styles.value}>{user?.RoleCode || '-'}</Text>
|
||||||
|
<Text style={styles.label}>Étterem:</Text>
|
||||||
|
<Text style={styles.value}>{user?.RestaurantName || '-'}</Text>
|
||||||
<TouchableOpacity style={styles.logoutButton} onPress={handleLogout}>
|
<TouchableOpacity style={styles.logoutButton} onPress={handleLogout}>
|
||||||
<Text style={styles.logoutText}>Kijelentkezés</Text>
|
<Text style={styles.logoutText}>Kijelentkezés</Text>
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
|
|||||||
173
app/schedule.tsx
173
app/schedule.tsx
@@ -1,6 +1,5 @@
|
|||||||
import { Ionicons, MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons';
|
import { Ionicons, MaterialCommunityIcons, MaterialIcons } from '@expo/vector-icons';
|
||||||
import axios from 'axios';
|
import { addDays, addWeeks, format, getMonth, getYear, isSameDay, startOfWeek, subWeeks } from 'date-fns';
|
||||||
import { addDays, addMonths, endOfMonth, endOfWeek, format, getMonth, getYear, isSameDay, startOfMonth, startOfWeek, subMonths } from 'date-fns';
|
|
||||||
import { useRouter } from 'expo-router';
|
import { useRouter } from 'expo-router';
|
||||||
import * as SecureStore from 'expo-secure-store';
|
import * as SecureStore from 'expo-secure-store';
|
||||||
import React, { useEffect, useState } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
@@ -10,68 +9,60 @@ const PRIMARY = '#A24BFA';
|
|||||||
const BG = '#0c0a0a';
|
const BG = '#0c0a0a';
|
||||||
|
|
||||||
export default function Schedule() {
|
export default function Schedule() {
|
||||||
const [currentMonth, setCurrentMonth] = useState(new Date());
|
const [currentWeek, setCurrentWeek] = useState(new Date());
|
||||||
const [workdays, setWorkdays] = useState<any[]>([]);
|
const [workdays, setWorkdays] = useState<any[]>([]);
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchWorkdays();
|
fetchWorkdays();
|
||||||
}, [currentMonth]);
|
}, [currentWeek]);
|
||||||
|
|
||||||
async function fetchWorkdays() {
|
async function fetchWorkdays() {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
try {
|
try {
|
||||||
const userCookieRaw = await SecureStore.getItemAsync('cookie');
|
const token = await SecureStore.getItemAsync('token');
|
||||||
if (!userCookieRaw) {
|
if (!token) {
|
||||||
throw new Error('Nincs elmentett cookie, kérlek jelentkezz be újra!');
|
throw new Error('Nincs elmentett token, kérlek jelentkezz be újra!');
|
||||||
}
|
}
|
||||||
console.log('Lekért cookie:', userCookieRaw);
|
|
||||||
|
|
||||||
const userCookie = userCookieRaw.split(';')[0];
|
// Az aktuális hét első és utolsó napja
|
||||||
const year = getYear(currentMonth);
|
const weekStart = startOfWeek(currentWeek, { weekStartsOn: 1 });
|
||||||
const month = getMonth(currentMonth) + 1;
|
const weekEnd = addDays(weekStart, 6);
|
||||||
console.log('Lekérdezett hónap:', year, month);
|
const months = new Set([
|
||||||
console.log('Beosztás API hívás:', { year, month });
|
getMonth(weekStart) + 1,
|
||||||
console.log('Küldött cookie:', userCookie);
|
getMonth(weekEnd) + 1
|
||||||
|
]);
|
||||||
|
const years = new Set([
|
||||||
|
getYear(weekStart),
|
||||||
|
getYear(weekEnd)
|
||||||
|
]);
|
||||||
|
|
||||||
const response = await axios.post(
|
let allWorkdays: any[] = [];
|
||||||
'https://mymenu.mcdonalds.hu/api/UserDataApi/GetWorkDayMonthList',
|
for (const year of years) {
|
||||||
{ Data: { Year: year, Month: month } },
|
for (const month of months) {
|
||||||
{
|
const response = await fetch(`https://menuapi.devbeni.lol/api/@me/schedule?year=${year}&month=${month}`, {
|
||||||
|
method: 'GET',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Authorization': `Bearer ${token}`,
|
||||||
'cookie': userCookie,
|
'Accept': 'application/json',
|
||||||
'Origin': 'https://mymenu.mcdonalds.hu',
|
},
|
||||||
'Referer': 'https://mymenu.mcdonalds.hu/',
|
});
|
||||||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36',
|
const data = await response.json();
|
||||||
'Accept': 'application/json, text/plain, */*',
|
if (data && data.data && Array.isArray(data.data.Data)) {
|
||||||
'Accept-Language': 'hu-HU,hu;q=0.9',
|
allWorkdays = allWorkdays.concat(data.data.Data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
|
||||||
|
|
||||||
const cookie = response.headers['set-cookie']?.join('; ');
|
|
||||||
if (cookie) {
|
|
||||||
await SecureStore.setItemAsync('cookie', cookie);
|
|
||||||
} else {
|
|
||||||
console.warn('Nincs set-cookie fejléc a válaszban!');
|
|
||||||
}
|
}
|
||||||
|
setWorkdays(allWorkdays);
|
||||||
console.log('API teljes válasz:', response.data);
|
|
||||||
if (!response.data || !response.data.data || !response.data.data.Data) {
|
|
||||||
console.log('Nincs beosztás adat a válaszban!');
|
|
||||||
setWorkdays([]);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
setWorkdays(response.data.data.Data);
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
const err = e as any;
|
const err = e as any;
|
||||||
if (err.response) {
|
if (err.response) {
|
||||||
console.log('API válasz hiba:', err.response.data);
|
console.log('API error response:', {
|
||||||
|
data: err.response.data,
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('Beosztás API hiba:', e);
|
console.log('Network error:', e);
|
||||||
}
|
}
|
||||||
setWorkdays([]);
|
setWorkdays([]);
|
||||||
} finally {
|
} finally {
|
||||||
@@ -80,59 +71,83 @@ export default function Schedule() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function renderCalendar() {
|
function renderCalendar() {
|
||||||
const monthStart = startOfMonth(currentMonth);
|
const weekStart = startOfWeek(currentWeek, { weekStartsOn: 1 });
|
||||||
const monthEnd = endOfMonth(monthStart);
|
|
||||||
const startDate = startOfWeek(monthStart, { weekStartsOn: 1 });
|
|
||||||
const endDate = endOfWeek(monthEnd, { weekStartsOn: 1 });
|
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const rows = [];
|
// 2 soros grid: első sor 4 nap, második sor 3 nap
|
||||||
let days = [];
|
const weekDays = Array.from({ length: 7 }, (_, i) => addDays(weekStart, i));
|
||||||
let day = startDate;
|
const firstRow = weekDays.slice(0, 4);
|
||||||
let formattedDate = '';
|
const secondRow = weekDays.slice(4);
|
||||||
while (day <= endDate) {
|
|
||||||
for (let i = 0; i < 7; i++) {
|
function renderDayBox(day: string | number | Date) {
|
||||||
formattedDate = format(day, 'yyyy-MM-dd');
|
const formattedDate = format(day, 'yyyy-MM-dd');
|
||||||
const wd = workdays.find(w => w.WorkDay?.slice(0, 10) === formattedDate);
|
const wd = workdays.find(w => w.WorkDay?.slice(0, 10) === formattedDate);
|
||||||
let bg = 'rgba(24,20,28,0.7)';
|
let bg = '#ede7f6';
|
||||||
let color = '#fff';
|
let color = '#6a1b9a';
|
||||||
let borderWidth = 0;
|
let borderWidth = 0;
|
||||||
if (isSameDay(day, today)) {
|
if (isSameDay(day, today)) {
|
||||||
borderWidth = 2;
|
borderWidth = 2;
|
||||||
color = PRIMARY;
|
color = PRIMARY;
|
||||||
}
|
}
|
||||||
if (wd) {
|
if (wd) {
|
||||||
bg = wd.color || 'deepskyblue';
|
if (wd.Type === 1) {
|
||||||
color = '#222';
|
bg = '#B388FF';
|
||||||
|
color = '#311b92';
|
||||||
|
} else if (wd.Type === 10) {
|
||||||
|
bg = '#A24BFA';
|
||||||
|
color = '#fff';
|
||||||
}
|
}
|
||||||
days.push(
|
}
|
||||||
<View key={day.toString()} style={{ flex: 1, aspectRatio: 1, margin: 2 }}>
|
return (
|
||||||
|
<View
|
||||||
|
key={day.toString()}
|
||||||
|
style={{
|
||||||
|
flex: 1,
|
||||||
|
margin: 6,
|
||||||
|
minWidth: 60,
|
||||||
|
minHeight: 70,
|
||||||
|
maxWidth: 120,
|
||||||
|
maxHeight: 120,
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
}}
|
||||||
|
>
|
||||||
<View style={{
|
<View style={{
|
||||||
backgroundColor: bg,
|
backgroundColor: bg,
|
||||||
borderRadius: 8,
|
borderRadius: 18,
|
||||||
borderWidth,
|
borderWidth,
|
||||||
borderColor: PRIMARY,
|
borderColor: PRIMARY,
|
||||||
justifyContent: 'center',
|
justifyContent: 'center',
|
||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
flex: 1,
|
width: '100%',
|
||||||
|
minHeight: 60,
|
||||||
|
paddingVertical: 10,
|
||||||
|
paddingHorizontal: 4,
|
||||||
|
shadowColor: '#a24bfa',
|
||||||
|
shadowOpacity: 0.10,
|
||||||
|
shadowRadius: 8,
|
||||||
|
shadowOffset: { width: 0, height: 2 },
|
||||||
|
overflow: 'hidden',
|
||||||
}}>
|
}}>
|
||||||
<Text style={{ color, fontWeight: isSameDay(day, today) ? 'bold' : 'normal' }}>{format(day, 'd')}</Text>
|
<Text style={{ color, fontWeight: 'bold', fontSize: 22, textAlign: 'center', width: '100%' }}>{format(day, 'd')}</Text>
|
||||||
{wd && <Text style={{ color, fontSize: 10 }}>{wd.text}</Text>}
|
{wd && wd.Type === 1 && (
|
||||||
|
<Text style={{ color, fontSize: 15, fontWeight: 'bold', marginTop: 4, textAlign: 'center', width: '100%' }} numberOfLines={2} ellipsizeMode="tail">PN</Text>
|
||||||
|
)}
|
||||||
|
{wd && wd.Type === 10 && wd.text && (
|
||||||
|
<Text style={{ color, fontSize: 15, fontWeight: 'bold', marginTop: 4, textAlign: 'center', width: '100%' }} numberOfLines={2} ellipsizeMode="tail">{wd.text}</Text>
|
||||||
|
)}
|
||||||
</View>
|
</View>
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
day = addDays(day, 1);
|
|
||||||
}
|
|
||||||
rows.push(<View key={day.toString()} style={{ flexDirection: 'row' }}>{days}</View>);
|
|
||||||
days = [];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View>
|
<View>
|
||||||
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 12 }}>
|
<View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginBottom: 12 }}>
|
||||||
<TouchableOpacity onPress={() => setCurrentMonth(subMonths(currentMonth, 1))}><Ionicons name="chevron-back" size={28} color="#fff" /></TouchableOpacity>
|
<TouchableOpacity onPress={() => setCurrentWeek(subWeeks(currentWeek, 1))}><Ionicons name="chevron-back" size={28} color="#fff" /></TouchableOpacity>
|
||||||
<Text style={{ color: '#fff', fontSize: 18, fontWeight: 'bold' }}>{format(currentMonth, 'yyyy. MMMM')}</Text>
|
<Text style={{ color: '#fff', fontSize: 18, fontWeight: 'bold' }}>{format(weekStart, 'yyyy. MMMM d.') + ' - ' + format(addDays(weekStart, 6), 'MMMM d.')}</Text>
|
||||||
<TouchableOpacity onPress={() => setCurrentMonth(addMonths(currentMonth, 1))}><Ionicons name="chevron-forward" size={28} color="#fff" /></TouchableOpacity>
|
<TouchableOpacity onPress={() => setCurrentWeek(addWeeks(currentWeek, 1))}><Ionicons name="chevron-forward" size={28} color="#fff" /></TouchableOpacity>
|
||||||
</View>
|
</View>
|
||||||
<View style={{ flexDirection: 'row', marginBottom: 4 }}>
|
<View style={{ flexDirection: 'row', marginBottom: 4, width: '100%' }}>
|
||||||
{["H", "K", "Sz", "Cs", "P", "Szo", "V"].map(d => (
|
{["H", "K", "Sz", "Cs", "P", "Szo", "V"].map(d => (
|
||||||
<Text key={d} style={{ flex: 1, color: '#bdbdbd', textAlign: 'center', fontWeight: 'bold' }}>{d}</Text>
|
<Text key={d} style={{ flex: 1, color: '#bdbdbd', textAlign: 'center', fontWeight: 'bold' }}>{d}</Text>
|
||||||
))}
|
))}
|
||||||
@@ -140,18 +155,24 @@ export default function Schedule() {
|
|||||||
{loading ? (
|
{loading ? (
|
||||||
<Text style={{ color: '#fff', textAlign: 'center', marginTop: 24 }}>Betöltés…</Text>
|
<Text style={{ color: '#fff', textAlign: 'center', marginTop: 24 }}>Betöltés…</Text>
|
||||||
) : (
|
) : (
|
||||||
<View>{rows}</View>
|
<View style={{ width: '100%', alignItems: 'center', justifyContent: 'center' }}>
|
||||||
|
<View style={{ flexDirection: 'row', width: '100%', justifyContent: 'center' }}>
|
||||||
|
{firstRow.map(renderDayBox)}
|
||||||
|
</View>
|
||||||
|
<View style={{ flexDirection: 'row', width: '75%', justifyContent: 'center' }}>
|
||||||
|
{secondRow.map(renderDayBox)}
|
||||||
|
</View>
|
||||||
|
</View>
|
||||||
)}
|
)}
|
||||||
</View>
|
</View>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScrollView style={{ flex: 1, backgroundColor: BG }} contentContainerStyle={{ flexGrow: 1, justifyContent: 'center', alignItems: 'center', minHeight: '100%', paddingBottom: 80 }}>
|
<ScrollView style={{ flex: 1, backgroundColor: BG }} contentContainerStyle={{ flexGrow: 1, justifyContent: 'center', alignItems: 'center', minHeight: '100%', paddingBottom: 80, width: '100%' }}>
|
||||||
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', width: '100%' }}>
|
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center', width: '100%' }}>
|
||||||
<View style={[styles.card, { alignSelf: 'center', marginTop: 48, marginBottom: 48 }]}>
|
<View style={[styles.card, { alignSelf: 'center', marginTop: 48, marginBottom: 48, width: '100%' }]}>
|
||||||
<Text style={styles.label}>Beosztás naptár</Text>
|
<Text style={styles.label}>Beosztás naptár</Text>
|
||||||
{/* Hibaüzenet, ha nincs bejelentkezve vagy nincs beosztás */}
|
|
||||||
{(!loading && workdays.length === 0) && (
|
{(!loading && workdays.length === 0) && (
|
||||||
<Text style={{ color: '#ff5252', textAlign: 'center', marginBottom: 12, fontWeight: 'bold' }}>
|
<Text style={{ color: '#ff5252', textAlign: 'center', marginBottom: 12, fontWeight: 'bold' }}>
|
||||||
Nincs beosztás vagy nem vagy bejelentkezve!
|
Nincs beosztás vagy nem vagy bejelentkezve!
|
||||||
|
|||||||
5
eas.json
5
eas.json
@@ -6,7 +6,10 @@
|
|||||||
"build": {
|
"build": {
|
||||||
"development": {
|
"development": {
|
||||||
"developmentClient": true,
|
"developmentClient": true,
|
||||||
"distribution": "internal"
|
"distribution": "internal",
|
||||||
|
"ios": {
|
||||||
|
"simulator": true
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"preview": {
|
"preview": {
|
||||||
"distribution": "internal"
|
"distribution": "internal"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "iso-test-app",
|
"name": "mcbeno",
|
||||||
"main": "expo-router/entry",
|
"main": "expo-router/entry",
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -7,7 +7,8 @@
|
|||||||
"android": "expo run:android",
|
"android": "expo run:android",
|
||||||
"ios": "expo run:ios",
|
"ios": "expo run:ios",
|
||||||
"web": "expo start --web",
|
"web": "expo start --web",
|
||||||
"lint": "expo lint"
|
"lint": "expo lint",
|
||||||
|
"build": "expo build:ios && expo build:android"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@expo/vector-icons": "^14.1.0",
|
"@expo/vector-icons": "^14.1.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user