Skip to content

Commit

Permalink
add months calculation to recent devs display (#306)
Browse files Browse the repository at this point in the history
* add months calculattion to recent devs display

* bump version -> 1.0.75
  • Loading branch information
roymoran authored Oct 7, 2020
1 parent 4c1b197 commit cd92185
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pub",
"version": "1.0.74",
"version": "1.0.75",
"private": true,
"scripts": {
"build": "gatsby build --prefix-paths",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,11 @@ export const ProjectsGallery: FC<ProjectsGalleryProps> = () => {
return 'Today';
} else if (daysAgo === 1) {
return `1 day ago`;
} else {
} else if (daysAgo <= 30) {
return `${daysAgo} days ago`;
} else {
const months = Math.round(daysAgo / 30);
return `${months} months ago`;
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/__tests__/feedback.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ describe('feedback form', () => {
fireEvent.change(feedbackTextArea, { target: { value: 'test feedback' } });
const sendFeedbackButton = getByText('Send');
fireEvent.click(sendFeedbackButton);
const banner = await waitFor(() => getByText('Feedback sent successfully'));
const banner = await waitFor(() => getByText('Feedback sent'));

// Assert
expect(banner).toBeDefined();
Expand Down
2 changes: 1 addition & 1 deletion src/components/shared/form/feedback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export const FeedbackForm: FC = () => {

// TODO: simplify, will always be true
if (response.ok) {
setSuccess('Feedback sent successfully');
setSuccess('Feedback sent');
setFeedback('');
} else {
// TODO: remove, currently this will never execute.
Expand Down

0 comments on commit cd92185

Please sign in to comment.