Skip to content

Commit 23cc64a

Browse files
committed
Display the "Give Kudos" button if the member has permission to create kudos.
1 parent 36175c6 commit 23cc64a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

web-ui/src/components/kudos/PublicKudos.jsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ import React, { useCallback, useContext, useEffect, useState } from 'react';
22

33
import { UPDATE_TOAST } from '../../context/actions';
44
import { AppContext } from '../../context/AppContext';
5-
import { selectCsrfToken } from '../../context/selectors';
5+
import {
6+
selectCsrfToken,
7+
selectHasCreateKudosPermission,
8+
} from '../../context/selectors';
69
import { sortKudos } from '../../context/util';
710

811
import { getRecentKudos } from '../../api/kudos';
@@ -45,13 +48,13 @@ const PublicKudos = () => {
4548
<div className="public-kudos">
4649
<div className="kudos-title">
4750
<h1>Kudos</h1>
48-
<Button
51+
{selectHasCreateKudosPermission(state) && <Button
4952
className="kudos-dialog-open"
5053
startIcon={<StarIcon />}
5154
onClick={() => setKudosDialogOpen(true)}
5255
>
5356
Give Kudos
54-
</Button>
57+
</Button>}
5558
</div>
5659
<KudosDialog
5760
open={kudosDialogOpen}

0 commit comments

Comments
 (0)