Skip to content

Commit

Permalink
fix: banner url
Browse files Browse the repository at this point in the history
  • Loading branch information
Barresi committed Apr 16, 2024
1 parent 2c2972d commit a1bfe72
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/shared/ui/banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ interface IBannerProps {
}

const Banner: FC<IBannerProps> = ({ className, src }) => {
const img = import.meta.env.VITE_BACKEND_DOMEN + '/ftp/avatars/' + src || banner
const img = import.meta.env.VITE_BACKEND_DOMEN + '/ftp/banners/' + src || banner
return (
<img
<img /* Todo убрать иконку файла при отсутствии урл */
src={img}
className={cn('w-full h-full object-cover rounded-[6px]', className)}
/>
Expand Down
3 changes: 1 addition & 2 deletions src/widgets/edit-account/ui/banner-change/banner-change.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,14 @@ import { handleFileChange } from '../../lib/handle-file-change'

const BannerChange: FC = () => {
const { control } = useFormContext()
const user = useAppSelector(selectUser)

return (
<Controller
name='banner'
control={control}
render={({ field: { onChange, value } }) => {
const [previewUrl, setPreviewUrl] = useState<string | null>(null)

const user = useAppSelector(selectUser)
useEffect(() => {
if (value) {
handleFileChange(value, setPreviewUrl)
Expand Down

0 comments on commit a1bfe72

Please sign in to comment.