-
Notifications
You must be signed in to change notification settings - Fork 50
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
chore: standardize date/number formatting #676
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@@ -100,7 +98,7 @@ export const OrderDetailsDialog = ({ | |||
); | |||
|
|||
const renderOrderTime = ({ timeInMs }: { timeInMs: Nullable<number> }) => | |||
timeInMs ? <time>{relativeTimeString({ timeInMs, selectedLocale })}</time> : '-'; | |||
timeInMs ? <Output type={OutputType.DateTime} value={timeInMs} /> : '-'; |
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.
I don't think we need to use a ternary here since the <Output>
component handles timeInMs = null
by rendering -
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.
As far as I can tell that is only true for numbers. Dates and relative dates bail early and return null if things aren't quite right I think.
We can make dates behave similarly, I'd just do a quick audit to make sure it doesn't break any existing behavior.
commit dc02b27 Author: yujin512 <yujin@dydx.exchange> Date: Thu Jun 27 16:30:17 2024 -0400 feat: add blast and metadata (dydxprotocol#738) Co-authored-by: jaredvu <jaredvu@gmail.com> commit cf2c9f2 Author: moo-onthelawn <70078372+moo-onthelawn@users.noreply.github.com> Date: Thu Jun 27 13:09:58 2024 -0400 chore(memo): clean up memo flag + flip staking to be true in mainnet (dydxprotocol#741) commit 27115fd Author: Jeremy Lee <37092291+yogurtandjam@users.noreply.github.com> Date: Wed Jun 26 20:11:42 2024 -0400 chore: observability for skip migration [OTE-432] (dydxprotocol#737) commit b85c1eb Author: moo-onthelawn <70078372+moo-onthelawn@users.noreply.github.com> Date: Wed Jun 26 19:08:56 2024 -0400 chore(staking): update faq to have see more here link to published help article (dydxprotocol#735) commit b10abde Author: tyleroooo <tyler@dydx.exchange> Date: Wed Jun 26 18:01:08 2024 -0400 chore: standardize date/number formatting (dydxprotocol#676) commit 23a4bd2 Author: yang-dydx <117109716+yang-dydx@users.noreply.github.com> Date: Wed Jun 26 14:30:08 2024 -0700 chore(staking): add default validator as part of stake transaction event (dydxprotocol#736) commit 83908b3 Author: tyleroooo <tyler@dydx.exchange> Date: Wed Jun 26 17:15:34 2024 -0400 fix: back to linear scale orderbook bars (dydxprotocol#734) commit b5ef243 Author: moo-onthelawn <70078372+moo-onthelawn@users.noreply.github.com> Date: Wed Jun 26 16:40:17 2024 -0400 fix(staking): fix chart not loading properly (dydxprotocol#733) commit 22125a6 Author: aleka <aforaleka@gmail.com> Date: Wed Jun 26 13:39:41 2024 -0400 chore: another pass for the markets panels padding (dydxprotocol#732) commit 131292e Author: moo-onthelawn <70078372+moo-onthelawn@users.noreply.github.com> Date: Wed Jun 26 12:18:25 2024 -0400 fix(staking): update button styling on tokens page + add error if wallet balance < gas fees on stake form page (dydxprotocol#731)
fix(staking): update button styling on tokens page + add error if wallet balance < gas fees on stake form page (dydxprotocol#731) chore: another pass for the markets panels padding (dydxprotocol#732) fix(staking): fix chart not loading properly (dydxprotocol#733) fix: back to linear scale orderbook bars (dydxprotocol#734) chore(staking): add default validator as part of stake transaction event (dydxprotocol#736) chore: standardize date/number formatting (dydxprotocol#676) chore(staking): update faq to have see more here link to published help article (dydxprotocol#735) chore: observability for skip migration [OTE-432] (dydxprotocol#737) chore(memo): clean up memo flag + flip staking to be true in mainnet (dydxprotocol#741) feat: add blast and metadata (dydxprotocol#738) Co-authored-by: jaredvu <jaredvu@gmail.com>
Made a helper function version of Output that takes a value and type and returns a string. We can use this in places we are rendering numbers that isn't JSX and ensure we are using the exact same logic for consistency.