bsky-app/src/lib
Eric Bailey 443beda741
Add `useGetTimeAgo` and utils (#4556)
* Create a testable version of ago() and re-enable the disabled test (#4364)

* Enable the test of ago()

* Use test cases

This puts the input and the expected values next to each other.

* Create dateDiff function

This is a copy of ago(), but with the ability to specify the second date instead of using Date.now().

* Let ago() use dateDiff()

* Move constants close to usage

* Test dateDiff instead of ago

This makes it possible to test the dates without being forced to rely on what the current date is.

The commented out tests do not yet pass. This is fixed in later commits.

* Update dateDiff and enable the remaining tests

* Split up tests, use date-fns as helpers

* Remove old test

* Add long format

* Add hook

* Migrate to hooks

* Delete old code

* Or equal to

* Update comment

---------

Co-authored-by: Jan Aagaard <jan@aagaard.net>
2024-06-18 10:55:02 -05:00
..
analytics [Reduced Onboarding] Add profile step (#3933) 2024-05-11 05:37:23 +01:00
api [🐴] send record via link in text (Record DMs - base PR) (#4227) 2024-05-31 10:41:06 -05:00
async Remove deprecated models and mobx usage (react-query refactor) (#1934) 2023-11-16 12:53:43 -08:00
broadcast Stub broadcast channel for unspported contexts (#2175) 2023-12-12 11:19:27 -08:00
custom-animations [🐴] Empty chat prompt (#4132) 2024-05-20 16:56:44 -07:00
hooks Add `useGetTimeAgo` and utils (#4556) 2024-06-18 10:55:02 -05:00
link-meta increase timeout to 15s (#2958) 2024-02-23 12:37:49 -08:00
media add `legacy` to picker for Android (#4377) 2024-06-05 16:27:57 -07:00
moderation Improve the visual clarity of labels on profiles and posts (#4262) 2024-05-30 05:33:18 +01:00
notifications register the push token after request has been approved on android (#4481) 2024-06-11 10:28:48 -07:00
routes Add KnownFollowers component to standard profile header (#4420) 2024-06-11 15:42:28 -07:00
statsig Add `native_pwi_disabled` feature gate experiment (#4507) 2024-06-17 13:21:09 -05:00
strings Add `useGetTimeAgo` and utils (#4556) 2024-06-18 10:55:02 -05:00
ScrollContext.tsx Account for momentum when hiding minimal shell (#3740) 2024-04-28 17:48:20 +01:00
ThemeContext.tsx Options for selecting dark theme, fix some white flashes when in dark mode (#2722) 2024-02-06 11:43:51 -08:00
app-info.ts fix bad bool check in action (#3885) 2024-05-06 20:13:12 -07:00
app-info.web.ts match web version exports (#4257) 2024-05-29 12:00:15 +03:00
assets.native.ts 🤫 (#2211) 2023-12-14 14:48:40 -06:00
assets.ts 🤫 (#2211) 2023-12-14 14:48:40 -06:00
batchedUpdates.ts Shadow refactoring and improvements (#1959) 2023-11-21 22:42:30 +00:00
batchedUpdates.web.ts New Web Layout (#2126) 2024-01-22 14:46:32 -08:00
browser.native.ts [🐴] Don't submit the message on return press when on a phone (web input) (#4203) 2024-05-23 19:45:50 -07:00
browser.ts [🐴] Don't submit the message on return press when on a phone (web input) (#4203) 2024-05-23 19:45:50 -07:00
build-flags.ts Remove old old onboarding (#3674) 2024-04-23 19:30:49 -05:00
constants.ts dont send message if >1000 graphemes (#3995) 2024-05-13 22:36:56 +01:00
embeds.ts Improved mute alerting (#1355) 2023-09-01 12:30:02 -07:00
functions.ts Performance improvements: structural sharing & moderation opts context (#3785) 2024-04-30 21:06:51 -07:00
gif-alt-text.ts [GIFs] Restore default alt text (#3893) 2024-05-07 20:05:40 +01:00
haptics.ts Improve Android haptic, offer toggle for haptics in the app (#3482) 2024-04-11 15:20:26 -07:00
icons.tsx Use new icons on notifications screen (#4299) 2024-05-31 13:13:01 +01:00
merge-refs.ts make tab bar scroll view draggable on web 2023-05-24 15:04:30 -07:00
moderatePost_wrapped.ts 3p moderation services [WIP] (#2550) 2024-03-18 12:46:28 -07:00
moderation.ts 3p moderation services [WIP] (#2550) 2024-03-18 12:46:28 -07:00
numbers.ts Refactor: create src/lib to reflect actual sharing of that code 2022-11-22 12:02:31 -06:00
react-query.tsx Extract query key roots to constants (#3404) 2024-04-04 18:57:38 +01:00
sentry.ts Better dist strings for Sentry (#3584) 2024-04-16 14:38:25 -07:00
sharing.ts migrate to `expo-clipboard` (#3419) 2024-04-04 21:19:15 -07:00
storage.ts Merge main into the Web PR (#230) 2023-02-22 14:23:57 -06:00
styles.ts Round line height (#2824) 2024-02-09 12:04:04 -06:00
themes.ts 3p moderation services [WIP] (#2550) 2024-03-18 12:46:28 -07:00
type-assertions.ts Update web image editor (#588) 2023-05-09 14:55:44 -05:00
type-guards.ts Merge main into the Web PR (#230) 2023-02-22 14:23:57 -06:00