-
Notifications
You must be signed in to change notification settings - Fork 0
Add PrintQR page and route for PrintQR page #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5959861
50f9bf2
6dc6e8a
015e5ad
28f4125
e660153
2a7c0e9
fd1b9f0
51d3466
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { SGLCard } from '../../components/UI/Card/SGLCard' | ||
| import { SGLButton } from '../../components/UI/Button/SGLButton' | ||
| import { SGLTypography } from '../../components/UI/Typography/SGLTypography' | ||
| import { QRGeneration } from '../login/QRLogin/QRGeneration.tsx' | ||
| import { useTranslation } from 'react-i18next' | ||
| import * as styles from './styles' | ||
|
|
||
| export const PrintQR = () => { | ||
| const { t } = useTranslation() | ||
|
|
||
| const MOCK_PATIENT_NUMBER = '123456' | ||
| const MOCK_PASSWORD = 'add123' | ||
|
|
||
| const MOCK_TOKEN = 'mock-token' | ||
|
|
||
| return ( | ||
| <div style={styles.pageContainer}> | ||
| <div style={styles.cardContainer}> | ||
| <SGLCard> | ||
| <div style={styles.containerStyle}> | ||
| <QRGeneration token={MOCK_TOKEN} /> | ||
| <SGLTypography styles={styles.textStyle}>{MOCK_PATIENT_NUMBER}</SGLTypography> | ||
|
|
||
| <SGLTypography styles={styles.textStyle}>{MOCK_PASSWORD}</SGLTypography> | ||
|
|
||
| <SGLButton styles={styles.submitButtonContent}>{t('login.login')}</SGLButton> | ||
| </div> | ||
| </SGLCard> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } |
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||||||||||||
| import { theme } from '@/theme' | ||||||||||||||||
| import type { CSSProperties } from '@mui/material' | ||||||||||||||||
|
|
||||||||||||||||
| export const pageContainer: CSSProperties = { | ||||||||||||||||
| display: 'flex', | ||||||||||||||||
| justifyContent: 'center', | ||||||||||||||||
| alignItems: 'center', | ||||||||||||||||
| minHeight: '100vh', | ||||||||||||||||
| width: '100%', | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| export const cardContainer: CSSProperties = { | ||||||||||||||||
| width: '400px', | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
+12
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the card responsive on narrow screens.
Proposed fix export const cardContainer: CSSProperties = {
- width: '400px',
+ width: '400px',
+ maxWidth: '100%',
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||
|
|
||||||||||||||||
| export const containerStyle: CSSProperties = { | ||||||||||||||||
| width: '335px', | ||||||||||||||||
| display: 'flex', | ||||||||||||||||
| flexDirection: 'column', | ||||||||||||||||
| alignItems: 'center', | ||||||||||||||||
| gap: '1rem', | ||||||||||||||||
| padding: '2rem', | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| export const textStyle: CSSProperties = { | ||||||||||||||||
| fontSize: '1.3rem', | ||||||||||||||||
| fontWeight: 'bold', | ||||||||||||||||
| color: theme.palette.common.white, | ||||||||||||||||
| } | ||||||||||||||||
|
|
||||||||||||||||
| export const submitButtonContent: CSSProperties = { | ||||||||||||||||
| display: 'flex', | ||||||||||||||||
| alignItems: 'center', | ||||||||||||||||
| justifyContent: 'center', | ||||||||||||||||
| width: '100%', | ||||||||||||||||
| fontWeight: 'bold', | ||||||||||||||||
| fontSize: '1rem', | ||||||||||||||||
| padding: '0.5rem', | ||||||||||||||||
| } | ||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/printQRis publicly accessible.This route is registered alongside
/login, outside theProtectedRouteblock (Lines 26–40), so it is reachable without authentication. SincePrintQRdisplays a patient number and password, this exposes sensitive data to anonymous users. If this page should require auth, move it under theProtectedRoutechildren.Proposed change
📝 Committable suggestion
🤖 Prompt for AI Agents