|
| 1 | +import { ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react' |
| 2 | +import { useTranslation } from 'components/hooks/useTranslation' |
| 3 | + |
| 4 | +export const Helpfulness = () => { |
| 5 | + const { t } = useTranslation('helpfulness') |
| 6 | + |
| 7 | + return ( |
| 8 | + <form className="js-helpfulness f5"> |
| 9 | + <h2 data-help-start data-help-yes data-help-no className="mb-1 f4"> |
| 10 | + {t`able_to_find`} |
| 11 | + </h2> |
| 12 | + <p className="f6"> |
| 13 | + <a href="/github/site-policy/github-privacy-statement">Privacy policy</a> |
| 14 | + </p> |
| 15 | + <p className="radio-group" data-help-start data-help-yes data-help-no> |
| 16 | + <input |
| 17 | + hidden |
| 18 | + id="helpfulness-yes" |
| 19 | + type="radio" |
| 20 | + name="helpfulness-vote" |
| 21 | + value="Yes" |
| 22 | + aria-label={t('yes')} |
| 23 | + /> |
| 24 | + <label className="btn x-radio-label mr-1" htmlFor="helpfulness-yes"> |
| 25 | + <ThumbsupIcon size={24} className="color-text-tertiary" /> |
| 26 | + </label> |
| 27 | + <input |
| 28 | + hidden |
| 29 | + id="helpfulness-no" |
| 30 | + type="radio" |
| 31 | + name="helpfulness-vote" |
| 32 | + value="No" |
| 33 | + aria-label={t`no`} |
| 34 | + /> |
| 35 | + <label className="btn x-radio-label" htmlFor="helpfulness-no"> |
| 36 | + <ThumbsdownIcon size={24} className="color-text-tertiary" /> |
| 37 | + </label> |
| 38 | + </p> |
| 39 | + <p className="color-text-secondary f6" hidden data-help-yes> |
| 40 | + {t('yes_feedback')} |
| 41 | + </p> |
| 42 | + <p className="color-text-secondary f6" hidden data-help-no> |
| 43 | + {t('no_feedback')} |
| 44 | + </p> |
| 45 | + <input type="text" className="d-none" name="helpfulness-token" aria-hidden="true" /> |
| 46 | + <p hidden data-help-no> |
| 47 | + <label className="d-block mb-1 f6" htmlFor="helpfulness-comment"> |
| 48 | + <span>{t('comment_label')}</span> |
| 49 | + <span className="text-normal color-text-tertiary float-right ml-1">{t('optional')}</span> |
| 50 | + </label> |
| 51 | + <textarea |
| 52 | + className="form-control input-sm width-full" |
| 53 | + name="helpfulness-comment" |
| 54 | + id="helpfulness-comment" |
| 55 | + ></textarea> |
| 56 | + </p> |
| 57 | + <p> |
| 58 | + <label className="d-block mb-1 f6" htmlFor="helpfulness-email" hidden data-help-no> |
| 59 | + {t('email_label')} |
| 60 | + <span className="text-normal color-text-tertiary float-right ml-1">{t('optional')}</span> |
| 61 | + </label> |
| 62 | + <input |
| 63 | + type="email" |
| 64 | + className="form-control input-sm width-full" |
| 65 | + name="helpfulness-email" |
| 66 | + id="helpfulness-email" |
| 67 | + placeholder={t('email_placeholder')} |
| 68 | + hidden |
| 69 | + data-help-yes |
| 70 | + data-help-no |
| 71 | + /> |
| 72 | + </p> |
| 73 | + <p className="text-right" hidden data-help-yes data-help-no> |
| 74 | + <button type="submit" className="btn btn-sm"> |
| 75 | + {t('send')} |
| 76 | + </button> |
| 77 | + </p> |
| 78 | + <p className="color-text-secondary f6" hidden data-help-end> |
| 79 | + {t('feedback')} |
| 80 | + </p> |
| 81 | + </form> |
| 82 | + ) |
| 83 | +} |
0 commit comments