Skip to content

Commit

Permalink
Кнопка активна для владельцев приютов
Browse files Browse the repository at this point in the history
  • Loading branch information
Notsmartname committed May 11, 2024
1 parent 992f15e commit 341de95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/ShelterNews/ShelterNews.jsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,21 @@
import React from 'react';
import { useParams } from 'react-router-dom';
import { useOutletContext, useParams } from 'react-router-dom';
import './ShelterNews.scss';
import NewsSection from '../NewsSection/NewsSection';
import { Button } from '../../ui';

const ShelterNews = () => {
const { id } = useParams();
const { isOwner } = useOutletContext();

return (
<section className='shelter-section shelter-news'>
<div className='shelter-section-top'>
<h2 className='shelter-section__title shelter-news__title'>Новости приюта</h2>
<Button className='shelter-section__btn-news' disabled>Предложить новость</Button>
<Button
className='shelter-section__btn-news'
disabled={!isOwner}
>Предложить новость</Button>
</div>
<NewsSection shelterId={id} />
<Button className='shelter-section__btn-more' theme='transparent'>Больше новостей</Button>
Expand Down

0 comments on commit 341de95

Please sign in to comment.