From 46835c6071dba70587744ff65a0b0f8210cfcee0 Mon Sep 17 00:00:00 2001 From: b3ni15 Date: Sun, 21 Dec 2025 00:46:00 +0100 Subject: [PATCH] feat: update TableBackground and LobbyScreen for improved UI and functionality; add promo code support in LobbyScreen --- src/components/TableBackground.js | 4 +- src/screens/LobbyScreen.js | 158 ++++++++++++++++++------------ src/screens/TableScreen.js | 32 +++--- 3 files changed, 119 insertions(+), 75 deletions(-) diff --git a/src/components/TableBackground.js b/src/components/TableBackground.js index 74e841e..ea3a556 100644 --- a/src/components/TableBackground.js +++ b/src/components/TableBackground.js @@ -6,7 +6,7 @@ export default function TableBackground({ children, style }) { return ( - - - Lobbi - Egyenleg: {user.balance} Ft + + + + Lobbi + Egyenleg: {user.balance} Ft + + - - - - Gyors feltöltés - - quickDeposit(200)} variant="gold" disabled={depositLoading} /> - quickDeposit(500)} variant="gold" disabled={depositLoading} /> - quickDeposit(1000)} variant="gold" disabled={depositLoading} /> - - - - Egyedi összeg - + + Gyors feltöltés + + quickDeposit(200)} variant="gold" disabled={depositLoading} /> + quickDeposit(500)} variant="gold" disabled={depositLoading} /> + quickDeposit(1000)} variant="gold" disabled={depositLoading} /> + + + + Egyedi összeg + + setCustomAmount(value.replace(/[^0-9]/g, ''))} + placeholder="pl. 250" + placeholderTextColor="rgba(255,255,255,0.35)" + keyboardType="number-pad" + style={styles.customInput} + /> + Ft + + Minimum 175 Ft, maximum 1000 Ft. + + handleDeposit(customValue)} + variant="gold" + disabled={depositLoading || !customValid} + /> + + + Promó kód + setCustomAmount(value.replace(/[^0-9]/g, ''))} - placeholder="pl. 250" + value={promoCode} + onChangeText={(value) => setPromoCode(value.replace(/\\s/g, '').toUpperCase())} + placeholder="PL. BLACKJACK2025" placeholderTextColor="rgba(255,255,255,0.35)" - keyboardType="number-pad" + autoCapitalize="characters" style={styles.customInput} /> - Ft - Minimum 175 Ft, maximum 1000 Ft. - handleDeposit(customValue)} - variant="gold" - disabled={depositLoading || !customValid} - /> + {depositError ? {depositError} : null} - {depositError ? {depositError} : null} - - Asztalok - {loading ? ( - - ) : ( - - {tables.map((table) => { - const free = table.seatCount - table.occupied; - return ( - - - Asztal {table.id} - Szabad hely: {free} / {table.seatCount} - - {Array.from({ length: table.seatCount }).map((_, idx) => ( - - ))} + Asztalok + {loading ? ( + + ) : ( + + {tables.map((table) => { + const free = table.seatCount - table.occupied; + return ( + + + Asztal {table.id} + Szabad hely: {free} / {table.seatCount} + + {Array.from({ length: table.seatCount }).map((_, idx) => ( + + ))} + + 0 ? 'Beülök' : 'Tele'} + onPress={() => free > 0 && onSelectTable(table.id)} + variant="green" + disabled={free === 0} + /> - 0 ? 'Beülök' : 'Tele'} - onPress={() => free > 0 && onSelectTable(table.id)} - variant="green" - disabled={free === 0} - /> - - ); - })} - - )} + ); + })} + + )} + ); } @@ -176,6 +198,9 @@ const styles = StyleSheet.create({ flex: 1, padding: 20 }, + scrollContent: { + paddingBottom: 20 + }, header: { flexDirection: 'row', justifyContent: 'space-between', @@ -249,6 +274,19 @@ const styles = StyleSheet.create({ fontSize: 11, marginTop: 6 }, + promoRow: { + marginTop: 12 + }, + promoInputRow: { + flexDirection: 'row', + alignItems: 'center', + backgroundColor: 'rgba(255,255,255,0.08)', + borderRadius: 12, + paddingHorizontal: 12, + paddingVertical: 10, + borderWidth: 1, + borderColor: 'rgba(255,255,255,0.12)' + }, tableList: { gap: 12 }, diff --git a/src/screens/TableScreen.js b/src/screens/TableScreen.js index d42e528..7316991 100644 --- a/src/screens/TableScreen.js +++ b/src/screens/TableScreen.js @@ -145,6 +145,9 @@ export default function TableScreen({ token, tableId, user, onLeave }) { Fordítsd el a telefont A blackjack asztal fekvő nézetben működik jól. + + + ); @@ -270,7 +273,7 @@ const styles = StyleSheet.create({ tableContent: { flex: 1, justifyContent: 'space-between', - paddingBottom: 8 + paddingBottom: 120 }, seatLayer: { flex: 1, @@ -278,14 +281,14 @@ const styles = StyleSheet.create({ }, seatSpot: { position: 'absolute', - width: 96, - transform: [{ translateX: -48 }] + width: 92, + transform: [{ translateX: -46 }] }, controlsOverlay: { position: 'absolute', - left: 12, - right: 12, - bottom: 14, + left: 18, + right: 18, + bottom: 12, gap: 10 }, blurPanel: { @@ -365,15 +368,18 @@ const styles = StyleSheet.create({ fontSize: 14, marginTop: 12, textAlign: 'center' + }, + rotateActions: { + marginTop: 20 } }); const seatPositions = { - 0: { left: '8%', top: '62%' }, - 1: { left: '22%', top: '55%' }, - 2: { left: '36%', top: '50%' }, - 3: { left: '50%', top: '48%' }, - 4: { left: '64%', top: '50%' }, - 5: { left: '78%', top: '55%' }, - 6: { left: '92%', top: '62%' } + 0: { left: '8%', top: '52%' }, + 1: { left: '22%', top: '45%' }, + 2: { left: '36%', top: '40%' }, + 3: { left: '50%', top: '38%' }, + 4: { left: '64%', top: '40%' }, + 5: { left: '78%', top: '45%' }, + 6: { left: '92%', top: '52%' } };