Skip to content

Commit

Permalink
fix: Fix sever/client mismatch due to time/date on Tweet component (#673
Browse files Browse the repository at this point in the history
)
  • Loading branch information
MaximeHeckel authored Jan 5, 2024
1 parent fb9c8d1 commit e84d928
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/components/Tweet/Tweet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ const Tweet = (props: Props) => {
<time
title={`Time Posted: ${createdAt.toUTCString()}`}
dateTime={createdAt.toISOString()}
suppressHydrationWarning
>
{format(createdAt, 'h:mm a - MMM d, y')}
</time>
Expand Down
8 changes: 4 additions & 4 deletions pages/design.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Logo from '@core/components/Logo';
import Glow from '@core/components/Glow';
import CodeBlock from '@core/components/Code/CodeBlock';
import Seo from '@core/components/Seo';
// import Tweet from '@core/components/Tweet';
import Tweet from '@core/components/Tweet';
import Layout from '@core/layout';
import { getTweets } from 'lib/tweets';
import dynamic from 'next/dynamic';
Expand Down Expand Up @@ -144,7 +144,7 @@ const Label = styled('p', {
marginBottom: '8px',
});

export default function Design(_props: { tweets: Record<string, NewTweet> }) {
export default function Design(props: { tweets: Record<string, NewTweet> }) {
const { dark } = useTheme();
const [showSearch, setShowSearch] = React.useState(false);
const [email, setEmail] = React.useState('');
Expand Down Expand Up @@ -1290,7 +1290,7 @@ function sayHi(name) {
</Button>
<Search onClose={() => setShowSearch(false)} open={showSearch} />
</Flex>
{/* <Flex
<Flex
alignItems="start"
as="section"
css={{ alignSelf: 'stretch' }}
Expand All @@ -1300,7 +1300,7 @@ function sayHi(name) {
>
<H2>Tweet</H2>
<Tweet tweet={props.tweets['1386013361809281024']} />
</Flex> */}
</Flex>
<Flex
alignItems="start"
as="section"
Expand Down

1 comment on commit e84d928

@vercel
Copy link

@vercel vercel bot commented on e84d928 Jan 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.