Skip to content
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

1879basic mvp #1933

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft
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
3 changes: 3 additions & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"
/>
<script src="https://unpkg.com/react@17/umd/react.production.min.js" crossorigin></script>
<script src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js" crossorigin></script>
<script src="https://cdn.jsdelivr.net/pyodide/v0.18.1/full/pyodide.js"></script>
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
Expand Down
7 changes: 7 additions & 0 deletions src/PolicyEngine.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
import Donate from "./pages/Donate";
import { useLocation } from "react-router-dom";
import BlogPage from "./pages/BlogPage";
import DocsMVP from "./pages/DocsMVP";
import Docs from './pages/Docs';
import { COUNTRY_BASELINE_POLICIES, COUNTRY_CODES } from "./data/countries";

import { useEffect, useState, lazy, Suspense } from "react";
Expand Down Expand Up @@ -299,7 +301,12 @@ export default function PolicyEngine() {
<Route index={true} element={<Research />} />
<Route path=":postName" element={<BlogPage />} />
</Route>
<Route path="anmol" element={<Outlet />}>
<Route index={true} element={<Research />} />
<Route path=":postName" element={<DocsMVP />} />
</Route>
<Route path="donate" element={<Donate />} />
<Route path="docs" element={<Docs />} />
<Route path="privacy" element={<PrivacyPage />} />
<Route path="terms" element={<TACPage />} />

Expand Down
41 changes: 8 additions & 33 deletions src/layout/CodeBlock.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export default function CodeBlock({
data,
title,
language,
maxHeight,
collapsedHeight = "260px",
expandedHeight = "auto",
showExpand = true,
}) {
const [isExpanded, setIsExpanded] = useState(false);
Expand All @@ -23,7 +24,6 @@ export default function CodeBlock({
useEffect(() => {
if (isCopied) {
const timeoutId = setTimeout(() => setIsCopied(false), 1000);

return () => clearTimeout(timeoutId);
}
}, [isCopied]);
Expand All @@ -35,18 +35,10 @@ export default function CodeBlock({
flexDirection: "row",
justifyContent: "space-between",
alignItems: "center",
// Padding is necessary so that button click effect
// is visible
padding: "0 6px 0 0",
}}
>
<p
style={{
margin: 0,
}}
>
{language}
</p>
<p style={{ margin: 0 }}>{language}</p>
<div
style={{
display: "flex",
Expand Down Expand Up @@ -76,11 +68,7 @@ export default function CodeBlock({
}}
>
{isExpanded ? <UpOutlined /> : <DownOutlined />}
<p
style={{
margin: 0,
}}
>
<p style={{ margin: 0 }}>
{isExpanded ? "Shrink" : "Expand"}
</p>
</div>
Expand Down Expand Up @@ -108,11 +96,7 @@ export default function CodeBlock({
}}
>
<CopyOutlined />
<p
style={{
margin: 0,
}}
>
<p style={{ margin: 0 }}>
{isCopied ? "Copied!" : "Copy"}
</p>
</div>
Expand All @@ -123,11 +107,7 @@ export default function CodeBlock({
);

return (
<div
style={{
flex: 1,
}}
>
<div style={{ flex: 1 }}>
<div
style={{
display: "flex",
Expand All @@ -139,18 +119,13 @@ export default function CodeBlock({
<h4>{title}</h4>
</div>
<Card
style={{}}
loading={!data}
styles={{
body: {
padding: 0,
},
}}
styles={{ body: { padding: 0 } }}
title={cardTitleComponent}
>
<CodeMirror
value={data}
maxHeight={maxHeight ? maxHeight : !isExpanded && "260px"}
maxHeight={isExpanded ? expandedHeight : collapsedHeight} // Toggle height
editable={false}
extensions={[
language in langs ? langs[language]() : langs.json(),
Expand Down
4 changes: 4 additions & 0 deletions src/layout/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ const LINKS = [
title: "Donate",
link: "donate",
},
{
title: "Docs",
link: "docs",
}
];

export default function Header() {
Expand Down
Loading
Loading