From 34cc8e7cabb97441eec6e1be50a6842a62a760af Mon Sep 17 00:00:00 2001
From: Romain
Date: Fri, 2 Oct 2020 10:24:59 +0200
Subject: [PATCH] Using markdown for feature description and resolving feature
content-type update issues.
---
api/api/feature/models/feature.settings.json | 11 +++++++----
components/Modal.js | 9 +++++++++
components/cards/FeatureCard.js | 10 +++++++---
3 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/api/api/feature/models/feature.settings.json b/api/api/feature/models/feature.settings.json
index e159812..2b59d1e 100644
--- a/api/api/feature/models/feature.settings.json
+++ b/api/api/feature/models/feature.settings.json
@@ -12,17 +12,20 @@
"attributes": {
"name": {
"type": "string",
- "description": "The name/title of the feature",
"required": true
},
"stage": {
"type": "enumeration",
- "enum": ["under_consideration", "planned", "in_development", "launched"],
+ "enum": [
+ "under_consideration",
+ "planned",
+ "in_development",
+ "launched"
+ ],
"default": "under_consideration"
},
"description": {
- "type": "text",
- "description": "Complete description of the wanted feature",
+ "type": "richtext",
"required": true
}
}
diff --git a/components/Modal.js b/components/Modal.js
index ea7904b..5f53cde 100644
--- a/components/Modal.js
+++ b/components/Modal.js
@@ -28,6 +28,7 @@ const Overlay = styled.div`
const ModalContainer = styled(Card)`
&& {
padding: 0;
+
height: unset;
width: 740px;
@@ -69,7 +70,15 @@ const IconHolder = styled(Icon)`
const ModalContent = styled.div`
width: 100%;
+ max-height: 80vh;
+
padding: 2rem;
+
+ overflow: auto;
+
+ @media screen and (max-width: ${Breaks.medium}) {
+ max-height: 100%;
+ }
`;
const Modal = ({ show, handleClose, title, children }) =>
diff --git a/components/cards/FeatureCard.js b/components/cards/FeatureCard.js
index c33faaf..3e4901e 100644
--- a/components/cards/FeatureCard.js
+++ b/components/cards/FeatureCard.js
@@ -5,6 +5,8 @@ import styled from "styled-components";
import useModal from "../../utils/useModal";
import Modal from "../Modal";
import Card from "./Card";
+import ReactMarkdown from "react-markdown";
+import styles from "../../styles/markdown.module.css";
const Container = styled(Card)`
flex-flow: column;
@@ -25,7 +27,7 @@ const Name = styled.b`
white-space: nowrap;
`;
-const Description = styled.p`
+const Description = styled.div`
display: -webkit-box;
-webkit-line-clamp: 6;
-webkit-box-orient: vertical;
@@ -61,12 +63,14 @@ export default function FeatureCard({ className, feature }) {
- {feature.description}
+
toggle()} className={className}>
{feature.name}
- {feature.description}
+
+
+
>
);