Skip to content

Commit

Permalink
Adds Mendable floating button. Closes #4765
Browse files Browse the repository at this point in the history
  • Loading branch information
Jwaegebaert authored and milanholemans committed Apr 24, 2023
1 parent edb1171 commit 686e8b9
Show file tree
Hide file tree
Showing 7 changed files with 3,204 additions and 5,294 deletions.
11 changes: 10 additions & 1 deletion docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,16 @@ const config = {
locales: ['en'],
},

plugins: ['docusaurus-plugin-sass'],
customFields: {
mendableAnonKey: 'd3313d54-6f8e-40e0-90d3-4095019d4be7',
},

plugins: [
'docusaurus-plugin-sass',
[
'docusaurus-node-polyfills', { excludeAliases: ['console']}
]
],

presets: [
[
Expand Down
8,427 changes: 3,136 additions & 5,291 deletions docs/package-lock.json

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"@docusaurus/core": "^2.4.0",
"@docusaurus/preset-classic": "^2.4.0",
"@mdx-js/react": "^1.6.22",
"@mendable/search": "^0.0.88",
"clsx": "^1.2.1",
"docusaurus-plugin-sass": "^0.2.3",
"prism-react-renderer": "^1.3.5",
Expand All @@ -29,6 +30,7 @@
"@docusaurus/module-type-aliases": "^2.4.0",
"@tsconfig/docusaurus": "^1.0.5",
"asciinema-player": "^3.0.0-rc.1",
"docusaurus-node-polyfills": "^1.0.0",
"typescript": "^4.7.4"
},
"browserslist": {
Expand Down
11 changes: 10 additions & 1 deletion docs/poc.docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,16 @@ const config = {
locales: ['en'],
},

plugins: ['docusaurus-plugin-sass'],
customFields: {
mendableAnonKey: 'd3313d54-6f8e-40e0-90d3-4095019d4be7',
},

plugins: [
'docusaurus-plugin-sass',
[
'docusaurus-node-polyfills', { excludeAliases: ['console']}
]
],

presets: [
[
Expand Down
21 changes: 20 additions & 1 deletion docs/src/scss/Global.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,23 @@
color: var(--ifm-font-color-base);
}
}
}
}

/* Reduce width on mobile for Mendable Search */
@media (max-width: 767px) {
.mendable-search {
width: 200px;
}
}

@media (max-width: 500px) {
.mendable-search {
width: 150px;
}
}

@media (max-width: 380px) {
.mendable-search {
width: 140px;
}
}
25 changes: 25 additions & 0 deletions docs/src/theme/SearchBar.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from "react";
import { MendableFloatingButton } from "@mendable/search";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";

export default function SearchBarWrapper(): JSX.Element {
const {
siteConfig: { customFields }
} = useDocusaurusContext();

const style = { darkMode: false, accentColor: "#ef5552" };

const floatingButtonStyle = {
color: "#fff",
backgroundColor: "#ef5552"
};

return (
<div className="mendable-search">
<MendableFloatingButton
anon_key={customFields.mendableAnonKey}
style={style}
floatingButtonStyle={floatingButtonStyle} />
</div>
);
}
1 change: 1 addition & 0 deletions docs/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// This file is not used in compilation. It is here just for a nice editor experience.
"extends": "@tsconfig/docusaurus/tsconfig.json",
"compilerOptions": {
"jsx": "react",
"baseUrl": "."
}
}

0 comments on commit 686e8b9

Please sign in to comment.