Skip to content

fix spelling and position on feedback #3733

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

Merged
merged 1 commit into from
Apr 25, 2025
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
8 changes: 4 additions & 4 deletions src/components/Feedback/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { useColorMode } from '@docusaurus/theme-common'
import styles from './styles.module.scss'
import clsx from 'clsx'

export default function Feedback() {
export default function Feedback({side}) {
const [open, setOpen] = useState(false);
const [negResponse, setNegResponse] = useState('');
const [comment, setComment] = useState('');
Expand All @@ -29,7 +29,7 @@ export default function Feedback() {
sentiment: response ? 'Positive' : 'Negative',
reason: response ? '' : negResponse,
google_id: gaId || 'anonymous',
comment,
comment: !response ? comment: '',
};

const insertQuery = `
Expand Down Expand Up @@ -84,10 +84,10 @@ export default function Feedback() {


const negative_feedback = (
<Popover.Content side='left' align='end' showArrow={true}>
<Popover.Content side={side} align='end' showArrow={true}>
<div ref={popoverRef}>
<div className='flex justify-between items-center mb-[4px]'>
<Title size='md'>Why was is not helpful?</Title>
<Title size='md'>Why was it not helpful?</Title>
<IconButton size='xs' icon='cross' onClick={() => handleSubmit(false) } type='ghost'/>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/theme/DocItem/Layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ function useDocTOC() {
const {frontMatter, toc} = useDoc();
const windowSize = useWindowSize();
const hidden = frontMatter.hide_table_of_contents;
const canRender = !hidden && toc.length > 0;
const canRender = !hidden;
const mobile = canRender ? <DocItemTOCMobile /> : undefined;
const desktop =
canRender && (windowSize === 'desktop' || windowSize === 'ssr') ? (
Expand Down
6 changes: 4 additions & 2 deletions src/theme/DocItem/TOC/Desktop/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import Feedback from '../../../../components/Feedback';

export default function DocItemTOCDesktop() {
const {toc, frontMatter} = useDoc();


return (
<div className={clsx(styles.docTOCContainer, 'theme-doc-toc-desktop-container')}>
<TOC
Expand All @@ -16,8 +18,8 @@ export default function DocItemTOCDesktop() {
maxHeadingLevel={frontMatter.toc_max_heading_level}
className={clsx(styles.docTOC, ThemeClassNames.docs.docTocDesktop)}
/>
<div style={{'marginTop': toc.length < 7 ? '150px': '32px'}}>
<Feedback/>
<div style={{'marginTop': '32px'}}>
<Feedback side ={toc.length >= 7 ? 'left' : 'bottom'}/>
</div>

<div className={styles.docCloudCard}>
Expand Down