Skip to content

Commit

Permalink
modify routes
Browse files Browse the repository at this point in the history
  • Loading branch information
kartikpaliwal committed May 8, 2024
1 parent ee135ab commit ca42a27
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 28 deletions.
2 changes: 1 addition & 1 deletion src/fragmentarium/ui/info/Record.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function Record({
const displayRecords =
record.length > 4 ? [record[0], ...record.slice(-3)] : record
const handleViewFullHistoryClick = () => {
history.push('/records')
history.push('/fragmentarium/:id/record')
}

const recordListWithButton = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import React from 'react'
import { RecordEntry } from 'fragmentarium/domain/RecordEntry'
import { RecordList } from './Record'

interface FullRecordProps {
interface RecordViewProps {
record: ReadonlyArray<RecordEntry>
}

const FullRecord: React.FC<FullRecordProps> = ({ record }) => {
const RecordView: React.FC<RecordViewProps> = ({ record }) => {
return (
<div>
<h2>Full Record History</h2>
<RecordList record={record} className="" />
</div>
)
}
export default FullRecord
export default RecordView
7 changes: 7 additions & 0 deletions src/router/fragmentariumRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { HeadTagsService } from 'router/head'
import BibliographyService from 'bibliography/application/BibliographyService'
import { FindspotService } from 'fragmentarium/application/FindspotService'
import AfoRegisterService from 'afo-register/application/AfoRegisterService'
import RecordView from 'fragmentarium/ui/info/RecordView'
import NotFoundPage from 'NotFoundPage'
function parseStringParam(location: Location, param: string): string | null {
const value = parse(location.search)[param]
Expand Down Expand Up @@ -129,6 +130,12 @@ export default function FragmentariumRoutes({
/>
)}
/>,
<Route
key="=RecordView"
exact
path="/fragmentarium/:id/record"
render={(match): ReactNode => <RecordView record={[]} />}
/>,
<Route
key="FragmentView"
path="/fragmentarium/:id"
Expand Down
22 changes: 0 additions & 22 deletions src/router/recordRoutes.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import DictionaryRoutes from 'router/dictionaryRoutes'
import SignRoutes from 'router/signRoutes'
import AboutRoutes from 'router/aboutRoutes'
import ToolsRoutes from 'router/toolsRoutes'
import RecordsRoutes from 'router/recordRoutes'
import Sitemap, { sitemapDefaults, Slugs } from 'router/sitemap'
import Header from 'Header'
import NotFoundPage from 'NotFoundPage'
Expand Down Expand Up @@ -78,6 +77,5 @@ export function WebsiteRoutes(
...DictionaryRoutes({ sitemap: sitemap, ...services, ...slugs }),
...CorpusRoutes({ sitemap: sitemap, ...services, ...slugs }),
...FragmentariumRoutes({ sitemap: sitemap, ...services, ...slugs }),
...RecordsRoutes({ sitemap: sitemap, ...services }),
]
}

0 comments on commit ca42a27

Please sign in to comment.