-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1597 from gettakaro/main-promotion
- Loading branch information
Showing
21 changed files
with
411 additions
and
214 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Takaro app-api | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* The version of the OpenAPI document: development - beba7b82477f27e48a128b4b6028e6fdfa149ec4 | ||
* The version of the OpenAPI document: development - 3b2d157a1e9a975202df8d28b26a2df38fa03417 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
|
@@ -5729,6 +5729,37 @@ export interface NOTDOMAINSCOPEDTakaroModelDTO { | |
*/ | ||
export type NOTDOMAINSCOPEDTakaroModelDTOCreatedAt = string; | ||
|
||
/** | ||
* | ||
* @export | ||
* @interface OptionalPogStatsInputDTO | ||
*/ | ||
export interface OptionalPogStatsInputDTO { | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof OptionalPogStatsInputDTO | ||
*/ | ||
gameServerId: string; | ||
/** | ||
* | ||
* @type {string} | ||
* @memberof OptionalPogStatsInputDTO | ||
*/ | ||
playerId?: string; | ||
/** | ||
* | ||
* @type {StatsControllerGetPingStatsStartDateParameter} | ||
* @memberof OptionalPogStatsInputDTO | ||
*/ | ||
startDate?: StatsControllerGetPingStatsStartDateParameter; | ||
/** | ||
* | ||
* @type {StatsControllerGetPingStatsStartDateParameter} | ||
* @memberof OptionalPogStatsInputDTO | ||
*/ | ||
endDate?: StatsControllerGetPingStatsStartDateParameter; | ||
} | ||
/** | ||
* | ||
* @export | ||
|
@@ -21916,23 +21947,21 @@ export const StatsApiAxiosParamCreator = function (configuration?: Configuration | |
* Required permissions: `READ_PLAYERS` | ||
* @summary Get currency stats | ||
* @param {string} gameServerId | ||
* @param {string} playerId | ||
* @param {string} [playerId] | ||
* @param {StatsControllerGetPingStatsStartDateParameter} [startDate] | ||
* @param {StatsControllerGetPingStatsStartDateParameter} [endDate] | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
statsControllerGetCurrencyStats: async ( | ||
gameServerId: string, | ||
playerId: string, | ||
playerId?: string, | ||
startDate?: StatsControllerGetPingStatsStartDateParameter, | ||
endDate?: StatsControllerGetPingStatsStartDateParameter, | ||
options: RawAxiosRequestConfig = {}, | ||
): Promise<RequestArgs> => { | ||
// verify required parameter 'gameServerId' is not null or undefined | ||
assertParamExists('statsControllerGetCurrencyStats', 'gameServerId', gameServerId); | ||
// verify required parameter 'playerId' is not null or undefined | ||
assertParamExists('statsControllerGetCurrencyStats', 'playerId', playerId); | ||
const localVarPath = `/stats/currency`; | ||
// use dummy base URL string because the URL constructor only accepts absolute URLs. | ||
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); | ||
|
@@ -22299,15 +22328,15 @@ export const StatsApiFp = function (configuration?: Configuration) { | |
* Required permissions: `READ_PLAYERS` | ||
* @summary Get currency stats | ||
* @param {string} gameServerId | ||
* @param {string} playerId | ||
* @param {string} [playerId] | ||
* @param {StatsControllerGetPingStatsStartDateParameter} [startDate] | ||
* @param {StatsControllerGetPingStatsStartDateParameter} [endDate] | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
async statsControllerGetCurrencyStats( | ||
gameServerId: string, | ||
playerId: string, | ||
playerId?: string, | ||
startDate?: StatsControllerGetPingStatsStartDateParameter, | ||
endDate?: StatsControllerGetPingStatsStartDateParameter, | ||
options?: RawAxiosRequestConfig, | ||
|
@@ -22531,15 +22560,15 @@ export const StatsApiFactory = function (configuration?: Configuration, basePath | |
* Required permissions: `READ_PLAYERS` | ||
* @summary Get currency stats | ||
* @param {string} gameServerId | ||
* @param {string} playerId | ||
* @param {string} [playerId] | ||
* @param {StatsControllerGetPingStatsStartDateParameter} [startDate] | ||
* @param {StatsControllerGetPingStatsStartDateParameter} [endDate] | ||
* @param {*} [options] Override http request option. | ||
* @throws {RequiredError} | ||
*/ | ||
statsControllerGetCurrencyStats( | ||
gameServerId: string, | ||
playerId: string, | ||
playerId?: string, | ||
startDate?: StatsControllerGetPingStatsStartDateParameter, | ||
endDate?: StatsControllerGetPingStatsStartDateParameter, | ||
options?: RawAxiosRequestConfig, | ||
|
@@ -22702,7 +22731,7 @@ export class StatsApi extends BaseAPI { | |
* Required permissions: `READ_PLAYERS` | ||
* @summary Get currency stats | ||
* @param {string} gameServerId | ||
* @param {string} playerId | ||
* @param {string} [playerId] | ||
* @param {StatsControllerGetPingStatsStartDateParameter} [startDate] | ||
* @param {StatsControllerGetPingStatsStartDateParameter} [endDate] | ||
* @param {*} [options] Override http request option. | ||
|
@@ -22711,7 +22740,7 @@ export class StatsApi extends BaseAPI { | |
*/ | ||
public statsControllerGetCurrencyStats( | ||
gameServerId: string, | ||
playerId: string, | ||
playerId?: string, | ||
startDate?: StatsControllerGetPingStatsStartDateParameter, | ||
endDate?: StatsControllerGetPingStatsStartDateParameter, | ||
options?: RawAxiosRequestConfig, | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Takaro app-api | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* The version of the OpenAPI document: development - beba7b82477f27e48a128b4b6028e6fdfa149ec4 | ||
* The version of the OpenAPI document: development - 3b2d157a1e9a975202df8d28b26a2df38fa03417 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Takaro app-api | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* The version of the OpenAPI document: development - beba7b82477f27e48a128b4b6028e6fdfa149ec4 | ||
* The version of the OpenAPI document: development - 3b2d157a1e9a975202df8d28b26a2df38fa03417 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Takaro app-api | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* The version of the OpenAPI document: development - beba7b82477f27e48a128b4b6028e6fdfa149ec4 | ||
* The version of the OpenAPI document: development - 3b2d157a1e9a975202df8d28b26a2df38fa03417 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
|
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 |
---|---|---|
|
@@ -4,7 +4,7 @@ | |
* Takaro app-api | ||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) | ||
* | ||
* The version of the OpenAPI document: development - beba7b82477f27e48a128b4b6028e6fdfa149ec4 | ||
* The version of the OpenAPI document: development - 3b2d157a1e9a975202df8d28b26a2df38fa03417 | ||
* Contact: [email protected] | ||
* | ||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). | ||
|
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
23 changes: 23 additions & 0 deletions
23
packages/lib-components/src/components/feedback/Badge/Badge.stories.tsx
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,23 @@ | ||
import React from 'react'; | ||
import { Meta, StoryFn } from '@storybook/react'; | ||
import { Badge, BadgeProps } from '.'; | ||
|
||
export default { | ||
title: 'Feedback/Badge', | ||
component: Badge, | ||
args: { | ||
variant: 'warning', | ||
animate: false, | ||
}, | ||
} as Meta<BadgeProps>; | ||
|
||
export const Default: StoryFn<BadgeProps> = (args) => ( | ||
<div> | ||
<h2 style={{ backgroundColor: 'orange', position: 'relative', width: 'fit-content' }}> | ||
this is the title{' '} | ||
<Badge variant={args.variant} animate={args.animate}> | ||
here | ||
</Badge> | ||
</h2> | ||
</div> | ||
); |
47 changes: 47 additions & 0 deletions
47
packages/lib-components/src/components/feedback/Badge/index.tsx
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,47 @@ | ||
import { forwardRef, PropsWithChildren } from 'react'; | ||
import { pulseAnimation, styled } from '../../../styled'; | ||
import { AlertVariants, Color } from '../../../styled'; | ||
import { shade } from 'polished'; | ||
|
||
type ColorVariant = AlertVariants | Color | 'default'; | ||
|
||
const Container = styled.div<{ variant: ColorVariant; animate: boolean }>` | ||
background-color: ${({ theme, variant }) => | ||
variant === 'default' ? theme.colors.background : shade('0.8', theme.colors[variant])}; | ||
color: ${({ theme, variant }) => (variant === 'default' ? theme.colors.text : theme.colors[variant])}; | ||
font-size: ${({ theme }) => theme.fontSize.tiny}; | ||
font-weight: 600; | ||
border-radius: ${({ theme }) => theme.borderRadius.small}; | ||
width: fit-content; | ||
height: 1.5rem; | ||
line-height: 1.1rem; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
position: absolute; | ||
top: -${({ theme }) => theme.spacing['1']}; | ||
right: -${({ theme }) => theme.spacing['0_75']}; | ||
padding: ${({ theme }) => theme.spacing['0_25']}; | ||
border: 1px solid | ||
${({ theme, variant }) => (variant === 'default' ? theme.colors.backgroundAccent : theme.colors[variant])}; | ||
animation: ${({ animate, variant, theme }) => | ||
animate ? pulseAnimation(variant === 'default' ? theme.colors.backgroundAccent : theme.colors[variant]) : 'none'} | ||
5s infinite ease-in-out; | ||
`; | ||
|
||
export interface BadgeProps { | ||
variant?: ColorVariant; | ||
animate?: boolean; | ||
} | ||
|
||
export const Badge = forwardRef<HTMLDivElement, PropsWithChildren<BadgeProps>>(function Badge( | ||
{ variant = 'default', children, animate = false }, | ||
ref, | ||
) { | ||
return ( | ||
<Container ref={ref} variant={variant} animate={animate}> | ||
{children} | ||
</Container> | ||
); | ||
}); |
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
Oops, something went wrong.