Commit 57cf49ab authored by Julien Bouquillon's avatar Julien Bouquillon 🐫

better diff + nav + perfs

parent 61b5b4c5
......@@ -14,7 +14,6 @@
"promise-serial-exec": "^1.0.0",
"prop-types": "^15.7.2",
"react": "^16.13.0",
"react-collapsible": "^2.7.0",
"react-dom": "^16.13.0",
"react-feather": "^2.0.3",
"reactstrap": "^8.4.1",
......
......@@ -20,9 +20,11 @@ import {
Col
} from "reactstrap";
import classnames from "classnames";
import Collapsible from "react-collapsible";
import { Search } from "react-feather";
import Link from "next/link";
import Collapsible from "../../../../src/Collapsible";
import Diff from "../../../../src/Diff";
const getUrl = (source, textId, rootId, type, data) => {
......@@ -105,7 +107,7 @@ const FileChangeDetail = ({
{previous && previous.data[textField] !== data[textField] && (
<Collapsible
trigger={
<div>
<div style={{ cursor: "pointer" }}>
<Search
size={16}
style={{ marginRight: 5, verticalAlign: "middle" }}
......@@ -113,8 +115,6 @@ const FileChangeDetail = ({
Voir le diff
</div>
}
transitionTime={200}
triggerStyle={{ cursor: "pointer" }}
>
<Diff
inputA={data[textField]}
......@@ -216,20 +216,43 @@ const Page = ({ query, changes }) => {
</Jumbotron>
<Nav tabs style={{ fontSize: "1.5em" }}>
<NavItem>
<NavLink
className={classnames({ active: query.repo === "legi-data" })}
href="/veille/socialgouv/legi-data"
>
LEGI
</NavLink>
<Link href="/veille/[owner]/[repo]" as="/veille/socialgouv/legi-data">
<a
className={classnames({
"nav-link": true,
active: query.repo === "legi-data"
})}
>
LEGI
</a>
</Link>
</NavItem>
<NavItem>
<NavLink
className={classnames({ active: query.repo === "kali-data" })}
href="/veille/socialgouv/kali-data"
<Link href="/veille/[owner]/[repo]" as="/veille/socialgouv/kali-data">
<a
className={classnames({
"nav-link": true,
active: query.repo === "kali-data"
})}
>
KALI
</a>
</Link>
</NavItem>
<NavItem>
<Link
href="/veille/[owner]/[repo]"
as="/veille/socialgouv/fiches-vdd"
>
KALI
</NavLink>
<a
className={classnames({
"nav-link": true,
active: query.repo === "fiches-vdd"
})}
>
Fiches SP
</a>
</Link>
</NavItem>
</Nav>
<TabContent>
......
import React, { useState } from "react";
const Collapsible = ({ trigger, children }) => {
const [open, setOpen] = useState(false);
return (
<div>
<span onClick={() => setOpen(!open)}>{trigger}</span>
{(open && children) || null}
</div>
);
};
export default Collapsible;
......@@ -5775,11 +5775,6 @@ raw-body@2.4.0:
iconv-lite "0.4.24"
unpipe "1.0.0"
react-collapsible@^2.7.0:
version "2.7.0"
resolved "https://registry.yarnpkg.com/react-collapsible/-/react-collapsible-2.7.0.tgz#d95111bfbea3c01adc7898c5895b191360f71e94"
integrity sha512-uS6cFyJ2WR0F0xfCjmJ3TGwH+no/JOs8cDKNTPMWKWSJdosmHPCk8io4ZrDyz5dKJmSI5X2T5eJqnasawe6wew==
react-dom@^16.13.0:
version "16.13.0"
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.13.0.tgz#cdde54b48eb9e8a0ca1b3dc9943d9bb409b81866"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment