Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Кнопка активна для владельцев приютов #228

Merged
merged 1 commit into from
May 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading