mirror of
https://github.com/billsonnn/nitro-react.git
synced 2024-11-26 15:40:51 +01:00
More changes
This commit is contained in:
parent
629083664a
commit
285d1ed6d5
@ -35,11 +35,17 @@
|
||||
"brace-style": [ "error", "allman" ],
|
||||
"template-curly-spacing": [ "error", "always" ],
|
||||
"no-multi-spaces": [ "error" ],
|
||||
"react/prop-types": [ "off" ],
|
||||
"jsx-quotes": [ "error" ],
|
||||
"react/prop-types": [ "off" ],
|
||||
"react/jsx-curly-spacing": [ "error", { "when": "always", "children": true } ],
|
||||
"react/jsx-equals-spacing": [ "error" ],
|
||||
"@typescript-eslint/object-curly-spacing": [ "error", "always", { "arraysInObjects": true, "objectsInObjects": false } ],
|
||||
"react/jsx-newline": [ "error", { "prevent": true } ],
|
||||
"@typescript-eslint/object-curly-spacing": [ "error", "always",
|
||||
{
|
||||
"arraysInObjects": true,
|
||||
"objectsInObjects": false
|
||||
}
|
||||
],
|
||||
"@typescript-eslint/ban-types": [
|
||||
"error",
|
||||
{
|
||||
|
@ -124,13 +124,9 @@ export const HcCenterView: FC<{}> = props =>
|
||||
<div>{ LocalizeText('hccenter.breakdown.paydayfactor.percent', [ 'percent' ], [ (kickbackData.kickbackPercentage * 100).toString() ]) }</div>
|
||||
<div>{ LocalizeText('hccenter.breakdown.streakbonus', [ 'credits' ], [ kickbackData.creditRewardForStreakBonus.toString() ]) }</div>
|
||||
<hr className="w-100 text-black my-1" />
|
||||
<div>{ LocalizeText('hccenter.breakdown.total', [ 'credits', 'actual' ], [ getHcPaydayAmount(),
|
||||
((((kickbackData.kickbackPercentage * kickbackData.totalCreditsSpent) + kickbackData.creditRewardForStreakBonus) * 100) / 100).toString() ]) }</div>
|
||||
<div className="btn btn-link text-primary p-0" onClick={ () =>
|
||||
{
|
||||
CreateLinkEvent('habbopages/' + GetConfiguration('hc.center')['payday.habbopage'])
|
||||
} }>{
|
||||
LocalizeText('hccenter.special.infolink') }
|
||||
<div>{ LocalizeText('hccenter.breakdown.total', [ 'credits', 'actual' ], [ getHcPaydayAmount(), ((((kickbackData.kickbackPercentage * kickbackData.totalCreditsSpent) + kickbackData.creditRewardForStreakBonus) * 100) / 100).toString() ]) }</div>
|
||||
<div className="btn btn-link text-primary p-0" onClick={ () => CreateLinkEvent('habbopages/' + GetConfiguration('hc.center')['payday.habbopage']) }>
|
||||
{ LocalizeText('hccenter.special.infolink') }
|
||||
</div>
|
||||
</Popover.Body>
|
||||
</Popover>
|
||||
@ -162,6 +158,7 @@ export const HcCenterView: FC<{}> = props =>
|
||||
</Flex>
|
||||
{ GetConfiguration('hc.center')['payday.info'] &&
|
||||
<Flex alignItems="center">
|
||||
|
||||
<Column className="rounded-start bg-primary p-2 payday-special mb-1">
|
||||
<h4 className="mb-1">{ LocalizeText('hccenter.special.title') }</h4>
|
||||
<div>{ LocalizeText('hccenter.special.info') }</div>
|
||||
@ -184,33 +181,27 @@ export const HcCenterView: FC<{}> = props =>
|
||||
</div>
|
||||
</OverlayTrigger>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
</div> }
|
||||
</div>
|
||||
</Flex>
|
||||
}
|
||||
</Flex> }
|
||||
{ GetConfiguration('hc.center')['gift.info'] &&
|
||||
<div className="rounded bg-success p-2 d-flex flex-row mb-0">
|
||||
<div>
|
||||
<h4 className="mb-1">{ LocalizeText('hccenter.gift.title') }</h4>
|
||||
<div dangerouslySetInnerHTML={ { __html: unclaimedGifts > 0 ? LocalizeText('hccenter.unclaimedgifts', [ 'unclaimedgifts' ], [ unclaimedGifts.toString() ]) : LocalizeText('hccenter.gift.info') } }></div>
|
||||
</div>
|
||||
<button className="btn btn-primary btn-lg align-self-center ms-auto" onClick={ () =>
|
||||
{
|
||||
CreateLinkEvent('catalog/open/' + GetConfiguration('catalog.links')['hc.hc_gifts'])
|
||||
} }>{ LocalizeText(clubStatus === ClubStatus.ACTIVE ? 'hccenter.btn.gifts.redeem' : 'hccenter.btn.gifts.view') }</button>
|
||||
</div>
|
||||
}
|
||||
<button className="btn btn-primary btn-lg align-self-center ms-auto" onClick={ () => CreateLinkEvent('catalog/open/' + GetConfiguration('catalog.links')['hc.hc_gifts']) }>
|
||||
{ LocalizeText(clubStatus === ClubStatus.ACTIVE ? 'hccenter.btn.gifts.redeem' : 'hccenter.btn.gifts.view') }
|
||||
</button>
|
||||
</div> }
|
||||
{ GetConfiguration('hc.center')['benefits.info'] &&
|
||||
<div className="benefits text-black py-2">
|
||||
<h5 className="mb-1 text-primary">{ LocalizeText('hccenter.general.title') }</h5>
|
||||
<div className="mb-2" dangerouslySetInnerHTML={ { __html: LocalizeText('hccenter.general.info') } } />
|
||||
<button className="btn btn-link p-0 text-primary" onClick={ () =>
|
||||
{
|
||||
CreateLinkEvent('habbopages/' + GetConfiguration('hc.center')['benefits.habbopage'])
|
||||
} }>{ LocalizeText('hccenter.general.infolink') }</button>
|
||||
</div>
|
||||
}
|
||||
<button className="btn btn-link p-0 text-primary" onClick={ () => CreateLinkEvent('habbopages/' + GetConfiguration('hc.center')['benefits.habbopage']) }>
|
||||
{ LocalizeText('hccenter.general.infolink') }
|
||||
</button>
|
||||
</div> }
|
||||
</NitroCardContentView>
|
||||
</NitroCardView>
|
||||
);
|
||||
|
@ -1,18 +0,0 @@
|
||||
import { createContext, FC, ProviderProps, useContext } from 'react';
|
||||
import { IPurse } from './common/IPurse';
|
||||
|
||||
interface IPurseContext
|
||||
{
|
||||
purse: IPurse;
|
||||
}
|
||||
|
||||
const PurseContext = createContext<IPurseContext>({
|
||||
purse: null
|
||||
});
|
||||
|
||||
export const PurseContextProvider: FC<ProviderProps<IPurseContext>> = props =>
|
||||
{
|
||||
return <PurseContext.Provider value={ props.value }>{ props.children }</PurseContext.Provider>
|
||||
}
|
||||
|
||||
export const usePurseContext = () => useContext(PurseContext);
|
@ -3,7 +3,6 @@ import { FC, useCallback, useMemo } from 'react';
|
||||
import { CreateLinkEvent, GetConfiguration, LocalizeText } from '../../api';
|
||||
import { Column, Flex, Grid, LayoutCurrencyIcon, Text } from '../../common';
|
||||
import { usePurse } from '../../hooks';
|
||||
import { PurseContextProvider } from './PurseContext';
|
||||
import { CurrencyView } from './views/CurrencyView';
|
||||
import { SeasonalView } from './views/SeasonalView';
|
||||
|
||||
@ -62,31 +61,29 @@ export const PurseView: FC<{}> = props =>
|
||||
if(!purse) return null;
|
||||
|
||||
return (
|
||||
<PurseContextProvider value={ { purse } }>
|
||||
<Column alignItems="end" className="nitro-purse-container" gap={ 1 }>
|
||||
<Flex className="nitro-purse rounded-bottom p-1">
|
||||
<Grid fullWidth gap={ 1 }>
|
||||
<Column justifyContent="center" size={ hcDisabled ? 10 : 6 } gap={ 0 }>
|
||||
<CurrencyView type={ -1 } amount={ purse.credits } short={ currencyDisplayNumberShort } />
|
||||
{ getCurrencyElements(0, 2) }
|
||||
</Column>
|
||||
{ !hcDisabled &&
|
||||
<Column center pointer size={ 4 } gap={ 1 } className="nitro-purse-subscription rounded" onClick={ event => CreateLinkEvent('habboUI/open/hccenter') }>
|
||||
<LayoutCurrencyIcon type="hc" />
|
||||
<Text variant="white">{ getClubText }</Text>
|
||||
</Column> }
|
||||
<Column justifyContent="center" size={ 2 } gap={ 0 }>
|
||||
<Flex center pointer fullHeight className="nitro-purse-button p-1 rounded" onClick={ event => CreateLinkEvent('help/show') }>
|
||||
<i className="icon icon-help"/>
|
||||
</Flex>
|
||||
<Flex center pointer fullHeight className="nitro-purse-button p-1 rounded" onClick={ event => CreateLinkEvent('user-settings/toggle') } >
|
||||
<i className="icon icon-cog"/>
|
||||
</Flex>
|
||||
</Column>
|
||||
</Grid>
|
||||
</Flex>
|
||||
{ getCurrencyElements(2, -1, true) }
|
||||
</Column>
|
||||
</PurseContextProvider>
|
||||
<Column alignItems="end" className="nitro-purse-container" gap={ 1 }>
|
||||
<Flex className="nitro-purse rounded-bottom p-1">
|
||||
<Grid fullWidth gap={ 1 }>
|
||||
<Column justifyContent="center" size={ hcDisabled ? 10 : 6 } gap={ 0 }>
|
||||
<CurrencyView type={ -1 } amount={ purse.credits } short={ currencyDisplayNumberShort } />
|
||||
{ getCurrencyElements(0, 2) }
|
||||
</Column>
|
||||
{ !hcDisabled &&
|
||||
<Column center pointer size={ 4 } gap={ 1 } className="nitro-purse-subscription rounded" onClick={ event => CreateLinkEvent('habboUI/open/hccenter') }>
|
||||
<LayoutCurrencyIcon type="hc" />
|
||||
<Text variant="white">{ getClubText }</Text>
|
||||
</Column> }
|
||||
<Column justifyContent="center" size={ 2 } gap={ 0 }>
|
||||
<Flex center pointer fullHeight className="nitro-purse-button p-1 rounded" onClick={ event => CreateLinkEvent('help/show') }>
|
||||
<i className="icon icon-help"/>
|
||||
</Flex>
|
||||
<Flex center pointer fullHeight className="nitro-purse-button p-1 rounded" onClick={ event => CreateLinkEvent('user-settings/toggle') } >
|
||||
<i className="icon icon-cog"/>
|
||||
</Flex>
|
||||
</Column>
|
||||
</Grid>
|
||||
</Flex>
|
||||
{ getCurrencyElements(2, -1, true) }
|
||||
</Column>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user