-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move card examples * update click handlers on examples with action buttons * update path to theme files
- Loading branch information
Showing
9 changed files
with
230 additions
and
157 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { create, tsx } from '@dojo/framework/core/vdom'; | ||
import { icache } from '@dojo/framework/core/middleware/icache'; | ||
import Card from '@dojo/widgets/card'; | ||
import Button from '@dojo/widgets/button'; | ||
|
||
import * as cardCss from '../../../../theme/dojo/card.m.css'; | ||
|
||
const factory = create({ icache }); | ||
|
||
export default factory(function ActionButtons({ middleware: { icache } }) { | ||
const clickCount = icache.getOrSet<number>('clickCount', 0); | ||
return ( | ||
<div styles={{ width: '400px' }}> | ||
<Card | ||
actionsRenderer={() => ( | ||
<div classes={cardCss.actionButtons}> | ||
<Button onClick={() => icache.set('clickCount', clickCount + 1)}> | ||
{clickCount === 0 | ||
? 'Action' | ||
: `Clicked: ${clickCount} time${clickCount > 1 ? 's' : ''}`} | ||
</Button> | ||
</div> | ||
)} | ||
> | ||
<h1 classes={cardCss.primary}>Hello, World</h1> | ||
<p classes={cardCss.secondary}>Lorem ipsum</p> | ||
</Card> | ||
</div> | ||
); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { create, tsx } from '@dojo/framework/core/vdom'; | ||
import { icache } from '@dojo/framework/core/middleware/icache'; | ||
import Card from '@dojo/widgets/card'; | ||
import Button from '@dojo/widgets/button'; | ||
import Icon from '@dojo/widgets/icon'; | ||
|
||
import * as cardCss from '../../../../theme/dojo/card.m.css'; | ||
|
||
const factory = create({ icache }); | ||
|
||
export default factory(function ActionButtonsAndIcons({ middleware: { icache } }) { | ||
const clickCount = icache.getOrSet<number>('clickCount', 0); | ||
return ( | ||
<div styles={{ width: '400px' }}> | ||
<Card | ||
actionsRenderer={() => [ | ||
<div classes={cardCss.actionButtons}> | ||
<Button onClick={() => icache.set('clickCount', clickCount + 1)}> | ||
{clickCount === 0 | ||
? 'Action' | ||
: `Clicked: ${clickCount} time${clickCount > 1 ? 's' : ''}`} | ||
</Button> | ||
</div>, | ||
<div classes={cardCss.actionButtons}> | ||
<Icon type="secureIcon" /> | ||
<Icon type="downIcon" /> | ||
<Icon type="upIcon" /> | ||
</div> | ||
]} | ||
> | ||
<h1 classes={cardCss.primary}>Hello, World</h1> | ||
<p classes={cardCss.secondary}>Lorem ipsum</p> | ||
</Card> | ||
</div> | ||
); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { create, tsx } from '@dojo/framework/core/vdom'; | ||
import Card from '@dojo/widgets/card'; | ||
import Icon from '@dojo/widgets/icon'; | ||
|
||
import * as cardCss from '../../../../theme/dojo/card.m.css'; | ||
|
||
const factory = create(); | ||
|
||
export default factory(function ActionIcons() { | ||
return ( | ||
<div styles={{ width: '400px' }}> | ||
<Card | ||
actionsRenderer={() => ( | ||
<div classes={cardCss.actionIcons}> | ||
<Icon type="secureIcon" /> | ||
<Icon type="downIcon" /> | ||
<Icon type="upIcon" /> | ||
</div> | ||
)} | ||
> | ||
<h1 classes={cardCss.primary}>Hello, World</h1> | ||
<p classes={cardCss.secondary}>Lorem ipsum</p> | ||
</Card> | ||
</div> | ||
); | ||
}); |
Oops, something went wrong.