Skip to content

Commit

Permalink
Do not allow to edit polls in waves
Browse files Browse the repository at this point in the history
  • Loading branch information
dkildar committed Dec 6, 2024
1 parent cc7915d commit d75ed5b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/features/waves/components/wave-form/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const WaveFormComponent = ({
<AvailableCredits username={activeUser.username} operation="comment_operation" />
)}
<WaveFormToolbar
isEdit={!!entry}
onAddImage={(url, name) => {
setImage(url);
setImageName(name);
Expand Down
7 changes: 5 additions & 2 deletions src/features/waves/components/wave-form/wave-form-toolbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ interface Props {
onEmojiPick: (value: string) => void;
onAddVideo: (value: string) => void;
submit?: ReactNode;
isEdit?: boolean;
}

export const WaveFormToolbar = ({ onAddImage, onEmojiPick, submit }: Props) => {
export const WaveFormToolbar = ({ onAddImage, onEmojiPick, submit, isEdit }: Props) => {
const { activePoll, setActivePoll, clearActivePoll } = useContext(PollsContext);
const [show, setShow] = useState(false);

Expand All @@ -21,7 +22,9 @@ export const WaveFormToolbar = ({ onAddImage, onEmojiPick, submit }: Props) => {
<div className="flex items-center">
<WaveFormToolbarImagePicker onAddImage={onAddImage} />
<WaveFormEmojiPicker onPick={onEmojiPick} />
<Button appearance="gray-link" icon={<UilChart />} onClick={() => setShow(true)} />
{!isEdit && (
<Button appearance="gray-link" icon={<UilChart />} onClick={() => setShow(true)} />
)}
<PollsCreation
existingPoll={activePoll}
show={show}
Expand Down

0 comments on commit d75ed5b

Please sign in to comment.