Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions client/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
COPY public/config.template.js /usr/share/nginx/html/config.template.js
COPY entrypoint.sh /entrypoint.sh
COPY nginx.conf /etc/nginx/nginx.conf
RUN chmod +x /entrypoint.sh

EXPOSE 80
Expand Down
26 changes: 26 additions & 0 deletions client/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
worker_processes 1;

events { worker_connections 1024; }

http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;

server {
listen 80;
server_name localhost;

root /usr/share/nginx/html;

location / {
try_files $uri $uri/ /index.html;
}

location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg)$ {
expires 1y;
add_header Cache-Control "public";
}
}
}
5 changes: 4 additions & 1 deletion client/src/components/CreateMatchRequestDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,10 @@ const CreateMatchRequestDialog: React.FC<CreateMatchRequestDialogProps> = ({
return;
}

const formattedDate = selectedDate.toISOString().split('T')[0]; // YYYY-MM-DD format
// Format date using local values to avoid UTC shift
const formattedDate = selectedDate
? `${selectedDate.getFullYear()}-${String(selectedDate.getMonth() + 1).padStart(2, '0')}-${String(selectedDate.getDate()).padStart(2, '0')}`
: '';

onSubmit({
userID: userID,
Expand Down
3 changes: 2 additions & 1 deletion client/src/components/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { useUserID } from '../contexts/UserIDContext';
import { Link as RouterLink } from 'react-router-dom';
import { useMatchActions } from '../hooks/useMatchActions';
import MatchActionDialogs from './MatchActionDialogs';
import { formatTimeslots } from '../utils/formatting';

const Dashboard = () => {
const { user } = useAuth0();
Expand Down Expand Up @@ -728,7 +729,7 @@ const Dashboard = () => {
{formatDate(req.date)}
</Typography>
<Typography variant="body2" sx={{ color: 'text.secondary', mb: 0.5 }}>
{req.timeslot && req.timeslot.length > 0 ? formatTime(req.timeslot[0]) : 'No timeslot'}
{req.timeslot && req.timeslot.length > 0 ? formatTimeslots(req.timeslot) : 'No timeslot'}
</Typography>
<Typography variant="body2" sx={{ color: 'text.secondary', mb: 1 }}>
{req.location}
Expand Down
8 changes: 6 additions & 2 deletions client/src/components/MatchRequests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,12 @@ const MatchRequests = () => {
await submitMatchRequest(matchRequestData);
setIsCreateDialogOpen(false);
await fetchMatchRequests();
} catch (err) {
setError('Failed to create match request. Please try again later.');
} catch (err: any) {
if (err?.response?.status === 409) {
setError('You can only create one match request per day.');
} else {
setError('Failed to create match request. Please try again later.');
}
console.error('Error creating match request:', err);
}
};
Expand Down
Loading