Switched category data struct from Map to object
Moved lineByName function
This commit is contained in:
@ -29,7 +29,7 @@ function AnnouncementDetails({ close, announcement: { id, name, category, bestBy
|
||||
<Modal.Body>
|
||||
<h1>{name}</h1>
|
||||
|
||||
<span>{categoryNames.get(category)}</span>
|
||||
<span>{categoryNames[category]}</span>
|
||||
<span className='m-2'>•</span>{/* dot */}
|
||||
<span>Годен до {new Date(bestBy).toLocaleString('ru-RU')}</span>
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Button, Form, Modal } from "react-bootstrap"
|
||||
|
||||
import { categoryNames } from "../assets/category"
|
||||
import { categories, categoryNames } from "../assets/category"
|
||||
import { stations, lines, lineNames } from '../assets/metro'
|
||||
import { FiltersType } from "../utils/filters"
|
||||
import { SetState } from "../utils/types"
|
||||
@ -49,9 +49,9 @@ function Filters({ filter, setFilter, filterShown, setFilterShown }: FiltersProp
|
||||
<option value="">
|
||||
Выберите категорию
|
||||
</option>
|
||||
{Array.from(categoryNames).map(
|
||||
([category, categoryName]) =>
|
||||
<option key={category} value={category}>{categoryName}</option>
|
||||
{categories.map(
|
||||
category =>
|
||||
<option key={category} value={category}>{categoryNames[category]}</option>
|
||||
)}
|
||||
</Form.Select>
|
||||
</Form.Group>
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { colors, lineNames } from '../assets/metro'
|
||||
import { lineByName } from '../utils/metro'
|
||||
import { colors, lineNames, lineByName } from '../assets/metro'
|
||||
|
||||
function LineDot({ station }: { station: string }) {
|
||||
const line = lineByName(station)
|
||||
|
Reference in New Issue
Block a user