Skip to content

Commit

Permalink
Merge pull request #108 from openkfw/97-disappering-feedback-button
Browse files Browse the repository at this point in the history
fix: set feedback button to always visible
  • Loading branch information
georgimld authored Oct 24, 2024
2 parents add444d + 50ea444 commit f3f65f2
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions app/components/landing/feedbackSection/FeedbackSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useEffect, useState } from 'react';
import { toast } from 'react-toastify';
import Link from 'next/link';
import { StatusCodes } from 'http-status-codes';
import { useSessionStorage } from 'usehooks-ts';

import Box from '@mui/material/Box';
import Checkbox from '@mui/material/Checkbox';
Expand Down Expand Up @@ -44,8 +43,7 @@ const ProjectLink = ({
function FeedbackSection() {
const [open, openDialog] = useState(false);
// The useState and the useSessionStorage both must be used to avoid pre-hydration errors.
const [feedbackClosed, setFeedbackClosed] = useSessionStorage('feedbackClosed', false);
const [hideButton, setHideButton] = useState(feedbackClosed);
const [hideButton, setHideButton] = useState(false);
const [projectId, setProjectId] = useState<string>();

const [showFeedbackOnProjectPage, setShowFeedbackOnProjectPage] = useState(false);
Expand All @@ -69,7 +67,6 @@ function FeedbackSection() {
}

function hideFeedbackButton() {
setFeedbackClosed(true);
setHideButton(true);
}

Expand All @@ -78,7 +75,6 @@ function FeedbackSection() {
if (result.status === StatusCodes.OK) {
toast.success(m.components_landing_feedbackSection_feedbackSection_toastSuccess());
handleClose();
hideFeedbackButton();
} else {
toast.error(m.components_landing_feedbackSection_feedbackSection_toastError());
}
Expand Down

0 comments on commit f3f65f2

Please sign in to comment.