We used the markdown for the Terms and Conditions page and planned to get the content from .md file directly instead of exporting string from .ts file. However, we can’t import the content from .md file directly like .ts file.

2 Blockers

  • content issue: not able to import content from .md file
  • typescript issue (type declaration)

Solution

  • this solve the import content issue

--

--

I came across this interesting bug yesterday in Firefox. The notification feature worked in Chrome but not in Firefox in production and I did my investigation in local.

I did the experiment in the development tool for both browser

Chrome

new Date("2022-09-29 15:00:00.000-7")
Thu Sep 29 2022 18:00:00 GMT-0400 (Eastern Daylight Time)
new Date("2022-09-29 15:00:00.000-07")
Thu Sep 29 2022 18:00:00 GMT-0400 (Eastern Daylight Time)

FireFox

new Date("2022-09-29 15:00:00.000-7")
Invalid Date
new Date("2022-09-29 15:00:00.000-07") Thu Sep 29 2022 18:00:00 GMT-0400 (Eastern Daylight Time)

Takeaway

The reason is because I set the time to 2022-09-29 15:00:00.000-7 so I should set the time to 2022-09-29 15:00:00.000-07 instead. We should user -/+ with 2 digit all the time.

--

--

I need to create a vertical bar to divide the sections like this.

First approach

{sections.map((section, index) => {
return (
<>
<Section onClick={section.onClick}>
ABC
</Section>
{index < sections.length - 1 && <VerticalLine />}
</>
);
})}

Second approach with css(suggestion from co-worker)

const VerticalLine = styled.div`
&:last-of-type {
display: none;
}
`;

Pretty nice right?

--

--