New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: display sign on log #3193
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, just a small suggestion, but you can ignore it if you feel it's a premature optimization
@@ -10,19 +10,23 @@ interface ITimeAgoCellProps { | |||
live?: boolean; | |||
emptyText?: string; | |||
title?: (date: string) => string; | |||
timestamp?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about receiving the format function as with the title?
timestamp?: boolean; | |
dateFormat?: (value?: string | number | Date, locale?: string) => string; |
Because timestamp as a boolean limits you to have 2 formats, if you want to add a third one things gets complicated. If the function is not provided you just use the default formatting function:
const fn = dateFormat || formatDateYMD;
const date = fn(value, locationSettings.locale);
Header: 'Created', | ||
accessor: 'created_at', | ||
Cell: ({ value }: { value: Date }) => ( | ||
<TimeAgoCell value={value} timestamp /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the change suggested this would become:
<TimeAgoCell value={value} dateFormat={formatDateYMDHMS} />
Thanks @gastonfournier, I think this is a great optimization for |
Slight refactor to `TimeAgoCell` that allows passing in a date format function. Suggested by @gastonfournier in #3193 (review)
About the changes
https://linear.app/unleash/issue/2-719/display-basic-sign-on-log-in-frontend
Adds a basic, naïve way of displaying sign-on history.
We can be OK with merging this for now if we want, given that it's behind a feature flag, and then iterate over it and implement the features and improvements we need in the meantime.
Relates to roadmap item: #2951