Skip to content

Commit

Permalink
Fix: issue-1089 - Change to default state and condition
Browse files Browse the repository at this point in the history
  • Loading branch information
yuanLeeMidori committed Nov 17, 2020
1 parent 449a45f commit a45d697
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/frontend/src/components/Post/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const Post = ({ postUrl }) => {
const sectionEl = useRef(null);
// Grab the post data from our backend so we can render it
const { data: post, error } = useSWR(postUrl, (url) => fetch(url).then((r) => r.json()));
const [expandHeader, setExpandHeader] = useState(true);
const [expandHeader, setExpandHeader] = useState(false);
const toggleExpandHeader = () => {
setExpandHeader(!expandHeader);
};
Expand Down Expand Up @@ -154,7 +154,7 @@ const Post = ({ postUrl }) => {
<Typography variant="h1" title={post.title} id={post.id} className={classes.title}>
<span
onClick={toggleExpandHeader}
className={expandHeader ? classes.collapseHeader : classes.expandHeader}
className={expandHeader ? classes.expandHeader : classes.collapseHeader}
>
{post.title}
</span>
Expand Down

0 comments on commit a45d697

Please sign in to comment.