-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat(examples): Add Collapse component to test problem with window in…
… resize observer
- Loading branch information
Showing
2 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,40 @@ | ||
import { Heading } from '@lmc-eu/spirit-web-react'; | ||
'use client'; | ||
|
||
import { Button, Collapse, Heading, useCollapse } from '@lmc-eu/spirit-web-react'; | ||
import { NextPage } from 'next'; | ||
|
||
const Home: NextPage = () => <Heading size="large">Spirit App Router</Heading>; | ||
const CollapseTrigger = ({ isOpen, ...rest }: any) => { | ||
return <Button {...rest}>Collapse Trigger ({isOpen ? 'Open' : 'Closed'})</Button>; | ||
}; | ||
|
||
const Home: NextPage = () => { | ||
const { isOpen, toggleHandler } = useCollapse(false); | ||
|
||
return ( | ||
<div> | ||
<Heading size="large">Spirit App Router</Heading> | ||
<CollapseTrigger isOpen={isOpen} onClick={toggleHandler} /> | ||
<Collapse id="collapse-id" isOpen={isOpen}> | ||
<p> | ||
Condimentum odio, pulvinar et sollicitudin accumsan ac hendrerit vestibulum commodo, molestie laoreet dui sit | ||
amet. Molestie consectetur, sed ac felis scelerisque lectus accumsan purus id dolor sed vitae, praesent | ||
aliquam dolor quis ornare. Nulla sit amet, rhoncus at quis odio et iaculis lacinia suscipit vivamus sodales, | ||
nunc id condimentum felis. Consectetur nec commodo, praesent et elit magna purus molestie cursus molestie, | ||
libero ut venenatis erat id et nisi. Quam posuere, aliquam quam leo vitae tellus semper eget nunc, ultricies | ||
adipiscing sit amet accumsan. Lorem rutrum, porttitor ante mauris suspendisse ultricies consequat purus, | ||
congue a commodo magna et. | ||
</p> | ||
<p> | ||
Nunc potenti, mauris sollicitudin purus augue justo et condimentum, vivamus a ornare consequat. Aliquet ut, | ||
metus libero vitae volutpat felis a iaculis sapien dolor quis, augue fermentum donec urna. Sem facilisis, | ||
finibus non mauris suspendisse varius et nisi egestas potenti, praesent interdum nulla sem. Sodales dui, quam | ||
sagittis sapien elit lorem fringilla hendrerit nunc, porttitor quis dolor ut sit amet. Scelerisque aliquet, | ||
maximus integer cursus fusce vitae proin lacinia sed vitae, bibendum suspendisse nunc ut enim et at. Sem | ||
turpis, iaculis a eget non mauris nulla vitae augue, molestie porttitor luctus bibendum. | ||
</p> | ||
</Collapse> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,37 @@ | ||
import { Heading } from '@lmc-eu/spirit-web-react'; | ||
import { Button, Collapse, Heading, useCollapse } from '@lmc-eu/spirit-web-react'; | ||
|
||
const Home = () => <Heading size="large">Spirit Pages App</Heading>; | ||
const CollapseTrigger = ({ isOpen, ...rest }: any) => { | ||
return <Button {...rest}>Collapse Trigger ({isOpen ? 'Open' : 'Closed'})</Button>; | ||
}; | ||
|
||
const Home = () => { | ||
const { isOpen, toggleHandler } = useCollapse(false); | ||
|
||
return ( | ||
<div> | ||
<Heading size="large">Spirit Pages App</Heading> | ||
<CollapseTrigger isOpen={isOpen} onClick={toggleHandler} /> | ||
<Collapse id="collapse-id" isOpen={isOpen}> | ||
<p> | ||
Condimentum odio, pulvinar et sollicitudin accumsan ac hendrerit vestibulum commodo, molestie laoreet dui sit | ||
amet. Molestie consectetur, sed ac felis scelerisque lectus accumsan purus id dolor sed vitae, praesent | ||
aliquam dolor quis ornare. Nulla sit amet, rhoncus at quis odio et iaculis lacinia suscipit vivamus sodales, | ||
nunc id condimentum felis. Consectetur nec commodo, praesent et elit magna purus molestie cursus molestie, | ||
libero ut venenatis erat id et nisi. Quam posuere, aliquam quam leo vitae tellus semper eget nunc, ultricies | ||
adipiscing sit amet accumsan. Lorem rutrum, porttitor ante mauris suspendisse ultricies consequat purus, | ||
congue a commodo magna et. | ||
</p> | ||
<p> | ||
Nunc potenti, mauris sollicitudin purus augue justo et condimentum, vivamus a ornare consequat. Aliquet ut, | ||
metus libero vitae volutpat felis a iaculis sapien dolor quis, augue fermentum donec urna. Sem facilisis, | ||
finibus non mauris suspendisse varius et nisi egestas potenti, praesent interdum nulla sem. Sodales dui, quam | ||
sagittis sapien elit lorem fringilla hendrerit nunc, porttitor quis dolor ut sit amet. Scelerisque aliquet, | ||
maximus integer cursus fusce vitae proin lacinia sed vitae, bibendum suspendisse nunc ut enim et at. Sem | ||
turpis, iaculis a eget non mauris nulla vitae augue, molestie porttitor luctus bibendum. | ||
</p> | ||
</Collapse> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Home; |