-
- {
- isAdmin ? 'Thank you! Your event was submitted for review. You’ll receive an email once the review is completed'
- : 'Thank you! Your event was added to the Timeline Wall.'
- }
-
+ {
+ uploading ? (
+
+ ) : (
+
+ {
+ !isAdmin ? 'Thank you! Your event was submitted for review. You’ll receive an email once the review is completed'
+ : 'Thank you! Your event was added to the Timeline Wall.'
+ }
+
+ )
+ }
@@ -47,6 +55,7 @@ function ModalEventAdd({ onClose, isAdmin }) {
ModalEventAdd.defaultProps = {
onClose: () => { },
isAdmin: false,
+ uploading: false,
};
/**
@@ -55,6 +64,7 @@ ModalEventAdd.defaultProps = {
ModalEventAdd.propTypes = {
onClose: PT.func,
isAdmin: PT.bool,
+ uploading: PT.bool,
};
export default ModalEventAdd;
diff --git a/src/shared/containers/timeline-wall/modal-photo-viewer/index.jsx b/src/shared/containers/timeline-wall/modal-photo-viewer/index.jsx
index a0f741b1d6..2b8b1fa9cc 100644
--- a/src/shared/containers/timeline-wall/modal-photo-viewer/index.jsx
+++ b/src/shared/containers/timeline-wall/modal-photo-viewer/index.jsx
@@ -11,9 +11,10 @@ import PhotoVideoItem from 'components/GUIKit/PhotoVideoItem';
import style from './styles.scss';
function ModalPhotoViewer({ onClose, selectedPhoto, photos }) {
+ const newPhotos = photos.map((photo, index) => ({ ...photo, id: index }));
const [localSelectedPhoto, setLocalSelectedPhoto] = useState(selectedPhoto);
const selectedPhotoObject = useMemo(
- () => _.find(photos, { id: localSelectedPhoto }), [localSelectedPhoto],
+ () => _.find(newPhotos, { id: localSelectedPhoto }), [localSelectedPhoto],
);
return (
diff --git a/src/shared/containers/timeline-wall/styles.scss b/src/shared/containers/timeline-wall/styles.scss
index 4e85586f17..cfb126ce8e 100644
--- a/src/shared/containers/timeline-wall/styles.scss
+++ b/src/shared/containers/timeline-wall/styles.scss
@@ -1,4 +1,4 @@
-@import '~styles/mixins';
+@import "~styles/mixins";
.container {
display: flex;
@@ -19,6 +19,10 @@
}
}
+.header-admin {
+ min-height: 207px;
+}
+
.header-content-1 {
font-family: BarlowCondensed, sans-serif;
font-weight: 500;
diff --git a/src/shared/containers/timeline-wall/timeline-events/add-event/index.jsx b/src/shared/containers/timeline-wall/timeline-events/add-event/index.jsx
index 2e7df6d0f2..de5001fc19 100644
--- a/src/shared/containers/timeline-wall/timeline-events/add-event/index.jsx
+++ b/src/shared/containers/timeline-wall/timeline-events/add-event/index.jsx
@@ -10,6 +10,7 @@ import FormField from 'components/Settings/FormField';
import FormInputDatePicker from 'components/Settings/FormInputDatePicker';
import FormInputTextArea from 'components/Settings/FormInputTextArea';
import PhotoVideoPicker from 'components/GUIKit/PhotoVideoPicker';
+import { config } from 'topcoder-react-utils';
import IconCloseGreen from 'assets/images/icon-close-green.svg';
import IconCloseBlack from 'assets/images/tc-edu/icon-close-big.svg';
import ModalEventAdd from '../../modal-event-add';
@@ -17,7 +18,7 @@ import ModalEventAdd from '../../modal-event-add';
import style from './styles.scss';
function AddEvents({
- className, isAuthenticated, createNewEvent, isAdmin,
+ className, isAuthenticated, createNewEvent, isAdmin, onDoneAddEvent, uploading,
}) {
const [formData, setFormData] = useState({
eventName: '',
@@ -31,13 +32,7 @@ function AddEvents({
&& !!formData.description, [formData]);
const submitEvent = () => {
- const form = new FormData();
- form.append('title', formData.eventName);
- form.append('description', formData.description);
- form.append('eventDate', formData.date);
- form.append('mediaFiles', formData.files || []);
-
- createNewEvent(form);
+ createNewEvent(formData);
setFormData({
eventName: '',
@@ -157,6 +152,10 @@ function AddEvents({
infoText={'Drag & drop your photo or video here\nYou can upload only up to 3 photos/videos'}
infoTextMobile="Drag & drop your photo or video here"
btnText="BROWSE"
+ options={{
+ accept: config.TIMELINE.ALLOWED_FILETYPES || [],
+ maxFiles: 3,
+ }}
/>