diff --git a/.env b/.env index 4f195586d..f975063c9 100644 --- a/.env +++ b/.env @@ -32,3 +32,5 @@ HASURA_GRAPHQL_UNAUTHORIZED_ROLE=public # webhook ACCOUNT_EMAIL_SECRET=a random string that will be verify when calling the webhook PUBLICATION_SECRET=a random string that will be verify when calling the webhook + +NEXT_PUBLIC_CONTAINER_NAME=cdtn-dev diff --git a/targets/frontend/package.json b/targets/frontend/package.json index 640b8579c..268f618f7 100644 --- a/targets/frontend/package.json +++ b/targets/frontend/package.json @@ -64,7 +64,7 @@ "strip-markdown": "^4.0.0", "styled-components": "^5.2.1", "swr": "^0.3.11", - "theme-ui": "0.6.0-alpha.3", + "theme-ui": "0.6.0-alpha.4", "unified": "^9.2.0", "unist-util-parents": "^1.0.3", "unist-util-select": "^3.0.4", diff --git a/targets/frontend/src/components/alerts/AlertTitle.js b/targets/frontend/src/components/alerts/AlertTitle.js index 0830a28df..2b812b942 100644 --- a/targets/frontend/src/components/alerts/AlertTitle.js +++ b/targets/frontend/src/components/alerts/AlertTitle.js @@ -1,3 +1,5 @@ +/** @jsxImportSource theme-ui */ + import PropTypes from "prop-types"; import { useState } from "react"; import { IoIosLink, IoMdChatbubbles } from "react-icons/io"; @@ -28,7 +30,7 @@ export function AlertTitle({ alertId, info, ...props }) { )} -
+ ); diff --git a/targets/frontend/src/components/changes/ChangeGroup.js b/targets/frontend/src/components/changes/ChangeGroup.js index dcd2253d7..742d74cc6 100644 --- a/targets/frontend/src/components/changes/ChangeGroup.js +++ b/targets/frontend/src/components/changes/ChangeGroup.js @@ -1,3 +1,5 @@ +/** @jsxImportSource theme-ui */ + import { AccordionItem, AccordionPanel } from "@reach/accordion"; import PropTypes from "prop-types"; import { AccordionButton } from "src/components/button"; diff --git a/targets/frontend/src/components/changes/ViewDiff.js b/targets/frontend/src/components/changes/ViewDiff.js index 200042195..84eb32f4d 100644 --- a/targets/frontend/src/components/changes/ViewDiff.js +++ b/targets/frontend/src/components/changes/ViewDiff.js @@ -1,10 +1,12 @@ -// adapted from https://github.com/davidmason/react-stylable-diff/blob/master/lib/react-diff.js +/** @jsxImportSource theme-ui */ import PropTypes from "prop-types"; import { useState } from "react"; var jsdiff = require("diff"); +// adapted from https://github.com/davidmason/react-stylable-diff/blob/master/lib/react-diff.js + const fnMap = { chars: jsdiff.diffChars, json: jsdiff.diffJson, diff --git a/targets/frontend/src/components/comments/Comment.js b/targets/frontend/src/components/comments/Comment.js index 1d2223557..2f720ce7a 100644 --- a/targets/frontend/src/components/comments/Comment.js +++ b/targets/frontend/src/components/comments/Comment.js @@ -1,16 +1,20 @@ import PropTypes from "prop-types"; -import { Box } from "theme-ui"; +import { Box, Text } from "theme-ui"; export function Comment({ comment }) { return ( - {comment.user.name}{" "} - + + {comment.user.name} + {" "} + {new Date(comment.createdAt).toLocaleDateString()} - + -

{comment.text}

