Skip to content

Commit

Permalink
Info text expanded by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Keskimaki committed Mar 13, 2023
1 parent 2f45ad2 commit de2464c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
11 changes: 9 additions & 2 deletions src/client/components/Common/ShowMore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ import ExpandMore from '@mui/icons-material/ExpandMore'
import HelpOutlineIcon from '@mui/icons-material/HelpOutline'
import Markdown from './Markdown'

const ShowMore = ({ text }: { text: string }) => {
const [expand, setExpand] = useState(false)
const ShowMore = ({
text,
expanded = false,
}: {
text: string
// eslint-disable-next-line react/require-default-props
expanded?: boolean
}) => {
const [expand, setExpand] = useState(expanded)

return (
<>
Expand Down
5 changes: 4 additions & 1 deletion src/client/components/InteractiveForm/HelloBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ const HelloBanner = () => {
<Box id="hello-component" sx={classes.helloBox}>
<Box sx={{ my: 2, mx: 2, display: 'flex', flexWrap: 'wrap', gap: 0.3 }}>
<Markdown>{helloMessages.title[language as keyof Locales]}</Markdown>
<ShowMore text={helloMessages.text[language as keyof Locales]} />
<ShowMore
text={helloMessages.text[language as keyof Locales]}
expanded
/>
</Box>
</Box>
)
Expand Down

0 comments on commit de2464c

Please sign in to comment.