Skip to content

Commit

Permalink
QA requests #556
Browse files Browse the repository at this point in the history
  • Loading branch information
buddy-web3 committed Mar 27, 2024
1 parent 47e3555 commit 8b67900
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/components/Article/FeedbackForm/feedbackForm.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.feedback-container {
max-width: 384px;
padding: var(--spacing-32);
}
.select-option {
Expand All @@ -13,7 +14,6 @@
}

.feedback-form {
width: 100%;
position: relative;
color: var(--colors-cool-grey-600);
z-index: 2;
Expand Down Expand Up @@ -50,7 +50,7 @@
.composite-button > .feedback-form {
position: absolute;
display: none;
transform: translate(-11vw, var(--spacing-56));
transform: translate(-9vw, var(--spacing-56));
margin: var(--spacing-24);
}
.composite-button > .feedback-form.show {
Expand Down
2 changes: 1 addition & 1 deletion app/components/Article/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const ArticleFooter = (question: Question) => {
pageid={question.pageid}
showText={true}
actionType={ActionType.UNHELPFUL}
onSuccess={() => setShowFeedbackForm(true)}
onClick={() => setShowFeedbackForm(true)}
/>
<div className={['action-feedback-text', showFeedback ? 'show' : ''].join(' ')}>
Thanks for your feedback!
Expand Down
1 change: 1 addition & 0 deletions app/newRoot.css
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ ol {
}
} /* end mobile */
p,
textarea,
button {
font-family: Poppins;
}
Expand Down
11 changes: 9 additions & 2 deletions app/routes/questions.actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,15 @@ type Props = {
children?: ReactNode | ReactNode[]
[k: string]: unknown
onSuccess?: () => void
onClick?: () => void
}
export const Action = ({
pageid,
actionType,
showText = true,
children,
onSuccess,
onClick,
...props
}: Props) => {
const [remixSearchParams] = useSearchParams()
Expand Down Expand Up @@ -131,7 +133,9 @@ export const Action = ({

const handleAction = async (e: MouseEvent<HTMLElement>) => {
e.preventDefault()

if (onClick) {
onClick()
}
setActionTaken(!actionTaken)

// This sort of cheats - if more than 1 request is sent per second (or some other such time
Expand Down Expand Up @@ -169,7 +173,10 @@ export const Action = ({
{children}
<Button className={className}>
<Icon />
<span className={actionTaken ? 'teal-500' : 'grey'}> {showText && title}</span>
<p className={[actionTaken ? 'teal-500' : 'grey', 'small'].join(' ')}>
{' '}
{showText && title}
</p>
</Button>
</Form>
)
Expand Down

0 comments on commit 8b67900

Please sign in to comment.