Skip to content

Commit eb5d13d

Browse files
authored
Merge pull request #137 from ModusCreateOrg/ADE-203
[ADE-203] UI fixes
2 parents e203962 + 85f483d commit eb5d13d

34 files changed

+517
-287
lines changed

.husky/pre-commit

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,20 @@ sh ./lizard.sh
55

66
# Only run frontend lint if the directory exists
77
if [ -d "frontend" ]; then
8-
cd frontend && npm run lint
8+
cd frontend
9+
npx lint-staged
10+
npm run lint
11+
cd ..
912
fi
1013

1114
cd $project_root
1215

13-
# Add backend linting
16+
# Add backend linting and formatting
1417
if [ -d "backend" ]; then
15-
cd backend && npm run lint
18+
cd backend
19+
npx lint-staged
20+
npm run lint
21+
cd ..
1622
fi
1723

1824
exit 0

backend/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
"cdk:destroy": "dotenv -- npx cdk destroy",
2727
"cdk:synth": "dotenv -- npx cdk synth"
2828
},
29+
"lint-staged": {
30+
"*.ts": [
31+
"prettier --write"
32+
]
33+
},
2934
"dependencies": {
3035
"@aws-sdk/client-bedrock": "^3.782.0",
3136
"@aws-sdk/client-bedrock-runtime": "^3.782.0",

frontend/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,12 @@
2828
"lint-staged": {
2929
"*.{ts,tsx}": [
3030
"eslint --fix",
31+
"prettier --write",
3132
"vitest related --run"
3233
],
34+
"*.{js,jsx,css,scss,md,json}": [
35+
"prettier --write"
36+
],
3337
"*.scss": [
3438
"stylelint --fix"
3539
]

frontend/src/common/components/Icon/SvgIcon.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88
max-width: 100%;
99
height: auto;
1010
/* CSS filter to display SVGs in #ABBCCD color */
11-
filter: brightness(0) saturate(100%) invert(84%) sepia(5%) saturate(1013%) hue-rotate(178deg) brightness(89%) contrast(84%);
11+
filter: brightness(0) saturate(100%) invert(84%) sepia(5%) saturate(1013%) hue-rotate(178deg)
12+
brightness(89%) contrast(84%);
1213
}
1314

1415
&--active {
1516
img {
1617
/* The active pink color from the design - using precise filter values for #FD7BF4 */
17-
filter: brightness(0) saturate(100%) invert(65%) sepia(82%) saturate(5793%) hue-rotate(292deg) brightness(99%) contrast(98%);
18+
filter: brightness(0) saturate(100%) invert(65%) sepia(82%) saturate(5793%) hue-rotate(292deg)
19+
brightness(99%) contrast(98%);
1820
}
1921
}
2022
}

