Skip to content

Commit

Permalink
feat: ✨ add contact form (#15)
Browse files Browse the repository at this point in the history
* feat: ✨ add contact form

* fix: 🐛 update explanation text
  • Loading branch information
megasanjay authored May 23, 2024
1 parent c51ebe4 commit 7973ecf
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
sidebar_position: 99
sidebar_position: 98
title: Changelog
---

Expand Down
10 changes: 10 additions & 0 deletions docs/contact.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
sidebar_position: 99
title: Contact Us
---

Want to provide feedback about our dataset? Have a question about our project? Need help using our data? Let us know!

import TallyEmbed from '@site/src/components/TallyEmbed';

<TallyEmbed />
5 changes: 3 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export default {
alt: 'My Site Logo',
src: 'https://fairdataihub.org/images/hero/aireadi-logo.png',
},
hideOnScroll: true,
hideOnScroll: false,
items: [
{
type: 'docsVersionDropdown',
Expand All @@ -78,7 +78,7 @@ export default {
position: 'right',
},
{
href: 'https://aireadi.org/contact',
href: '/docs/1/contact',
label: 'Contact Us',
position: 'right',
},
Expand Down Expand Up @@ -162,6 +162,7 @@ export default {
content: 'summary_large_image',
},
],
scripts: [],
headTags: [
{
tagName: 'link',
Expand Down
10 changes: 10 additions & 0 deletions src/components/PageFeedback.jsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable react/button-has-type */
import React from 'react';
import Lottie from 'react-lottie';
import { Icon } from '@iconify/react';

import LikeAnimationData from './lotties/like.json';
import DislikeAnimationData from './lotties/dislike.json';
Expand Down Expand Up @@ -217,6 +218,15 @@ function PageFeedback() {
/>
)}

<hr className="w-2/5 mx-auto bg-sky-200" />

<div className="flex justify-center items-center space-x-2 pt-1">
<Icon icon="lucide:badge-info" />
<a href="/docs/1/contact" className="">
<h4 className="mb-0">I have more feedback!</h4>
</a>
</div>

{showTextFeedback && (
<div className="flex justify-center space-x-2 pt-1">
<textarea
Expand Down
31 changes: 31 additions & 0 deletions src/components/TallyEmbed.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/* eslint-disable no-param-reassign */
/* eslint-disable no-undef */
import React, { useEffect } from 'react';

export default function TallyEmbed() {
useEffect(() => {
const script = document.createElement('script');
script.src = 'https://tally.so/widgets/embed.js';
script.onload = function () {
if (typeof Tally !== 'undefined') {
Tally.loadEmbeds();
} else {
document.querySelectorAll('iframe[data-tally-src]:not([src])').forEach((iframe) => {
iframe.src = iframe.dataset.tallySrc;
});
}
};
script.onerror = script.onload;
document.body.appendChild(script);
}, []);

return (
<iframe
data-tally-src="https://tally.so/embed/wdY71y?alignLeft=1&hideTitle=1&transparentBackground=1&dynamicHeight=1"
loading="lazy"
width="100%"
height="276"
title="AI-READI Contact Form"
/>
);
}

0 comments on commit 7973ecf

Please sign in to comment.