-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
10 changed files
with
155 additions
and
74 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
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
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
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
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
84 changes: 84 additions & 0 deletions
84
newIDE/app/src/stories/componentStories/Profile/CurrentUsageDisplayer.stories.js
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,84 @@ | ||
// @flow | ||
import * as React from 'react'; | ||
import { action } from '@storybook/addon-actions'; | ||
import muiDecorator from '../../ThemeDecorator'; | ||
import paperDecorator from '../../PaperDecorator'; | ||
import CurrentUsageDisplayer from '../../../Profile/CurrentUsageDisplayer'; | ||
import subscriptionSuggestionDecorator from '../../SubscriptionSuggestionDecorator'; | ||
import { | ||
limitsReached, | ||
noSubscription, | ||
silverSubscriptionWithExpiredRedemptionCode, | ||
silverSubscriptionWithRedemptionCode, | ||
subscriptionForIndieUser, | ||
} from '../../../fixtures/GDevelopServicesTestData'; | ||
|
||
export default { | ||
title: 'Profile/CurrentUsageDisplayer', | ||
component: CurrentUsageDisplayer, | ||
decorators: [subscriptionSuggestionDecorator, paperDecorator, muiDecorator], | ||
}; | ||
|
||
export const Default = () => ( | ||
<CurrentUsageDisplayer | ||
subscription={subscriptionForIndieUser} | ||
currentUsage={{ | ||
current: 2, | ||
max: 10, | ||
limitReached: false, | ||
}} | ||
onChangeSubscription={action('on change subscription callback')} | ||
/> | ||
); | ||
|
||
export const With1BuildRemaining = () => ( | ||
<CurrentUsageDisplayer | ||
subscription={subscriptionForIndieUser} | ||
currentUsage={{ | ||
current: 4, | ||
max: 5, | ||
limitReached: false, | ||
}} | ||
onChangeSubscription={action('on change subscription callback')} | ||
/> | ||
); | ||
|
||
export const WithRedemptionCode = () => ( | ||
<CurrentUsageDisplayer | ||
subscription={silverSubscriptionWithRedemptionCode} | ||
currentUsage={{ | ||
current: 2, | ||
max: 10, | ||
limitReached: false, | ||
}} | ||
onChangeSubscription={action('on change subscription callback')} | ||
/> | ||
); | ||
|
||
export const WithExpiredRedemptionCode = () => ( | ||
<CurrentUsageDisplayer | ||
subscription={silverSubscriptionWithExpiredRedemptionCode} | ||
currentUsage={{ | ||
current: 2, | ||
max: 10, | ||
limitReached: false, | ||
}} | ||
onChangeSubscription={action('on change subscription callback')} | ||
/> | ||
); | ||
|
||
export const LimitReached = () => ( | ||
<CurrentUsageDisplayer | ||
subscription={subscriptionForIndieUser} | ||
currentUsage={limitsReached.limits['cordova-build']} | ||
onChangeSubscription={action('on change subscription callback')} | ||
/> | ||
); | ||
|
||
export const LimitsReachedWithoutSubscription = () => ( | ||
<CurrentUsageDisplayer | ||
subscription={noSubscription} | ||
currentUsage={limitsReached.limits['cordova-build']} | ||
onChangeSubscription={action('on change subscription callback')} | ||
/> | ||
); |
Oops, something went wrong.