frontend/src/common/components/Icon/SvgIcon.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,7 @@ const SvgIcon = ({
7373

7474
return (
7575
<IonText
76-
className={classNames(
77-
'ls-svg-icon',
78-
{ 'ls-svg-icon--active': active },
79-
className
80-
)}
76+
className={classNames('ls-svg-icon', { 'ls-svg-icon--active': active }, className)}
8177
data-testid={testid}
8278
{...props}
8379
>

frontend/src/common/components/Modal/ConfirmationModal.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575

7676
// Handle the pull indicator
7777
&::part(handle) {
78-
background: #D9D9D9;
78+
background: #d9d9d9;
7979
width: 36px;
8080
height: 4px;
8181
border-radius: 2px;

frontend/src/common/components/Modal/ConfirmationModal.tsx

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,8 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
3030
testid = 'confirmation-modal',
3131
}) => {
3232
// Replace placeholder with actual item name if provided
33-
const formattedMessage = itemName
34-
? message.replace('{itemName}', `"${itemName}"`)
35-
: message;
36-
33+
const formattedMessage = itemName ? message.replace('{itemName}', `"${itemName}"`) : message;
34+
3735
return (
3836
<IonModal
3937
isOpen={isOpen}
@@ -43,11 +41,9 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
4341
>
4442
<div className="confirmation-modal__container">
4543
<h2 className="confirmation-modal__title">{title}</h2>
46-
47-
<p className="confirmation-modal__message">
48-
{formattedMessage}
49-
</p>
50-
44+
45+
<p className="confirmation-modal__message">{formattedMessage}</p>
46+
5147
<div className="confirmation-modal__actions">
5248
<IonButton
5349
expand="block"
@@ -58,7 +54,7 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
5854
>
5955
{cancelText}
6056
</IonButton>
61-
57+
6258
<IonButton
6359
expand="block"
6460
fill="outline"
@@ -74,4 +70,4 @@ const ConfirmationModal: React.FC<ConfirmationModalProps> = ({
7470
);
7571
};
7672

77-
export default ConfirmationModal;
73+
export default ConfirmationModal;

frontend/src/common/components/Router/TabNavigation.scss

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
padding-bottom: 0;
1111

1212
&-button {
13-
--color: #ABBCCD;
13+
--color: #abbccd;
1414
--color-selected: #fd7bf4;
1515

1616
/* Ensure consistent alignment across platforms */
@@ -21,7 +21,7 @@
2121
&-icon {
2222
margin: 0;
2323
font-size: 1.25rem;
24-
color: #ABBCCD;
24+
color: #abbccd;
2525
}
2626

2727
&.tab-selected {
@@ -31,7 +31,8 @@
3131
/* Apply to SvgIcon component */
3232
&.ls-svg-icon img {
3333
/* Pink color #FD7BF4 using precise filter values */
34-
filter: brightness(0) saturate(100%) invert(65%) sepia(82%) saturate(5793%) hue-rotate(292deg) brightness(99%) contrast(98%);
34+
filter: brightness(0) saturate(100%) invert(65%) sepia(82%) saturate(5793%)
35+
hue-rotate(292deg) brightness(99%) contrast(98%);
3536
}
3637
}
3738
}

frontend/src/common/components/Router/__tests__/TabNavigation.test.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -231,19 +231,19 @@ vi.mock('../../Icon/SvgIcon', () => ({
231231

232232
// Mock the SVG icons
233233
vi.mock('assets/icons/home.svg', () => ({
234-
default: 'mocked-home-icon.svg'
234+
default: 'mocked-home-icon.svg',
235235
}));
236236
vi.mock('assets/icons/reports.svg', () => ({
237-
default: 'mocked-reports-icon.svg'
237+
default: 'mocked-reports-icon.svg',
238238
}));
239239
vi.mock('assets/icons/upload.svg', () => ({
240-
default: 'mocked-upload-icon.svg'
240+
default: 'mocked-upload-icon.svg',
241241
}));
242242
vi.mock('assets/icons/chat.svg', () => ({
243-
default: 'mocked-chat-icon.svg'
243+
default: 'mocked-chat-icon.svg',
244244
}));
245245
vi.mock('assets/icons/profile.svg', () => ({
246-
default: 'mocked-profile-icon.svg'
246+
default: 'mocked-profile-icon.svg',
247247
}));
248248

249249
// Mock the UploadModal component

frontend/src/common/components/Upload/UploadModal.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,8 @@ const UploadModal = ({ isOpen, onClose, onUploadComplete }: UploadModalProps): J
190190
<div className="upload-modal__file-details">
191191
<div className="upload-modal__filename">{file.name}</div>
192192
<div className="upload-modal__file-info">
193-
{formatFileSize(file.size)}{Math.ceil((1 - progress) * 10)} {t('upload.secondsLeft', { ns: 'common' })}
193+
{formatFileSize(file.size)}{Math.ceil((1 - progress) * 10)}{' '}
194+
{t('upload.secondsLeft', { ns: 'common' })}
194195
</div>
195196
{/* Progress bar */}
196197
<IonProgressBar value={progress} className="upload-modal__progress" />

0 commit comments

Comments
 (0)