Skip to content

Commit

Permalink
Merge pull request #311 from SWE574-Fall2023-Group1/feature/285-imple…
Browse files Browse the repository at this point in the history
…ment-frontend-pop-up-warnings

Feature/285 implement frontend pop up warnings
  • Loading branch information
dbaslan authored Dec 29, 2023
2 parents 61658ad + 4e6355e commit 00e27ce
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/frontend/src/pages/story/CreateStory.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import Quill from 'quill'
import StoryMap from './StoryMap';
import TagSearch from './TagSearch'; // Adjust the path as needed
import Chip from '@mui/material/Chip';
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import { format, parseISO } from 'date-fns';


let postHeader = null;

function CreateStory({ currentTheme }) {
Expand Down Expand Up @@ -235,6 +236,7 @@ function CreateStory({ currentTheme }) {

} catch (error) {
console.error('Error submitting story:', error);
toast.error('Please fill all fields correctly');
}
};

Expand Down Expand Up @@ -487,6 +489,7 @@ function CreateStory({ currentTheme }) {
</div>
</div>
</div>
<ToastContainer position="bottom-right" autoClose={5000} />
</div>
);
}
Expand Down
4 changes: 4 additions & 0 deletions backend/frontend/src/pages/story/EditStory.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import Quill from 'quill'
import StoryMap from './StoryMap';
import TagSearch from './TagSearch'; // Adjust the path as needed
import Chip from '@mui/material/Chip';
import { ToastContainer, toast } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import { format, parseISO } from 'date-fns';


Expand Down Expand Up @@ -365,6 +367,7 @@ const parseLocation = (location) => {
navigate(`/story/${storyId}`);
} catch (error) {
console.error('Error submitting story:', error);
toast.error('Please fill all fields correctly');
}
};

Expand Down Expand Up @@ -619,6 +622,7 @@ const parseLocation = (location) => {
</div>
</div>
</div>
<ToastContainer position="bottom-right" autoClose={5000} />
</div>
);
}
Expand Down

0 comments on commit 00e27ce

Please sign in to comment.