This commit is contained in:
DmitryGantimurov 2023-08-13 16:33:39 +03:00
commit 97e2ae5489
5 changed files with 6 additions and 15 deletions

View File

@ -13,7 +13,7 @@ const UserCategoriesNames: Record<UserCategory, string> = {
const userCategoriesInfos: Record<UserCategory, (ann: Announcement) => string> = { const userCategoriesInfos: Record<UserCategory, (ann: Announcement) => string> = {
givingOut: (ann: Announcement) => ( givingOut: (ann: Announcement) => (
`Годен до ${new Date(ann.bestBy).toLocaleDateString('ru')}` `Годен до ${ann.bestBy}`
), ),
needDispose: (ann: Announcement) => ( needDispose: (ann: Announcement) => (
`Было заинтересно ${ann.bookedBy} чел.` `Было заинтересно ${ann.bookedBy} чел.`

View File

@ -38,7 +38,7 @@ const View = ({
<span>{categoryNames[category]}</span> <span>{categoryNames[category]}</span>
<span className='m-2'>&#x2022;</span>{/* dot */} <span className='m-2'>&#x2022;</span>{/* dot */}
<span>Годен до {new Date(bestBy).toLocaleString('ru-RU')}</span> <span>Годен до {bestBy}</span>
<p className='mb-0'>{description}</p> <p className='mb-0'>{description}</p>
@ -84,10 +84,10 @@ function Control({
<> <>
<p>Забронировали {bookedBy + (bookButton.disabled ? 1 : 0)} чел.</p> <p>Забронировали {bookedBy + (bookButton.disabled ? 1 : 0)} чел.</p>
{(myId === userId) ? ( {(myId === userId) ? (
<> <div className='m-0'>
<Button variant='success' onClick={showDispose}>Утилизировать</Button> <Button className='m-1' variant='success' onClick={showDispose}>Утилизировать</Button>
<Button variant='success' onClick={() => void handleRemove(id)} {...removeButton} /> <Button className='m-1' variant='success' onClick={() => void handleRemove(id)} {...removeButton} />
</> </div>
) : ( ) : (
<Button variant='success' onClick={() => void handleBook(id)} {...bookButton} /> <Button variant='success' onClick={() => void handleBook(id)} {...bookButton} />
)} )}

View File

@ -7,8 +7,6 @@ import { Category } from '../../assets/category'
import { composeTrashboxURL, processTrashbox } from '../../api/trashbox' import { composeTrashboxURL, processTrashbox } from '../../api/trashbox'
const useTrashboxes = (position: LatLng, category: Category): UseFetchReturn<Trashbox[]> => ( const useTrashboxes = (position: LatLng, category: Category): UseFetchReturn<Trashbox[]> => (
// TODO: Remove once available
// eslint-disable-next-line react-hooks/rules-of-hooks
useFetch( useFetch(
composeTrashboxURL(position, category), composeTrashboxURL(position, category),
'GET', 'GET',

View File

@ -70,7 +70,6 @@ function useFetch<R, T extends NonNullable<unknown>>(
data => { data => {
if (data !== undefined && data !== null) { if (data !== undefined && data !== null) {
setData(data) setData(data)
console.log('Got data', data)
} }
if (data !== undefined) { if (data !== undefined) {

6
package-lock.json generated
View File

@ -1,6 +0,0 @@
{
"name": "porridger_tmp",
"lockfileVersion": 3,
"requires": true,
"packages": {}
}