Skip to content

Commit

Permalink
chore(StepIndicator): remove deprecated currentItem prop in onClick (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
langz committed Feb 22, 2023
1 parent 5321b3a commit 0dcd560
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ export default class StepIndicatorItem extends React.PureComponent {
item,
current_step: currentItemNum,
currentStep: currentItemNum,
currentItem: currentItemNum, // deprecated
}
const onClickItem = dispatchCustomElementEvent(
this,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ const data = [
// title: 'First',
title: <>Bestill eller erstatt</>,
// 'Second Sapien vivamus convallis fermentum euismod quam platea tellus nullam mollis',
// on_click: ({ currentItem }) => console.log('on_click', currentItem),
// on_click: ({ currentStep }) => console.log('on_click', currentStep),
status:
'Du må velge bestill nytt kort eller erstatt kort for å kunne fullføre bestillingen din.',
// status_state: 'warn',
// on_click: ({ currentItem }) => console.log('on_click', currentItem),
// on_click: ({ currentStep }) => console.log('on_click', currentStep),
// on_render: ({ StepItem }) => (
// <StepItem
// onClick={e => {
Expand All @@ -90,15 +90,15 @@ const data = [
{
title:
'Second Sapien vivamus convallis fermentum euismod quam platea tellus nullam mollis',
// on_click: ({ currentItem }) => console.log('on_click', currentItem),
// on_click: ({ currentStep }) => console.log('on_click', currentStep),
// disabled: true,
// inactive: true,
// is_current: true,
},
{
title:
'Third Sapien vivamus convallis fermentum euismod quam platea tellus nullam mollis',
// on_click: ({ currentItem }) => console.log('on_click', currentItem),
// on_click: ({ currentStep }) => console.log('on_click', currentStep),
},
]

Expand Down Expand Up @@ -191,10 +191,10 @@ export const StepIndicatorSandbox = () => {
// mode="strict"
mode="loose"
current_step={current_step}
on_change={({ currentItem }) => {
console.log('on_change', currentItem)
setCurrentStep(currentItem)
// console.log('on_change', currentItem)
on_change={({ currentStep }) => {
console.log('on_change', currentStep)
setCurrentStep(currentStep)
// console.log('on_change', currentStep)
}}
// on_item_render={({ StepItem }) => {
// return (
Expand Down Expand Up @@ -222,10 +222,10 @@ export const StepIndicatorSandbox = () => {
// mode="static"
mode="strict"
current_step={current_step}
on_change={({ currentItem }) => {
console.log('on_change', currentItem)
setCurrentStep(currentItem)
// console.log('on_change', currentItem)
on_change={({ currentStep }) => {
console.log('on_change', currentStep)
setCurrentStep(currentStep)
// console.log('on_change', currentStep)
}}
// on_item_render={({ StepItem }) => {
// return (
Expand Down

0 comments on commit 0dcd560

Please sign in to comment.