Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
pavliuc75 committed Nov 1, 2024
1 parent 909d905 commit af4164f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@babel/plugin-transform-react-jsx-self": "^7.24.7",
"@babel/plugin-transform-react-jsx-source": "^7.24.7",
"@carp-dk/authentication-react": "^1.0.1",
"@carp-dk/client": "1.3.0",
"@carp-dk/client": "1.5.0",
"@emotion/react": "^11.11.4",
"@emotion/styled": "^11.11.5",
"@js-joda/core": "^5.6.2",
Expand Down
7 changes: 4 additions & 3 deletions src/pages/StudyAnnouncementEdit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import { useFormik } from "formik";
import { useEffect, useState } from "react";
import * as yup from "yup";
import { StyledButton, StyledCard, StyledContainer } from "./styles";
import { MessageData } from "@carp-dk/client";

const fileTypes = [
"image/png",
Expand Down Expand Up @@ -92,13 +93,13 @@ const StudyAnnouncementEdit = () => {
announcement: {
id: studyAnnouncementId,
title: values.title.trim(),
subTitle: values.subTitle.trim(),
sub_title: values.subTitle.trim(),
message: values.message.trim(),
type: values.type as "announcement" | "article" | "news",
timestamp: new Date().toISOString(),
image: values.image,
url: values.url,
},
} as MessageData,
newImage,
});
},
Expand All @@ -108,7 +109,7 @@ const StudyAnnouncementEdit = () => {
if (announcement) {
formik.setValues({
title: announcement.title,
subTitle: announcement.subTitle,
subTitle: announcement.sub_title,
message: announcement.message,
type: announcement.type,
image: announcement.image,
Expand Down
5 changes: 3 additions & 2 deletions src/pages/StudyAnnouncementNew/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import * as yup from "yup";
import StudyAnnouncementPreview from "../../components/StudyAnnouncementPreview";
import { StyledContainer } from "../Studies/StudiesSection/styles";
import { ContainerRight, StyledButton, StyledCard } from "./styles";
import { MessageData } from "@carp-dk/client";

const { UUID } = carpCommon.dk.cachet.carp.common.application;

Expand Down Expand Up @@ -84,13 +85,13 @@ const StudyAnnouncementNew = () => {
announcement: {
id: UUID.Companion.randomUUID().toString(),
title: values.title.trim(),
subTitle: values.subTitle.trim(),
sub_title: values.subTitle.trim(),
message: values.message.trim(),
type: values.type as "announcement" | "article" | "news",
timestamp: new Date().toISOString(),
image: values.image,
url: values.url.trim(),
},
} as MessageData,
image: values.image,
});
},
Expand Down
4 changes: 2 additions & 2 deletions src/pages/StudyAnnouncements/StudyAnnouncement/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ const StudyAnnouncment = ({ studyId, announcement, announcementId }: Props) => {
<img src={announcement.image} alt="announcement preview" />
)}
<AnnouncementTitle variant="h2">{announcement.title}</AnnouncementTitle>
{announcement.subTitle ?? (
{announcement.sub_title ?? (
<AnnouncementSubtitle variant="subtitle1">
{announcement.subTitle}
{announcement.sub_title}
</AnnouncementSubtitle>
)}
{announcement.message.length > 200 ? (
Expand Down

0 comments on commit af4164f

Please sign in to comment.