Skip to content

Commit

Permalink
Only show 'new configuration' button if authorized
Browse files Browse the repository at this point in the history
  • Loading branch information
tomcur committed Aug 31, 2023
1 parent 054b7b6 commit dafce10
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions astroplant-frontend/src/scenes/kit/Configurations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ function ConfigurationRow({
}

export function Configurations({ kit }: ConfigurationsProps) {
const permissions = useContext(PermissionsContext);

const configurations_ = useAppSelector((state) =>
configurationsById(state, kit.configurations),
);
Expand All @@ -180,11 +182,13 @@ export function Configurations({ kit }: ConfigurationsProps) {
path="/"
element={
<article>
<section className={style.top}>
<ButtonLink to="create" variant="primary">
New configuration
</ButtonLink>
</section>
{permissions.editConfiguration && (
<section className={style.top}>
<ButtonLink to="create" variant="primary">
New configuration
</ButtonLink>
</section>
)}
<section className={style.listContainer}>
<header>
<h3>Active</h3>
Expand Down

0 comments on commit dafce10

Please sign in to comment.