Skip to content

Commit 2d67d0f

Browse files
committed
remove uneeded css and modules for initial load
1 parent 8c6be63 commit 2d67d0f

7 files changed

Lines changed: 27 additions & 102 deletions

File tree

src/app/screens/Analytics/GBFSFeedAnalytics/GBFSFeedAnalyticsTable.tsx

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,20 +89,15 @@ export const useTableColumns = (): Array<
8989
}) => (
9090
<div>
9191
{cell.getValue<string[]>()?.map((version, index) => (
92-
<div
92+
<Box
9393
key={index}
94-
style={{
95-
cursor: 'pointer',
96-
marginBottom: 2,
97-
padding: 1,
98-
}}
99-
className={'navigable-list-item'}
94+
sx={{ cursor: 'pointer', marginBottom: '2px', padding: '1px', '&:hover': { textDecoration: 'underline', color: '#000' } }}
10095
onClick={() => {
10196
router.push(`/metrics/gbfs/versions?version=${version}`);
10297
}}
10398
>
10499
{version}
105-
</div>
100+
</Box>
106101
))}
107102
</div>
108103
),

src/app/screens/Analytics/GBFSFeedAnalytics/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import {
2424
Typography,
2525
} from '@mui/material';
2626

27-
import '../analytics.css';
2827
import { useSearchParams } from 'next/navigation';
2928
import {
3029
fetchAvailableFilesStart,

src/app/screens/Analytics/GTFSFeedAnalytics/GTFSFeedAnalyticsTable.tsx

Lines changed: 21 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ export const useTableColumns = (
5151
title={`Open feed ${cell.getValue<string>()} page in new tab`}
5252
placement='top-start'
5353
>
54-
<div
55-
className={'navigable-list-item'}
54+
<Box
55+
sx={{ cursor: 'pointer', '&:hover': { textDecoration: 'underline', color: '#000' } }}
5656
onClick={() => {
5757
const url = `/feeds/${cell.getValue<string>()}`;
5858
window.open(url, '_blank');
5959
}}
6060
>
6161
{renderedCellValue}{' '}
6262
<OpenInNew sx={{ verticalAlign: 'middle' }} fontSize='small' />
63-
</div>
63+
</Box>
6464
</Tooltip>
6565
),
6666
},
@@ -157,20 +157,15 @@ export const useTableColumns = (
157157
Cell: ({ cell }: { cell: MRT_Cell<GTFSFeedMetrics> }) => (
158158
<div>
159159
{cell.getValue<string[]>()?.map((error, index) => (
160-
<div
160+
<Box
161161
key={index}
162-
style={{
163-
cursor: 'pointer',
164-
marginBottom: 2,
165-
padding: 1,
166-
}}
167-
className={'navigable-list-item'}
162+
sx={{ cursor: 'pointer', marginBottom: '2px', padding: '1px', '&:hover': { textDecoration: 'underline', color: '#000' } }}
168163
onClick={() => {
169164
router.push(`/metrics/gtfs/notices?noticeCode=${error}`);
170165
}}
171166
>
172167
{error}
173-
</div>
168+
</Box>
174169
))}
175170
</div>
176171
),
@@ -180,9 +175,9 @@ export const useTableColumns = (
180175
Header: (
181176
<span>
182177
Notice Severity :
183-
<span className='notice-severity-error notice-severity-label'>
178+
<Box component='span' sx={{ borderRadius: '5px', padding: '5px', marginLeft: '5px', marginBottom: '2px', width: 'fit-content', backgroundColor: '#d54402', color: 'white' }}>
184179
ERROR
185-
</span>
180+
</Box>
186181
</span>
187182
),
188183
Footer: () => (
@@ -199,20 +194,15 @@ export const useTableColumns = (
199194
Cell: ({ cell }: { cell: MRT_Cell<GTFSFeedMetrics> }) => (
200195
<div>
201196
{cell.getValue<string[]>()?.map((warning, index) => (
202-
<div
197+
<Box
203198
key={index}
204-
style={{
205-
cursor: 'pointer',
206-
marginBottom: 2,
207-
padding: 1,
208-
}}
209-
className={'navigable-list-item'}
199+
sx={{ cursor: 'pointer', marginBottom: '2px', padding: '1px', '&:hover': { textDecoration: 'underline', color: '#000' } }}
210200
onClick={() => {
211201
router.push(`/metrics/gtfs/notices?noticeCode=${warning}`);
212202
}}
213203
>
214204
{warning}
215-
</div>
205+
</Box>
216206
))}
217207
</div>
218208
),
@@ -222,9 +212,9 @@ export const useTableColumns = (
222212
Header: (
223213
<span>
224214
Notice Severity :
225-
<span className='notice-severity-warning notice-severity-label'>
215+
<Box component='span' sx={{ borderRadius: '5px', padding: '5px', marginLeft: '5px', marginBottom: '2px', width: 'fit-content', backgroundColor: '#f3c280', color: 'black' }}>
226216
WARNING
227-
</span>
217+
</Box>
228218
</span>
229219
),
230220
Footer: () => (
@@ -241,28 +231,23 @@ export const useTableColumns = (
241231
Header: (
242232
<span>
243233
Notice Severity :
244-
<span className='notice-severity-info notice-severity-label'>
234+
<Box component='span' sx={{ borderRadius: '5px', padding: '5px', marginLeft: '5px', marginBottom: '2px', width: 'fit-content', backgroundColor: '#badfb7', color: 'black' }}>
245235
INFO
246-
</span>
236+
</Box>
247237
</span>
248238
),
249239
Cell: ({ cell }: { cell: MRT_Cell<GTFSFeedMetrics> }) => (
250240
<div>
251241
{cell.getValue<string[]>()?.map((info, index) => (
252-
<div
242+
<Box
253243
key={index}
254-
style={{
255-
cursor: 'pointer',
256-
marginBottom: 2,
257-
padding: 1,
258-
}}
259-
className={'navigable-list-item'}
244+
sx={{ cursor: 'pointer', marginBottom: '2px', padding: '1px', '&:hover': { textDecoration: 'underline', color: '#000' } }}
260245
onClick={() => {
261246
router.push(`/metrics/gtfs/notices?noticeCode=${info}`);
262247
}}
263248
>
264249
{info}
265-
</div>
250+
</Box>
266251
))}
267252
</div>
268253
),
@@ -313,10 +298,9 @@ export const useTableColumns = (
313298
{group}
314299
</div>
315300
{features.map((featureData, index) => (
316-
<div
301+
<Box
317302
key={index}
318-
style={{ cursor: 'pointer', marginLeft: '10px' }}
319-
className={'navigable-list-item'}
303+
sx={{ cursor: 'pointer', marginLeft: '10px', '&:hover': { textDecoration: 'underline', color: '#000' } }}
320304
onClick={() => {
321305
router.push(
322306
`/metrics/gtfs/features?featureName=${featureData.feature}`,
@@ -332,7 +316,7 @@ export const useTableColumns = (
332316
<IconButton>{componentDecorator.icon}</IconButton>
333317
</Tooltip>
334318
)}
335-
</div>
319+
</Box>
336320
))}
337321
</div>
338322
);

src/app/screens/Analytics/GTFSFeedAnalytics/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import {
1818
Typography,
1919
} from '@mui/material';
2020

21-
import '../analytics.css';
2221
import { useSearchParams } from 'next/navigation';
2322
import {
2423
fetchAvailableFilesStart,
@@ -36,10 +35,7 @@ import { type AnalyticsFile, type GTFSFeedMetrics } from '../types';
3635
import { useRemoteConfig } from '../../../context/RemoteConfigProvider';
3736
import DownloadIcon from '@mui/icons-material/Download';
3837
import { download, generateCsv, mkConfig } from 'export-to-csv';
39-
40-
let globalAnalyticsBucketEndpoint: string | undefined;
41-
export const getAnalyticsBucketEndpoint = (): string | undefined =>
42-
globalAnalyticsBucketEndpoint;
38+
import { setAnalyticsBucketEndpoint } from '../utils';
4339

4440
export default function GTFSFeedAnalytics(): React.ReactElement {
4541
const searchParams = useSearchParams();
@@ -79,7 +75,7 @@ export default function GTFSFeedAnalytics(): React.ReactElement {
7975
};
8076

8177
React.useEffect(() => {
82-
globalAnalyticsBucketEndpoint = config.gtfsMetricsBucketEndpoint;
78+
setAnalyticsBucketEndpoint(config.gtfsMetricsBucketEndpoint);
8379
dispatch(fetchAvailableFilesStart());
8480
}, [dispatch, config.gtfsMetricsBucketEndpoint]);
8581

src/app/screens/Analytics/analytics.css

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/app/store/saga/gtfs-analytics-saga.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import {
1313
type GTFSMetrics,
1414
} from '../../screens/Analytics/types';
1515
import { getLocationName } from '../../services/feeds/utils';
16-
import { getAnalyticsBucketEndpoint } from '../../screens/Analytics/GTFSFeedAnalytics';
16+
import { getAnalyticsBucketEndpoint } from '../../screens/Analytics/utils';
1717

1818
function* fetchFeedMetricsSaga(
1919
action: ReturnType<typeof selectFile>,

src/app/styles/Footer.css

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)