-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4282 from janhq/fix/message-attachments-preview
- Loading branch information
Showing
15 changed files
with
97 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 21 additions & 26 deletions
47
web/screens/Thread/ThreadCenterPanel/TextMessage/DocMessage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 2 additions & 25 deletions
27
web/screens/Thread/ThreadCenterPanel/TextMessage/ImageMessage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
import { displayDate } from './datetime' | ||
import { isToday } from './datetime' | ||
|
||
import { displayDate } from './datetime'; | ||
import { isToday } from './datetime'; | ||
|
||
test('should return only time for today\'s timestamp', () => { | ||
const today = new Date(); | ||
const timestamp = today.getTime(); | ||
const expectedTime = today.toLocaleTimeString(undefined, { | ||
test("should return only time for today's timestamp", () => { | ||
const today = new Date() | ||
const timestamp = today.getTime() | ||
const expectedTime = `${today.toLocaleDateString(undefined, { | ||
day: '2-digit', | ||
month: 'short', | ||
year: 'numeric', | ||
})}, ${today.toLocaleTimeString(undefined, { | ||
hour: '2-digit', | ||
minute: '2-digit', | ||
second: '2-digit', | ||
hour12: true, | ||
}); | ||
expect(displayDate(timestamp)).toBe(expectedTime); | ||
}); | ||
|
||
})}` | ||
expect(displayDate(timestamp / 1000)).toBe(expectedTime) | ||
}) | ||
|
||
test('should return N/A for undefined timestamp', () => { | ||
expect(displayDate()).toBe('N/A'); | ||
}); | ||
|
||
expect(displayDate()).toBe('N/A') | ||
}) | ||
|
||
test('should return true for today\'s timestamp', () => { | ||
const today = new Date(); | ||
const timestamp = today.setHours(0, 0, 0, 0); | ||
expect(isToday(timestamp)).toBe(true); | ||
}); | ||
test("should return true for today's timestamp", () => { | ||
const today = new Date() | ||
const timestamp = today.setHours(0, 0, 0, 0) | ||
expect(isToday(timestamp)).toBe(true) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters