Skip to content

Commit

Permalink
Merge pull request #31 from betagouv/mep
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm authored Aug 7, 2024
2 parents 58d01b6 + bb2af91 commit 2db8738
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 22 deletions.
22 changes: 3 additions & 19 deletions packages/frontend/src/components/Chip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const ChipGroup = ({
options,
isMulti,
label,
canBeEmpty,
canBeEmpty = true,
value,
onChange,
className,
Expand Down Expand Up @@ -76,11 +76,10 @@ export const Chip = ({
isChecked?: boolean;
onCheckChange: (value: boolean) => void;
}) => {
const styles = chip({ isChecked });

return (
<Tag
className={styles}
// className={styles}
pressed={isChecked}
nativeButtonProps={{
onClick: () => onCheckChange(!isChecked),
type: "button",
Expand All @@ -90,18 +89,3 @@ export const Chip = ({
</Tag>
);
};

const chip = cva({
base: {
color: "background-action-high-blue-france",
bgColor: "background-action-low-blue-france",
},
variants: {
isChecked: {
true: {
color: "background-action-low-blue-france",
bgColor: "background-action-high-blue-france",
},
},
},
});
7 changes: 6 additions & 1 deletion packages/frontend/src/features/InfoForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ export const InfoForm = () => {
<Button
type="button"
iconId="ri-arrow-right-line"
nativeButtonProps={{ type: "button", onClick: () => tab.setValue("notes") }}
nativeButtonProps={{
type: "button",
onClick: () => {
tab.setValue("notes");
},
}}
>
Rédiger le bilan
</Button>
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/routes/edit.$reportId.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ const WithReport = ({ report }: { report: Report }) => {

const setTab = (tab: string) => {
navigate({ search: { tab }, replace: true });
document.getElementById("root")!.scrollTo(0, 0);
};

const options = [
Expand Down
10 changes: 8 additions & 2 deletions packages/pdf/src/report.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import { Document, PDFViewer, Page } from "@react-pdf/renderer";
import { Document, Font, Page } from "@react-pdf/renderer";
import { Html } from "react-pdf-html";
import React from "react";
import type { Udap, Report, Service_instructeurs, Clause_v2 } from "@cr-vif/electric-client/frontend";

Font.registerHyphenationCallback((word) => {
console.log(word);
return [word];
});

export const ReportPDFDocument = ({ udap, htmlString, images }: ReportPDFDocumentProps) => {
return (
<Document>
Expand Down Expand Up @@ -93,7 +98,6 @@ export const ReportPDFDocument = ({ udap, htmlString, images }: ReportPDFDocumen
align-items: flex-end;
}
</style>
<div class="header">
<div class="marianne">
Expand Down Expand Up @@ -187,6 +191,8 @@ export const getReportHtmlString = (
Ref cadastrale : ${report.projectCadastralRef ?? ""}<br/>
</p>
<span class="link">https://stackoverflow.com/questions/8753296/how-to-prevent-line-break-at-hyphens-in-all-browsers</span>
<p>
<strong>Objet de la demande : ${report.title ?? ""}</strong>
</p>
Expand Down

0 comments on commit 2db8738

Please sign in to comment.