generated from google/docsy-example
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
544 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React, {useEffect} from 'react'; | ||
import Footer from '@theme-original/DocItem/Footer'; | ||
|
||
import { FeedbackButton } from 'pushfeedback-react'; | ||
import { defineCustomElements } from 'pushfeedback/loader'; | ||
import 'pushfeedback/dist/pushfeedback/pushfeedback.css'; | ||
|
||
function FeedbackWidget() { | ||
const buttonThumbsUp = <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3"></path></svg>; | ||
const buttonThumbsDown = <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"><path d="M10 15v4a3 3 0 0 0 3 3l4-9V2H5.72a2 2 0 0 0-2 1.7l-1.38 9a2 2 0 0 0 2 2.3zm7-13h2.67A2.31 2.31 0 0 1 22 4v7a2.31 2.31 0 0 1-2.33 2H17"></path></svg>; | ||
// Replace with your PROJECT_ID | ||
const projectId = 'nzs6xodw4b'; | ||
|
||
useEffect(() => { | ||
if (typeof window !== 'undefined') { | ||
defineCustomElements(window); | ||
} | ||
}, []); | ||
|
||
return( | ||
<div className="feedback-widget margin-top--md margin-bottom--md"> | ||
<div className="margin-bottom--sm"> | ||
<b>Was this helpful?</b> | ||
</div> | ||
<span class="feedback-widget-positive"> | ||
<FeedbackButton project={projectId} rating="1" custom-font="True" button-style="default" modal-position="center"> | ||
<button className="button button--outline button--primary button--sm" title="Yes"> | ||
{buttonThumbsUp} | ||
</button> | ||
</FeedbackButton> | ||
</span> | ||
<span class="feedback-widget-negative margin-left--sm"> | ||
<FeedbackButton project={projectId} rating="0" custom-font="True" button-style="default" modal-position="center"> | ||
<button className="button button--outline button--primary button--sm" title="No"> | ||
{buttonThumbsDown} | ||
</button> | ||
</FeedbackButton> | ||
</span> | ||
</div> | ||
); | ||
} | ||
|
||
export default function FooterWrapper(props) { | ||
return ( | ||
<> | ||
<FeedbackWidget/> | ||
<Footer {...props} /> | ||
</> | ||
); | ||
} |
Oops, something went wrong.