last changes
This commit is contained in:
@ -1,18 +1,26 @@
|
||||
import {Autocomplete, Box, TextField} from '@mui/material'
|
||||
import {Edit, useAutocomplete} from '@refinedev/mui'
|
||||
import {useForm} from '@refinedev/react-hook-form'
|
||||
import { EVERY_LANGUAGE, Languages, languageStore, META_LANGUAGE } from '@stores'
|
||||
import { LanguageSelector } from '@ui'
|
||||
import { observer } from 'mobx-react-lite'
|
||||
import { useEffect, useState } from 'react'
|
||||
import {Controller} from 'react-hook-form'
|
||||
|
||||
export const CityEdit = () => {
|
||||
export const CityEdit = observer(() => {
|
||||
const { language } = languageStore;
|
||||
const {
|
||||
saveButtonProps,
|
||||
register,
|
||||
control,
|
||||
formState: {errors},
|
||||
} = useForm({})
|
||||
} = useForm({
|
||||
refineCoreProps: META_LANGUAGE(language)
|
||||
})
|
||||
|
||||
const {autocompleteProps: countryAutocompleteProps} = useAutocomplete({
|
||||
resource: 'country',
|
||||
...META_LANGUAGE(language)
|
||||
})
|
||||
|
||||
const {autocompleteProps: mediaAutocompleteProps} = useAutocomplete({
|
||||
@ -24,11 +32,14 @@ export const CityEdit = () => {
|
||||
value,
|
||||
},
|
||||
],
|
||||
})
|
||||
...META_LANGUAGE(language)
|
||||
});
|
||||
|
||||
return (
|
||||
<Edit saveButtonProps={saveButtonProps}>
|
||||
<Box component="form" sx={{display: 'flex', flexDirection: 'column'}} autoComplete="off">
|
||||
<LanguageSelector/>
|
||||
|
||||
<Controller
|
||||
control={control}
|
||||
name="country_code"
|
||||
@ -94,4 +105,4 @@ export const CityEdit = () => {
|
||||
</Box>
|
||||
</Edit>
|
||||
)
|
||||
}
|
||||
})
|
@ -1,7 +1,7 @@
|
||||
import { Stack, Typography } from "@mui/material";
|
||||
import { useShow } from "@refinedev/core";
|
||||
import { Show, TextFieldComponent as TextField } from "@refinedev/mui";
|
||||
import { TOKEN_KEY } from "../../authProvider";
|
||||
import { TOKEN_KEY } from "@providers";
|
||||
|
||||
export const CityShow = () => {
|
||||
const { query } = useShow({});
|
||||
|
Reference in New Issue
Block a user