+ + {comment.text} +
); } diff --git a/targets/frontend/src/components/comments/CommentForm.js b/targets/frontend/src/components/comments/CommentForm.js index 55366ae49..be90f0d23 100644 --- a/targets/frontend/src/components/comments/CommentForm.js +++ b/targets/frontend/src/components/comments/CommentForm.js @@ -1,6 +1,7 @@ import VisuallyHidden from "@reach/visually-hidden"; import PropTypes from "prop-types"; import { useForm } from "react-hook-form"; +import { Input, Label } from "theme-ui"; import { Button } from "../button"; @@ -18,8 +19,8 @@ export function CommentForm({ onSubmit }) { return (
- +
); } diff --git a/targets/frontend/src/components/comments/CommentList.js b/targets/frontend/src/components/comments/CommentList.js index 17b97ef0c..25d3a001a 100644 --- a/targets/frontend/src/components/comments/CommentList.js +++ b/targets/frontend/src/components/comments/CommentList.js @@ -1,6 +1,6 @@ import PropTypes from "prop-types"; import { useLayoutEffect, useRef } from "react"; -import { Text } from "theme-ui"; +import { Box, Text } from "theme-ui"; import { Stack } from "../layout/Stack"; import { Comment, commentPropTypes } from "./Comment"; @@ -13,7 +13,7 @@ export function CommentList({ comments }) { } }); return ( -
@@ -28,7 +28,7 @@ export function CommentList({ comments }) { )} -
+
); } diff --git a/targets/frontend/src/components/comments/index.js b/targets/frontend/src/components/comments/index.js index f741846bb..8314fd122 100644 --- a/targets/frontend/src/components/comments/index.js +++ b/targets/frontend/src/components/comments/index.js @@ -1,3 +1,5 @@ +/** @jsxImportSource theme-ui */ + import PropTypes from "prop-types"; import { useMemo } from "react"; import { useUser } from "src/hooks/useUser"; diff --git a/targets/frontend/src/components/editorialContent/ContentSections/MarkdownPreviewModal.js b/targets/frontend/src/components/editorialContent/ContentSections/MarkdownPreviewModal.js index c38a31a8d..be4337439 100644 --- a/targets/frontend/src/components/editorialContent/ContentSections/MarkdownPreviewModal.js +++ b/targets/frontend/src/components/editorialContent/ContentSections/MarkdownPreviewModal.js @@ -1,3 +1,5 @@ +/** @jsxImportSource theme-ui */ + import micromark from "micromark"; import PropTypes from "prop-types"; import { useState } from "react"; @@ -33,6 +35,7 @@ export const MarkdownPreviewModal = ({ markdown }) => { maxHeight: "90vh", maxWidth: "50rem", overflow: "auto", + position: "absolute", top: "50%", transform: "translate(-50%, -50%)", width: "90vw", diff --git a/targets/frontend/src/components/editorialContent/ContentSections/Section.js b/targets/frontend/src/components/editorialContent/ContentSections/Section.js index 9b850cd48..832516163 100644 --- a/targets/frontend/src/components/editorialContent/ContentSections/Section.js +++ b/targets/frontend/src/components/editorialContent/ContentSections/Section.js @@ -1,3 +1,5 @@ +/** @jsxImportSource theme-ui */ + import PropTypes from "prop-types"; import React, { useEffect, useState } from "react"; import { useWatch } from "react-hook-form"; @@ -12,8 +14,9 @@ import { Button, IconButton } from "src/components/button"; import { ReferenceBlocks } from "src/components/editorialContent/ReferenceBlocks"; import { FormErrorMessage } from "src/components/forms/ErrorMessage"; import { Stack } from "src/components/layout/Stack"; +import { Li } from "src/components/list"; import { MarkdownLink } from "src/components/MarkdownLink"; -import { Container, Field, Flex, Label, Radio, Textarea } from "theme-ui"; +import { Box, Container, Field, Flex, Label, Radio, Textarea } from "theme-ui"; import { MarkdownPreviewModal } from "./MarkdownPreviewModal"; @@ -64,7 +67,7 @@ const RootSection = ({ }, [errors, setOpen]); return ( -
  • +
  • {numberOfBlocks > 1 && } -
    + -
    -
    + + -
    + -
    +
    @@ -150,7 +153,7 @@ const RootSection = ({ > Graphique{" "}
    -
    +
    -
  • + ); }; diff --git a/targets/frontend/src/components/editorialContent/ContentSections/index.js b/targets/frontend/src/components/editorialContent/ContentSections/index.js index 7c7d104ed..cbd9c5830 100644 --- a/targets/frontend/src/components/editorialContent/ContentSections/index.js +++ b/targets/frontend/src/components/editorialContent/ContentSections/index.js @@ -4,12 +4,13 @@ import { useFieldArray } from "react-hook-form"; import { IoMdAdd } from "react-icons/io"; import { SortableContainer } from "react-sortable-hoc"; import { Button } from "src/components/button"; +import { List } from "src/components/list"; import { SortableSection, TYPES } from "./Section"; const SortableSectionList = SortableContainer( ({ blocks, errors, name, ...props }) => ( - + ) ); @@ -35,7 +36,7 @@ export function ContentSections({ control, name, register, errors }) { }); return ( - <> +
    - +
    ); } diff --git a/targets/frontend/src/components/editorialContent/Form.js b/targets/frontend/src/components/editorialContent/Form.js index 6e20e87e4..16af9e984 100644 --- a/targets/frontend/src/components/editorialContent/Form.js +++ b/targets/frontend/src/components/editorialContent/Form.js @@ -1,3 +1,5 @@ +/** @jsxImportSource theme-ui */ + import { ErrorMessage } from "@hookform/error-message"; import slugify from "@socialgouv/cdtn-slugify"; import { SOURCES } from "@socialgouv/cdtn-sources"; @@ -11,7 +13,7 @@ import { ContentSections } from "src/components/editorialContent/ContentSections import { ReferenceBlocks } from "src/components/editorialContent/ReferenceBlocks"; import { FormErrorMessage } from "src/components/forms/ErrorMessage"; import { MarkdownLink } from "src/components/MarkdownLink"; -import { Field, Flex, Label, NavLink, Textarea } from "theme-ui"; +import { Box, Field, Flex, Label, NavLink, Textarea } from "theme-ui"; import { TYPES as SECTION_TYPES } from "./ContentSections/Section"; @@ -60,7 +62,7 @@ const EditorialContentForm = ({ return (
    <> -
    + ( -
    + La date n’est pas formatée correctement. Le format attendu est "jour/mois/année" -
    +
    )} /> -
    + -
    + -
    + -
    + -
    + -
    +