Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA requests #556 #574

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading