Skip to content

Commit c787a7e

Browse files
authored
Merge pull request #56 from splitly25/fix-guest-email-ui
fix guest email ui, add link to navebar
2 parents 7e67f1f + af5b9f2 commit c787a7e

5 files changed

Lines changed: 91 additions & 20 deletions

File tree

.github/workflows/deploy-web.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,18 @@ jobs:
4242
username: ${{ secrets.VPS_USERNAME }}
4343
key: ${{ secrets.VPS_SSH_KEY }}
4444
port: 22
45+
timeout: 300s
46+
command_timeout: 120s
4547
script: |
4648
# Navigate to project directory
47-
cd ~/splitly/web
49+
cd ~/splitly
50+
51+
# Clean deployment approach - remove and reclone
52+
rm -rf ~/splitly-temp
53+
git clone https://github.com/splitly25/splitly.git ~/splitly-temp
4854
49-
# Pull latest changes
50-
git pull origin main
55+
# Navigate to web directory
56+
cd ~/splitly-temp/web
5157
5258
# Install dependencies
5359
npm install
@@ -59,6 +65,12 @@ jobs:
5965
sudo cp -r dist/* /var/www/splitly/
6066
sudo chown -R www-data:www-data /var/www/splitly
6167
68+
# Clean up temp directory
69+
rm -rf ~/splitly-temp
70+
71+
# Navigate back to original directory for PM2 operations
72+
cd ~/splitly/web
73+
6274
# Restart PM2 web process (with fallback if process doesn't exist)
6375
pm2 restart splitly-web || pm2 start npm --name "splitly-web" -- run preview -- --port 3001
6476

web/src/App.jsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import { Outlet } from 'react-router-dom'
1010
import Debt from './pages/Debt'
1111
import AccountVerification from './pages/Auth/AccountVerification'
1212
import PaymentConfirmation from './pages/PaymentConfirmation/PaymentConfirmation'
13-
import { Ocr, Bills } from "./pages/Bills"
13+
import { Ocr, Bills } from './pages/Bills'
1414
import BillDetail from './pages/Bills/BillDetail'
1515
import Profile from './pages/Auth/Profile'
16+
import Settings from './pages/Settings/Settings'
1617
import Group from './pages/Groups/Group'
1718
import Payment from './pages/Payment/Payment'
1819
import PaymentSuccess from './pages/Payment/PaymentSuccess'
@@ -27,7 +28,6 @@ function App() {
2728
const currentUser = useSelector(selectCurrentUser)
2829
return (
2930
<Routes>
30-
3131
{/* Protected Routes */}
3232
<Route element={<ProtectedRoute user={currentUser} />}>
3333
<Route path="/dashboard" element={<Dashboard />} />
@@ -39,18 +39,20 @@ function App() {
3939
<Route path="/create" element={<Bills />} />
4040
<Route path="/ocr" element={<Ocr />} />
4141
<Route path="/bills/:billId" element={<BillDetail />} />
42+
<Route path="/profile" element={<Profile />} />
43+
{/* <Route path="/settings" element={<Settings />} /> */}
4244
</Route>
4345

4446
{/* Authentication Routes */}
4547
<Route path="/login" element={<Auth />} />
4648
<Route path="/register" element={<Auth />} />
4749
<Route path="/account/verification" element={<AccountVerification />} />
48-
<Route path="/profile" element={<Profile/>} />
50+
4951
{/* Public Routes (no authentication required) */}
5052
<Route path="/payment/confirm" element={<PaymentConfirmation />} />
5153
<Route path="/payment/pay" element={<Payment />} />
5254
<Route path="/payment/pay/success" element={<PaymentSuccess />} />
53-
55+
5456
{/* Default and Not Found Routes */}
5557
<Route path="/" element={<Navigate to="/dashboard" replace={true} />} />
5658
<Route path="*" element={<NotFound />} />

web/src/components/Bills/AddParticipantDialog.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ const AddParticipantDialog = ({
761761
<CircularProgress size={24} />
762762
</Box>
763763
) : filteredPeople.length === 0 ? (
764-
<Box sx={{ textAlign: 'center', py: 4 }}>
764+
<Box sx={{ py: 4 }}>
765765
{shouldShowGuestOption ? (
766766
<>
767767
<Typography sx={{ fontSize: '14px', color: 'text.secondary', mb: 2 }}>

web/src/components/Layout/Layout.jsx

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ import {
3131
Edit as EditIcon,
3232
CameraAlt as CameraAltIcon,
3333
Chat as ChatIcon,
34+
Person as PersonIcon,
35+
Settings as SettingsIcon,
3436
} from '@mui/icons-material'
3537
import { useNavigate, useLocation } from 'react-router-dom'
3638
import { useState, useEffect } from 'react'
@@ -215,7 +217,7 @@ const Layout = ({ children }) => {
215217
display: 'flex',
216218
alignItems: 'center',
217219
justifyContent: 'center',
218-
gap: (isMobile || isExpanded) ? '8px' : 0,
220+
gap: isMobile || isExpanded ? '8px' : 0,
219221
px: 2.5,
220222
minWidth: 0,
221223
transition: 'all 0.4s cubic-bezier(0.4, 0, 0.2, 1)',
@@ -229,12 +231,12 @@ const Layout = ({ children }) => {
229231
<Box
230232
component="span"
231233
sx={{
232-
opacity: (isMobile || isExpanded) ? 1 : 0,
233-
width: (isMobile || isExpanded) ? 'auto' : 0,
234+
opacity: isMobile || isExpanded ? 1 : 0,
235+
width: isMobile || isExpanded ? 'auto' : 0,
234236
overflow: 'hidden',
235237
whiteSpace: 'nowrap',
236238
transition: 'opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1)',
237-
transitionDelay: (isMobile || isExpanded) ? '0.1s' : '0s',
239+
transitionDelay: isMobile || isExpanded ? '0.1s' : '0s',
238240
}}
239241
>
240242
Tạo hóa đơn mới
@@ -254,7 +256,7 @@ const Layout = ({ children }) => {
254256
display: 'flex',
255257
alignItems: 'center',
256258
justifyContent: 'flex-start',
257-
gap: (isMobile || isExpanded) ? '12px' : 0,
259+
gap: isMobile || isExpanded ? '12px' : 0,
258260
borderRadius: '16px',
259261
height: '48px',
260262
px: 2,
@@ -294,12 +296,12 @@ const Layout = ({ children }) => {
294296
<Box
295297
component="span"
296298
sx={{
297-
opacity: (isMobile || isExpanded) ? 1 : 0,
298-
width: (isMobile || isExpanded) ? 'auto' : 0,
299+
opacity: isMobile || isExpanded ? 1 : 0,
300+
width: isMobile || isExpanded ? 'auto' : 0,
299301
overflow: 'hidden',
300302
whiteSpace: 'nowrap',
301303
transition: 'opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.4s cubic-bezier(0.4, 0, 0.2, 1)',
302-
transitionDelay: (isMobile || isExpanded) ? '0.1s' : '0s',
304+
transitionDelay: isMobile || isExpanded ? '0.1s' : '0s',
303305
}}
304306
>
305307
{item.label}
@@ -317,8 +319,8 @@ const Layout = ({ children }) => {
317319
p: 2,
318320
display: 'flex',
319321
alignItems: 'center',
320-
gap: (isMobile || isExpanded) ? 2 : 0,
321-
justifyContent: (isMobile || isExpanded) ? 'flex-start' : 'center',
322+
gap: isMobile || isExpanded ? 2 : 0,
323+
justifyContent: isMobile || isExpanded ? 'flex-start' : 'center',
322324
cursor: 'pointer',
323325
borderRadius: '16px',
324326
mx: 2,
@@ -587,8 +589,31 @@ const Layout = ({ children }) => {
587589
},
588590
}}
589591
>
592+
{/* Profile and Settings */}
593+
<MenuItem onClick={() => {
594+
handleNavigate('/profile')
595+
handleProfileMenuClose()
596+
}}>
597+
<ListItemIcon>
598+
<PersonIcon fontSize="small" />
599+
</ListItemIcon>
600+
<ListItemText>Profile</ListItemText>
601+
</MenuItem>
602+
<MenuItem onClick={() => {
603+
handleNavigate('/settings')
604+
handleProfileMenuClose()
605+
}}>
606+
<ListItemIcon>
607+
<SettingsIcon fontSize="small" />
608+
</ListItemIcon>
609+
<ListItemText>Settings</ListItemText>
610+
</MenuItem>
611+
612+
{/* Divider */}
613+
<Box sx={{ borderBottom: '1px solid', borderColor: 'divider', my: 1 }} />
614+
590615
{/* Theme Mode Options */}
591-
<MenuItem onClick={() => handleModeChange('light')}>
616+
{/* <MenuItem onClick={() => handleModeChange('light')}>
592617
<ListItemIcon>
593618
<LightModeIcon fontSize="small" />
594619
</ListItemIcon>
@@ -608,11 +633,34 @@ const Layout = ({ children }) => {
608633
</ListItemIcon>
609634
<ListItemText>System</ListItemText>
610635
{mode === 'system' && <Box sx={{ ml: 1, color: COLORS.secondary }}>✓</Box>}
636+
</MenuItem> */}
637+
638+
{/* Theme Mode Options */}
639+
<MenuItem onClick={() => handleModeChange('light')}>
640+
<ListItemIcon>
641+
<LightModeIcon fontSize="small" />
642+
</ListItemIcon>
643+
<ListItemText>Light Mode</ListItemText>
644+
{mode === 'light' && <Box sx={{ ml: 1, color: COLORS.secondary }}></Box>}
645+
</MenuItem>
646+
<MenuItem onClick={() => handleModeChange('dark')}>
647+
<ListItemIcon>
648+
<DarkModeIcon fontSize="small" />
649+
</ListItemIcon>
650+
<ListItemText>Dark Mode</ListItemText>
651+
{mode === 'dark' && <Box sx={{ ml: 1, color: COLORS.secondary }}></Box>}
611652
</MenuItem>
653+
<MenuItem onClick={() => handleModeChange('system')}>
654+
<ListItemIcon>
655+
<SettingsBrightnessIcon fontSize="small" />
656+
</ListItemIcon>
657+
<ListItemText>System</ListItemText>
658+
{mode === 'system' && <Box sx={{ ml: 1, color: COLORS.secondary }}></Box>}
659+
</MenuItem>{' '}
660+
612661

613662
{/* Divider */}
614663
<Box sx={{ borderBottom: '1px solid', borderColor: 'divider', my: 1 }} />
615-
616664
{/* Logout */}
617665
<MenuItem onClick={handleLogout}>
618666
<ListItemIcon>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import React from 'react'
2+
3+
function Settings() {
4+
return (
5+
<div>Settings</div>
6+
)
7+
}
8+
9+
export default Settings

0 commit comments

Comments
 (0)